From 57c70f83b8604b7eabc2c69a4cf5f1bcd56b1369 Mon Sep 17 00:00:00 2001 From: Jovica Zoric Date: Tue, 26 Sep 2017 13:29:50 +0200 Subject: [PATCH 001/693] 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: Fri, 29 Dec 2017 17:44:19 -0800 Subject: [PATCH 002/693] 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 003/693] 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 eebfcef80eec96a3c823b0e73e32f297050241bf Mon Sep 17 00:00:00 2001 From: Craig Kovatch Date: Thu, 4 Jan 2018 14:23:28 -0800 Subject: [PATCH 004/693] 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 005/693] 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 006/693] 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 007/693] 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 008/693] 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 009/693] [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 010/693] [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 011/693] 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 012/693] 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 013/693] 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 014/693] 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 015/693] 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 016/693] 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 017/693] 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 018/693] 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 019/693] 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 020/693] 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 021/693] 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 022/693] 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 023/693] 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 024/693] 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 025/693] 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
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 026/693] 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 027/693] 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 028/693] 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 029/693] 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 030/693] 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 031/693] 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 032/693] [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 033/693] 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 034/693] 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 035/693] [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 036/693] 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 037/693] 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 038/693] 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 039/693] 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 040/693] 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 041/693] 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 042/693] 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 043/693] 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 044/693] 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 045/693] 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 046/693] 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 047/693] 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 048/693] 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 049/693] 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 050/693] 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 051/693] [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 052/693] 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 053/693] 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 054/693] 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 055/693] 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 056/693] 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 057/693] [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 058/693] 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 059/693] 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 060/693] 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 061/693] 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 062/693] 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 063/693] 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 064/693] 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 065/693] 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 066/693] 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 067/693] 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 068/693] 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 069/693] [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 070/693] [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 071/693] 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 072/693] 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 073/693] 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 074/693] 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 075/693] 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 076/693] 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 077/693] 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 078/693] 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 079/693] 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 6b7b07a0ab0107001239df30da0587606855a1b2 Mon Sep 17 00:00:00 2001 From: Guo Yunhe Date: Sat, 17 Mar 2018 22:37:14 +0200 Subject: [PATCH 080/693] wpapi: types for WPAPI and APRequest classes --- types/wpapi/index.d.ts | 492 +++++++++++++++++++++++++++++++++++++ types/wpapi/tsconfig.json | 16 ++ types/wpapi/tslint.json | 1 + types/wpapi/wpapi-tests.ts | 0 4 files changed, 509 insertions(+) create mode 100644 types/wpapi/index.d.ts create mode 100644 types/wpapi/tsconfig.json create mode 100644 types/wpapi/tslint.json create mode 100644 types/wpapi/wpapi-tests.ts diff --git a/types/wpapi/index.d.ts b/types/wpapi/index.d.ts new file mode 100644 index 0000000000..309b613599 --- /dev/null +++ b/types/wpapi/index.d.ts @@ -0,0 +1,492 @@ +// Type definitions for wpapi 1.1 +// Project: https://github.com/wp-api/node-wpapi +// Definitions by: Guo Yunhe +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = WPAPI; + +/** + * REST API Client for WordPress + * + * @see http://wp-api.org/node-wpapi/api-reference/wpapi/1.1.2/WPAPI.html + */ +declare class WPAPI { + /** + * Construct a REST API client instance object to create + * + * @param options An options hash to configure the instance + */ + constructor(options?: WPAPI.WPAPIOptions); + + /** + * Take an arbitrary WordPress site, deduce the WP REST API root endpoint, + * query that endpoint, and parse the response JSON. Use the returned JSON + * response to instantiate a WPAPI instance bound to the provided site. + * + * @param url A URL within a REST API-enabled WordPress website + */ + discover(url: string): Promise; + + /** Start a request against /categories endpoint */ + categories(): WPAPI.WPRequest; + + /** Start a request against /comments endpoints */ + comments(): WPAPI.WPRequest; + + /** Start a request against /media endpoints */ + media(): WPAPI.WPRequest; + + /** Start a request against /pages endpoints */ + pages(): WPAPI.WPRequest; + + /** Start a request against /posts endpoints */ + posts(): WPAPI.WPRequest; + + /** Start a request against /settings endpoints */ + settings(): WPAPI.WPRequest; + + /** Start a request against /statuses endpoints */ + statuses(): WPAPI.WPRequest; + + /** Start a request against /tags endpoints */ + tags(): WPAPI.WPRequest; + + /** Start a request against /taxonomies endpoints */ + taxonomies(): WPAPI.WPRequest; + + /** Start a request against /types endpoints */ + types(): WPAPI.WPRequest; + + /** Start a request against /users endpoints */ + users(): WPAPI.WPRequest; + + /** + * Set the authentication to use for a WPAPI site handler instance. Accepts + * basic HTTP authentication credentials (string username & password) or a + * Nonce (for cookie authentication) by default; may be overloaded to accept + * OAuth credentials in the future. + * + * @param credentials An authentication credentials object + */ + auth(credentials?: WPAPI.Credentials): WPAPI; + + /** + * Deduce request methods from a provided API root JSON response object's + * routes dictionary, and assign those methods to the current instance. If + * no routes dictionary is provided then the instance will be bootstrapped + * with route handlers for the default API endpoints only. + * + * This method is called automatically during WPAPI instance creation. + * + * @param routes The "routes" object from the JSON object returned from the + * root API endpoint of a WP site, which should be a dictionary of route + * definition objects keyed by the route's regex pattern + */ + bootstrap(routes: WPAPI.Routes): WPAPI; + + /** + * Access API endpoint handlers from a particular API namespace object + * + * @param namespace A namespace string + */ + namespace(namespace: string): WPAPI; + + /** + * Create and return a handler for an arbitrary WP REST API endpoint. + * TODO: type for Endpoint Factory + * + * @param namespace A namespace string, e.g. 'myplugin/v1' + * @param restBase A REST route string, e.g. '/author/(?P\d+)' + * @param options An (optional) options object + */ + registerRoute( + namespace: string, + restBase: string, + options?: WPAPI.RegisterRouteOptions + ): Function; + + /** + * Set the default headers to use for all HTTP requests created from this + * WPAPI site instance. Accepts a header name and its associated value as + * two strings, or multiple headers as an object of name-value pairs. + * + * @param headers + */ + setHeaders(headers: WPAPI.HTTPHeaders): WPAPI; + + /** + * Convenience method for making a new WPAPI instance + * + * @param endpoint The URI for a WP-API endpoint + * @param routes The "routes" object from the JSON object returned from the + * root API endpoint of a WP site, which should be a dictionary of route + * definition objects keyed by the route's regex pattern + */ + site(endpoint: string, routes: WPAPI.Routes): WPAPI; + + /** + * Set custom transport methods to use when making HTTP requests against the + * API. + * + * Pass an object with a function for one or many of "get", "post", "put", + * "delete" and "head" and that function will be called when making that + * type of request. The provided transport functions should take a WPRequest + * handler instance (e.g. the result of a wp.posts()... chain or any other + * chaining request handler) as their first argument; a data object as their + * second argument (for POST, PUT and DELETE requests); and an optional + * callback as their final argument. Transport methods should invoke the + * callback with the response data (or error, as appropriate), and should + * also return a Promise. + * + * @param transport A dictionary of HTTP transport methods + */ + transport(transport: WPAPI.Transport): WPAPI; + + /** + * Generate a query against an arbitrary path on the current endpoint. This + * is useful for requesting resources at custom WP-API endpoints, such as + * WooCommerce's /products. + * + * @param relativePath An endpoint-relative path to which to bind the request + */ + root(relativePath?: string): WPAPI.WPRequest; + + /** + * Generate a request against a completely arbitrary endpoint, with no + * assumptions about or mutation of path, filtering, or query parameters. + * This request is not restricted to the endpoint specified during WPAPI + * object instantiation. + * + * @param url The URL to request + */ + url(url: string): WPAPI.WPRequest; +} + +/*~ If you want to expose types from your module as well, you can + *~ place them in this block. + */ +declare namespace WPAPI { + /** + * The base WordPress API request + * + * @see http://wp-api.org/node-wpapi/api-reference/wpapi/1.1.2/WPRequest.html + */ + export class WPRequest { + /** + * WPRequest is the base API request object constructor + * + * @param options A hash of options for the WPRequest instance + */ + constructor(options: WPAPIOptions); + + /** + * Set a request to use authentication, and optionally provide auth + * credentials. If auth credentials were already specified when the WPAPI + * instance was created, calling .auth on the request chain will set + * that request to use the existing credentials. + * + * @param credentials An authentication credentials object + */ + auth(credentials?: WPAPI.Credentials): WPRequest; + + /** + * Set the context of the request. Used primarily to expose private + * values on a request object by setting the context to "edit". + * + * @param context The context to set on the request + */ + context(context: string): WPRequest; + + /** + * Create the specified resource with the provided data + * + * This is the public interface for creating POST requests + * + * TODO: callback type + * + * @param data The data for the POST request + * @param callback A callback to invoke with the results of the POST request + */ + create(data: Object, callback?: Function): Promise; + + /** + * Delete the specified resource + * + * @param data Data to send along with the DELETE request + * @param callback A callback to invoke with the results of the DELETE request + */ + delete(data?: Object, callback?: Function): Promise; + + /** + * Convenience wrapper for .context( 'edit' ) + */ + edit(): WPRequest; + + /** + * Return embedded resources as part of the response payload. + */ + embed(): WPRequest; + + /** + * Exclude specific resource IDs in the response collection. + * + * @param ids An ID or array of IDs to exclude + */ + exclude(ids: number | number[]): WPRequest; + + /** + * Specify a file or a file buffer to attach to the request, for use + * when creating a new Media item + * + * @param fileA path to a file (in Node) or an file object (Node or + * Browser) to attach to the request + * @param name An (optional) filename to use for the file + */ + file(file: Object | string, name?: string): WPRequest; + + /** + * Get the headers for the specified resource + * + * @param callback A callback to invoke with the results of the HEAD request + */ + get(callback?: Function): Promise; + + /** + * Include specific resource IDs in the response collection. + * + * @param ids An ID or array of IDs to include + */ + include(ids: number | number[]): WPRequest; + + /** + * Set the namespace of the request, e.g. to specify the API root for + * routes registered by wp core v2 ("wp/v2") or by any given plugin. Any + * previously- set namespace will be overwritten by subsequent calls to + * the method. + * + * @param namespace A namespace string, e.g. "wp/v2" + */ + namespace(namespace: string): WPRequest; + + /** + * Set an arbitrary offset to retrieve items from a specific point in a + * collection. + * + * @param offsetNumber The number of items by which to offset the response + */ + offset(offsetNumber: number): WPRequest; + + /** + * Change the sort direction of a returned collection + * + * @param direction The order to use when sorting the response + */ + order(direction: "asc" | "desc"): WPRequest; + + /** + * Order a collection by a specific field + * + * @param field The field by which to order the response + */ + orderby(field: string): WPRequest; + + /** + * Set the pagination of a request. Use in conjunction with .perPage() + * for explicit pagination handling. (The number of pages in a response + * can be retrieved from the response's _paging.totalPages property.) + * + * @param pageNumber The page number of results to retrieve + */ + page(pageNumber: number): WPRequest; + + /** + * Set a parameter to render into the final query URI. + * + * @param props The name of the parameter to set, or an object containing + * parameter keys and their corresponding values + * @param value The value of the parameter being set + */ + param( + props: string | Object, + value?: string | number | any[] + ): WPRequest; + + /** + * Set the number of items to be returned in a page of responses. + * + * @param itemsPerPage The number of items to return in one page of results + */ + perPage(itemsPerPage: number): WPRequest; + + /** + * Filter results to those matching the specified search terms. + * + * @param searchString A string to search for within post content + */ + search(searchString: string): WPRequest; + + /** + * Specify one or more headers to send with the dispatched HTTP request. + * + * @param headers The name of the header to set, or an object of header + * names and their associated string values + * @param value The value of the header being set + */ + setHeaders(headers: string | Object, value?: string): WPRequest; + + /** + * Set a component of the resource URL itself (as opposed to a query + * parameter) + * + * If a path component has already been set at this level, throw an + * error: requests are meant to be transient, so any re-writing of a + * previously-set path part value is likely to be a mistake. + * + * @param level A "level" of the path to set, e.g. "1" or "2" + * @param value The value to set at that path part level + */ + setPathPart(level: number | string, value: number | string): WPRequest; + + /** + * Query a collection for members with a specific slug. + * + * @param slug A post slug (slug), e.g. "hello-world" + */ + slug(slug: string): WPRequest; + + /** + * Calling .then on a query chain will invoke the query as a GET and + * return a promise + * + * @param successCallback A callback to handle the data returned from + * the GET request + * @param failureCallback A callback to handle any errors encountered + * by the request + */ + then( + successCallback?: Function, + failureCallback?: Function + ): Promise; + + /** + * Parse the request into a WordPress API request URI string + */ + toString(): string; + + /** + * Validate whether the specified path parts are valid for this endpoint + * + * "Path parts" are non-query-string URL segments, like "some" "path" in + * the URL mydomain.com/some/path?and=a&query=string&too. Because a well + * -formed path is necessary to execute a successful API request, we + * throw an error if the user has omitted a value (such as /some/[missing + * component]/url) or has provided a path part value that does not match + * the regular expression the API uses to goven that segment. + */ + validatePath(): WPRequest; + } + + export interface WPAPIOptions extends Credentials { + /** The URI for a WP-API endpoint */ + endpoint: string; + /** + * A dictionary of API routes with which to bootstrap the WPAPI instance: + * the instance will be initialized with default routes only if this + * property is omitted + */ + routes?: Routes; + /** + * An optional dictionary of HTTP transport methods (.get, .post, .put, + * .delete, .head) to use instead of the defaults, e.g. to use a + * different HTTP library than superagent + */ + transport?: Transport; + } + + export interface WPRequestOptions extends Credentials { + /** The URI for a WP-API endpoint */ + endpoint: string; + /** + * An dictionary of HTTP transport methods (.get, .post, .put, + * .delete, .head) to use instead of the defaults, e.g. to use a + * different HTTP library than superagent + */ + transport?: Transport; + } + + /** Authentication credentials */ + export interface Credentials { + /** A WP-API Basic HTTP Authentication username */ + username?: string; + /** A WP-API Basic HTTP Authentication password */ + password?: string; + /** A WP nonce for use with cookie authentication */ + nonce?: string; + } + + export interface Transport { + get?: TransportFunction; + post?: TransportFunction; + put?: TransportFunction; + delete?: TransportFunction; + head?: TransportFunction; + } + + export type TransportFunction = ( + wpreq: WPRequest, + cb: Function + ) => Promise; + + export interface Routes { + [path: string]: Route; + } + + export interface Route { + namespace: string; + methods: HTTPMethod[]; + endpoints: HTTPEndpoint[]; + _links?: { + self: string; + }; + } + + export type HTTPMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; + + export interface HTTPEndpoint { + methods: HTTPMethod[]; + args: { + [arg: string]: HTTPArgument; + }; + } + + export interface HTTPArgument { + required: boolean; + default?: string | number; + enum?: string[]; + description?: string; + type?: HTTPArgumentType; + items?: { + type: HTTPArgumentType; + }; + } + + export type HTTPArgumentType = + | "string" + | "integer" + | "number" + | "boolean" + | "object" + | "array"; + + export interface HTTPHeaders { + [key: string]: string; + } + + export interface RegisterRouteOptions { + params?: string[]; + methods?: HTTPMethod[]; + mixins?: { + [key: string]: (val: any) => any; + }; + } +} diff --git a/types/wpapi/tsconfig.json b/types/wpapi/tsconfig.json new file mode 100644 index 0000000000..c017072758 --- /dev/null +++ b/types/wpapi/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "ES6", + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "wpapi-tests.ts"] +} diff --git a/types/wpapi/tslint.json b/types/wpapi/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/wpapi/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/wpapi/wpapi-tests.ts b/types/wpapi/wpapi-tests.ts new file mode 100644 index 0000000000..e69de29bb2 From d337cc5fc506e03e6cd2205709d3ad6b35eb03f2 Mon Sep 17 00:00:00 2001 From: Guo Yunhe Date: Sat, 17 Mar 2018 22:51:05 +0200 Subject: [PATCH 081/693] wpapi: discover() should be static function --- types/wpapi/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/wpapi/index.d.ts b/types/wpapi/index.d.ts index 309b613599..62d4583042 100644 --- a/types/wpapi/index.d.ts +++ b/types/wpapi/index.d.ts @@ -25,7 +25,7 @@ declare class WPAPI { * * @param url A URL within a REST API-enabled WordPress website */ - discover(url: string): Promise; + static discover(url: string): Promise; /** Start a request against /categories endpoint */ categories(): WPAPI.WPRequest; From b3f5f3c9e567c0d84ed3f94d5e67896ce772e63b Mon Sep 17 00:00:00 2001 From: Guo Yunhe Date: Sat, 17 Mar 2018 23:21:45 +0200 Subject: [PATCH 082/693] wpapi: some missing function --- types/wpapi/index.d.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/types/wpapi/index.d.ts b/types/wpapi/index.d.ts index 62d4583042..3f3c293119 100644 --- a/types/wpapi/index.d.ts +++ b/types/wpapi/index.d.ts @@ -27,6 +27,9 @@ declare class WPAPI { */ static discover(url: string): Promise; + /** Start a request of plugin authors endpoint */ + authors(): WPAPI.WPRequest; + /** Start a request against /categories endpoint */ categories(): WPAPI.WPRequest; @@ -251,6 +254,13 @@ declare namespace WPAPI { */ get(callback?: Function): Promise; + /** + * Set the id of resource. + * + * @param id An ID of item + */ + id(id: number): WPRequest; + /** * Include specific resource IDs in the response collection. * @@ -373,6 +383,18 @@ declare namespace WPAPI { */ toString(): string; + /** + * Update the specified resource with the provided data + * + * This is the public interface for creating PATCH requests + * + * TODO: callback type + * + * @param data The data for the PATCH request + * @param callback A callback to invoke with the results of the PATCH request + */ + update(data: Object, callback?: Function): Promise; + /** * Validate whether the specified path parts are valid for this endpoint * From 764517153396b3502849dc31344a0c521e5228fe Mon Sep 17 00:00:00 2001 From: Guo Yunhe Date: Sat, 17 Mar 2018 23:21:53 +0200 Subject: [PATCH 083/693] wpapi: test file --- types/wpapi/wpapi-tests.ts | 94 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/types/wpapi/wpapi-tests.ts b/types/wpapi/wpapi-tests.ts index e69de29bb2..e88b8d6dcb 100644 --- a/types/wpapi/wpapi-tests.ts +++ b/types/wpapi/wpapi-tests.ts @@ -0,0 +1,94 @@ +// Initialize the client +import * as WPAPI from "wpapi"; +import { WPRequest } from "wpapi"; + +const wp = new WPAPI({ endpoint: "http://src.wordpress-develop.dev/wp-json" }); + +// Callbacks +wp.posts().get(function(err: Error, data: any) { + if (err) { + // handle err + } + // do something with the returned posts +}); + +// Promises +wp + .posts() + .then(function(data: any) { + // do something with the returned posts + }) + .catch(function(err: Error) { + // handle error + }); + +// Auto-discover +const apiPromise = WPAPI.discover("http://my-site.com"); +apiPromise.then(function(site) { + // If default routes were detected, they are now available + site.posts().then(function(posts: Object[]) {}); // etc + + // If custom routes were detected, they can be accessed via .namespace() + site + .namespace("myplugin/v1") + .authors() + .then(function(authors: Object[]) { + /* ... */ + }); + + // Namespaces can be saved out to variables: + const myplugin = site.namespace("myplugin/v1"); + myplugin + .authors() + .id(7) + .then(function(author: Object[]) { + /* ... */ + }); +}); + +// Authenticating with Auto-Discovery +const apiPromise2 = WPAPI.discover("http://my-site.com").then(function(site) { + return site.auth({ + username: "admin", + password: "always use secure passwords" + }); +}); + +apiPromise2.then(function(site) { + // site is now configured to use authentication +}); + +// You must authenticate to be able to POST (create) a post +const wp2 = new WPAPI({ + endpoint: "http://your-site.com/wp-json", + // This assumes you are using basic auth, as described further below + username: "someusername", + password: "password" +}); +wp2 + .posts() + .create({ + // "title" and "content" are the only required properties + title: "Your Post Title", + content: "Your post content", + // Post will be created as a draft by default if a specific "status" + // is not specified + status: "publish" + }) + .then(function(response) { + // "response" will hold all properties of your newly-created post, + // including the unique `id` the post was assigned on creation + }); + +// You must authenticate to be able to PUT (update) a post +// .id() must be used to specify the post we are updating +wp2 + .posts() + .id(2501) + .update({ + // Update the title + title: "A Better Title", + // Set the post live (assuming it was "draft" before) + status: "publish" + }) + .then(function(response: Object) {}); 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 084/693] 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 085/693] 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 086/693] 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 91110e458cb1d8d6b01181753cac7213e04436e1 Mon Sep 17 00:00:00 2001 From: Guo Yunhe Date: Sun, 18 Mar 2018 15:09:02 +0200 Subject: [PATCH 087/693] wpapi: add strictFunctionTypes option for tsconfig.json --- types/wpapi/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/types/wpapi/tsconfig.json b/types/wpapi/tsconfig.json index c017072758..af7f0df782 100644 --- a/types/wpapi/tsconfig.json +++ b/types/wpapi/tsconfig.json @@ -6,6 +6,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": ["../"], "types": [], From 5a3ea0a7e54e6a2a1c79cbf5b8c22d547c136334 Mon Sep 17 00:00:00 2001 From: Guo Yunhe Date: Sun, 18 Mar 2018 15:18:58 +0200 Subject: [PATCH 088/693] Use arrow function --- types/wpapi/wpapi-tests.ts | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/types/wpapi/wpapi-tests.ts b/types/wpapi/wpapi-tests.ts index e88b8d6dcb..7e414daecc 100644 --- a/types/wpapi/wpapi-tests.ts +++ b/types/wpapi/wpapi-tests.ts @@ -1,11 +1,10 @@ // Initialize the client import * as WPAPI from "wpapi"; -import { WPRequest } from "wpapi"; const wp = new WPAPI({ endpoint: "http://src.wordpress-develop.dev/wp-json" }); // Callbacks -wp.posts().get(function(err: Error, data: any) { +wp.posts().get((err: Error, data: any) => { if (err) { // handle err } @@ -15,24 +14,24 @@ wp.posts().get(function(err: Error, data: any) { // Promises wp .posts() - .then(function(data: any) { + .then((data: any) => { // do something with the returned posts }) - .catch(function(err: Error) { + .catch((err: Error) => { // handle error }); // Auto-discover const apiPromise = WPAPI.discover("http://my-site.com"); -apiPromise.then(function(site) { +apiPromise.then(site => { // If default routes were detected, they are now available - site.posts().then(function(posts: Object[]) {}); // etc + site.posts().then((posts: Object[]) => {}); // etc // If custom routes were detected, they can be accessed via .namespace() site .namespace("myplugin/v1") .authors() - .then(function(authors: Object[]) { + .then((authors: Object[]) => { /* ... */ }); @@ -41,20 +40,20 @@ apiPromise.then(function(site) { myplugin .authors() .id(7) - .then(function(author: Object[]) { + .then((author: Object[]) => { /* ... */ }); }); // Authenticating with Auto-Discovery -const apiPromise2 = WPAPI.discover("http://my-site.com").then(function(site) { +const apiPromise2 = WPAPI.discover("http://my-site.com").then(site => { return site.auth({ username: "admin", password: "always use secure passwords" }); }); -apiPromise2.then(function(site) { +apiPromise2.then(site => { // site is now configured to use authentication }); @@ -75,7 +74,7 @@ wp2 // is not specified status: "publish" }) - .then(function(response) { + .then((response: Object) => { // "response" will hold all properties of your newly-created post, // including the unique `id` the post was assigned on creation }); @@ -91,4 +90,4 @@ wp2 // Set the post live (assuming it was "draft" before) status: "publish" }) - .then(function(response: Object) {}); + .then((response: Object) => {}); From c59f06c21f4a00775c947c34e4c1cf950ce3ca06 Mon Sep 17 00:00:00 2001 From: Guo Yunhe Date: Sun, 18 Mar 2018 15:32:20 +0200 Subject: [PATCH 089/693] Format comments --- types/wpapi/index.d.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/types/wpapi/index.d.ts b/types/wpapi/index.d.ts index 3f3c293119..ae079b0edc 100644 --- a/types/wpapi/index.d.ts +++ b/types/wpapi/index.d.ts @@ -208,7 +208,8 @@ declare namespace WPAPI { * TODO: callback type * * @param data The data for the POST request - * @param callback A callback to invoke with the results of the POST request + * @param callback A callback to invoke with the results of the POST + * request */ create(data: Object, callback?: Function): Promise; @@ -216,7 +217,8 @@ declare namespace WPAPI { * Delete the specified resource * * @param data Data to send along with the DELETE request - * @param callback A callback to invoke with the results of the DELETE request + * @param callback A callback to invoke with the results of the DELETE + * request */ delete(data?: Object, callback?: Function): Promise; @@ -250,7 +252,8 @@ declare namespace WPAPI { /** * Get the headers for the specified resource * - * @param callback A callback to invoke with the results of the HEAD request + * @param callback A callback to invoke with the results of the HEAD + * request */ get(callback?: Function): Promise; @@ -324,7 +327,8 @@ declare namespace WPAPI { /** * Set the number of items to be returned in a page of responses. * - * @param itemsPerPage The number of items to return in one page of results + * @param itemsPerPage The number of items to return in one page of + * results */ perPage(itemsPerPage: number): WPRequest; @@ -391,7 +395,8 @@ declare namespace WPAPI { * TODO: callback type * * @param data The data for the PATCH request - * @param callback A callback to invoke with the results of the PATCH request + * @param callback A callback to invoke with the results of the PATCH + * request */ update(data: Object, callback?: Function): Promise; From 4a0594d983cabc194f072baa54c3c91bb75cabb2 Mon Sep 17 00:00:00 2001 From: AndersonFriaca Date: Sun, 18 Mar 2018 11:41:46 -0400 Subject: [PATCH 090/693] 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 091/693] [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 092/693] 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 21be2857d9842e2df771bfd35fc0e36487ef3e91 Mon Sep 17 00:00:00 2001 From: Guo Yunhe Date: Sun, 18 Mar 2018 19:33:21 +0200 Subject: [PATCH 093/693] wpapi: class support custom methods though without return type --- types/wpapi/index.d.ts | 17 ++++++++++++++--- types/wpapi/wpapi-tests.ts | 14 ++++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/types/wpapi/index.d.ts b/types/wpapi/index.d.ts index ae079b0edc..cbaee37286 100644 --- a/types/wpapi/index.d.ts +++ b/types/wpapi/index.d.ts @@ -27,9 +27,6 @@ declare class WPAPI { */ static discover(url: string): Promise; - /** Start a request of plugin authors endpoint */ - authors(): WPAPI.WPRequest; - /** Start a request against /categories endpoint */ categories(): WPAPI.WPRequest; @@ -163,6 +160,13 @@ declare class WPAPI { * @param url The URL to request */ url(url: string): WPAPI.WPRequest; + + /** + * An API client can define its parameter methods, like .authors(), .cart(), + * .products(). They are usually decided by WPAPI namespaces configuration + * object. They have WPRequest return type. + */ + [customRoutesMethod: string]: any; } /*~ If you want to expose types from your module as well, you can @@ -411,6 +415,13 @@ declare namespace WPAPI { * the regular expression the API uses to goven that segment. */ validatePath(): WPRequest; + + /** + * A request can define its parameter methods, like .id(), .date(), + * .author(). They are usually decided by WPAPI routes configuration + * object. + */ + [customParamsMethod: string]: any; } export interface WPAPIOptions extends Credentials { diff --git a/types/wpapi/wpapi-tests.ts b/types/wpapi/wpapi-tests.ts index 7e414daecc..f990ba09cb 100644 --- a/types/wpapi/wpapi-tests.ts +++ b/types/wpapi/wpapi-tests.ts @@ -28,19 +28,21 @@ apiPromise.then(site => { site.posts().then((posts: Object[]) => {}); // etc // If custom routes were detected, they can be accessed via .namespace() - site - .namespace("myplugin/v1") - .authors() - .then((authors: Object[]) => { + // Custom routes have different methods to generate requests, so .authors() + // does not necessarily exist. You have use force type or 'as + // Request' + (site.namespace("myplugin/v1").authors() as WPAPI.WPRequest).then( + (authors: any[]) => { /* ... */ - }); + } + ); // Namespaces can be saved out to variables: const myplugin = site.namespace("myplugin/v1"); myplugin .authors() .id(7) - .then((author: Object[]) => { + .then((author: any) => { /* ... */ }); }); From a60368955c89ed089ab0ab8fe98270b6eaebd0ca Mon Sep 17 00:00:00 2001 From: Guo Yunhe Date: Sun, 18 Mar 2018 19:38:44 +0200 Subject: [PATCH 094/693] wpapi: do not use Object --- types/wpapi/wpapi-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/wpapi/wpapi-tests.ts b/types/wpapi/wpapi-tests.ts index f990ba09cb..dbbfa1deb0 100644 --- a/types/wpapi/wpapi-tests.ts +++ b/types/wpapi/wpapi-tests.ts @@ -25,7 +25,7 @@ wp const apiPromise = WPAPI.discover("http://my-site.com"); apiPromise.then(site => { // If default routes were detected, they are now available - site.posts().then((posts: Object[]) => {}); // etc + site.posts().then((posts: any[]) => {}); // etc // If custom routes were detected, they can be accessed via .namespace() // Custom routes have different methods to generate requests, so .authors() @@ -76,7 +76,7 @@ wp2 // is not specified status: "publish" }) - .then((response: Object) => { + .then((response: any) => { // "response" will hold all properties of your newly-created post, // including the unique `id` the post was assigned on creation }); @@ -92,4 +92,4 @@ wp2 // Set the post live (assuming it was "draft" before) status: "publish" }) - .then((response: Object) => {}); + .then((response: any) => {}); From cd32df9e19e8ac08eaf3ba28b4de072237653d99 Mon Sep 17 00:00:00 2001 From: Guo Yunhe Date: Sun, 18 Mar 2018 19:39:04 +0200 Subject: [PATCH 095/693] wpapi: restrict typescript 2.2 --- types/wpapi/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/wpapi/index.d.ts b/types/wpapi/index.d.ts index cbaee37286..9c0d635e5d 100644 --- a/types/wpapi/index.d.ts +++ b/types/wpapi/index.d.ts @@ -1,4 +1,5 @@ // Type definitions for wpapi 1.1 +// TypeScript Version: 2.2 // Project: https://github.com/wp-api/node-wpapi // Definitions by: Guo Yunhe // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From cd9e2541db660bb37ae5fc53f412edbffd7248c5 Mon Sep 17 00:00:00 2001 From: Noah Santschi-Cooney Date: Sun, 18 Mar 2018 21:50:20 +0000 Subject: [PATCH 096/693] 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 097/693] 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 098/693] 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 099/693] 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 100/693] 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 101/693] 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 102/693] 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 103/693] 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 104/693] 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 105/693] 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 26f073522709f23c6483030538291c6726260cc4 Mon Sep 17 00:00:00 2001 From: Guo Yunhe Date: Mon, 19 Mar 2018 14:03:10 +0200 Subject: [PATCH 106/693] wpapi: avoid using Function and Object --- types/wpapi/index.d.ts | 68 ++++++++++++++++++++------------------ types/wpapi/tsconfig.json | 2 +- types/wpapi/wpapi-tests.ts | 8 +++++ 3 files changed, 44 insertions(+), 34 deletions(-) diff --git a/types/wpapi/index.d.ts b/types/wpapi/index.d.ts index 9c0d635e5d..9f1d81e531 100644 --- a/types/wpapi/index.d.ts +++ b/types/wpapi/index.d.ts @@ -1,8 +1,8 @@ // Type definitions for wpapi 1.1 -// TypeScript Version: 2.2 // Project: https://github.com/wp-api/node-wpapi // Definitions by: Guo Yunhe // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 export = WPAPI; @@ -94,7 +94,6 @@ declare class WPAPI { /** * Create and return a handler for an arbitrary WP REST API endpoint. - * TODO: type for Endpoint Factory * * @param namespace A namespace string, e.g. 'myplugin/v1' * @param restBase A REST route string, e.g. '/author/(?P\d+)' @@ -104,7 +103,7 @@ declare class WPAPI { namespace: string, restBase: string, options?: WPAPI.RegisterRouteOptions - ): Function; + ): WPAPI.WPRequestFactory; /** * Set the default headers to use for all HTTP requests created from this @@ -179,7 +178,7 @@ declare namespace WPAPI { * * @see http://wp-api.org/node-wpapi/api-reference/wpapi/1.1.2/WPRequest.html */ - export class WPRequest { + class WPRequest { /** * WPRequest is the base API request object constructor * @@ -195,7 +194,7 @@ declare namespace WPAPI { * * @param credentials An authentication credentials object */ - auth(credentials?: WPAPI.Credentials): WPRequest; + auth(credentials?: Credentials): WPRequest; /** * Set the context of the request. Used primarily to expose private @@ -210,13 +209,11 @@ declare namespace WPAPI { * * This is the public interface for creating POST requests * - * TODO: callback type - * * @param data The data for the POST request * @param callback A callback to invoke with the results of the POST * request */ - create(data: Object, callback?: Function): Promise; + create(data: any, callback?: WPRequestCallback): Promise; /** * Delete the specified resource @@ -225,7 +222,7 @@ declare namespace WPAPI { * @param callback A callback to invoke with the results of the DELETE * request */ - delete(data?: Object, callback?: Function): Promise; + delete(data?: any, callback?: WPRequestCallback): Promise; /** * Convenience wrapper for .context( 'edit' ) @@ -248,11 +245,11 @@ declare namespace WPAPI { * Specify a file or a file buffer to attach to the request, for use * when creating a new Media item * - * @param fileA path to a file (in Node) or an file object (Node or + * @param file A path to a file (in Node) or an file object (Node or * Browser) to attach to the request * @param name An (optional) filename to use for the file */ - file(file: Object | string, name?: string): WPRequest; + file(file: string | File, name?: string): WPRequest; /** * Get the headers for the specified resource @@ -260,7 +257,7 @@ declare namespace WPAPI { * @param callback A callback to invoke with the results of the HEAD * request */ - get(callback?: Function): Promise; + get(callback?: WPRequestCallback): Promise; /** * Set the id of resource. @@ -325,7 +322,7 @@ declare namespace WPAPI { * @param value The value of the parameter being set */ param( - props: string | Object, + props: string | { [name: string]: string | number | any[] }, value?: string | number | any[] ): WPRequest; @@ -351,7 +348,10 @@ declare namespace WPAPI { * names and their associated string values * @param value The value of the header being set */ - setHeaders(headers: string | Object, value?: string): WPRequest; + setHeaders( + headers: string | { [name: string]: string }, + value?: string + ): WPRequest; /** * Set a component of the resource URL itself (as opposed to a query @@ -383,8 +383,8 @@ declare namespace WPAPI { * by the request */ then( - successCallback?: Function, - failureCallback?: Function + successCallback?: (data: any) => void, + failureCallback?: (error: Error) => void ): Promise; /** @@ -397,13 +397,11 @@ declare namespace WPAPI { * * This is the public interface for creating PATCH requests * - * TODO: callback type - * * @param data The data for the PATCH request * @param callback A callback to invoke with the results of the PATCH * request */ - update(data: Object, callback?: Function): Promise; + update(data: any, callback?: WPRequestCallback): Promise; /** * Validate whether the specified path parts are valid for this endpoint @@ -425,7 +423,7 @@ declare namespace WPAPI { [customParamsMethod: string]: any; } - export interface WPAPIOptions extends Credentials { + interface WPAPIOptions extends Credentials { /** The URI for a WP-API endpoint */ endpoint: string; /** @@ -442,7 +440,7 @@ declare namespace WPAPI { transport?: Transport; } - export interface WPRequestOptions extends Credentials { + interface WPRequestOptions extends Credentials { /** The URI for a WP-API endpoint */ endpoint: string; /** @@ -453,8 +451,12 @@ declare namespace WPAPI { transport?: Transport; } + type WPRequestFactory = () => WPRequest; + + type WPRequestCallback = (error: Error, data: any) => void; + /** Authentication credentials */ - export interface Credentials { + interface Credentials { /** A WP-API Basic HTTP Authentication username */ username?: string; /** A WP-API Basic HTTP Authentication password */ @@ -463,7 +465,7 @@ declare namespace WPAPI { nonce?: string; } - export interface Transport { + interface Transport { get?: TransportFunction; post?: TransportFunction; put?: TransportFunction; @@ -471,16 +473,16 @@ declare namespace WPAPI { head?: TransportFunction; } - export type TransportFunction = ( + type TransportFunction = ( wpreq: WPRequest, - cb: Function + cb?: WPRequestCallback ) => Promise; - export interface Routes { + interface Routes { [path: string]: Route; } - export interface Route { + interface Route { namespace: string; methods: HTTPMethod[]; endpoints: HTTPEndpoint[]; @@ -489,16 +491,16 @@ declare namespace WPAPI { }; } - export type HTTPMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; + type HTTPMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; - export interface HTTPEndpoint { + interface HTTPEndpoint { methods: HTTPMethod[]; args: { [arg: string]: HTTPArgument; }; } - export interface HTTPArgument { + interface HTTPArgument { required: boolean; default?: string | number; enum?: string[]; @@ -509,7 +511,7 @@ declare namespace WPAPI { }; } - export type HTTPArgumentType = + type HTTPArgumentType = | "string" | "integer" | "number" @@ -517,11 +519,11 @@ declare namespace WPAPI { | "object" | "array"; - export interface HTTPHeaders { + interface HTTPHeaders { [key: string]: string; } - export interface RegisterRouteOptions { + interface RegisterRouteOptions { params?: string[]; methods?: HTTPMethod[]; mixins?: { diff --git a/types/wpapi/tsconfig.json b/types/wpapi/tsconfig.json index af7f0df782..789edd9ee4 100644 --- a/types/wpapi/tsconfig.json +++ b/types/wpapi/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ES6", "module": "commonjs", - "lib": ["es6"], + "lib": ["es6", "dom"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/types/wpapi/wpapi-tests.ts b/types/wpapi/wpapi-tests.ts index dbbfa1deb0..a06908d94e 100644 --- a/types/wpapi/wpapi-tests.ts +++ b/types/wpapi/wpapi-tests.ts @@ -93,3 +93,11 @@ wp2 status: "publish" }) .then((response: any) => {}); + +// Custom routes + +const site = new WPAPI({ endpoint: "http://www.yoursite.com/wp-json" }); +const myCustomResource = site.registerRoute("myplugin/v1", "/author/(?P)"); +myCustomResource() + .id(17) + .then((response: any) => {}); // => myplugin/v1/author/17 From fc89e65611bedf181bc934995b57715575f958d9 Mon Sep 17 00:00:00 2001 From: Johan Isaksson Date: Mon, 19 Mar 2018 14:51:13 +0100 Subject: [PATCH 107/693] 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 108/693] 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 109/693] 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 110/693] 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 111/693] 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 112/693] 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 113/693] 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 114/693] 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 115/693] 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 116/693] 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 117/693] 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 118/693] 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 119/693] 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 120/693] 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 121/693] 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 122/693] :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 387b17a0846d1d7e902af138870bed2505450f2c Mon Sep 17 00:00:00 2001 From: karak Date: Tue, 20 Mar 2018 13:36:12 +0900 Subject: [PATCH 123/693] [karma-viewport] Added boilerplate. --- types/karma-viewport/index.d.ts | 13 ++++++++++++ types/karma-viewport/karma-viewport-tests.ts | 0 types/karma-viewport/tsconfig.json | 22 ++++++++++++++++++++ types/karma-viewport/tslint.json | 1 + 4 files changed, 36 insertions(+) create mode 100644 types/karma-viewport/index.d.ts create mode 100644 types/karma-viewport/karma-viewport-tests.ts create mode 100644 types/karma-viewport/tsconfig.json create mode 100644 types/karma-viewport/tslint.json diff --git a/types/karma-viewport/index.d.ts b/types/karma-viewport/index.d.ts new file mode 100644 index 0000000000..e03d76bb1a --- /dev/null +++ b/types/karma-viewport/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for karma-viewport 0.4 +// Project: https://github.com/squidfunk/karma-viewport +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = karma_viewport; + +declare const karma_viewport: { + "framework:viewport": string[]; + "middleware:viewport": string[]; + "preprocessor:viewport": string[]; +}; + diff --git a/types/karma-viewport/karma-viewport-tests.ts b/types/karma-viewport/karma-viewport-tests.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/karma-viewport/tsconfig.json b/types/karma-viewport/tsconfig.json new file mode 100644 index 0000000000..e0574b5659 --- /dev/null +++ b/types/karma-viewport/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", + "karma-viewport-tests.ts" + ] +} diff --git a/types/karma-viewport/tslint.json b/types/karma-viewport/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/karma-viewport/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 31246bf64c16091ac638ccb74a3ffa85243ddd06 Mon Sep 17 00:00:00 2001 From: karak Date: Tue, 20 Mar 2018 14:00:01 +0900 Subject: [PATCH 124/693] [karma-viewport] Added a type definition and tests of it. --- types/karma-viewport/index.d.ts | 125 ++++++++++++++++++- types/karma-viewport/karma-viewport-tests.ts | 48 +++++++ types/karma-viewport/tsconfig.json | 4 +- 3 files changed, 170 insertions(+), 7 deletions(-) diff --git a/types/karma-viewport/index.d.ts b/types/karma-viewport/index.d.ts index e03d76bb1a..451f48d8cf 100644 --- a/types/karma-viewport/index.d.ts +++ b/types/karma-viewport/index.d.ts @@ -2,12 +2,125 @@ // Project: https://github.com/squidfunk/karma-viewport // Definitions by: My Self // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Type definition file for 'karma-viewport' +// https://www.npmjs.com/package/karma-viewport -export = karma_viewport; +declare namespace KarmaViewport { + interface Breakpoint { + name: string; + size: { + width: number, + height: number, + }; + } -declare const karma_viewport: { - "framework:viewport": string[]; - "middleware:viewport": string[]; - "preprocessor:viewport": string[]; -}; + interface Config { + /** Context selector */ + context: string; + /** Breakpoints */ + breakpoints: Breakpoint[]; + } + class Viewport { + /** + * Create viewport resizer + * + * @param config - Configuration + * @param context - Initialization context + */ + constructor(config: Config, context: Window); + + /** + * Load and embed document into viewport + * + * @param url - URL of document to load + * @param cb - Callback to execute after document was loaded + */ + load(url: string, cb: () => void): void; + + /** + * Set viewport to number or array + */ + set(width: number, height?: number): void; + + /** + * Set viewport to breakpoint identifier + */ + set(name: string): void; + + /** + * Reset viewport + */ + reset(): void; + + /** + * Execute a callback for all breakpoints between the first and last given + * + * @example + * viewport.between("mobile", "tablet", name => { + * ... + * }) + * + * @param first - First breakpoint name + * @param last - Last breakpoint name + * @param cb - Callback to execute after resizing + */ + between(first: string, last: string, cb: (name: string) => void): void; + + /** + * Execute a callback for all breakpoints + * + * @example + * viewport.each(name => { + * ... + * }) + * + * @param cb - Callback to execute after resizing + */ + each(cb: (name: string) => void): void; + + /** + * Execute a callback starting at the given breakpoint + * + * @example + * viewport.from("tablet", name => { + * ... + * }) + * + * @param first - First breakpoint name + * @param cb - Callback to execute after resizing + */ + from(first: string, cb: (name: string) => void): void; + + /** + * Execute a callback ending at the given breakpoint + * + * @example + * viewport.to("tablet", name => { + * ... + * }) + * + * @param last - Last breakpoint name + * @param cb - Callback to execute after resizing + */ + to(last: string, cb: (name: string) => void): void; + + /** + * Retrieve configuration + * + * @return Configuration + */ + readonly config: Config; // get config() + + /** + * Retrieve context element + * + * @return context element + */ + readonly element: HTMLIFrameElement; // get element() + } +} + +declare const viewport: KarmaViewport.Viewport; + +export = viewport; diff --git a/types/karma-viewport/karma-viewport-tests.ts b/types/karma-viewport/karma-viewport-tests.ts index e69de29bb2..d76ea9d6fd 100644 --- a/types/karma-viewport/karma-viewport-tests.ts +++ b/types/karma-viewport/karma-viewport-tests.ts @@ -0,0 +1,48 @@ +import * as viewport from 'karma-viewport'; + +// Set to 320px x 100% +viewport.set(320); + +// Set to 320px x 480px +viewport.set(320, 480); + +// Set to 320px x 480px by breakpoints +viewport.set("mobile"); + +// Reset to 100% x 100% +viewport.reset(); + +// Load entire webpages for testing: +viewport.load("/path/to/fixture.html", () => console.log('done')); + +// Run tests for mobile, tablet and screen +viewport.each(name => { + // ... +}); + +// Run tests for tablet and screen +viewport.from("tablet", name => { + // ... +}); + +// Run tests for mobile and tablet +viewport.to("tablet", name => { + // ... +}); + +// Run tests for tablet and screen +viewport.between("tablet", "screen", name => { + // ... +}); + +// get config +viewport.config.breakpoints.forEach(breakpoint => { + const name: string = breakpoint.name; + const width: number = breakpoint.size.width; + const height: number = breakpoint.size.height; +}); + +const contextSelector: string = viewport.config.context; + +// get element +const iframe: HTMLIFrameElement = viewport.element; diff --git a/types/karma-viewport/tsconfig.json b/types/karma-viewport/tsconfig.json index e0574b5659..def40ab217 100644 --- a/types/karma-viewport/tsconfig.json +++ b/types/karma-viewport/tsconfig.json @@ -2,11 +2,13 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From c87f850b4943f3fb92889945ad5796e9f96d0d70 Mon Sep 17 00:00:00 2001 From: karak Date: Tue, 20 Mar 2018 14:09:39 +0900 Subject: [PATCH 125/693] [karma-viewport] Migrated to global form. --- types/karma-viewport/index.d.ts | 2 -- types/karma-viewport/karma-viewport-tests.ts | 2 -- 2 files changed, 4 deletions(-) diff --git a/types/karma-viewport/index.d.ts b/types/karma-viewport/index.d.ts index 451f48d8cf..cb220bfc5b 100644 --- a/types/karma-viewport/index.d.ts +++ b/types/karma-viewport/index.d.ts @@ -122,5 +122,3 @@ declare namespace KarmaViewport { } declare const viewport: KarmaViewport.Viewport; - -export = viewport; diff --git a/types/karma-viewport/karma-viewport-tests.ts b/types/karma-viewport/karma-viewport-tests.ts index d76ea9d6fd..f220f35d98 100644 --- a/types/karma-viewport/karma-viewport-tests.ts +++ b/types/karma-viewport/karma-viewport-tests.ts @@ -1,5 +1,3 @@ -import * as viewport from 'karma-viewport'; - // Set to 320px x 100% viewport.set(320); From e1f320d2d696601fc1a6008baf6e40954e0c1dbc Mon Sep 17 00:00:00 2001 From: pvavrik Date: Tue, 20 Mar 2018 09:16:47 +0100 Subject: [PATCH 126/693] 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 127/693] 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 128/693] 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 129/693] [@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 130/693] [@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 131/693] @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 9fb3b602b102351d49fb442a4ad6e799118c88ed Mon Sep 17 00:00:00 2001 From: Menushka Weeratunga Date: Tue, 20 Mar 2018 08:32:07 -0400 Subject: [PATCH 132/693] Added types for node-pushnotifications --- types/node-pushnotifications/index.d.ts | 170 ++++++++++++++++++ .../node-pushnotifications-tests.ts | 51 ++++++ types/node-pushnotifications/tsconfig.json | 22 +++ types/node-pushnotifications/tslint.json | 1 + 4 files changed, 244 insertions(+) create mode 100644 types/node-pushnotifications/index.d.ts create mode 100644 types/node-pushnotifications/node-pushnotifications-tests.ts create mode 100644 types/node-pushnotifications/tsconfig.json create mode 100644 types/node-pushnotifications/tslint.json diff --git a/types/node-pushnotifications/index.d.ts b/types/node-pushnotifications/index.d.ts new file mode 100644 index 0000000000..fbb11eac3b --- /dev/null +++ b/types/node-pushnotifications/index.d.ts @@ -0,0 +1,170 @@ +// Type definitions for node-pushnotifications 1.0 +// Project: https://github.com/appfeel/node-pushnotifications +// Definitions by: Menushka Weeratunga +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class PushNotifications { + constructor(settings: PushNotifications.ISettings); + + setOptions(opts: PushNotifications.ISettings): void; + sendWith(method: PushNotifications.IPushMethod, regIds: string[], data: PushNotifications.IData, cb: PushNotifications.ICallback): void; + send(registrationIds: string[], data: PushNotifications.IData, cb: PushNotifications.ICallback): void; + send(registrationIds: string[], data: PushNotifications.IData): Promise; +} + +declare module PushNotifications { + interface ISettings { + /** Google Cloud Messaging */ + gcm?: { + /** GCM or FCM token */ + id?: string + }, + /** Apple Push Notifications */ + apn?: { + /** APN Token */ + token?: { + /** The filename of the provider token key (as supplied by Apple) to load from disk, or a Buffer/String containing the key data. */ + key?: Buffer | string, + /** The ID of the key issued by Apple */ + keyId?: string, + /** ID of the team associated with the provider token key */ + teamId?: string + } + /** The filename of the connection certificate to load from disk, or a Buffer/String containing the certificate data. */ + cert?: string, + /** The filename of the connection key to load from disk, or a Buffer/String containing the key data. */ + key?: string, + /** An array of trusted certificates. Each element should contain either a filename to load, or a Buffer/String (in PEM format) to be used directly. If this is omitted several well known "root" CAs will be used. - You may need to use this as some environments don't include the CA used by Apple (entrust_2048). */ + ca?: (Buffer | string)[], + /** File path for private key, certificate and CA certs in PFX or PKCS12 format, or a Buffer containing the PFX data. If supplied will always be used instead of certificate and key above. */ + pfx?: Buffer | string, + /** The passphrase for the connection key, if required */ + passphrase?: string, + productionv?: boolean, + voip?: boolean, + address?: string, + port?: number, + rejectUnauthorized?: boolean, + connectionRetryLimit?: number, + + cacheLength?: number, + connectionTimeout?: number, + autoAdjustCache?: boolean, + maxConnections?: number, + minConnections?: number, + connectTimeout?: number, + buffersNotifications?: boolean, + fastMode?: boolean, + disableNagle?: boolean, + disableEPIPEFix?: boolean + }, + /** Amazon Device Messaging */ + adm?: { + client_id?: string, + client_secret?: string + }, + /** Windows Push Notifications */ + wns?: { + client_id?: string, + client_secret?: string, + accessToken?: string, + headers?: string, + notificationMethod?: string + }, + /** Microsoft Push Notification Service */ + mpns?: { + options?: { + client_id?: string, + client_secret?: string + } + } + } + + interface IData { + /** REQUIRED */ + title: string, + /** REQUIRED */ + body: string, + custom?: { + sender?: string, + }, + /** gcm, apn. Supported values are 'high' or 'normal' (gcm). Will be translated to 10 and 5 for apn. Defaults to 'high' */ + priority?: string, + /** gcm for android, used as collapseId in apn */ + collapseKey?: string, + /** gcm for android */ + contentAvailable?: boolean | string, + /** gcm for android */ + delayWhileIdle?: boolean, + /** gcm for android */ + restrictedPackageName?: string, + /** gcm for android */ + dryRun?: boolean, + /** gcm for android */ + icon?: string, + /** gcm for android */ + tag?: string, + /** gcm for android */ + color?: string, + /** gcm for android. In ios, category will be used if not supplied */ + clickAction?: string, + /** gcm, apn */ + locKey?: string, + /** gcm, apn */ + bodyLocArgs?: string, + /** gcm, apn */ + titleLocKey?: string, + /** gcm, apn */ + titleLocArgs?: string, + /** gcm, apn */ + retries?: number, + /** apn */ + encoding?: string, + /** gcm for ios, apn */ + badge?: number, + /** gcm, apn */ + sound?: string, + /** apn, will take precedence over title and body. It is also accepted a text message in alert */ + alert?: {} | string, + /** apn and gcm for ios */ + launchImage?: string, + /** apn and gcm for ios */ + action?: string, + /** apn and gcm for ios */ + topic?: string, + /** apn and gcm for ios */ + category?: string, + /** apn and gcm for ios */ + mdm?: string, + /** apn and gcm for ios */ + urlArgs?: string, + /** apn and gcm for ios */ + truncateAtWordEnd?: boolean, + /** apn */ + mutableContent?: number, + /** seconds */ + expiry?: number, + /** if both expiry and timeToLive are given, expiry will take precedency */ + timeToLive?: number, + /** wns */ + headers?: string[], + /** wns */ + launch?: string, + /** wns */ + duration?: string, + /** ADM */ + consolidationKey?: string + } + + interface IPushMethod { + (regIds: string[], data: IData, settings: ISettings): void + } + + interface ICallback { + (err: any, result: any): void + } +} + +declare module 'node-pushnotifications' { + export = PushNotifications; +} \ No newline at end of file diff --git a/types/node-pushnotifications/node-pushnotifications-tests.ts b/types/node-pushnotifications/node-pushnotifications-tests.ts new file mode 100644 index 0000000000..2d815a21dc --- /dev/null +++ b/types/node-pushnotifications/node-pushnotifications-tests.ts @@ -0,0 +1,51 @@ +import * as PushNotifications from "node-pushnotifications"; + +const settings = { + gcm: { + id: "null" + }, + apn: { + token: { + key: './certs/key.p8', + keyId: 'ABCD', + teamId: 'EFGH', + } + }, + adm: { + client_id: "null", + client_secret: "null" + }, + wns: { + client_id: "null", + client_secret: "null", + notificationMethod: 'sendTileSquareBlock', + } +}; +const push = new PushNotifications(settings); + +const registrationIds = []; +registrationIds.push('INSERT_YOUR_DEVICE_ID'); +registrationIds.push('INSERT_OTHER_DEVICE_ID'); + +const data = { + title: 'New push notification', + body: 'Powered by AppFeel' +}; + +// You can use it in node callback style +push.send(registrationIds, data, (err, result) => { + if (err) { + console.log(err); + } else { + console.log(result); + } +}); + +// Or you could use it as a promise: +push.send(registrationIds, data) + .then((results) => { + console.log(results); + }) + .catch((err) => { + console.log(err); + }); diff --git a/types/node-pushnotifications/tsconfig.json b/types/node-pushnotifications/tsconfig.json new file mode 100644 index 0000000000..bbd908bcdb --- /dev/null +++ b/types/node-pushnotifications/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": ["node"], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "node-pushnotifications-tests.ts" + ] +} diff --git a/types/node-pushnotifications/tslint.json b/types/node-pushnotifications/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/node-pushnotifications/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 85764dcd2b63e8548b4e3beb429d4617d9e914b7 Mon Sep 17 00:00:00 2001 From: Nicolas Graziano Date: Tue, 20 Mar 2018 18:17:28 +0100 Subject: [PATCH 133/693] [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 134/693] [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 2fe16d8d8186e72761ca0f4d06adf31d36391837 Mon Sep 17 00:00:00 2001 From: Menushka Weeratunga Date: Tue, 20 Mar 2018 15:38:15 -0400 Subject: [PATCH 135/693] Changes to pass `npm test` --- types/node-pushnotifications/index.d.ts | 224 +++++++++--------- .../node-pushnotifications-tests.ts | 2 +- types/node-pushnotifications/tsconfig.json | 3 +- 3 files changed, 120 insertions(+), 109 deletions(-) diff --git a/types/node-pushnotifications/index.d.ts b/types/node-pushnotifications/index.d.ts index fbb11eac3b..2134069936 100644 --- a/types/node-pushnotifications/index.d.ts +++ b/types/node-pushnotifications/index.d.ts @@ -3,168 +3,178 @@ // Definitions by: Menushka Weeratunga // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare class PushNotifications { - constructor(settings: PushNotifications.ISettings); +// TypeScript Version: 2.1 +/// - setOptions(opts: PushNotifications.ISettings): void; - sendWith(method: PushNotifications.IPushMethod, regIds: string[], data: PushNotifications.IData, cb: PushNotifications.ICallback): void; - send(registrationIds: string[], data: PushNotifications.IData, cb: PushNotifications.ICallback): void; - send(registrationIds: string[], data: PushNotifications.IData): Promise; +export = PushNotifications; + +declare class PushNotifications { + constructor(settings: PushNotifications.Settings); + + setOptions(opts: PushNotifications.Settings): void; + sendWith(method: PushNotifications.PushMethod, regIds: string[], data: PushNotifications.Data, cb: PushNotifications.Callback): void; + send(registrationIds: string[], data: PushNotifications.Data, cb: PushNotifications.Callback): void; + send(registrationIds: string[], data: PushNotifications.Data): Promise; } -declare module PushNotifications { - interface ISettings { +declare namespace PushNotifications { + interface Settings { /** Google Cloud Messaging */ gcm?: { /** GCM or FCM token */ - id?: string - }, + id?: string; + }; /** Apple Push Notifications */ apn?: { /** APN Token */ token?: { - /** The filename of the provider token key (as supplied by Apple) to load from disk, or a Buffer/String containing the key data. */ - key?: Buffer | string, + /** + * The filename of the provider token key (as supplied by Apple) to load from disk, or a + * Buffer/String containing the key data. + */ + key?: Buffer | string; /** The ID of the key issued by Apple */ - keyId?: string, + keyId?: string; /** ID of the team associated with the provider token key */ - teamId?: string - } - /** The filename of the connection certificate to load from disk, or a Buffer/String containing the certificate data. */ - cert?: string, - /** The filename of the connection key to load from disk, or a Buffer/String containing the key data. */ - key?: string, - /** An array of trusted certificates. Each element should contain either a filename to load, or a Buffer/String (in PEM format) to be used directly. If this is omitted several well known "root" CAs will be used. - You may need to use this as some environments don't include the CA used by Apple (entrust_2048). */ - ca?: (Buffer | string)[], - /** File path for private key, certificate and CA certs in PFX or PKCS12 format, or a Buffer containing the PFX data. If supplied will always be used instead of certificate and key above. */ - pfx?: Buffer | string, + teamId?: string; + }; + /** + * The filename of the connection certificate to load from disk, or a Buffer/String containing the + * certificate data. + */ + cert?: string; + /** The filename of the connection key to load from disk, or a Buffer or String containing the key data. */ + key?: string; + /** + * An array of trusted certificates. Each element should contain either a filename to load, or a + * Buffer/String (in PEM format) to be used directly. If this is omitted several well known "root" CAs + * will be used. - You may need to use this as some environments don't include the CA used by + * Apple (entrust_2048). + */ + ca?: Array; + /** + * File path for private key, certificate and CA certs in PFX or PKCS12 format, or a Buffer containing + * the PFX data. If supplied will always be used instead of certificate and key above. + */ + pfx?: Buffer | string; /** The passphrase for the connection key, if required */ - passphrase?: string, - productionv?: boolean, - voip?: boolean, - address?: string, - port?: number, - rejectUnauthorized?: boolean, - connectionRetryLimit?: number, - - cacheLength?: number, - connectionTimeout?: number, - autoAdjustCache?: boolean, - maxConnections?: number, - minConnections?: number, - connectTimeout?: number, - buffersNotifications?: boolean, - fastMode?: boolean, - disableNagle?: boolean, - disableEPIPEFix?: boolean - }, + passphrase?: string; + productionv?: boolean; + voip?: boolean; + address?: string; + port?: number; + rejectUnauthorized?: boolean; + connectionRetryLimit?: number; + cacheLength?: number; + connectionTimeout?: number; + autoAdjustCache?: boolean; + maxConnections?: number; + minConnections?: number; + connectTimeout?: number; + buffersNotifications?: boolean; + fastMode?: boolean; + disableNagle?: boolean; + disableEPIPEFix?: boolean; + }; /** Amazon Device Messaging */ adm?: { - client_id?: string, - client_secret?: string - }, + client_id?: string; + client_secret?: string; + }; /** Windows Push Notifications */ wns?: { - client_id?: string, - client_secret?: string, - accessToken?: string, - headers?: string, - notificationMethod?: string - }, + client_id?: string; + client_secret?: string; + accessToken?: string; + headers?: string; + notificationMethod?: string; + }; /** Microsoft Push Notification Service */ mpns?: { options?: { - client_id?: string, - client_secret?: string - } - } + client_id?: string; + client_secret?: string; + }; + }; } - - interface IData { + interface Data { /** REQUIRED */ - title: string, + title: string; /** REQUIRED */ - body: string, + body: string; custom?: { - sender?: string, - }, - /** gcm, apn. Supported values are 'high' or 'normal' (gcm). Will be translated to 10 and 5 for apn. Defaults to 'high' */ - priority?: string, + sender?: string; + }; + /** + * gcm, apn. Supported values are 'high' or 'normal' (gcm). Will be translated to 10 and 5 for apn. Defaults + * to 'high' + */ + priority?: string; /** gcm for android, used as collapseId in apn */ - collapseKey?: string, + collapseKey?: string; /** gcm for android */ - contentAvailable?: boolean | string, + contentAvailable?: boolean | string; /** gcm for android */ - delayWhileIdle?: boolean, + delayWhileIdle?: boolean; /** gcm for android */ - restrictedPackageName?: string, + restrictedPackageName?: string; /** gcm for android */ - dryRun?: boolean, + dryRun?: boolean; /** gcm for android */ - icon?: string, + icon?: string; /** gcm for android */ - tag?: string, + tag?: string; /** gcm for android */ - color?: string, + color?: string; /** gcm for android. In ios, category will be used if not supplied */ - clickAction?: string, + clickAction?: string; /** gcm, apn */ - locKey?: string, + locKey?: string; /** gcm, apn */ - bodyLocArgs?: string, + bodyLocArgs?: string; /** gcm, apn */ - titleLocKey?: string, + titleLocKey?: string; /** gcm, apn */ - titleLocArgs?: string, + titleLocArgs?: string; /** gcm, apn */ - retries?: number, + retries?: number; /** apn */ - encoding?: string, + encoding?: string; /** gcm for ios, apn */ - badge?: number, + badge?: number; /** gcm, apn */ - sound?: string, + sound?: string; /** apn, will take precedence over title and body. It is also accepted a text message in alert */ - alert?: {} | string, + alert?: {} | string; /** apn and gcm for ios */ - launchImage?: string, + launchImage?: string; /** apn and gcm for ios */ - action?: string, + action?: string; /** apn and gcm for ios */ - topic?: string, + topic?: string; /** apn and gcm for ios */ - category?: string, + category?: string; /** apn and gcm for ios */ - mdm?: string, + mdm?: string; /** apn and gcm for ios */ - urlArgs?: string, + urlArgs?: string; /** apn and gcm for ios */ - truncateAtWordEnd?: boolean, + truncateAtWordEnd?: boolean; /** apn */ - mutableContent?: number, + mutableContent?: number; /** seconds */ - expiry?: number, + expiry?: number; /** if both expiry and timeToLive are given, expiry will take precedency */ - timeToLive?: number, + timeToLive?: number; /** wns */ - headers?: string[], + headers?: string[]; /** wns */ - launch?: string, + launch?: string; /** wns */ - duration?: string, + duration?: string; /** ADM */ - consolidationKey?: string - } - - interface IPushMethod { - (regIds: string[], data: IData, settings: ISettings): void - } - - interface ICallback { - (err: any, result: any): void + consolidationKey?: string; } + type PushMethod = (regIds: string[], data: Data, settings: Settings) => void; + type Callback = (err: any, result: any) => void; } - -declare module 'node-pushnotifications' { - export = PushNotifications; -} \ No newline at end of file diff --git a/types/node-pushnotifications/node-pushnotifications-tests.ts b/types/node-pushnotifications/node-pushnotifications-tests.ts index 2d815a21dc..6a4d9d3335 100644 --- a/types/node-pushnotifications/node-pushnotifications-tests.ts +++ b/types/node-pushnotifications/node-pushnotifications-tests.ts @@ -1,4 +1,4 @@ -import * as PushNotifications from "node-pushnotifications"; +import PushNotifications = require('node-pushnotifications'); const settings = { gcm: { diff --git a/types/node-pushnotifications/tsconfig.json b/types/node-pushnotifications/tsconfig.json index bbd908bcdb..54ace6c986 100644 --- a/types/node-pushnotifications/tsconfig.json +++ b/types/node-pushnotifications/tsconfig.json @@ -7,11 +7,12 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], - "types": ["node"], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, From 0cdf91a543126d20f7bbd61c8b24cf49ccf9dff8 Mon Sep 17 00:00:00 2001 From: Ben Gazzard Date: Tue, 20 Mar 2018 16:04:05 -0400 Subject: [PATCH 136/693] 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 137/693] 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 138/693] 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 139/693] 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 55421afb90b7eacef9e8fc79f54a1d279cc54d27 Mon Sep 17 00:00:00 2001 From: Christian Chown Date: Tue, 20 Mar 2018 23:18:23 +0000 Subject: [PATCH 140/693] Initial typings for react-infinite-calendar --- types/react-infinite-calendar/index.d.ts | 66 +++++++++++++++++++ .../react-infinite-calendar-tests.tsx | 61 +++++++++++++++++ types/react-infinite-calendar/tsconfig.json | 25 +++++++ types/react-infinite-calendar/tslint.json | 1 + 4 files changed, 153 insertions(+) create mode 100644 types/react-infinite-calendar/index.d.ts create mode 100644 types/react-infinite-calendar/react-infinite-calendar-tests.tsx create mode 100644 types/react-infinite-calendar/tsconfig.json create mode 100644 types/react-infinite-calendar/tslint.json diff --git a/types/react-infinite-calendar/index.d.ts b/types/react-infinite-calendar/index.d.ts new file mode 100644 index 0000000000..8a1adbff14 --- /dev/null +++ b/types/react-infinite-calendar/index.d.ts @@ -0,0 +1,66 @@ +// Type definitions for react-infinite-calendar 2.3 +// Project: https://github.com/clauderic/react-infinite-calendar +// Definitions by: Christian Chown +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; + +export interface ReactInfiniteCalendarProps { + selected?: Date | boolean; + width?: number; + height?: number; + min?: Date; + max?: Date; + minDate?: Date; + maxDate?: Date; + disabledDays?: Array<0 | 1 | 2 | 3 | 4 | 5 | 6>; + disabledDates?: Date[]; + display?: 'days' | 'years'; + displayOptions?: { + hideYearsOnSelect?: boolean; + layout?: 'portrait' | 'landscape'; + overscanMonthCount?: number; + shouldHeaderAnimate?: boolean; + showHeader?: boolean; + showMonthsForYears?: boolean; + showOverlay?: boolean; + showTodayHelper?: boolean; + showWeekdays?: boolean; + todayHelperRowOffset?: number; + }; + locale?: { + blank?: string; + headerFormat?: string; + todayLabel?: { + long: string; + }; + weekdays?: string[]; + weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6; + }; + theme?: { + accentColor?: string; + floatingNav: { + background?: string; + chevron?: string; + color?: string; + }; + headerColor?: string; + selectionColor?: string; + textColor?: { + active?: string; + default?: string; + }; + todayColor?: string; + weekdayColor?: string; + }; + className?: string; + onSelect?: () => void; + onScroll?: (scrollTop: number) => void; + onScrollEnd?: (scrollTop: number) => void; + rowHeight?: number; + autoFocus?: boolean; + tabIndex?: number; +} + +export default class ReactInfiniteCalendar extends React.Component {} diff --git a/types/react-infinite-calendar/react-infinite-calendar-tests.tsx b/types/react-infinite-calendar/react-infinite-calendar-tests.tsx new file mode 100644 index 0000000000..ff1918d539 --- /dev/null +++ b/types/react-infinite-calendar/react-infinite-calendar-tests.tsx @@ -0,0 +1,61 @@ +import * as React from 'react'; +import ReactInfiniteCalendar from 'react-infinite-calendar'; + +const test: React.SFC = () => ( + {}} + onScroll={(scrollTop: number) => { console.log(scrollTop); }} + onScrollEnd={(scrollTop: number) => { console.log(scrollTop); }} + rowHeight={40} + autoFocus={false} + tabIndex={1} + /> +); diff --git a/types/react-infinite-calendar/tsconfig.json b/types/react-infinite-calendar/tsconfig.json new file mode 100644 index 0000000000..bf57e148ca --- /dev/null +++ b/types/react-infinite-calendar/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-infinite-calendar-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/react-infinite-calendar/tslint.json b/types/react-infinite-calendar/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/react-infinite-calendar/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file From b745db2194e27703c8dde8b7af4e2fd20ac5da8e Mon Sep 17 00:00:00 2001 From: karak Date: Wed, 21 Mar 2018 08:41:20 +0900 Subject: [PATCH 141/693] Fix author. --- types/karma-viewport/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/karma-viewport/index.d.ts b/types/karma-viewport/index.d.ts index cb220bfc5b..10196485ca 100644 --- a/types/karma-viewport/index.d.ts +++ b/types/karma-viewport/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for karma-viewport 0.4 // Project: https://github.com/squidfunk/karma-viewport -// Definitions by: My Self +// Definitions by: Karak // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Type definition file for 'karma-viewport' // https://www.npmjs.com/package/karma-viewport From 7fab72af1ed86dbf1db1cf1c2049e6d4c27a526c Mon Sep 17 00:00:00 2001 From: Christian Chown Date: Wed, 21 Mar 2018 00:02:59 +0000 Subject: [PATCH 142/693] Initial typings for exenv --- types/exenv/exenv-tests.ts | 6 ++++++ types/exenv/index.d.ts | 10 ++++++++++ types/exenv/tsconfig.json | 23 +++++++++++++++++++++++ types/exenv/tslint.json | 1 + 4 files changed, 40 insertions(+) create mode 100644 types/exenv/exenv-tests.ts create mode 100644 types/exenv/index.d.ts create mode 100644 types/exenv/tsconfig.json create mode 100644 types/exenv/tslint.json diff --git a/types/exenv/exenv-tests.ts b/types/exenv/exenv-tests.ts new file mode 100644 index 0000000000..d13633b4a6 --- /dev/null +++ b/types/exenv/exenv-tests.ts @@ -0,0 +1,6 @@ +import * as ExecutionEnvironment from 'exenv'; + +JSON.stringify(ExecutionEnvironment.canUseDOM); +JSON.stringify(ExecutionEnvironment.canUseEventListeners); +JSON.stringify(ExecutionEnvironment.canUseViewport); +JSON.stringify(ExecutionEnvironment.canUseWorkers); diff --git a/types/exenv/index.d.ts b/types/exenv/index.d.ts new file mode 100644 index 0000000000..701494f6d8 --- /dev/null +++ b/types/exenv/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for exenv 1.2 +// Project: https://github.com/JedWatson/exenv +// Definitions by: Christian Chown +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +export const canUseDOM: boolean; +export const canUseEventListeners: boolean; +export const canUseViewport: boolean; +export const canUseWorkers: boolean; diff --git a/types/exenv/tsconfig.json b/types/exenv/tsconfig.json new file mode 100644 index 0000000000..d8825637a1 --- /dev/null +++ b/types/exenv/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", + "exenv-tests.ts" + ] +} \ No newline at end of file diff --git a/types/exenv/tslint.json b/types/exenv/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/exenv/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file From 1ad2b822af67c1d88a80f35e895260dcbe738eb9 Mon Sep 17 00:00:00 2001 From: Christian Chown Date: Wed, 21 Mar 2018 00:19:09 +0000 Subject: [PATCH 143/693] Allow auto width/height, floatingNav is optional, onSelect takes a string --- types/react-infinite-calendar/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-infinite-calendar/index.d.ts b/types/react-infinite-calendar/index.d.ts index 8a1adbff14..0264c70d91 100644 --- a/types/react-infinite-calendar/index.d.ts +++ b/types/react-infinite-calendar/index.d.ts @@ -8,8 +8,8 @@ import * as React from 'react'; export interface ReactInfiniteCalendarProps { selected?: Date | boolean; - width?: number; - height?: number; + width?: number | 'auto'; + height?: number | 'auto'; min?: Date; max?: Date; minDate?: Date; @@ -40,7 +40,7 @@ export interface ReactInfiniteCalendarProps { }; theme?: { accentColor?: string; - floatingNav: { + floatingNav?: { background?: string; chevron?: string; color?: string; @@ -55,7 +55,7 @@ export interface ReactInfiniteCalendarProps { weekdayColor?: string; }; className?: string; - onSelect?: () => void; + onSelect?: (date: string) => void; onScroll?: (scrollTop: number) => void; onScrollEnd?: (scrollTop: number) => void; rowHeight?: number; From 2de73dedb7ade81167148adf6545130b1da42ee6 Mon Sep 17 00:00:00 2001 From: tonyholt Date: Tue, 20 Mar 2018 21:23:34 -0400 Subject: [PATCH 144/693] 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 5a36ea31c36bcd4d92b7ea0d7a07dba4524a8b72 Mon Sep 17 00:00:00 2001 From: Walter Rumsby Date: Wed, 21 Mar 2018 16:26:51 +1300 Subject: [PATCH 145/693] Add types for mem-fs --- types/mem-fs/index.d.ts | 23 +++++++++++++++++++++++ types/mem-fs/test/index.ts | 6 ++++++ types/mem-fs/tsconfig.json | 23 +++++++++++++++++++++++ types/mem-fs/tslint.json | 7 +++++++ 4 files changed, 59 insertions(+) create mode 100644 types/mem-fs/index.d.ts create mode 100644 types/mem-fs/test/index.ts create mode 100644 types/mem-fs/tsconfig.json create mode 100644 types/mem-fs/tslint.json diff --git a/types/mem-fs/index.d.ts b/types/mem-fs/index.d.ts new file mode 100644 index 0000000000..dedc40f7fc --- /dev/null +++ b/types/mem-fs/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for mem-fs 1.1 +// Project: https://github.com/SBoudrias/mem-fs +// Definitions by: My Food Bag +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import events = require('events'); +import stream = require('stream'); +import File = require('vinyl'); + +declare namespace FileSystem { + interface Store extends events.EventEmitter { + add: (file: File, content: string) => void; + each: (callback: (file: File, index: number) => void) => void; + get: (filepath: string) => File; + stream: () => stream.Transform; + } + + export function create(): Store; +} + +export = FileSystem; diff --git a/types/mem-fs/test/index.ts b/types/mem-fs/test/index.ts new file mode 100644 index 0000000000..bb925837aa --- /dev/null +++ b/types/mem-fs/test/index.ts @@ -0,0 +1,6 @@ +import * as fs from 'mem-fs'; + +const store = fs.create(); +const file = store.get('hello'); + +store.add(file, 'hahahahah'); diff --git a/types/mem-fs/tsconfig.json b/types/mem-fs/tsconfig.json new file mode 100644 index 0000000000..f0d4f87dbb --- /dev/null +++ b/types/mem-fs/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", + "test/index.ts" + ] +} diff --git a/types/mem-fs/tslint.json b/types/mem-fs/tslint.json new file mode 100644 index 0000000000..0189538855 --- /dev/null +++ b/types/mem-fs/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "export-just-namespace": false, + "strict-export-declare-modifiers": false + } +} From f2d6f88dc636fe2f68b913a717a578418f354d38 Mon Sep 17 00:00:00 2001 From: Abdulsattar Mohammed Date: Wed, 21 Mar 2018 11:48:50 +0530 Subject: [PATCH 146/693] 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 4c2186d54c12b61c2554314e7c82053ff6399ecf Mon Sep 17 00:00:00 2001 From: Walter Rumsby Date: Wed, 21 Mar 2018 21:49:18 +1300 Subject: [PATCH 147/693] Generate with dts-gen --- types/mem-fs/index.d.ts | 13 ++++++------- types/mem-fs/{test/index.ts => mem-fs-tests.ts} | 0 types/mem-fs/tsconfig.json | 4 ++-- types/mem-fs/tslint.json | 3 +-- 4 files changed, 9 insertions(+), 11 deletions(-) rename types/mem-fs/{test/index.ts => mem-fs-tests.ts} (100%) diff --git a/types/mem-fs/index.d.ts b/types/mem-fs/index.d.ts index dedc40f7fc..08a3067637 100644 --- a/types/mem-fs/index.d.ts +++ b/types/mem-fs/index.d.ts @@ -1,15 +1,15 @@ // Type definitions for mem-fs 1.1 -// Project: https://github.com/SBoudrias/mem-fs +// Project: https://github.com/sboudrias/mem-fs#readme // Definitions by: My Food Bag // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - import events = require('events'); import stream = require('stream'); import File = require('vinyl'); -declare namespace FileSystem { +export function create(...args: any[]): create.Store; + +export namespace create { interface Store extends events.EventEmitter { add: (file: File, content: string) => void; each: (callback: (file: File, index: number) => void) => void; @@ -17,7 +17,6 @@ declare namespace FileSystem { stream: () => stream.Transform; } - export function create(): Store; + const prototype: { + }; } - -export = FileSystem; diff --git a/types/mem-fs/test/index.ts b/types/mem-fs/mem-fs-tests.ts similarity index 100% rename from types/mem-fs/test/index.ts rename to types/mem-fs/mem-fs-tests.ts diff --git a/types/mem-fs/tsconfig.json b/types/mem-fs/tsconfig.json index f0d4f87dbb..23cb94acb6 100644 --- a/types/mem-fs/tsconfig.json +++ b/types/mem-fs/tsconfig.json @@ -6,8 +6,8 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": true, "strictFunctionTypes": true, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "test/index.ts" + "mem-fs-tests.ts" ] } diff --git a/types/mem-fs/tslint.json b/types/mem-fs/tslint.json index 0189538855..2ff396e742 100644 --- a/types/mem-fs/tslint.json +++ b/types/mem-fs/tslint.json @@ -1,7 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "export-just-namespace": false, - "strict-export-declare-modifiers": false + } } From 49e76eb838d9fdcc5a7a9975a11542eb14f660a2 Mon Sep 17 00:00:00 2001 From: pvavrik Date: Wed, 21 Mar 2018 10:09:37 +0100 Subject: [PATCH 148/693] 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 149/693] 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 150/693] 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 ea9dfd9bddd1ed8102d9dfc86eeaef46cdad7d52 Mon Sep 17 00:00:00 2001 From: Christian Chown Date: Wed, 21 Mar 2018 12:27:59 +0000 Subject: [PATCH 151/693] strictNullChecks = true --- types/react-infinite-calendar/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-infinite-calendar/tsconfig.json b/types/react-infinite-calendar/tsconfig.json index bf57e148ca..dab62fb64c 100644 --- a/types/react-infinite-calendar/tsconfig.json +++ b/types/react-infinite-calendar/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "jsx": "react", From 3a4346adbc05847d5724f69857be817ef0c74cdf Mon Sep 17 00:00:00 2001 From: Johannes Maximilian Toball Date: Wed, 21 Mar 2018 13:39:21 +0100 Subject: [PATCH 152/693] 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 a000a913af6b12acc27ba6d17011d14b72b54a73 Mon Sep 17 00:00:00 2001 From: Menushka Weeratunga Date: Wed, 21 Mar 2018 09:22:49 -0400 Subject: [PATCH 153/693] Fixed small typo for APN settings --- types/node-pushnotifications/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/node-pushnotifications/index.d.ts b/types/node-pushnotifications/index.d.ts index 2134069936..5b9ed891f9 100644 --- a/types/node-pushnotifications/index.d.ts +++ b/types/node-pushnotifications/index.d.ts @@ -59,7 +59,7 @@ declare namespace PushNotifications { pfx?: Buffer | string; /** The passphrase for the connection key, if required */ passphrase?: string; - productionv?: boolean; + production?: boolean; voip?: boolean; address?: string; port?: number; From 428c74629144cf1973136c997761db802fcce61a Mon Sep 17 00:00:00 2001 From: Edward Sammut Alessi Date: Wed, 21 Mar 2018 14:30:39 +0100 Subject: [PATCH 154/693] Typings for steam-client --- types/steam-client/index.d.ts | 3390 ++++++++++++++++++++++ types/steam-client/steam-client-tests.ts | 38 + types/steam-client/tsconfig.json | 22 + types/steam-client/tslint.json | 1 + 4 files changed, 3451 insertions(+) create mode 100644 types/steam-client/index.d.ts create mode 100644 types/steam-client/steam-client-tests.ts create mode 100644 types/steam-client/tsconfig.json create mode 100644 types/steam-client/tslint.json diff --git a/types/steam-client/index.d.ts b/types/steam-client/index.d.ts new file mode 100644 index 0000000000..ec9f88565f --- /dev/null +++ b/types/steam-client/index.d.ts @@ -0,0 +1,3390 @@ +// Type definitions for steam-client 2.5 +// Project: https://github.com/DoctorMcKay/node-steam-client +// Definitions by: Edward Sammut Alessi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +export class CMClient { + /** + * A boolean that indicates whether you are currently connected and the encryption handshake is complete. + * 'connected' is emitted when it changes to true, and 'error' is emitted when it changes to false unless you called disconnect. + * Sending any client messages is only allowed while this is true. + */ + connected: boolean; + + /** + * A boolean that indicates whether you are currently logged on. + * Calling any handler methods except for methods to log on is only allowed while logged on. + */ + loggedOn: boolean; + + /** + * Your own SteamID while logged on, otherwise unspecified. + * Must be set to a valid initial value before sending a logon message. + */ + steamID: string; + + /** + * If we've initiated a connection previously, a string containing "ipv4:port" for the server we're connecting/connected to. + * Also contains the address of the last host we were connected to if we're currently disconnected. + */ + remoteAddress: string; + + // Default is TCP. UDP support is experimental + constructor(protocol?: EConnectionProtocol); + + /** + * Override the address and/or port that will be used for the outgoing connection. + * Takes effect the next time you connect. + * + * @param localAddress The local IP address you want to use for the outgoing connection + * @param localPort The local port you want to use for the outgoing connection + */ + bind(localAddress?: string, localPort?: string | number): void; + + /** + * Connects to Steam.It will keep trying to reconnect (provided autoRetry is not false) until encryption handshake is complete (see 'connected'), unless you cancel it with disconnect. + * + * You can call this method at any time. If you are already connected, disconnects you first. If there is an ongoing connection attempt, cancels it. + * + * @param server If you want to connect to a specific CM server, provide an object here containing host and port properties. Default is a random value from the servers property. + * @param autoRetry true if you want to automatically retry connection until successful, or false if you want an error event if connection fails. Default true + */ + connect(server?: Server, autoRetry?: boolean): void; + + /** + * Immediately terminates the connection and prevents any events (including 'error') from being emitted until you connect again. + * If you are already disconnected, does nothing. + * If there is an ongoing connection attempt, cancels it. + */ + disconnect(): void; + + /** + * Send a logon message to the CM. + * You must first be connected and set steamID to a valid initial value. + * You will receive the response in the logOnResponse event. + * + * @param details An object containing your logon parameters + */ + logOn(details: CMsgClientLogonPassword | CMsgClientLogonLoginKey): void; + + /** + * + * @param header + * @param body + * @param callback + */ + send: SendMessage; + + // Events + + on(eventType: T, callback: CMEventCallback[T]): void; +} + +/** + * Steam.servers contains the list of CM servers that CMClient will attempt to connect to. + * The bootstrapped list is not always up-to-date and might contain dead servers. + * To avoid timeouts, replace it with your own list before logging in if you have one (see 'servers' event). + */ +export const servers: Server[]; + +export type SendMessage = ( + /** + * An object containing the message header. It has the following properties: + * The following fields are reserved for internal use and shall be ignored: steamid, client_sessionid, jobid_source, jobid_target. + * (Note: pass an empty object if you don't need to set any fields) + */ + header: { + /** + * A value from EMsg + */ + msg: EMsg, + + /** + * A CMsgProtoBufHeader object if this message is protobuf-backed, otherwise header.proto is falsy. + */ + proto?: CMsgProtoBufHeader | false + }, + + /** + * A Buffer or ByteBuffer containing the rest of the message + */ + body: Buffer | ByteBuffer, + + /** + * If not falsy, then this message is a request, and callback shall be called with any response to it instead of 'message'/send. callback has the same arguments as 'message'/send. + */ + callback?: SendMessage | false +) => void; + +export type CMEventCallback = { + /** + * Connection closed by the server. + * Only emitted if the encryption handshake is complete, otherwise it will reconnect automatically (unless you disabled autoRetry). + * loggedOn is now false. + * + * @param err An Error object. May contain an eresult property. + */ + error: (err: Error) => void, + + /** + * Encryption handshake complete. + * From now on, it's your responsibility to handle disconnections and reconnect (see error). + * You'll likely want to log on now. + * + * @param serverLoad The load value of the CM server you're connected to. Only available if you're connecting using UDP. It's unclear at this time what scale this value uses. + */ + connected: (serverLoad: string) => void, + + /** + * Logon response received. If eresult is EResult.OK, loggedOn is now true. + * + * @param response An object with the properties in CMsgClientLogonResponse + */ + logOnResponse: (response: CMsgClientLogonResponse) => void, + + /** + * CMClient will use this new list when reconnecting, but it will be lost when your application restarts. + * You might want to save it to a file or a database and assign it to Steam.servers before logging in next time. + * + * Note that Steam.servers will be automatically updated after this event is emitted. + * This will be useful if you want to compare the old list with the new one for some reason - otherwise it shouldn't matter. + * + * @param servers An array containing the up-to-date server list + */ + servers: (servers: Server[]) => void, + + /** + * You were logged off from Steam. loggedOn is now false. + * + * @param eresesult A value from EResult + */ + loggedOff: (eresesult: EResult) => void, + + message: SendMessage, +}; + +export type Server = { + host: string, + port: string | number, +} + +// Protobufs + +export interface CMsgClientLogon { + /** + * Your steam login + */ + account_name: string; + + /** + * Steam Guard code. Must be valid if provided, otherwise the logon will fail. Note that Steam Guard codes expire after a short while + */ + auth_code?: string; + + /** + * Two-factor authentication code provided by the Steam mobile application. You will have to provide this code every time you log in if your account uses 2FA. + */ + two_factor_code?: string; + + /** + * SHA1 hash of your sentry file. + * If not provided, Steam will send you a sentry file through the ClientUpdateMachineAuth message (unless a limit for registered sentries is reached? see https://github.com/seishun/node-steam/issues/178). + * If no Steam Guard code is provided, the hash must be already registered with this account, otherwise it's ignored. + * This value will be ignored if you enable 2FA. + */ + sha_sentryfile?: string; +} + +export interface CMsgClientLogonPassword extends CMsgClientLogon { + /** + * Required unless login_key is used + */ + password: string; +} + +export interface CMsgClientLogonLoginKey extends CMsgClientLogon { + /** + * Alternative to password + */ + login_key: string; +} + +export interface CMsgClientLogonResponse { + /** + * The logon was successful if equal to EResult.OK + */ + eresult: EResult; + + /** + * "loginkey" to be used with WebAPI's AuthenticateUser." + */ + webapi_authenticate_user_nonce: string; +} + +export interface CMsgProtoBufHeader { + steamid?: string; + client_sessionid?: number; + routing_appid?: number; + jobid_source?: string; + jobid_target?: string; + target_job_name?: string; + seq_num?: number; + eresult?: number; + error_message?: string; + ip?: number; + auth_account_flags?: number; + token_source?: number; + admin_spoofing_user?: boolean; + transport_error?: number; + messageid?: string; + publisher_group_id?: number; + sysid?: number; + trace_tag?: string; + webapi_key_id?: number; + is_from_external_source?: boolean; + forward_to_sysid?: number[]; +} + +// Enums + +export enum EConnectionProtocol { + TCP = 1, + UDP = 2, + WebSocket = 3, +} + +export enum EMsg { + Invalid = 0, + Multi = 1, + ProtobufWrapped = 2, + + BaseGeneral = 100, + GenericReply = 100, + DestJobFailed = 113, + Alert = 115, + SCIDRequest = 120, + SCIDResponse = 121, + JobHeartbeat = 123, + HubConnect = 124, + Subscribe = 126, + RouteMessage = 127, // obsolete + RemoteSysID = 128, // obsolete + AMCreateAccountResponse = 129, + WGRequest = 130, + WGResponse = 131, + KeepAlive = 132, + WebAPIJobRequest = 133, + WebAPIJobResponse = 134, + ClientSessionStart = 135, + ClientSessionEnd = 136, + ClientSessionUpdateAuthTicket = 137, // obsolete "renamed to ClientSessionUpdate" + ClientSessionUpdate = 137, + StatsDeprecated = 138, // obsolete + Ping = 139, + PingResponse = 140, + Stats = 141, + RequestFullStatsBlock = 142, + LoadDBOCacheItem = 143, + LoadDBOCacheItemResponse = 144, + InvalidateDBOCacheItems = 145, + ServiceMethod = 146, + ServiceMethodResponse = 147, + ClientPackageVersions = 148, + TimestampRequest = 149, + TimestampResponse = 150, + + BaseShell = 200, + AssignSysID = 200, + Exit = 201, + DirRequest = 202, + DirResponse = 203, + ZipRequest = 204, + ZipResponse = 205, + UpdateRecordResponse = 215, + UpdateCreditCardRequest = 221, + UpdateUserBanResponse = 225, + PrepareToExit = 226, + ContentDescriptionUpdate = 227, + TestResetServer = 228, + UniverseChanged = 229, + ShellConfigInfoUpdate = 230, + RequestWindowsEventLogEntries = 233, + ProvideWindowsEventLogEntries = 234, + ShellSearchLogs = 235, + ShellSearchLogsResponse = 236, + ShellCheckWindowsUpdates = 237, + ShellCheckWindowsUpdatesResponse = 238, + ShellFlushUserLicenseCache = 239, // obsolete + + BaseGM = 300, + Heartbeat = 300, + ShellFailed = 301, + ExitShells = 307, + ExitShell = 308, + GracefulExitShell = 309, + NotifyWatchdog = 314, + LicenseProcessingComplete = 316, + SetTestFlag = 317, + QueuedEmailsComplete = 318, + GMReportPHPError = 319, + GMDRMSync = 320, + PhysicalBoxInventory = 321, + UpdateConfigFile = 322, + TestInitDB = 323, + GMWriteConfigToSQL = 324, + GMLoadActivationCodes = 325, + GMQueueForFBS = 326, + GMSchemaConversionResults = 327, + GMSchemaConversionResultsResponse = 328, // obsolete + GMWriteShellFailureToSQL = 329, + GMWriteStatsToSOS = 330, + GMGetServiceMethodRouting = 331, + GMGetServiceMethodRoutingResponse = 332, + GMConvertUserWallets = 333, + + BaseAIS = 400, + AISRefreshContentDescription = 401, // obsolete + AISRequestContentDescription = 402, + AISUpdateAppInfo = 403, + AISUpdatePackageInfo = 404, // obsolete "renamed to AISUpdatePackageCosts" + AISUpdatePackageCosts = 404, + AISGetPackageChangeNumber = 405, + AISGetPackageChangeNumberResponse = 406, + AISAppInfoTableChanged = 407, // obsolete + AISUpdatePackageCostsResponse = 408, + AISCreateMarketingMessage = 409, + AISCreateMarketingMessageResponse = 410, + AISGetMarketingMessage = 411, + AISGetMarketingMessageResponse = 412, + AISUpdateMarketingMessage = 413, + AISUpdateMarketingMessageResponse = 414, + AISRequestMarketingMessageUpdate = 415, + AISDeleteMarketingMessage = 416, + AISGetMarketingTreatments = 419, // obsolete + AISGetMarketingTreatmentsResponse = 420, // obsolete + AISRequestMarketingTreatmentUpdate = 421, // obsolete + AISTestAddPackage = 422, // obsolete + AIGetAppGCFlags = 423, + AIGetAppGCFlagsResponse = 424, + AIGetAppList = 425, + AIGetAppListResponse = 426, + AIGetAppInfo = 427, // obsolete + AIGetAppInfoResponse = 428, // obsolete + AISGetCouponDefinition = 429, + AISGetCouponDefinitionResponse = 430, + AISUpdateSlaveContentDescription = 431, + AISUpdateSlaveContentDescriptionResponse = 432, + AISTestEnableGC = 433, + + BaseAM = 500, + AMUpdateUserBanRequest = 504, + AMAddLicense = 505, + AMBeginProcessingLicenses = 507, // obsolete + AMSendSystemIMToUser = 508, + AMExtendLicense = 509, + AMAddMinutesToLicense = 510, + AMCancelLicense = 511, + AMInitPurchase = 512, + AMPurchaseResponse = 513, + AMGetFinalPrice = 514, + AMGetFinalPriceResponse = 515, + AMGetLegacyGameKey = 516, + AMGetLegacyGameKeyResponse = 517, + AMFindHungTransactions = 518, + AMSetAccountTrustedRequest = 519, + AMCompletePurchase = 521, + AMCancelPurchase = 522, + AMNewChallenge = 523, + AMLoadOEMTickets = 524, + AMFixPendingPurchase = 525, + AMFixPendingPurchaseResponse = 526, + AMIsUserBanned = 527, + AMRegisterKey = 528, + AMLoadActivationCodes = 529, + AMLoadActivationCodesResponse = 530, + AMLookupKeyResponse = 531, + AMLookupKey = 532, + AMChatCleanup = 533, + AMClanCleanup = 534, + AMFixPendingRefund = 535, + AMReverseChargeback = 536, + AMReverseChargebackResponse = 537, + AMClanCleanupList = 538, + AMGetLicenses = 539, + AMGetLicensesResponse = 540, + AllowUserToPlayQuery = 550, + AllowUserToPlayResponse = 551, + AMVerfiyUser = 552, + AMClientNotPlaying = 553, + ClientRequestFriendship = 554, + AMRelayPublishStatus = 555, + AMResetCommunityContent = 556, // obsolete + AMPrimePersonaStateCache = 557, // obsolete + AMAllowUserContentQuery = 558, // obsolete + AMAllowUserContentResponse = 559, // obsolete + AMInitPurchaseResponse = 560, + AMRevokePurchaseResponse = 561, + AMLockProfile = 562, // obsolete + AMRefreshGuestPasses = 563, + AMInviteUserToClan = 564, + AMAcknowledgeClanInvite = 565, + AMGrantGuestPasses = 566, + AMClanDataUpdated = 567, + AMReloadAccount = 568, + AMClientChatMsgRelay = 569, + AMChatMulti = 570, + AMClientChatInviteRelay = 571, + AMChatInvite = 572, + AMClientJoinChatRelay = 573, + AMClientChatMemberInfoRelay = 574, + AMPublishChatMemberInfo = 575, + AMClientAcceptFriendInvite = 576, + AMChatEnter = 577, + AMClientPublishRemovalFromSource = 578, + AMChatActionResult = 579, + AMFindAccounts = 580, + AMFindAccountsResponse = 581, + AMRequestAccountData = 582, + AMRequestAccountDataResponse = 583, + AMSetAccountFlags = 584, + AMCreateClan = 586, + AMCreateClanResponse = 587, + AMGetClanDetails = 588, + AMGetClanDetailsResponse = 589, + AMSetPersonaName = 590, + AMSetAvatar = 591, + AMAuthenticateUser = 592, + AMAuthenticateUserResponse = 593, + AMGetAccountFriendsCount = 594, // obsolete + AMGetAccountFriendsCountResponse = 595, // obsolete + AMP2PIntroducerMessage = 596, + ClientChatAction = 597, + AMClientChatActionRelay = 598, + + BaseVS = 600, + ReqChallenge = 600, + VACResponse = 601, + ReqChallengeTest = 602, + VSMarkCheat = 604, + VSAddCheat = 605, + VSPurgeCodeModDB = 606, + VSGetChallengeResults = 607, + VSChallengeResultText = 608, + VSReportLingerer = 609, + VSRequestManagedChallenge = 610, + VSLoadDBFinished = 611, + + BaseDRMS = 625, + DRMBuildBlobRequest = 628, + DRMBuildBlobResponse = 629, + DRMResolveGuidRequest = 630, + DRMResolveGuidResponse = 631, + DRMVariabilityReport = 633, + DRMVariabilityReportResponse = 634, + DRMStabilityReport = 635, + DRMStabilityReportResponse = 636, + DRMDetailsReportRequest = 637, + DRMDetailsReportResponse = 638, + DRMProcessFile = 639, + DRMAdminUpdate = 640, + DRMAdminUpdateResponse = 641, + DRMSync = 642, + DRMSyncResponse = 643, + DRMProcessFileResponse = 644, + DRMEmptyGuidCache = 645, + DRMEmptyGuidCacheResponse = 646, + + BaseCS = 650, + CSUserContentRequest = 652, // obsolete + + BaseClient = 700, + ClientLogOn_Deprecated = 701, // obsolete + ClientAnonLogOn_Deprecated = 702, // obsolete + ClientHeartBeat = 703, + ClientVACResponse = 704, + ClientGamesPlayed_obsolete = 705, // obsolete + ClientLogOff = 706, + ClientNoUDPConnectivity = 707, + ClientInformOfCreateAccount = 708, + ClientAckVACBan = 709, // obsolete + ClientConnectionStats = 710, + ClientInitPurchase = 711, // obsolete + ClientPingResponse = 712, + ClientRemoveFriend = 714, + ClientGamesPlayedNoDataBlob = 715, + ClientChangeStatus = 716, + ClientVacStatusResponse = 717, + ClientFriendMsg = 718, + ClientGameConnect_obsolete = 719, // obsolete + ClientGamesPlayed2_obsolete = 720, // obsolete + ClientGameEnded_obsolete = 721, // obsolete + ClientGetFinalPrice = 722, // obsolete + ClientSystemIM = 726, + ClientSystemIMAck = 727, + ClientGetLicenses = 728, + ClientCancelLicense = 729, // obsolete + ClientGetLegacyGameKey = 730, + ClientContentServerLogOn_Deprecated = 731, // obsolete + ClientAckVACBan2 = 732, + ClientAckMessageByGID = 735, // obsolete + ClientGetPurchaseReceipts = 736, + ClientAckPurchaseReceipt = 737, // obsolete + ClientGamesPlayed3_obsolete = 738, // obsolete + ClientSendGuestPass = 739, // obsolete + ClientAckGuestPass = 740, + ClientRedeemGuestPass = 741, + ClientGamesPlayed = 742, + ClientRegisterKey = 743, + ClientInviteUserToClan = 744, + ClientAcknowledgeClanInvite = 745, + ClientPurchaseWithMachineID = 746, + ClientAppUsageEvent = 747, + ClientGetGiftTargetList = 748, // obsolete + ClientGetGiftTargetListResponse = 749, // obsolete + ClientLogOnResponse = 751, + ClientVACChallenge = 753, // obsolete + ClientSetHeartbeatRate = 755, + ClientNotLoggedOnDeprecated = 756, // obsolete + ClientLoggedOff = 757, + GSApprove = 758, + GSDeny = 759, + GSKick = 760, + ClientCreateAcctResponse = 761, + ClientPurchaseResponse = 763, + ClientPing = 764, + ClientNOP = 765, + ClientPersonaState = 766, + ClientFriendsList = 767, + ClientAccountInfo = 768, + ClientVacStatusQuery = 770, // obsolete + ClientNewsUpdate = 771, + ClientGameConnectDeny = 773, + GSStatusReply = 774, + ClientGetFinalPriceResponse = 775, // obsolete + ClientGameConnectTokens = 779, + ClientLicenseList = 780, + ClientCancelLicenseResponse = 781, // obsolete + ClientVACBanStatus = 782, + ClientCMList = 783, + ClientEncryptPct = 784, + ClientGetLegacyGameKeyResponse = 785, + ClientFavoritesList = 786, // obsolete + CSUserContentApprove = 787, // obsolete + CSUserContentDeny = 788, // obsolete + ClientInitPurchaseResponse = 789, // obsolete + ClientAddFriend = 791, + ClientAddFriendResponse = 792, + ClientInviteFriend = 793, // obsolete + ClientInviteFriendResponse = 794, // obsolete + ClientSendGuestPassResponse = 795, // obsolete + ClientAckGuestPassResponse = 796, + ClientRedeemGuestPassResponse = 797, + ClientUpdateGuestPassesList = 798, + ClientChatMsg = 799, + ClientChatInvite = 800, + ClientJoinChat = 801, + ClientChatMemberInfo = 802, + ClientLogOnWithCredentials_Deprecated = 803, // obsolete + ClientPasswordChangeResponse = 805, + ClientChatEnter = 807, + ClientFriendRemovedFromSource = 808, + ClientCreateChat = 809, + ClientCreateChatResponse = 810, + ClientUpdateChatMetadata = 811, // obsolete + ClientP2PIntroducerMessage = 813, + ClientChatActionResult = 814, + ClientRequestFriendData = 815, + ClientGetUserStats = 818, + ClientGetUserStatsResponse = 819, + ClientStoreUserStats = 820, + ClientStoreUserStatsResponse = 821, + ClientClanState = 822, + ClientServiceModule = 830, + ClientServiceCall = 831, + ClientServiceCallResponse = 832, + ClientPackageInfoRequest = 833, // obsolete + ClientPackageInfoResponse = 834, // obsolete + ClientNatTraversalStatEvent = 839, + ClientAppInfoRequest = 840, // obsolete + ClientAppInfoResponse = 841, // obsolete + ClientSteamUsageEvent = 842, + ClientCheckPassword = 845, + ClientResetPassword = 846, + ClientCheckPasswordResponse = 848, + ClientResetPasswordResponse = 849, + ClientSessionToken = 850, + ClientDRMProblemReport = 851, + ClientSetIgnoreFriend = 855, + ClientSetIgnoreFriendResponse = 856, + ClientGetAppOwnershipTicket = 857, + ClientGetAppOwnershipTicketResponse = 858, + ClientGetLobbyListResponse = 860, + ClientGetLobbyMetadata = 861, // obsolete + ClientGetLobbyMetadataResponse = 862, // obsolete + ClientVTTCert = 863, // obsolete + ClientAppInfoUpdate = 866, // obsolete + ClientAppInfoChanges = 867, // obsolete + ClientServerList = 880, + ClientEmailChangeResponse = 891, + ClientSecretQAChangeResponse = 892, + ClientDRMBlobRequest = 896, + ClientDRMBlobResponse = 897, + ClientLookupKey = 898, // obsolete + ClientLookupKeyResponse = 899, // obsolete + + BaseGameServer = 900, + GSDisconnectNotice = 901, + GSStatus = 903, + GSUserPlaying = 905, + GSStatus2 = 906, + GSStatusUpdate_Unused = 907, + GSServerType = 908, + GSPlayerList = 909, + GSGetUserAchievementStatus = 910, + GSGetUserAchievementStatusResponse = 911, + GSGetPlayStats = 918, + GSGetPlayStatsResponse = 919, + GSGetUserGroupStatus = 920, + AMGetUserGroupStatus = 921, + AMGetUserGroupStatusResponse = 922, + GSGetUserGroupStatusResponse = 923, + GSGetReputation = 936, + GSGetReputationResponse = 937, + GSAssociateWithClan = 938, + GSAssociateWithClanResponse = 939, + GSComputeNewPlayerCompatibility = 940, + GSComputeNewPlayerCompatibilityResponse = 941, + + BaseAdmin = 1000, + AdminCmd = 1000, + AdminCmdResponse = 1004, + AdminLogListenRequest = 1005, + AdminLogEvent = 1006, + LogSearchRequest = 1007, // obsolete + LogSearchResponse = 1008, // obsolete + LogSearchCancel = 1009, // obsolete + UniverseData = 1010, + RequestStatHistory = 1014, // obsolete + StatHistory = 1015, // obsolete + AdminPwLogon = 1017, // obsolete + AdminPwLogonResponse = 1018, // obsolete + AdminSpew = 1019, + AdminConsoleTitle = 1020, + AdminGCSpew = 1023, + AdminGCCommand = 1024, + AdminGCGetCommandList = 1025, + AdminGCGetCommandListResponse = 1026, + FBSConnectionData = 1027, + AdminMsgSpew = 1028, + + BaseFBS = 1100, + FBSReqVersion = 1100, + FBSVersionInfo = 1101, + FBSForceRefresh = 1102, + FBSForceBounce = 1103, + FBSDeployPackage = 1104, + FBSDeployResponse = 1105, + FBSUpdateBootstrapper = 1106, + FBSSetState = 1107, + FBSApplyOSUpdates = 1108, + FBSRunCMDScript = 1109, + FBSRebootBox = 1110, + FBSSetBigBrotherMode = 1111, + FBSMinidumpServer = 1112, + FBSSetShellCount_obsolete = 1113, // obsolete + FBSDeployHotFixPackage = 1114, + FBSDeployHotFixResponse = 1115, + FBSDownloadHotFix = 1116, + FBSDownloadHotFixResponse = 1117, + FBSUpdateTargetConfigFile = 1118, + FBSApplyAccountCred = 1119, + FBSApplyAccountCredResponse = 1120, + FBSSetShellCount = 1121, + FBSTerminateShell = 1122, + FBSQueryGMForRequest = 1123, + FBSQueryGMResponse = 1124, + FBSTerminateZombies = 1125, + FBSInfoFromBootstrapper = 1126, + FBSRebootBoxResponse = 1127, + FBSBootstrapperPackageRequest = 1128, + FBSBootstrapperPackageResponse = 1129, + FBSBootstrapperGetPackageChunk = 1130, + FBSBootstrapperGetPackageChunkResponse = 1131, + FBSBootstrapperPackageTransferProgress = 1132, + FBSRestartBootstrapper = 1133, + + BaseFileXfer = 1200, + FileXferRequest = 1200, + FileXferResponse = 1201, + FileXferData = 1202, + FileXferEnd = 1203, + FileXferDataAck = 1204, + + BaseChannelAuth = 1300, + ChannelAuthChallenge = 1300, + ChannelAuthResponse = 1301, + ChannelAuthResult = 1302, + ChannelEncryptRequest = 1303, + ChannelEncryptResponse = 1304, + ChannelEncryptResult = 1305, + + BaseBS = 1400, + BSPurchaseStart = 1401, + BSPurchaseResponse = 1402, // obsolete + BSSettleNOVA = 1404, // obsolete + BSSettleComplete = 1406, + BSBannedRequest = 1407, // obsolete + BSInitPayPalTxn = 1408, + BSInitPayPalTxnResponse = 1409, + BSGetPayPalUserInfo = 1410, + BSGetPayPalUserInfoResponse = 1411, + BSRefundTxn = 1413, // obsolete + BSRefundTxnResponse = 1414, // obsolete + BSGetEvents = 1415, // obsolete + BSChaseRFRRequest = 1416, // obsolete + BSPaymentInstrBan = 1417, + BSPaymentInstrBanResponse = 1418, + BSProcessGCReports = 1419, // obsolete + BSProcessPPReports = 1420, // obsolete + BSInitGCBankXferTxn = 1421, + BSInitGCBankXferTxnResponse = 1422, + BSQueryGCBankXferTxn = 1423, // obsolete + BSQueryGCBankXferTxnResponse = 1424, // obsolete + BSCommitGCTxn = 1425, + BSQueryTransactionStatus = 1426, + BSQueryTransactionStatusResponse = 1427, + BSQueryCBOrderStatus = 1428, // obsolete + BSQueryCBOrderStatusResponse = 1429, // obsolete + BSRunRedFlagReport = 1430, // obsolete + BSQueryPaymentInstUsage = 1431, + BSQueryPaymentInstResponse = 1432, + BSQueryTxnExtendedInfo = 1433, + BSQueryTxnExtendedInfoResponse = 1434, + BSUpdateConversionRates = 1435, + BSProcessUSBankReports = 1436, // obsolete + BSPurchaseRunFraudChecks = 1437, + BSPurchaseRunFraudChecksResponse = 1438, + BSStartShippingJobs = 1439, // obsolete + BSQueryBankInformation = 1440, + BSQueryBankInformationResponse = 1441, + BSValidateXsollaSignature = 1445, + BSValidateXsollaSignatureResponse = 1446, + BSQiwiWalletInvoice = 1448, + BSQiwiWalletInvoiceResponse = 1449, + BSUpdateInventoryFromProPack = 1450, + BSUpdateInventoryFromProPackResponse = 1451, + BSSendShippingRequest = 1452, + BSSendShippingRequestResponse = 1453, + BSGetProPackOrderStatus = 1454, + BSGetProPackOrderStatusResponse = 1455, + BSCheckJobRunning = 1456, + BSCheckJobRunningResponse = 1457, + BSResetPackagePurchaseRateLimit = 1458, + BSResetPackagePurchaseRateLimitResponse = 1459, + BSUpdatePaymentData = 1460, + BSUpdatePaymentDataResponse = 1461, + BSGetBillingAddress = 1462, + BSGetBillingAddressResponse = 1463, + BSGetCreditCardInfo = 1464, + BSGetCreditCardInfoResponse = 1465, + BSRemoveExpiredPaymentData = 1468, + BSRemoveExpiredPaymentDataResponse = 1469, + BSConvertToCurrentKeys = 1470, + BSConvertToCurrentKeysResponse = 1471, + BSInitPurchase = 1472, + BSInitPurchaseResponse = 1473, + BSCompletePurchase = 1474, + BSCompletePurchaseResponse = 1475, + BSPruneCardUsageStats = 1476, + BSPruneCardUsageStatsResponse = 1477, + BSStoreBankInformation = 1478, + BSStoreBankInformationResponse = 1479, + BSVerifyPOSAKey = 1480, + BSVerifyPOSAKeyResponse = 1481, + BSReverseRedeemPOSAKey = 1482, + BSReverseRedeemPOSAKeyResponse = 1483, + BSQueryFindCreditCard = 1484, + BSQueryFindCreditCardResponse = 1485, + BSStatusInquiryPOSAKey = 1486, + BSStatusInquiryPOSAKeyResponse = 1487, + BSValidateMoPaySignature = 1488, + BSValidateMoPaySignatureResponse = 1489, + BSMoPayConfirmProductDelivery = 1490, + BSMoPayConfirmProductDeliveryResponse = 1491, + BSGenerateMoPayMD5 = 1492, + BSGenerateMoPayMD5Response = 1493, + BSBoaCompraConfirmProductDelivery = 1494, + BSBoaCompraConfirmProductDeliveryResponse = 1495, + BSGenerateBoaCompraMD5 = 1496, + BSGenerateBoaCompraMD5Response = 1497, + BSCommitWPTxn = 1498, + + BaseATS = 1500, + ATSStartStressTest = 1501, + ATSStopStressTest = 1502, + ATSRunFailServerTest = 1503, + ATSUFSPerfTestTask = 1504, + ATSUFSPerfTestResponse = 1505, + ATSCycleTCM = 1506, + ATSInitDRMSStressTest = 1507, + ATSCallTest = 1508, + ATSCallTestReply = 1509, + ATSStartExternalStress = 1510, + ATSExternalStressJobStart = 1511, + ATSExternalStressJobQueued = 1512, + ATSExternalStressJobRunning = 1513, + ATSExternalStressJobStopped = 1514, + ATSExternalStressJobStopAll = 1515, + ATSExternalStressActionResult = 1516, + ATSStarted = 1517, + ATSCSPerfTestTask = 1518, + ATSCSPerfTestResponse = 1519, + + BaseDP = 1600, + DPSetPublishingState = 1601, + DPGamePlayedStats = 1602, // obsolete + DPUniquePlayersStat = 1603, + DPStreamingUniquePlayersStat = 1604, + DPVacInfractionStats = 1605, + DPVacBanStats = 1606, + DPBlockingStats = 1607, + DPNatTraversalStats = 1608, + DPSteamUsageEvent = 1609, // obsolete + DPVacCertBanStats = 1610, + DPVacCafeBanStats = 1611, + DPCloudStats = 1612, + DPAchievementStats = 1613, + DPAccountCreationStats = 1614, + DPGetPlayerCount = 1615, + DPGetPlayerCountResponse = 1616, + DPGameServersPlayersStats = 1617, + DPDownloadRateStatistics = 1618, // obsolete + DPFacebookStatistics = 1619, + ClientDPCheckSpecialSurvey = 1620, + ClientDPCheckSpecialSurveyResponse = 1621, + ClientDPSendSpecialSurveyResponse = 1622, + ClientDPSendSpecialSurveyResponseReply = 1623, + DPStoreSaleStatistics = 1624, + ClientDPUpdateAppJobReport = 1625, + ClientDPSteam2AppStarted = 1627, // obsolete + DPUpdateContentEvent = 1626, + DPPartnerMicroTxns = 1628, + DPPartnerMicroTxnsResponse = 1629, + ClientDPContentStatsReport = 1630, + DPVRUniquePlayersStat = 1631, + + BaseCM = 1700, + CMSetAllowState = 1701, + CMSpewAllowState = 1702, + CMAppInfoResponseDeprecated = 1703, // obsolete + + BaseDSS = 1800, // obsolete + DSSNewFile = 1801, // obsolete + DSSCurrentFileList = 1802, // obsolete + DSSSynchList = 1803, // obsolete + DSSSynchListResponse = 1804, // obsolete + DSSSynchSubscribe = 1805, // obsolete + DSSSynchUnsubscribe = 1806, // obsolete + + BaseEPM = 1900, // obsolete + EPMStartProcess = 1901, // obsolete + EPMStopProcess = 1902, // obsolete + EPMRestartProcess = 1903, // obsolete + + BaseGC = 2200, + GCSendClient = 2200, // obsolete + AMRelayToGC = 2201, // obsolete + GCUpdatePlayedState = 2202, // obsolete + GCCmdRevive = 2203, + GCCmdBounce = 2204, // obsolete + GCCmdForceBounce = 2205, // obsolete + GCCmdDown = 2206, + GCCmdDeploy = 2207, + GCCmdDeployResponse = 2208, + GCCmdSwitch = 2209, + AMRefreshSessions = 2210, + GCUpdateGSState = 2211, // obsolete + GCAchievementAwarded = 2212, + GCSystemMessage = 2213, + GCValidateSession = 2214, // obsolete + GCValidateSessionResponse = 2215, // obsolete + GCCmdStatus = 2216, + GCRegisterWebInterfaces = 2217, // obsolete + GCRegisterWebInterfaces_Deprecated = 2217, // obsolete + GCGetAccountDetails = 2218, // obsolete + GCGetAccountDetails_DEPRECATED = 2218, // obsolete + GCInterAppMessage = 2219, + GCGetEmailTemplate = 2220, + GCGetEmailTemplateResponse = 2221, + ISRelayToGCH = 2222, // obsolete "renamed to GCHRelay" + GCHRelay = 2222, + GCHRelayClientToIS = 2223, // obsolete "renamed to GCHRelayToClient" + GCHRelayToClient = 2223, + GCHUpdateSession = 2224, + GCHRequestUpdateSession = 2225, + GCHRequestStatus = 2226, + GCHRequestStatusResponse = 2227, + GCHAccountVacStatusChange = 2228, + GCHSpawnGC = 2229, + GCHSpawnGCResponse = 2230, + GCHKillGC = 2231, + GCHKillGCResponse = 2232, + GCHAccountTradeBanStatusChange = 2233, + GCHAccountLockStatusChange = 2234, + GCHVacVerificationChange = 2235, + GCHAccountPhoneNumberChange = 2236, + GCHAccountTwoFactorChange = 2237, + + BaseP2P = 2500, + P2PIntroducerMessage = 2502, + + BaseSM = 2900, + SMExpensiveReport = 2902, + SMHourlyReport = 2903, + SMFishingReport = 2904, + SMPartitionRenames = 2905, + SMMonitorSpace = 2906, + SMGetSchemaConversionResults = 2907, // obsolete + SMGetSchemaConversionResultsResponse = 2908, // obsolete + + BaseTest = 3000, + FailServer = 3000, + JobHeartbeatTest = 3001, + JobHeartbeatTestResponse = 3002, + + BaseFTSRange = 3100, + FTSGetBrowseCounts = 3101, // obsolete + FTSGetBrowseCountsResponse = 3102, // obsolete + FTSBrowseClans = 3103, // obsolete + FTSBrowseClansResponse = 3104, // obsolete + FTSSearchClansByLocation = 3105, // obsolete + FTSSearchClansByLocationResponse = 3106, // obsolete + FTSSearchPlayersByLocation = 3107, // obsolete + FTSSearchPlayersByLocationResponse = 3108, // obsolete + FTSClanDeleted = 3109, // obsolete + FTSSearch = 3110, // obsolete + FTSSearchResponse = 3111, // obsolete + FTSSearchStatus = 3112, // obsolete + FTSSearchStatusResponse = 3113, // obsolete + FTSGetGSPlayStats = 3114, // obsolete + FTSGetGSPlayStatsResponse = 3115, // obsolete + FTSGetGSPlayStatsForServer = 3116, // obsolete + FTSGetGSPlayStatsForServerResponse = 3117, // obsolete + FTSReportIPUpdates = 3118, // obsolete + + BaseCCSRange = 3150, + CCSGetComments = 3151, // obsolete + CCSGetCommentsResponse = 3152, // obsolete + CCSAddComment = 3153, // obsolete + CCSAddCommentResponse = 3154, // obsolete + CCSDeleteComment = 3155, // obsolete + CCSDeleteCommentResponse = 3156, // obsolete + CCSPreloadComments = 3157, // obsolete + CCSNotifyCommentCount = 3158, // obsolete + CCSGetCommentsForNews = 3159, // obsolete + CCSGetCommentsForNewsResponse = 3160, // obsolete + CCSDeleteAllCommentsByAuthor = 3161, + CCSDeleteAllCommentsByAuthorResponse = 3162, + + + BaseLBSRange = 3200, + LBSSetScore = 3201, + LBSSetScoreResponse = 3202, + LBSFindOrCreateLB = 3203, + LBSFindOrCreateLBResponse = 3204, + LBSGetLBEntries = 3205, + LBSGetLBEntriesResponse = 3206, + LBSGetLBList = 3207, + LBSGetLBListResponse = 3208, + LBSSetLBDetails = 3209, + LBSDeleteLB = 3210, + LBSDeleteLBEntry = 3211, + LBSResetLB = 3212, + LBSResetLBResponse = 3213, + LBSDeleteLBResponse = 3214, + + BaseOGS = 3400, + OGSBeginSession = 3401, + OGSBeginSessionResponse = 3402, + OGSEndSession = 3403, + OGSEndSessionResponse = 3404, + OGSWriteAppSessionRow = 3406, + + BaseBRP = 3600, + BRPStartShippingJobs = 3601, + BRPProcessUSBankReports = 3602, + BRPProcessGCReports = 3603, + BRPProcessPPReports = 3604, + BRPSettleNOVA = 3605, // obsolete + BRPSettleCB = 3606, // obsolete + BRPCommitGC = 3607, + BRPCommitGCResponse = 3608, + BRPFindHungTransactions = 3609, + BRPCheckFinanceCloseOutDate = 3610, + BRPProcessLicenses = 3611, + BRPProcessLicensesResponse = 3612, + BRPRemoveExpiredPaymentData = 3613, + BRPRemoveExpiredPaymentDataResponse = 3614, + BRPConvertToCurrentKeys = 3615, + BRPConvertToCurrentKeysResponse = 3616, + BRPPruneCardUsageStats = 3617, + BRPPruneCardUsageStatsResponse = 3618, + BRPCheckActivationCodes = 3619, + BRPCheckActivationCodesResponse = 3620, + BRPCommitWP = 3621, + BRPCommitWPResponse = 3622, + BRPProcessWPReports = 3623, + BRPProcessPaymentRules = 3624, + BRPProcessPartnerPayments = 3625, + BRPCheckSettlementReports = 3626, + BRPPostTaxToAvalara = 3628, + BRPPostTransactionTax = 3629, + BRPPostTransactionTaxResponse = 3630, + BRPProcessIMReports = 3631, + + BaseAMRange2 = 4000, + AMCreateChat = 4001, + AMCreateChatResponse = 4002, + AMUpdateChatMetadata = 4003, // obsolete + AMPublishChatMetadata = 4004, // obsolete + AMSetProfileURL = 4005, + AMGetAccountEmailAddress = 4006, + AMGetAccountEmailAddressResponse = 4007, + AMRequestFriendData = 4008, // obsolete "renamed to AMRequestClanData" + AMRequestClanData = 4008, + AMRouteToClients = 4009, + AMLeaveClan = 4010, + AMClanPermissions = 4011, + AMClanPermissionsResponse = 4012, + AMCreateClanEvent = 4013, + AMCreateClanEventResponse = 4014, + AMUpdateClanEvent = 4015, + AMUpdateClanEventResponse = 4016, + AMGetClanEvents = 4017, + AMGetClanEventsResponse = 4018, + AMDeleteClanEvent = 4019, + AMDeleteClanEventResponse = 4020, + AMSetClanPermissionSettings = 4021, + AMSetClanPermissionSettingsResponse = 4022, + AMGetClanPermissionSettings = 4023, + AMGetClanPermissionSettingsResponse = 4024, + AMPublishChatRoomInfo = 4025, + ClientChatRoomInfo = 4026, + AMCreateClanAnnouncement = 4027, // obsolete + AMCreateClanAnnouncementResponse = 4028, // obsolete + AMUpdateClanAnnouncement = 4029, // obsolete + AMUpdateClanAnnouncementResponse = 4030, // obsolete + AMGetClanAnnouncementsCount = 4031, // obsolete + AMGetClanAnnouncementsCountResponse = 4032, // obsolete + AMGetClanAnnouncements = 4033, // obsolete + AMGetClanAnnouncementsResponse = 4034, // obsolete + AMDeleteClanAnnouncement = 4035, // obsolete + AMDeleteClanAnnouncementResponse = 4036, // obsolete + AMGetSingleClanAnnouncement = 4037, // obsolete + AMGetSingleClanAnnouncementResponse = 4038, // obsolete + AMGetClanHistory = 4039, + AMGetClanHistoryResponse = 4040, + AMGetClanPermissionBits = 4041, + AMGetClanPermissionBitsResponse = 4042, + AMSetClanPermissionBits = 4043, + AMSetClanPermissionBitsResponse = 4044, + AMSessionInfoRequest = 4045, + AMSessionInfoResponse = 4046, + AMValidateWGToken = 4047, + AMGetSingleClanEvent = 4048, + AMGetSingleClanEventResponse = 4049, + AMGetClanRank = 4050, + AMGetClanRankResponse = 4051, + AMSetClanRank = 4052, + AMSetClanRankResponse = 4053, + AMGetClanPOTW = 4054, + AMGetClanPOTWResponse = 4055, + AMSetClanPOTW = 4056, + AMSetClanPOTWResponse = 4057, + AMRequestChatMetadata = 4058, // obsolete + AMDumpUser = 4059, + AMKickUserFromClan = 4060, + AMAddFounderToClan = 4061, + AMValidateWGTokenResponse = 4062, + AMSetCommunityState = 4063, + AMSetAccountDetails = 4064, + AMGetChatBanList = 4065, + AMGetChatBanListResponse = 4066, + AMUnBanFromChat = 4067, + AMSetClanDetails = 4068, + AMGetAccountLinks = 4069, + AMGetAccountLinksResponse = 4070, + AMSetAccountLinks = 4071, + AMSetAccountLinksResponse = 4072, + AMGetUserGameStats = 4073, + AMGetUserGameStatsResponse = 4074, + AMCheckClanMembership = 4075, + AMGetClanMembers = 4076, + AMGetClanMembersResponse = 4077, + AMJoinPublicClan = 4078, + AMNotifyChatOfClanChange = 4079, + AMResubmitPurchase = 4080, + AMAddFriend = 4081, + AMAddFriendResponse = 4082, + AMRemoveFriend = 4083, + AMDumpClan = 4084, + AMChangeClanOwner = 4085, + AMCancelEasyCollect = 4086, + AMCancelEasyCollectResponse = 4087, + AMGetClanMembershipList = 4088, // obsolete + AMGetClanMembershipListResponse = 4089, // obsolete + AMClansInCommon = 4090, + AMClansInCommonResponse = 4091, + AMIsValidAccountID = 4092, + AMConvertClan = 4093, + AMGetGiftTargetListRelay = 4094, // obsolete + AMWipeFriendsList = 4095, + AMSetIgnored = 4096, + AMClansInCommonCountResponse = 4097, + AMFriendsList = 4098, + AMFriendsListResponse = 4099, + AMFriendsInCommon = 4100, + AMFriendsInCommonResponse = 4101, + AMFriendsInCommonCountResponse = 4102, + AMClansInCommonCount = 4103, + AMChallengeVerdict = 4104, + AMChallengeNotification = 4105, + AMFindGSByIP = 4106, + AMFoundGSByIP = 4107, + AMGiftRevoked = 4108, + AMCreateAccountRecord = 4109, + AMUserClanList = 4110, + AMUserClanListResponse = 4111, + AMGetAccountDetails2 = 4112, + AMGetAccountDetailsResponse2 = 4113, + AMSetCommunityProfileSettings = 4114, + AMSetCommunityProfileSettingsResponse = 4115, + AMGetCommunityPrivacyState = 4116, + AMGetCommunityPrivacyStateResponse = 4117, + AMCheckClanInviteRateLimiting = 4118, + AMGetUserAchievementStatus = 4119, + AMGetIgnored = 4120, + AMGetIgnoredResponse = 4121, + AMSetIgnoredResponse = 4122, + AMSetFriendRelationshipNone = 4123, + AMGetFriendRelationship = 4124, + AMGetFriendRelationshipResponse = 4125, + AMServiceModulesCache = 4126, + AMServiceModulesCall = 4127, + AMServiceModulesCallResponse = 4128, + AMGetCaptchaDataForIP = 4129, + AMGetCaptchaDataForIPResponse = 4130, + AMValidateCaptchaDataForIP = 4131, + AMValidateCaptchaDataForIPResponse = 4132, + AMTrackFailedAuthByIP = 4133, + AMGetCaptchaDataByGID = 4134, + AMGetCaptchaDataByGIDResponse = 4135, + AMGetLobbyList = 4136, // obsolete + AMGetLobbyListResponse = 4137, // obsolete + AMGetLobbyMetadata = 4138, // obsolete + AMGetLobbyMetadataResponse = 4139, // obsolete + CommunityAddFriendNews = 4140, + AMAddClanNews = 4141, // obsolete + AMWriteNews = 4142, // obsolete + AMFindClanUser = 4143, + AMFindClanUserResponse = 4144, + AMBanFromChat = 4145, + AMGetUserHistoryResponse = 4146, // obsolete + AMGetUserNewsSubscriptions = 4147, + AMGetUserNewsSubscriptionsResponse = 4148, + AMSetUserNewsSubscriptions = 4149, + AMGetUserNews = 4150, // obsolete + AMGetUserNewsResponse = 4151, // obsolete + AMSendQueuedEmails = 4152, + AMSetLicenseFlags = 4153, + AMGetUserHistory = 4154, // obsolete + CommunityDeleteUserNews = 4155, + AMAllowUserFilesRequest = 4156, + AMAllowUserFilesResponse = 4157, + AMGetAccountStatus = 4158, + AMGetAccountStatusResponse = 4159, + AMEditBanReason = 4160, + AMCheckClanMembershipResponse = 4161, + AMProbeClanMembershipList = 4162, + AMProbeClanMembershipListResponse = 4163, + AMGetFriendsLobbies = 4165, + AMGetFriendsLobbiesResponse = 4166, + AMGetUserFriendNewsResponse = 4172, + CommunityGetUserFriendNews = 4173, + AMGetUserClansNewsResponse = 4174, + AMGetUserClansNews = 4175, + AMStoreInitPurchase = 4176, // obsolete + AMStoreInitPurchaseResponse = 4177, // obsolete + AMStoreGetFinalPrice = 4178, // obsolete + AMStoreGetFinalPriceResponse = 4179, // obsolete + AMStoreCompletePurchase = 4180, // obsolete + AMStoreCancelPurchase = 4181, // obsolete + AMStorePurchaseResponse = 4182, // obsolete + AMCreateAccountRecordInSteam3 = 4183, // obsolete + AMGetPreviousCBAccount = 4184, + AMGetPreviousCBAccountResponse = 4185, + AMUpdateBillingAddress = 4186, // obsolete + AMUpdateBillingAddressResponse = 4187, // obsolete + AMGetBillingAddress = 4188, // obsolete + AMGetBillingAddressResponse = 4189, // obsolete + AMGetUserLicenseHistory = 4190, + AMGetUserLicenseHistoryResponse = 4191, + AMSupportChangePassword = 4194, + AMSupportChangeEmail = 4195, + AMSupportChangeSecretQA = 4196, // obsolete + AMResetUserVerificationGSByIP = 4197, + AMUpdateGSPlayStats = 4198, + AMSupportEnableOrDisable = 4199, + AMGetComments = 4200, // obsolete + AMGetCommentsResponse = 4201, // obsolete + AMAddComment = 4202, // obsolete + AMAddCommentResponse = 4203, // obsolete + AMDeleteComment = 4204, // obsolete + AMDeleteCommentResponse = 4205, // obsolete + AMGetPurchaseStatus = 4206, + AMSupportIsAccountEnabled = 4209, + AMSupportIsAccountEnabledResponse = 4210, + AMGetUserStats = 4211, + AMSupportKickSession = 4212, + AMGSSearch = 4213, + MarketingMessageUpdate = 4216, + AMRouteFriendMsg = 4219, + AMTicketAuthRequestOrResponse = 4220, + AMVerifyDepotManagementRights = 4222, + AMVerifyDepotManagementRightsResponse = 4223, + AMAddFreeLicense = 4224, + AMGetUserFriendsMinutesPlayed = 4225, // obsolete + AMGetUserFriendsMinutesPlayedResponse = 4226, // obsolete + AMGetUserMinutesPlayed = 4227, // obsolete + AMGetUserMinutesPlayedResponse = 4228, // obsolete + AMValidateEmailLink = 4231, + AMValidateEmailLinkResponse = 4232, + AMAddUsersToMarketingTreatment = 4234, // obsolete + AMStoreUserStats = 4236, + AMGetUserGameplayInfo = 4237, // obsolete + AMGetUserGameplayInfoResponse = 4238, // obsolete + AMGetCardList = 4239, // obsolete + AMGetCardListResponse = 4240, // obsolete + AMDeleteStoredCard = 4241, + AMRevokeLegacyGameKeys = 4242, + AMGetWalletDetails = 4244, + AMGetWalletDetailsResponse = 4245, + AMDeleteStoredPaymentInfo = 4246, + AMGetStoredPaymentSummary = 4247, + AMGetStoredPaymentSummaryResponse = 4248, + AMGetWalletConversionRate = 4249, + AMGetWalletConversionRateResponse = 4250, + AMConvertWallet = 4251, + AMConvertWalletResponse = 4252, + AMRelayGetFriendsWhoPlayGame = 4253, // obsolete + AMRelayGetFriendsWhoPlayGameResponse = 4254, // obsolete + AMSetPreApproval = 4255, + AMSetPreApprovalResponse = 4256, + AMMarketingTreatmentUpdate = 4257, // obsolete + AMCreateRefund = 4258, + AMCreateRefundResponse = 4259, + AMCreateChargeback = 4260, + AMCreateChargebackResponse = 4261, + AMCreateDispute = 4262, + AMCreateDisputeResponse = 4263, + AMClearDispute = 4264, + AMClearDisputeResponse = 4265, + AMPlayerNicknameList = 4266, + AMPlayerNicknameListResponse = 4267, + AMSetDRMTestConfig = 4268, + AMGetUserCurrentGameInfo = 4269, + AMGetUserCurrentGameInfoResponse = 4270, + AMGetGSPlayerList = 4271, + AMGetGSPlayerListResponse = 4272, + AMUpdatePersonaStateCache = 4275, // obsolete + AMGetGameMembers = 4276, + AMGetGameMembersResponse = 4277, + AMGetSteamIDForMicroTxn = 4278, + AMGetSteamIDForMicroTxnResponse = 4279, + AMAddPublisherUser = 4280, + AMRemovePublisherUser = 4281, + AMGetUserLicenseList = 4282, + AMGetUserLicenseListResponse = 4283, + AMReloadGameGroupPolicy = 4284, + AMAddFreeLicenseResponse = 4285, + AMVACStatusUpdate = 4286, + AMGetAccountDetails = 4287, + AMGetAccountDetailsResponse = 4288, + AMGetPlayerLinkDetails = 4289, + AMGetPlayerLinkDetailsResponse = 4290, + AMSubscribeToPersonaFeed = 4291, // obsolete + AMGetUserVacBanList = 4292, // obsolete + AMGetUserVacBanListResponse = 4293, // obsolete + AMGetAccountFlagsForWGSpoofing = 4294, + AMGetAccountFlagsForWGSpoofingResponse = 4295, + AMGetFriendsWishlistInfo = 4296, // obsolete + AMGetFriendsWishlistInfoResponse = 4297, // obsolete + AMGetClanOfficers = 4298, + AMGetClanOfficersResponse = 4299, + AMNameChange = 4300, + AMGetNameHistory = 4301, + AMGetNameHistoryResponse = 4302, + AMUpdateProviderStatus = 4305, + AMClearPersonaMetadataBlob = 4306, // obsolete + AMSupportRemoveAccountSecurity = 4307, + AMIsAccountInCaptchaGracePeriod = 4308, + AMIsAccountInCaptchaGracePeriodResponse = 4309, + AMAccountPS3Unlink = 4310, + AMAccountPS3UnlinkResponse = 4311, + AMStoreUserStatsResponse = 4312, + AMGetAccountPSNInfo = 4313, + AMGetAccountPSNInfoResponse = 4314, + AMAuthenticatedPlayerList = 4315, + AMGetUserGifts = 4316, + AMGetUserGiftsResponse = 4317, + AMTransferLockedGifts = 4320, + AMTransferLockedGiftsResponse = 4321, + AMPlayerHostedOnGameServer = 4322, + AMGetAccountBanInfo = 4323, + AMGetAccountBanInfoResponse = 4324, + AMRecordBanEnforcement = 4325, + AMRollbackGiftTransfer = 4326, + AMRollbackGiftTransferResponse = 4327, + AMHandlePendingTransaction = 4328, + AMRequestClanDetails = 4329, + AMDeleteStoredPaypalAgreement = 4330, + AMGameServerUpdate = 4331, + AMGameServerRemove = 4332, + AMGetPaypalAgreements = 4333, + AMGetPaypalAgreementsResponse = 4334, + AMGameServerPlayerCompatibilityCheck = 4335, + AMGameServerPlayerCompatibilityCheckResponse = 4336, + AMRenewLicense = 4337, + AMGetAccountCommunityBanInfo = 4338, + AMGetAccountCommunityBanInfoResponse = 4339, + AMGameServerAccountChangePassword = 4340, + AMGameServerAccountDeleteAccount = 4341, + AMRenewAgreement = 4342, + AMSendEmail = 4343, // obsolete + AMXsollaPayment = 4344, + AMXsollaPaymentResponse = 4345, + AMAcctAllowedToPurchase = 4346, + AMAcctAllowedToPurchaseResponse = 4347, + AMSwapKioskDeposit = 4348, + AMSwapKioskDepositResponse = 4349, + AMSetUserGiftUnowned = 4350, + AMSetUserGiftUnownedResponse = 4351, + AMClaimUnownedUserGift = 4352, + AMClaimUnownedUserGiftResponse = 4353, + AMSetClanName = 4354, + AMSetClanNameResponse = 4355, + AMGrantCoupon = 4356, + AMGrantCouponResponse = 4357, + AMIsPackageRestrictedInUserCountry = 4358, + AMIsPackageRestrictedInUserCountryResponse = 4359, + AMHandlePendingTransactionResponse = 4360, + AMGrantGuestPasses2 = 4361, + AMGrantGuestPasses2Response = 4362, + AMSessionQuery = 4363, + AMSessionQueryResponse = 4364, + AMGetPlayerBanDetails = 4365, + AMGetPlayerBanDetailsResponse = 4366, + AMFinalizePurchase = 4367, + AMFinalizePurchaseResponse = 4368, + AMPersonaChangeResponse = 4372, + AMGetClanDetailsForForumCreation = 4373, + AMGetClanDetailsForForumCreationResponse = 4374, + AMGetPendingNotificationCount = 4375, + AMGetPendingNotificationCountResponse = 4376, + AMPasswordHashUpgrade = 4377, + AMMoPayPayment = 4378, + AMMoPayPaymentResponse = 4379, + AMBoaCompraPayment = 4380, + AMBoaCompraPaymentResponse = 4381, + AMExpireCaptchaByGID = 4382, + AMCompleteExternalPurchase = 4383, + AMCompleteExternalPurchaseResponse = 4384, + AMResolveNegativeWalletCredits = 4385, + AMResolveNegativeWalletCreditsResponse = 4386, + AMPayelpPayment = 4387, + AMPayelpPaymentResponse = 4388, + AMPlayerGetClanBasicDetails = 4389, + AMPlayerGetClanBasicDetailsResponse = 4390, + AMMOLPayment = 4391, + AMMOLPaymentResponse = 4392, + GetUserIPCountry = 4393, + GetUserIPCountryResponse = 4394, + NotificationOfSuspiciousActivity = 4395, + AMDegicaPayment = 4396, + AMDegicaPaymentResponse = 4397, + AMEClubPayment = 4398, + AMEClubPaymentResponse = 4399, + AMPayPalPaymentsHubPayment = 4400, + AMPayPalPaymentsHubPaymentResponse = 4401, + AMTwoFactorRecoverAuthenticatorRequest = 4402, + AMTwoFactorRecoverAuthenticatorResponse = 4403, + AMSmart2PayPayment = 4404, + AMSmart2PayPaymentResponse = 4405, + AMValidatePasswordResetCodeAndSendSmsRequest = 4406, + AMValidatePasswordResetCodeAndSendSmsResponse = 4407, + AMGetAccountResetDetailsRequest = 4408, + AMGetAccountResetDetailsResponse = 4409, + AMBitPayPayment = 4410, + AMBitPayPaymentResponse = 4411, + AMSendAccountInfoUpdate = 4412, + + BasePSRange = 5000, + PSCreateShoppingCart = 5001, + PSCreateShoppingCartResponse = 5002, + PSIsValidShoppingCart = 5003, + PSIsValidShoppingCartResponse = 5004, + PSAddPackageToShoppingCart = 5005, + PSAddPackageToShoppingCartResponse = 5006, + PSRemoveLineItemFromShoppingCart = 5007, + PSRemoveLineItemFromShoppingCartResponse = 5008, + PSGetShoppingCartContents = 5009, + PSGetShoppingCartContentsResponse = 5010, + PSAddWalletCreditToShoppingCart = 5011, + PSAddWalletCreditToShoppingCartResponse = 5012, + + BaseUFSRange = 5200, + ClientUFSUploadFileRequest = 5202, + ClientUFSUploadFileResponse = 5203, + ClientUFSUploadFileChunk = 5204, + ClientUFSUploadFileFinished = 5205, + ClientUFSGetFileListForApp = 5206, + ClientUFSGetFileListForAppResponse = 5207, + ClientUFSDownloadRequest = 5210, + ClientUFSDownloadResponse = 5211, + ClientUFSDownloadChunk = 5212, + ClientUFSLoginRequest = 5213, + ClientUFSLoginResponse = 5214, + UFSReloadPartitionInfo = 5215, + ClientUFSTransferHeartbeat = 5216, + UFSSynchronizeFile = 5217, + UFSSynchronizeFileResponse = 5218, + ClientUFSDeleteFileRequest = 5219, + ClientUFSDeleteFileResponse = 5220, + UFSDownloadRequest = 5221, // obsolete + UFSDownloadResponse = 5222, // obsolete + UFSDownloadChunk = 5223, // obsolete + ClientUFSGetUGCDetails = 5226, + ClientUFSGetUGCDetailsResponse = 5227, + UFSUpdateFileFlags = 5228, + UFSUpdateFileFlagsResponse = 5229, + ClientUFSGetSingleFileInfo = 5230, + ClientUFSGetSingleFileInfoResponse = 5231, + ClientUFSShareFile = 5232, + ClientUFSShareFileResponse = 5233, + UFSReloadAccount = 5234, + UFSReloadAccountResponse = 5235, + UFSUpdateRecordBatched = 5236, + UFSUpdateRecordBatchedResponse = 5237, + UFSMigrateFile = 5238, + UFSMigrateFileResponse = 5239, + UFSGetUGCURLs = 5240, + UFSGetUGCURLsResponse = 5241, + UFSHttpUploadFileFinishRequest = 5242, + UFSHttpUploadFileFinishResponse = 5243, + UFSDownloadStartRequest = 5244, + UFSDownloadStartResponse = 5245, + UFSDownloadChunkRequest = 5246, + UFSDownloadChunkResponse = 5247, + UFSDownloadFinishRequest = 5248, + UFSDownloadFinishResponse = 5249, + UFSFlushURLCache = 5250, + UFSUploadCommit = 5251, + UFSUploadCommitResponse = 5252, + UFSMigrateFileAppID = 5253, + UFSMigrateFileAppIDResponse = 5254, + + BaseClient2 = 5400, + ClientRequestForgottenPasswordEmail = 5401, + ClientRequestForgottenPasswordEmailResponse = 5402, + ClientCreateAccountResponse = 5403, + ClientResetForgottenPassword = 5404, + ClientResetForgottenPasswordResponse = 5405, + ClientCreateAccount2 = 5406, + ClientInformOfResetForgottenPassword = 5407, + ClientInformOfResetForgottenPasswordResponse = 5408, + ClientAnonUserLogOn_Deprecated = 5409, // obsolete + ClientGamesPlayedWithDataBlob = 5410, + ClientUpdateUserGameInfo = 5411, + ClientFileToDownload = 5412, + ClientFileToDownloadResponse = 5413, + ClientLBSSetScore = 5414, + ClientLBSSetScoreResponse = 5415, + ClientLBSFindOrCreateLB = 5416, + ClientLBSFindOrCreateLBResponse = 5417, + ClientLBSGetLBEntries = 5418, + ClientLBSGetLBEntriesResponse = 5419, + ClientMarketingMessageUpdate = 5420, // obsolete + ClientChatDeclined = 5426, + ClientFriendMsgIncoming = 5427, + ClientAuthList_Deprecated = 5428, // obsolete + ClientTicketAuthComplete = 5429, + ClientIsLimitedAccount = 5430, + ClientRequestAuthList = 5431, + ClientAuthList = 5432, + ClientStat = 5433, + ClientP2PConnectionInfo = 5434, + ClientP2PConnectionFailInfo = 5435, + ClientGetNumberOfCurrentPlayers = 5436, // obsolete + ClientGetNumberOfCurrentPlayersResponse = 5437, // obsolete + ClientGetDepotDecryptionKey = 5438, + ClientGetDepotDecryptionKeyResponse = 5439, + GSPerformHardwareSurvey = 5440, + ClientGetAppBetaPasswords = 5441, // obsolete + ClientGetAppBetaPasswordsResponse = 5442, // obsolete + ClientEnableTestLicense = 5443, + ClientEnableTestLicenseResponse = 5444, + ClientDisableTestLicense = 5445, + ClientDisableTestLicenseResponse = 5446, + ClientRequestValidationMail = 5448, + ClientRequestValidationMailResponse = 5449, + ClientCheckAppBetaPassword = 5450, + ClientCheckAppBetaPasswordResponse = 5451, + ClientToGC = 5452, + ClientFromGC = 5453, + ClientRequestChangeMail = 5454, + ClientRequestChangeMailResponse = 5455, + ClientEmailAddrInfo = 5456, + ClientPasswordChange3 = 5457, + ClientEmailChange3 = 5458, + ClientPersonalQAChange3 = 5459, + ClientResetForgottenPassword3 = 5460, + ClientRequestForgottenPasswordEmail3 = 5461, + ClientCreateAccount3 = 5462, // obsolete + ClientNewLoginKey = 5463, + ClientNewLoginKeyAccepted = 5464, + ClientLogOnWithHash_Deprecated = 5465, // obsolete + ClientStoreUserStats2 = 5466, + ClientStatsUpdated = 5467, + ClientActivateOEMLicense = 5468, + ClientRegisterOEMMachine = 5469, + ClientRegisterOEMMachineResponse = 5470, + ClientRequestedClientStats = 5480, + ClientStat2Int32 = 5481, + ClientStat2 = 5482, + ClientVerifyPassword = 5483, + ClientVerifyPasswordResponse = 5484, + ClientDRMDownloadRequest = 5485, + ClientDRMDownloadResponse = 5486, + ClientDRMFinalResult = 5487, + ClientGetFriendsWhoPlayGame = 5488, + ClientGetFriendsWhoPlayGameResponse = 5489, + ClientOGSBeginSession = 5490, + ClientOGSBeginSessionResponse = 5491, + ClientOGSEndSession = 5492, + ClientOGSEndSessionResponse = 5493, + ClientOGSWriteRow = 5494, + ClientDRMTest = 5495, + ClientDRMTestResult = 5496, + ClientServerUnavailable = 5500, + ClientServersAvailable = 5501, + ClientRegisterAuthTicketWithCM = 5502, + ClientGCMsgFailed = 5503, + ClientMicroTxnAuthRequest = 5504, + ClientMicroTxnAuthorize = 5505, + ClientMicroTxnAuthorizeResponse = 5506, + ClientAppMinutesPlayedData = 5507, + ClientGetMicroTxnInfo = 5508, + ClientGetMicroTxnInfoResponse = 5509, + ClientMarketingMessageUpdate2 = 5510, + ClientDeregisterWithServer = 5511, + ClientSubscribeToPersonaFeed = 5512, + ClientLogon = 5514, + ClientGetClientDetails = 5515, + ClientGetClientDetailsResponse = 5516, + ClientReportOverlayDetourFailure = 5517, + ClientGetClientAppList = 5518, + ClientGetClientAppListResponse = 5519, + ClientInstallClientApp = 5520, + ClientInstallClientAppResponse = 5521, + ClientUninstallClientApp = 5522, + ClientUninstallClientAppResponse = 5523, + ClientSetClientAppUpdateState = 5524, + ClientSetClientAppUpdateStateResponse = 5525, + ClientRequestEncryptedAppTicket = 5526, + ClientRequestEncryptedAppTicketResponse = 5527, + ClientWalletInfoUpdate = 5528, + ClientLBSSetUGC = 5529, + ClientLBSSetUGCResponse = 5530, + ClientAMGetClanOfficers = 5531, + ClientAMGetClanOfficersResponse = 5532, + ClientCheckFileSignature = 5533, // obsolete + ClientCheckFileSignatureResponse = 5534, // obsolete + ClientFriendProfileInfo = 5535, + ClientFriendProfileInfoResponse = 5536, + ClientUpdateMachineAuth = 5537, + ClientUpdateMachineAuthResponse = 5538, + ClientReadMachineAuth = 5539, + ClientReadMachineAuthResponse = 5540, + ClientRequestMachineAuth = 5541, + ClientRequestMachineAuthResponse = 5542, + ClientScreenshotsChanged = 5543, + ClientEmailChange4 = 5544, + ClientEmailChangeResponse4 = 5545, + ClientGetCDNAuthToken = 5546, + ClientGetCDNAuthTokenResponse = 5547, + ClientDownloadRateStatistics = 5548, + ClientRequestAccountData = 5549, + ClientRequestAccountDataResponse = 5550, + ClientResetForgottenPassword4 = 5551, + ClientHideFriend = 5552, + ClientFriendsGroupsList = 5553, + ClientGetClanActivityCounts = 5554, + ClientGetClanActivityCountsResponse = 5555, + ClientOGSReportString = 5556, + ClientOGSReportBug = 5557, + ClientSentLogs = 5558, + ClientLogonGameServer = 5559, + AMClientCreateFriendsGroup = 5560, + AMClientCreateFriendsGroupResponse = 5561, + AMClientDeleteFriendsGroup = 5562, + AMClientDeleteFriendsGroupResponse = 5563, + AMClientRenameFriendsGroup = 5564, + AMClientRenameFriendsGroupResponse = 5565, + AMClientAddFriendToGroup = 5566, + AMClientAddFriendToGroupResponse = 5567, + AMClientRemoveFriendFromGroup = 5568, + AMClientRemoveFriendFromGroupResponse = 5569, + ClientAMGetPersonaNameHistory = 5570, + ClientAMGetPersonaNameHistoryResponse = 5571, + ClientRequestFreeLicense = 5572, + ClientRequestFreeLicenseResponse = 5573, + ClientDRMDownloadRequestWithCrashData = 5574, + ClientAuthListAck = 5575, + ClientItemAnnouncements = 5576, + ClientRequestItemAnnouncements = 5577, + ClientFriendMsgEchoToSender = 5578, + ClientChangeSteamGuardOptions = 5579, // obsolete + ClientChangeSteamGuardOptionsResponse = 5580, // obsolete + ClientOGSGameServerPingSample = 5581, + ClientCommentNotifications = 5582, + ClientRequestCommentNotifications = 5583, + ClientPersonaChangeResponse = 5584, + ClientRequestWebAPIAuthenticateUserNonce = 5585, + ClientRequestWebAPIAuthenticateUserNonceResponse = 5586, + ClientPlayerNicknameList = 5587, + AMClientSetPlayerNickname = 5588, + AMClientSetPlayerNicknameResponse = 5589, + ClientRequestOAuthTokenForApp = 5590, // obsolete + ClientRequestOAuthTokenForAppResponse = 5591, // obsolete + ClientCreateAccountProto = 5590, + ClientCreateAccountProtoResponse = 5591, + ClientGetNumberOfCurrentPlayersDP = 5592, + ClientGetNumberOfCurrentPlayersDPResponse = 5593, + ClientServiceMethod = 5594, + ClientServiceMethodResponse = 5595, + ClientFriendUserStatusPublished = 5596, + ClientCurrentUIMode = 5597, + ClientVanityURLChangedNotification = 5598, + ClientUserNotifications = 5599, + + BaseDFS = 5600, + DFSGetFile = 5601, + DFSInstallLocalFile = 5602, + DFSConnection = 5603, + DFSConnectionReply = 5604, + ClientDFSAuthenticateRequest = 5605, + ClientDFSAuthenticateResponse = 5606, + ClientDFSEndSession = 5607, + DFSPurgeFile = 5608, + DFSRouteFile = 5609, + DFSGetFileFromServer = 5610, + DFSAcceptedResponse = 5611, + DFSRequestPingback = 5612, + DFSRecvTransmitFile = 5613, + DFSSendTransmitFile = 5614, + DFSRequestPingback2 = 5615, + DFSResponsePingback2 = 5616, + ClientDFSDownloadStatus = 5617, + DFSStartTransfer = 5618, + DFSTransferComplete = 5619, + DFSRouteFileResponse = 5620, + + BaseMDS = 5800, + ClientMDSLoginRequest = 5801, // obsolete + ClientMDSLoginResponse = 5802, // obsolete + ClientMDSUploadManifestRequest = 5803, // obsolete + ClientMDSUploadManifestResponse = 5804, // obsolete + ClientMDSTransmitManifestDataChunk = 5805, // obsolete + ClientMDSHeartbeat = 5806, // obsolete + ClientMDSUploadDepotChunks = 5807, // obsolete + ClientMDSUploadDepotChunksResponse = 5808, // obsolete + ClientMDSInitDepotBuildRequest = 5809, // obsolete + ClientMDSInitDepotBuildResponse = 5810, // obsolete + AMToMDSGetDepotDecryptionKey = 5812, + MDSToAMGetDepotDecryptionKeyResponse = 5813, + MDSGetVersionsForDepot = 5814, // obsolete + MDSGetVersionsForDepotResponse = 5815, // obsolete + MDSSetPublicVersionForDepot = 5816, // obsolete + MDSSetPublicVersionForDepotResponse = 5817, // obsolete + ClientMDSInitWorkshopBuildRequest = 5816, // obsolete + ClientMDSInitWorkshopBuildResponse = 5817, // obsolete + ClientMDSGetDepotManifest = 5818, // obsolete + ClientMDSGetDepotManifestResponse = 5819, // obsolete + ClientMDSGetDepotManifestChunk = 5820, // obsolete + ClientMDSUploadRateTest = 5823, // obsolete + ClientMDSUploadRateTestResponse = 5824, // obsolete + MDSDownloadDepotChunksAck = 5825, // obsolete + MDSContentServerStatsBroadcast = 5826, // obsolete + MDSContentServerConfigRequest = 5827, + MDSContentServerConfig = 5828, + MDSGetDepotManifest = 5829, + MDSGetDepotManifestResponse = 5830, + MDSGetDepotManifestChunk = 5831, + MDSGetDepotChunk = 5832, + MDSGetDepotChunkResponse = 5833, + MDSGetDepotChunkChunk = 5834, + MDSUpdateContentServerConfig = 5835, // obsolete + MDSGetServerListForUser = 5836, + MDSGetServerListForUserResponse = 5837, + ClientMDSRegisterAppBuild = 5838, // obsolete + ClientMDSRegisterAppBuildResponse = 5839, // obsolete + ClientMDSSetAppBuildLive = 5840, // obsolete + ClientMDSSetAppBuildLiveResponse = 5841, // obsolete + ClientMDSGetPrevDepotBuild = 5842, // obsolete + ClientMDSGetPrevDepotBuildResponse = 5843, // obsolete + MDSToCSFlushChunk = 5844, + ClientMDSSignInstallScript = 5845, // obsolete + ClientMDSSignInstallScriptResponse = 5846, // obsolete + MDSMigrateChunk = 5847, + MDSMigrateChunkResponse = 5848, + + CSBase = 6200, + CSPing = 6201, + CSPingResponse = 6202, + + GMSBase = 6400, + GMSGameServerReplicate = 6401, + ClientGMSServerQuery = 6403, + GMSClientServerQueryResponse = 6404, + AMGMSGameServerUpdate = 6405, + AMGMSGameServerRemove = 6406, + GameServerOutOfDate = 6407, + + DeviceAuthorizationBase = 6500, + ClientAuthorizeLocalDeviceRequest = 6501, + ClientAuthorizeLocalDevice = 6502, // obsolete + ClientAuthorizeLocalDeviceResponse = 6502, + ClientDeauthorizeDeviceRequest = 6503, + ClientDeauthorizeDevice = 6504, + ClientUseLocalDeviceAuthorizations = 6505, + ClientGetAuthorizedDevices = 6506, + ClientGetAuthorizedDevicesResponse = 6507, + AMNotifySessionDeviceAuthorized = 6508, + ClientAuthorizeLocalDeviceNotification = 6509, + + MMSBase = 6600, + ClientMMSCreateLobby = 6601, + ClientMMSCreateLobbyResponse = 6602, + ClientMMSJoinLobby = 6603, + ClientMMSJoinLobbyResponse = 6604, + ClientMMSLeaveLobby = 6605, + ClientMMSLeaveLobbyResponse = 6606, + ClientMMSGetLobbyList = 6607, + ClientMMSGetLobbyListResponse = 6608, + ClientMMSSetLobbyData = 6609, + ClientMMSSetLobbyDataResponse = 6610, + ClientMMSGetLobbyData = 6611, + ClientMMSLobbyData = 6612, + ClientMMSSendLobbyChatMsg = 6613, + ClientMMSLobbyChatMsg = 6614, + ClientMMSSetLobbyOwner = 6615, + ClientMMSSetLobbyOwnerResponse = 6616, + ClientMMSSetLobbyGameServer = 6617, + ClientMMSLobbyGameServerSet = 6618, + ClientMMSUserJoinedLobby = 6619, + ClientMMSUserLeftLobby = 6620, + ClientMMSInviteToLobby = 6621, + ClientMMSFlushFrenemyListCache = 6622, + ClientMMSFlushFrenemyListCacheResponse = 6623, + ClientMMSSetLobbyLinked = 6624, + + NonStdMsgBase = 6800, + NonStdMsgMemcached = 6801, + NonStdMsgHTTPServer = 6802, + NonStdMsgHTTPClient = 6803, + NonStdMsgWGResponse = 6804, + NonStdMsgPHPSimulator = 6805, + NonStdMsgChase = 6806, + NonStdMsgDFSTransfer = 6807, + NonStdMsgTests = 6808, + NonStdMsgUMQpipeAAPL = 6809, + NonStdMsgSyslog = 6810, // obsolete + NonStdMsgLogsink = 6811, + NonStdMsgSteam2Emulator = 6812, + NonStdMsgRTMPServer = 6813, + + UDSBase = 7000, + ClientUDSP2PSessionStarted = 7001, + ClientUDSP2PSessionEnded = 7002, + UDSRenderUserAuth = 7003, + UDSRenderUserAuthResponse = 7004, + ClientUDSInviteToGame = 7005, + UDSFindSession = 7006, // obsolete "renamed to UDSHasSession" + UDSHasSession = 7006, + UDSFindSessionResponse = 7007, // obsolete "renamed to UDSHasSessionResponse" + UDSHasSessionResponse = 7007, + + MPASBase = 7100, + MPASVacBanReset = 7101, + + KGSBase = 7200, + KGSAllocateKeyRange = 7201, // obsolete + KGSAllocateKeyRangeResponse = 7202, // obsolete + KGSGenerateKeys = 7203, // obsolete + KGSGenerateKeysResponse = 7204, // obsolete + KGSRemapKeys = 7205, // obsolete + KGSRemapKeysResponse = 7206, // obsolete + KGSGenerateGameStopWCKeys = 7207, // obsolete + KGSGenerateGameStopWCKeysResponse = 7208, // obsolete + + UCMBase = 7300, + ClientUCMAddScreenshot = 7301, + ClientUCMAddScreenshotResponse = 7302, + UCMValidateObjectExists = 7303, // obsolete + UCMValidateObjectExistsResponse = 7304, // obsolete + UCMResetCommunityContent = 7307, + UCMResetCommunityContentResponse = 7308, + ClientUCMDeleteScreenshot = 7309, + ClientUCMDeleteScreenshotResponse = 7310, + ClientUCMPublishFile = 7311, + ClientUCMPublishFileResponse = 7312, + ClientUCMGetPublishedFileDetails = 7313, // obsolete + ClientUCMGetPublishedFileDetailsResponse = 7314, // obsolete + ClientUCMDeletePublishedFile = 7315, + ClientUCMDeletePublishedFileResponse = 7316, + ClientUCMEnumerateUserPublishedFiles = 7317, + ClientUCMEnumerateUserPublishedFilesResponse = 7318, + ClientUCMSubscribePublishedFile = 7319, // obsolete + ClientUCMSubscribePublishedFileResponse = 7320, // obsolete + ClientUCMEnumerateUserSubscribedFiles = 7321, + ClientUCMEnumerateUserSubscribedFilesResponse = 7322, + ClientUCMUnsubscribePublishedFile = 7323, // obsolete + ClientUCMUnsubscribePublishedFileResponse = 7324, // obsolete + ClientUCMUpdatePublishedFile = 7325, + ClientUCMUpdatePublishedFileResponse = 7326, + UCMUpdatePublishedFile = 7327, + UCMUpdatePublishedFileResponse = 7328, + UCMDeletePublishedFile = 7329, + UCMDeletePublishedFileResponse = 7330, + UCMUpdatePublishedFileStat = 7331, + UCMUpdatePublishedFileBan = 7332, + UCMUpdatePublishedFileBanResponse = 7333, + UCMUpdateTaggedScreenshot = 7334, // obsolete + UCMAddTaggedScreenshot = 7335, // obsolete + UCMRemoveTaggedScreenshot = 7336, // obsolete + UCMReloadPublishedFile = 7337, + UCMReloadUserFileListCaches = 7338, + UCMPublishedFileReported = 7339, + UCMUpdatePublishedFileIncompatibleStatus = 7340, + UCMPublishedFilePreviewAdd = 7341, + UCMPublishedFilePreviewAddResponse = 7342, + UCMPublishedFilePreviewRemove = 7343, + UCMPublishedFilePreviewRemoveResponse = 7344, + UCMPublishedFilePreviewChangeSortOrder = 7345, // obsolete + UCMPublishedFilePreviewChangeSortOrderResponse = 7346, // obsolete + ClientUCMPublishedFileSubscribed = 7347, + ClientUCMPublishedFileUnsubscribed = 7348, + UCMPublishedFileSubscribed = 7349, + UCMPublishedFileUnsubscribed = 7350, + UCMPublishFile = 7351, + UCMPublishFileResponse = 7352, + UCMPublishedFileChildAdd = 7353, + UCMPublishedFileChildAddResponse = 7354, + UCMPublishedFileChildRemove = 7355, + UCMPublishedFileChildRemoveResponse = 7356, + UCMPublishedFileChildChangeSortOrder = 7357, // obsolete + UCMPublishedFileChildChangeSortOrderResponse = 7358, // obsolete + UCMPublishedFileParentChanged = 7359, + ClientUCMGetPublishedFilesForUser = 7360, + ClientUCMGetPublishedFilesForUserResponse = 7361, + UCMGetPublishedFilesForUser = 7362, // obsolete + UCMGetPublishedFilesForUserResponse = 7363, // obsolete + ClientUCMSetUserPublishedFileAction = 7364, + ClientUCMSetUserPublishedFileActionResponse = 7365, + ClientUCMEnumeratePublishedFilesByUserAction = 7366, + ClientUCMEnumeratePublishedFilesByUserActionResponse = 7367, + ClientUCMPublishedFileDeleted = 7368, + UCMGetUserSubscribedFiles = 7369, + UCMGetUserSubscribedFilesResponse = 7370, + UCMFixStatsPublishedFile = 7371, + UCMDeleteOldScreenshot = 7372, // obsolete + UCMDeleteOldScreenshotResponse = 7373, // obsolete + UCMDeleteOldVideo = 7374, // obsolete + UCMDeleteOldVideoResponse = 7375, // obsolete + UCMUpdateOldScreenshotPrivacy = 7376, // obsolete + UCMUpdateOldScreenshotPrivacyResponse = 7377, // obsolete + ClientUCMEnumerateUserSubscribedFilesWithUpdates = 7378, + ClientUCMEnumerateUserSubscribedFilesWithUpdatesResponse = 7379, + UCMPublishedFileContentUpdated = 7380, + UCMPublishedFileUpdated = 7381, + ClientWorkshopItemChangesRequest = 7382, + ClientWorkshopItemChangesResponse = 7383, + ClientWorkshopItemInfoRequest = 7384, + ClientWorkshopItemInfoResponse = 7385, + + FSBase = 7500, + ClientRichPresenceUpload = 7501, + ClientRichPresenceRequest = 7502, + ClientRichPresenceInfo = 7503, + FSRichPresenceRequest = 7504, + FSRichPresenceResponse = 7505, + FSComputeFrenematrix = 7506, + FSComputeFrenematrixResponse = 7507, + FSPlayStatusNotification = 7508, + FSPublishPersonaStatus = 7509, + FSAddOrRemoveFollower = 7510, + FSAddOrRemoveFollowerResponse = 7511, + FSUpdateFollowingList = 7512, + FSCommentNotification = 7513, + FSCommentNotificationViewed = 7514, + ClientFSGetFollowerCount = 7515, + ClientFSGetFollowerCountResponse = 7516, + ClientFSGetIsFollowing = 7517, + ClientFSGetIsFollowingResponse = 7518, + ClientFSEnumerateFollowingList = 7519, + ClientFSEnumerateFollowingListResponse = 7520, + FSGetPendingNotificationCount = 7521, + FSGetPendingNotificationCountResponse = 7522, + ClientFSOfflineMessageNotification = 7523, + ClientFSRequestOfflineMessageCount = 7524, + ClientFSGetFriendMessageHistory = 7525, + ClientFSGetFriendMessageHistoryResponse = 7526, + ClientFSGetFriendMessageHistoryForOfflineMessages = 7527, + ClientFSGetFriendsSteamLevels = 7528, + ClientFSGetFriendsSteamLevelsResponse = 7529, + FSRequestFriendData = 7530, + + DRMRange2 = 7600, + CEGVersionSetEnableDisableRequest = 7600, + CEGVersionSetEnableDisableResponse = 7601, + CEGPropStatusDRMSRequest = 7602, + CEGPropStatusDRMSResponse = 7603, + CEGWhackFailureReportRequest = 7604, + CEGWhackFailureReportResponse = 7605, + DRMSFetchVersionSet = 7606, + DRMSFetchVersionSetResponse = 7607, + + EconBase = 7700, + EconTrading_InitiateTradeRequest = 7701, + EconTrading_InitiateTradeProposed = 7702, + EconTrading_InitiateTradeResponse = 7703, + EconTrading_InitiateTradeResult = 7704, + EconTrading_StartSession = 7705, + EconTrading_CancelTradeRequest = 7706, + EconFlushInventoryCache = 7707, + EconFlushInventoryCacheResponse = 7708, + EconCDKeyProcessTransaction = 7711, + EconCDKeyProcessTransactionResponse = 7712, + EconGetErrorLogs = 7713, + EconGetErrorLogsResponse = 7714, + + RMRange = 7800, + RMTestVerisignOTP = 7800, + RMTestVerisignOTPResponse = 7801, + RMDeleteMemcachedKeys = 7803, + RMRemoteInvoke = 7804, + BadLoginIPList = 7805, + RMMsgTraceAddTrigger = 7806, + RMMsgTraceRemoveTrigger = 7807, + RMMsgTraceEvent = 7808, + + UGSBase = 7900, + UGSUpdateGlobalStats = 7900, + ClientUGSGetGlobalStats = 7901, + ClientUGSGetGlobalStatsResponse = 7902, + + StoreBase = 8000, + StoreUpdateRecommendationCount = 8000, // obsolete + + UMQBase = 8100, + UMQLogonRequest = 8100, + UMQLogonResponse = 8101, + UMQLogoffRequest = 8102, + UMQLogoffResponse = 8103, + UMQSendChatMessage = 8104, + UMQIncomingChatMessage = 8105, + UMQPoll = 8106, + UMQPollResults = 8107, + UMQ2AM_ClientMsgBatch = 8108, + UMQEnqueueMobileSalePromotions = 8109, // obsolete + UMQEnqueueMobileAnnouncements = 8110, // obsolete + + WorkshopBase = 8200, + WorkshopAcceptTOSRequest = 8200, // obsolete + WorkshopAcceptTOSResponse = 8201, // obsolete + + WebAPIBase = 8300, + WebAPIValidateOAuth2Token = 8300, + WebAPIValidateOAuth2TokenResponse = 8301, + WebAPIInvalidateTokensForAccount = 8302, // obsolete + WebAPIRegisterGCInterfaces = 8303, + WebAPIInvalidateOAuthClientCache = 8304, + WebAPIInvalidateOAuthTokenCache = 8305, + WebAPISetSecrets = 8306, + + BackpackBase = 8400, + BackpackAddToCurrency = 8401, + BackpackAddToCurrencyResponse = 8402, + + CREBase = 8500, + CRERankByTrend = 8501, // obsolete + CRERankByTrendResponse = 8502, // obsolete + CREItemVoteSummary = 8503, + CREItemVoteSummaryResponse = 8504, + CRERankByVote = 8505, // obsolete + CRERankByVoteResponse = 8506, // obsolete + CREUpdateUserPublishedItemVote = 8507, + CREUpdateUserPublishedItemVoteResponse = 8508, + CREGetUserPublishedItemVoteDetails = 8509, + CREGetUserPublishedItemVoteDetailsResponse = 8510, + CREEnumeratePublishedFiles = 8511, + CREEnumeratePublishedFilesResponse = 8512, + CREPublishedFileVoteAdded = 8513, + + SecretsBase = 8600, + SecretsRequestCredentialPair = 8600, + SecretsCredentialPairResponse = 8601, + SecretsRequestServerIdentity = 8602, // obsolete + SecretsServerIdentityResponse = 8603, // obsolete + SecretsUpdateServerIdentities = 8604, // obsolete + + BoxMonitorBase = 8700, + BoxMonitorReportRequest = 8700, + BoxMonitorReportResponse = 8701, + + LogsinkBase = 8800, + LogsinkWriteReport = 8800, + + PICSBase = 8900, + ClientPICSChangesSinceRequest = 8901, + ClientPICSChangesSinceResponse = 8902, + ClientPICSProductInfoRequest = 8903, + ClientPICSProductInfoResponse = 8904, + ClientPICSAccessTokenRequest = 8905, + ClientPICSAccessTokenResponse = 8906, + + WorkerProcess = 9000, + WorkerProcessPingRequest = 9000, + WorkerProcessPingResponse = 9001, + WorkerProcessShutdown = 9002, + + DRMWorkerProcess = 9100, + DRMWorkerProcessDRMAndSign = 9100, + DRMWorkerProcessDRMAndSignResponse = 9101, + DRMWorkerProcessSteamworksInfoRequest = 9102, + DRMWorkerProcessSteamworksInfoResponse = 9103, + DRMWorkerProcessInstallDRMDLLRequest = 9104, + DRMWorkerProcessInstallDRMDLLResponse = 9105, + DRMWorkerProcessSecretIdStringRequest = 9106, + DRMWorkerProcessSecretIdStringResponse = 9107, + DRMWorkerProcessGetDRMGuidsFromFileRequest = 9108, // obsolete + DRMWorkerProcessGetDRMGuidsFromFileResponse = 9109, // obsolete + DRMWorkerProcessInstallProcessedFilesRequest = 9110, + DRMWorkerProcessInstallProcessedFilesResponse = 9111, + DRMWorkerProcessExamineBlobRequest = 9112, + DRMWorkerProcessExamineBlobResponse = 9113, + DRMWorkerProcessDescribeSecretRequest = 9114, + DRMWorkerProcessDescribeSecretResponse = 9115, + DRMWorkerProcessBackfillOriginalRequest = 9116, + DRMWorkerProcessBackfillOriginalResponse = 9117, + DRMWorkerProcessValidateDRMDLLRequest = 9118, + DRMWorkerProcessValidateDRMDLLResponse = 9119, + DRMWorkerProcessValidateFileRequest = 9120, + DRMWorkerProcessValidateFileResponse = 9121, + DRMWorkerProcessSplitAndInstallRequest = 9122, + DRMWorkerProcessSplitAndInstallResponse = 9123, + DRMWorkerProcessGetBlobRequest = 9124, + DRMWorkerProcessGetBlobResponse = 9125, + DRMWorkerProcessEvaluateCrashRequest = 9126, + DRMWorkerProcessEvaluateCrashResponse = 9127, + DRMWorkerProcessAnalyzeFileRequest = 9128, + DRMWorkerProcessAnalyzeFileResponse = 9129, + DRMWorkerProcessUnpackBlobRequest = 9130, + DRMWorkerProcessUnpackBlobResponse = 9131, + DRMWorkerProcessInstallAllRequest = 9132, + DRMWorkerProcessInstallAllResponse = 9133, + + TestWorkerProcess = 9200, + TestWorkerProcessLoadUnloadModuleRequest = 9200, + TestWorkerProcessLoadUnloadModuleResponse = 9201, + TestWorkerProcessServiceModuleCallRequest = 9202, + TestWorkerProcessServiceModuleCallResponse = 9203, + + QuestServerBase = 9300, + + ClientGetEmoticonList = 9330, + ClientEmoticonList = 9331, + + ClientSharedLibraryBase = 9400, // obsolete "renamed to SLCBase" + SLCBase = 9400, + SLCUserSessionStatus = 9400, + SLCRequestUserSessionStatus = 9401, + SLCSharedLicensesLockStatus = 9402, + ClientSharedLicensesLockStatus = 9403, // obsolete + ClientSharedLicensesStopPlaying = 9404, // obsolete + ClientSharedLibraryLockStatus = 9405, + ClientSharedLibraryStopPlaying = 9406, + SLCOwnerLibraryChanged = 9407, + SLCSharedLibraryChanged = 9408, + + RemoteClientBase = 9500, + RemoteClientAuth = 9500, + RemoteClientAuthResponse = 9501, + RemoteClientAppStatus = 9502, + RemoteClientStartStream = 9503, + RemoteClientStartStreamResponse = 9504, + RemoteClientPing = 9505, + RemoteClientPingResponse = 9506, + ClientUnlockStreaming = 9507, + ClientUnlockStreamingResponse = 9508, + RemoteClientAcceptEULA = 9509, + RemoteClientGetControllerConfig = 9510, + RemoteClientGetControllerConfigResposne = 9511, + RemoteClientStreamingEnabled = 9512, + + ClientConcurrentSessionsBase = 9600, + ClientPlayingSessionState = 9600, + ClientKickPlayingSession = 9601, + + ClientBroadcastBase = 9700, + ClientBroadcastInit = 9700, + ClientBroadcastFrames = 9701, + ClientBroadcastDisconnect = 9702, + ClientBroadcastScreenshot = 9703, + ClientBroadcastUploadConfig = 9704, + + BaseClient3 = 9800, + ClientVoiceCallPreAuthorize = 9800, + ClientVoiceCallPreAuthorizeResponse = 9801, +} + +export enum EUniverse { + Invalid = 0, + + Public = 1, + Beta = 2, + Internal = 3, + Dev = 4, + + Max = 5, +} + +export enum EChatEntryType { + Invalid = 0, + + ChatMsg = 1, + Typing = 2, + InviteGame = 3, + Emote = 4, // removed "No longer supported by clients" + LobbyGameStart = 5, // removed "Listen for LobbyGameCreated_t callback instead" + LeftConversation = 6, + Entered = 7, + WasKicked = 8, + WasBanned = 9, + Disconnected = 10, + HistoricalChat = 11, + Reserved1 = 12, + Reserved2 = 13, + LinkBlocked = 14, +} + +export enum EPersonaState { + Offline = 0, + + Online = 1, + Busy = 2, + Away = 3, + Snooze = 4, + LookingToTrade = 5, + LookingToPlay = 6, + + Max = 7, +} + +export enum EAccountType { + Invalid = 0, + + Individual = 1, + Multiseat = 2, + GameServer = 3, + AnonGameServer = 4, + Pending = 5, + ContentServer = 6, + Clan = 7, + Chat = 8, + ConsoleUser = 9, + AnonUser = 10, + + Max = 11, +} + +export enum EFriendRelationship { + None = 0, + + Blocked = 1, + RequestRecipient = 2, + Friend = 3, + RequestInitiator = 4, + Ignored = 5, + IgnoredFriend = 6, + SuggestedFriend = 7, + + Max = 8, +} + +export enum EAccountFlags { + NormalUser = 0, + + PersonaNameSet = 1, + Unbannable = 2, + PasswordSet = 4, + Support = 8, + Admin = 16, + Supervisor = 32, + AppEditor = 64, + HWIDSet = 128, + PersonalQASet = 256, + VacBeta = 512, + Debug = 1024, + Disabled = 2048, + LimitedUser = 4096, + LimitedUserForce = 8192, + EmailValidated = 16384, + MarketingTreatment = 32768, + OGGInviteOptOut = 65536, + ForcePasswordChange = 131072, + ForceEmailVerification = 262144, + LogonExtraSecurity = 524288, + LogonExtraSecurityDisabled = 1048576, + Steam2MigrationComplete = 2097152, + NeedLogs = 4194304, + Lockdown = 8388608, + MasterAppEditor = 16777216, + BannedFromWebAPI = 33554432, + ClansOnlyFromFriends = 67108864, + GlobalModerator = 134217728, + ParentalSettings = 268435456, + ThirdPartySupport = 536870912, + NeedsSSANextSteamLogon = 1073741824, +} + +export enum EClanPermission { + Nobody = 0, + + Owner = 1, + Officer = 2, + OwnerAndOfficer = 3, + Member = 4, + Moderator = 8, + + OwnerOfficerModerator = Owner | Officer | Moderator, // 11 + AllMembers = Owner | Officer | Moderator | Member, // 15 + + OGGGameOwner = 16, + + NonMember = 128, + + MemberAllowed = NonMember | Member, // 132 + ModeratorAllowed = NonMember | Member | Moderator, // 140 + OfficerAllowed = NonMember | Member | Moderator | Officer, // 142 + OwnerAllowed = NonMember | Member | Moderator | Officer | Owner, // 143 + Anybody = NonMember | Member | Moderator | Officer | Owner, // 143 +} + +export enum EChatPermission { + Close = 1, + Invite = 2, + Talk = 8, + Kick = 16, + Mute = 32, + SetMetadata = 64, + ChangePermissions = 128, + Ban = 256, + ChangeAccess = 512, + + EveryoneNotInClanDefault = Talk, // 8 + EveryoneDefault = Talk | Invite, // 10 + + // todo: this doesn't seem correct... + MemberDefault = Ban | Kick | Talk | Invite, // 282 + + OfficerDefault = Ban | Kick | Talk | Invite, // 282 + OwnerDefault = ChangeAccess | Ban | SetMetadata | Mute | Kick | Talk | Invite | Close, // 891 + + Mask = 1019, +} + +export enum EFriendFlags { + None = 0, + Blocked = 1, + FriendshipRequested = 2, + Immediate = 4, + ClanMember = 8, + OnGameServer = 16, + RequestingFriendship = 128, + RequestingInfo = 256, + Ignored = 512, + IgnoredFriend = 1024, + Suggested = 2048, + ChatMember = 4096, + + FlagAll = 65535, +} + +export enum EPersonaStateFlag { + HasRichPresence = 1, + InJoinableGame = 2, + Golden = 4, // removed "no longer has any effect" + + OnlineUsingWeb = 256, // removed "renamed to ClientTypeWeb" + ClientTypeWeb = 256, + OnlineUsingMobile = 512, // removed "renamed to ClientTypeMobile" + ClientTypeMobile = 512, + OnlineUsingBigPicture = 1024, // removed "renamed to ClientTypeTenfoot" + ClientTypeTenfoot = 1024, + OnlineUsingVR = 2048, // removed "renamed to ClientTypeVR" + ClientTypeVR = 2048, + LaunchTypeGamepad = 4096, +} + +export enum EClientPersonaStateFlag { + Status = 1, + PlayerName = 2, + QueryPort = 4, + SourceID = 8, + Presence = 16, + Metadata = 32, // removed + LastSeen = 64, + ClanInfo = 128, + GameExtraInfo = 256, + GameDataBlob = 512, + ClanTag = 1024, + Facebook = 2048, +} + +export enum EAppUsageEvent { + GameLaunch = 1, + GameLaunchTrial = 2, + Media = 3, + PreloadStart = 4, + PreloadFinish = 5, + MarketingMessageView = 6, + InGameAdViewed = 7, + GameLaunchFreeWeekend = 8, +} + +export enum ELicenseFlags { + None = 0, + Renew = 0x01, + RenewalFailed = 0x02, + Pending = 0x04, + Expired = 0x08, + CancelledByUser = 0x10, + CancelledByAdmin = 0x20, + LowViolenceContent = 0x40, + ImportedFromSteam2 = 0x80, + ForceRunRestriction = 0x100, + RegionRestrictionExpired = 0x200, + CancelledByFriendlyFraudLock = 0x400, + NotActivated = 0x800, +} + +export enum ELicenseType { + NoLicense = 0, + SinglePurchase = 1, + SinglePurchaseLimitedUse = 2, + RecurringCharge = 3, + RecurringChargeLimitedUse = 4, + RecurringChargeLimitedUseWithOverages = 5, + RecurringOption = 6, + LimitedUseDelayedActivation = 7, +} + +export enum EPaymentMethod { + None = 0, + ActivationCode = 1, + CreditCard = 2, + Giropay = 3, + PayPal = 4, + Ideal = 5, + PaySafeCard = 6, + Sofort = 7, + GuestPass = 8, + WebMoney = 9, + MoneyBookers = 10, + AliPay = 11, + Yandex = 12, + Kiosk = 13, + Qiwi = 14, + GameStop = 15, + HardwarePromo = 16, + MoPay = 17, + BoletoBancario = 18, + BoaCompraGold = 19, + BancoDoBrasilOnline = 20, + ItauOnline = 21, + BradescoOnline = 22, + Pagseguro = 23, + VisaBrazil = 24, + AmexBrazil = 25, + Aura = 26, + Hipercard = 27, + MastercardBrazil = 28, + DinersCardBrazil = 29, + AuthorizedDevice = 30, + MOLPoints = 31, + ClickAndBuy = 32, + Beeline = 33, + Konbini = 34, + EClubPoints = 35, + CreditCardJapan = 36, + BankTransferJapan = 37, + PayEasyJapan = 38, // removed "renamed to PayEasy" + PayEasy = 38, + Zong = 39, + CultureVoucher = 40, + BookVoucher = 41, + HappymoneyVoucher = 42, + ConvenientStoreVoucher = 43, + GameVoucher = 44, + Multibanco = 45, + Payshop = 46, + Maestro = 47, // removed "renamed to MaestroBoaCompra" + MaestroBoaCompra = 47, + OXXO = 48, + ToditoCash = 49, + Carnet = 50, + SPEI = 51, + ThreePay = 52, + IsBank = 53, + Garanti = 54, + Akbank = 55, + YapiKredi = 56, + Halkbank = 57, + BankAsya = 58, + Finansbank = 59, + DenizBank = 60, + PTT = 61, + CashU = 62, + AutoGrant = 64, + WebMoneyJapan = 65, + OneCard = 66, + PSE = 67, + Exito = 68, + Efecty = 69, + Paloto = 70, + PinValidda = 71, + MangirKart = 72, + BancoCreditoDePeru = 73, + BBVAContinental = 74, + SafetyPay = 75, + PagoEfectivo = 76, + Trustly = 77, + UnionPay = 78, + BitCoin = 79, + Wallet = 128, + Valve = 129, + SteamPressMaster = 130, // removed "renamed to MasterComp" + MasterComp = 130, + StorePromotion = 131, // removed "renamed to Promotional" + Promotional = 131, + OEMTicket = 256, + Split = 512, + Complimentary = 1024, +} + +export enum EPurchaseResultDetail { + NoDetail = 0, + AVSFailure = 1, + InsufficientFunds = 2, + ContactSupport = 3, + Timeout = 4, + InvalidPackage = 5, + InvalidPaymentMethod = 6, + InvalidData = 7, + OthersInProgress = 8, + AlreadyPurchased = 9, + WrongPrice = 10, + FraudCheckFailed = 11, + CancelledByUser = 12, + RestrictedCountry = 13, + BadActivationCode = 14, + DuplicateActivationCode = 15, + UseOtherPaymentMethod = 16, + UseOtherFunctionSource = 17, + InvalidShippingAddress = 18, + RegionNotSupported = 19, + AcctIsBlocked = 20, + AcctNotVerified = 21, + InvalidAccount = 22, + StoreBillingCountryMismatch = 23, + DoesNotOwnRequiredApp = 24, + CanceledByNewTransaction = 25, + ForceCanceledPending = 26, + FailCurrencyTransProvider = 27, + FailedCyberCafe = 28, + NeedsPreApproval = 29, + PreApprovalDenied = 30, + WalletCurrencyMismatch = 31, + EmailNotValidated = 32, + ExpiredCard = 33, + TransactionExpired = 34, + WouldExceedMaxWallet = 35, + MustLoginPS3AppForPurchase = 36, + CannotShipToPOBox = 37, + InsufficientInventory = 38, + CannotGiftShippedGoods = 39, + CannotShipInternationally = 40, + BillingAgreementCancelled = 41, + InvalidCoupon = 42, + ExpiredCoupon = 43, + AccountLocked = 44, + OtherAbortableInProgress = 45, + ExceededSteamLimit = 46, + OverlappingPackagesInCart = 47, + NoWallet = 48, + NoCachedPaymentMethod = 49, + CannotRedeemCodeFromClient = 50, + PurchaseAmountNoSupportedByProvider = 51, + OverlappingPackagesInPendingTransaction = 52, + RateLimited = 53, + OwnsExcludedApp = 54, + CreditCardBinMismatchesType = 55, + CartValueTooHigh = 56, + BillingAgreementAlreadyExists = 57, + POSACodeNotActivated = 58, + CannotShipToCountry = 59, + HungTransactionCancelled = 60, + PaypalInternalError = 61, + UnknownGlobalCollectError = 62, + InvalidTaxAddress = 63, + PhysicalProductLimitExceeded = 64, + PurchaseCannotBeReplayed = 65, + DelayedCompletion = 66, + BundleTypeCannotBeGifted = 67, +} + +export enum EIntroducerRouting { + FileShare = 0, // removed + P2PVoiceChat = 1, + P2PNetworking = 2, +} + +export enum EServerFlags { + None = 0, + Active = 1, + Secure = 2, + Dedicated = 4, + Linux = 8, + Passworded = 16, + Private = 32, +} + +export enum EDenyReason { + InvalidVersion = 1, + Generic = 2, + NotLoggedOn = 3, + NoLicense = 4, + Cheater = 5, + LoggedInElseWhere = 6, + UnknownText = 7, + IncompatibleAnticheat = 8, + MemoryCorruption = 9, + IncompatibleSoftware = 10, + SteamConnectionLost = 11, + SteamConnectionError = 12, + SteamResponseTimedOut = 13, + SteamValidationStalled = 14, + SteamOwnerLeftGuestUser = 15, +} + +export enum EClanRank { + None = 0, + Owner = 1, + Officer = 2, + Member = 3, + Moderator = 4, +} + +export enum EClanRelationship { + None = 0, + Blocked = 1, + Invited = 2, + Member = 3, + Kicked = 4, + KickAcknowledged = 5, +} + +export enum EAuthSessionResponse { + OK = 0, + UserNotConnectedToSteam = 1, + NoLicenseOrExpired = 2, + VACBanned = 3, + LoggedInElseWhere = 4, + VACCheckTimedOut = 5, + AuthTicketCanceled = 6, + AuthTicketInvalidAlreadyUsed = 7, + AuthTicketInvalid = 8, + PublisherIssuedBan = 9, +} + +export enum EChatRoomEnterResponse { + Success = 1, + DoesntExist = 2, + NotAllowed = 3, + Full = 4, + Error = 5, + Banned = 6, + Limited = 7, + ClanDisabled = 8, + CommunityBan = 9, + MemberBlockedYou = 10, + YouBlockedMember = 11, + + // these appear to have been removed + NoRankingDataLobby = 12, // removed + NoRankingDataUser = 13, // removed + RankOutOfRange = 14, //removed +} + +export enum EChatRoomType { + Friend = 1, + MUC = 2, + Lobby = 3, +} + +export enum EChatInfoType { + StateChange = 1, + InfoUpdate = 2, + MemberLimitChange = 3, +} + +export enum EChatAction { + InviteChat = 1, + Kick = 2, + Ban = 3, + UnBan = 4, + StartVoiceSpeak = 5, + EndVoiceSpeak = 6, + LockChat = 7, + UnlockChat = 8, + CloseChat = 9, + SetJoinable = 10, + SetUnjoinable = 11, + SetOwner = 12, + SetInvisibleToFriends = 13, + SetVisibleToFriends = 14, + SetModerated = 15, + SetUnmoderated = 16, +} + +export enum EChatActionResult { + Success = 1, + Error = 2, + NotPermitted = 3, + NotAllowedOnClanMember = 4, + NotAllowedOnBannedUser = 5, + NotAllowedOnChatOwner = 6, + NotAllowedOnSelf = 7, + ChatDoesntExist = 8, + ChatFull = 9, + VoiceSlotsFull = 10, +} + +export enum EAppInfoSection { + Unknown = 0, + All = 1, + + First = 2, + Common = 2, + Extended = 3, + Config = 4, + Stats = 5, + Install = 6, + Depots = 7, + VAC = 8, // removed + VAC_UNUSED = 8, // removed + DRM = 9, // removed + DRM_UNUSED = 9, // removed + UFS = 10, + OGG = 11, + Items = 12, // removed + ItemsUNUSED = 12, // removed + Policies = 13, + SysReqs = 14, + Community = 15, + Store = 16, + + Max = 17, +} + +export enum EContentDownloadSourceType { + Invalid = 0, + + CS = 1, + CDN = 2, + LCS = 3, + ProxyCache = 4, + LANPeer = 5, + + Max = 5, +} + +export enum EPlatformType { + Unknown = 0, + + Win32 = 1, + Win64 = 2, + Linux = 3, // removed "split to Linux64 and Linux32" + Linux64 = 3, + OSX = 4, + PS3 = 5, + Linux32 = 6, + + Max = 6, +} + +export enum EOSType { + Unknown = -1, + + IOSUnknown = -600, + + AndroidUnknown = -500, + + UMQ = -400, + + PS3 = -300, + + MacOSUnknown = -102, + MacOS104 = -101, + MacOS105 = -100, + MacOS1058 = -99, + MacOS106 = -95, + MacOS1063 = -94, + MacOS1064_slgu = -93, + MacOS1067 = -92, + MacOS107 = -90, + MacOS108 = -89, + MacOS109 = -88, + MacOS1010 = -87, + MacOS1011 = -86, + MacOS1012 = -85, + MacOSMax = -1, + + LinuxUnknown = -203, + Linux22 = -202, + Linux24 = -201, + Linux26 = -200, + Linux32 = -199, + Linux35 = -198, + Linux36 = -197, + Linux310 = -196, + LinuxMax = -103, + + WinUnknown = 0, + Win311 = 1, + Win95 = 2, + Win98 = 3, + WinME = 4, + WinNT = 5, + Win200 = 6, // removed "renamed to Win2000" + Win2000 = 6, + WinXP = 7, + Win2003 = 8, + WinVista = 9, + Win7 = 10, // removed "renamed to Windows7" + Windows7 = 10, + Win2008 = 11, + Win2012 = 12, + Win8 = 13, // removed "renamed to Windows8" + Windows8 = 13, + Win81 = 14, // removed "renamed to Windows81" + Windows81 = 14, + Win2012R2 = 15, + Win10 = 16, // removed "renamed to Windows10" + Windows10 = 16, + + WinMAX = 15, + + Max = 26, +} + +export enum EServerType { + Invalid = -1, + First = 0, + + Shell = 0, + GM = 1, + BUM = 2, // removed + BUMOBOSOLETE = 2, // removed + AM = 3, + BS = 4, + VS = 5, + ATS = 6, + CM = 7, + FBS = 8, + FG = 9, // removed "renamed to BoxMonitor" + BoxMonitor = 9, + SS = 10, + DRMS = 11, + HubOBSOLETE = 12, // removed + Console = 13, + ASBOBSOLETE = 14, // removed + PICS = 14, + Client = 15, + BootstrapOBSOLETE = 16, // removed, + DP = 17, + WG = 18, + SM = 19, + SLC = 20, + UFS = 21, + Util = 23, + DSS = 24, // removed "renamed to Community" + Community = 24, + P2PRelayOBSOLETE = 25, // removed + AppInformation = 26, + Spare = 27, + FTS = 28, + EPM = 29, // removed + EPMOBSOLETE = 29, // removed + PS = 30, + IS = 31, + CCS = 32, + DFS = 33, + LBS = 34, + MDS = 35, + CS = 36, + GC = 37, + NS = 38, + OGS = 39, + WebAPI = 40, + UDS = 41, + MMS = 42, + GMS = 43, + KGS = 44, + UCM = 45, + RM = 46, + FS = 47, + Econ = 48, + Backpack = 49, + UGS = 50, + Store = 51, // removed "renamed to StoreFeature" + StoreFeature = 51, + MoneyStats = 52, + CRE = 53, + UMQ = 54, + Workshop = 55, + BRP = 56, + GCH = 57, + MPAS = 58, + Trade = 59, + Secrets = 60, + Logsink = 61, + Market = 62, + Quest = 63, + WDS = 64, + ACS = 65, + PNP = 66, + TaxForm = 67, + ExternalMonitor = 68, + Parental = 69, + PartnerUpload = 70, + Partner = 71, + ES = 72, + DepotWebContent = 73, + ExternalConfig = 74, + GameNotifications = 75, + MarketRepl = 76, + MarketSearch = 77, + Localization = 78, + Steam2Emulator = 79, + PublicTest = 80, + SolrMgr = 81, + BroadcastRelay = 82, + BroadcastDirectory = 83, + VideoManager = 84, + TradeOffer = 85, + BroadcastChat = 86, + Phone = 87, + AccountScore = 88, + Support = 89, + LogRequest = 90, + LogWorker = 91, + EmailDelivery = 92, + InventoryManagement = 93, + Auth = 94, + StoreCatalog = 95, + HLTVRelay = 96, + + Max = 97, +} + +export enum EBillingType { + NoCost = 0, + BillOnceOnly = 1, + BillMonthly = 2, + ProofOfPrepurchaseOnly = 3, + GuestPass = 4, + HardwarePromo = 5, + Gift = 6, + AutoGrant = 7, + OEMTicket = 8, + RecurringOption = 9, + BillOnceOrCDKey = 10, + Repurchaseable = 11, + FreeOnDemand = 12, + Rental = 13, + CommercialLicense = 14, + FreeCommercialLicense = 15, + + NumBillingTypes = 16, +} + +export enum EActivationCodeClass { + WonCDKey = 0, + ValveCDKey = 1, + Doom3CDKey = 2, + DBLookup = 3, + Steam2010Key = 4, + Max = 5, + Test = 2147483647, + Invalid = 4294967295, +} + + +export enum EChatMemberStateChange { + Entered = 0x01, + Left = 0x02, + Disconnected = 0x04, + Kicked = 0x08, + Banned = 0x10, + + VoiceSpeaking = 0x1000, + VoiceDoneSpeaking = 0x2000, +} + +export enum ERegionCode { + USEast = 0x00, + USWest = 0x01, + SouthAmerica = 0x02, + Europe = 0x03, + Asia = 0x04, + Australia = 0x05, + MiddleEast = 0x06, + Africa = 0x07, + World = 0xFF, +} + +export enum ECurrencyCode { + Invalid = 0, + + USD = 1, + GBP = 2, + EUR = 3, + CHF = 4, + RUB = 5, + PLN = 6, + BRL = 7, + JPY = 8, + NOK = 9, + IDR = 10, + MYR = 11, + PHP = 12, + SGD = 13, + THB = 14, + VND = 15, + KRW = 16, + TRY = 17, + UAH = 18, + MXN = 19, + CAD = 20, + AUD = 21, + NZD = 22, + CNY = 23, + INR = 24, + CLP = 25, + PEN = 26, + COP = 27, + ZAR = 28, + HKD = 29, + TWD = 30, + SAR = 31, + AED = 32, + ARS = 34, + ILS = 35, + BYN = 36, + KZT = 37, + KWD = 38, + QAR = 39, + CRC = 40, + UYU = 41, + + Max = 42, +} + +export enum EDepotFileFlag { + UserConfig = 1, + VersionedUserConfig = 2, + Encrypted = 4, + ReadOnly = 8, + Hidden = 16, + Executable = 32, + Directory = 64, + CustomExecutable = 128, + InstallScript = 256, + Symlink = 512, +} + +export enum EWorkshopEnumerationType { + RankedByVote = 0, + Recent = 1, + Trending = 2, + FavoriteOfFriends = 3, + VotedByFriends = 4, + ContentByFriends = 5, + RecentFromFollowedUsers = 6, +} + +export enum EPublishedFileVisibility { + Public = 0, + FriendsOnly = 1, + Private = 2, +} + +export enum EWorkshopFileType { + First = 0, + + Community = 0, + Microtransaction = 1, + Collection = 2, + Art = 3, + Video = 4, + Screenshot = 5, + Game = 6, + Software = 7, + Concept = 8, + WebGuide = 9, + IntegratedGuide = 10, + Merch = 11, + ControllerBinding = 12, + SteamworksAccessInvite = 13, + SteamVideo = 14, + GameManagedItem = 15, + + Max = 16, +} + +export enum EWorkshopFileAction { + Played = 0, + Completed = 1, +} + +export enum EEconTradeResponse { + Accepted = 0, + Declined = 1, + TradeBannedInitiator = 2, + TradeBannedTarget = 3, + TargetAlreadyTrading = 4, + Disabled = 5, + NotLoggedIn = 6, + Cancel = 7, + TooSoon = 8, + TooSoonPenalty = 9, + ConnectionFailed = 10, + AlreadyTrading = 11, + AlreadyHasTradeRequest = 12, + NoResponse = 13, + CyberCafeInitiator = 14, + CyberCafeTarget = 15, + SchoolLabInitiator = 16, + SchoolLabTarget = 16, + InitiatorBlockedTarget = 18, + InitiatorNeedsVerifiedEmail = 20, + InitiatorNeedsSteamGuard = 21, + TargetAccountCannotTrade = 22, + InitiatorSteamGuardDuration = 23, + InitiatorPasswordResetProbation = 24, + InitiatorNewDeviceCooldown = 25, + InitiatorSentInvalidCookie = 26, + NeedsEmailConfirmation = 27, + InitiatorRecentEmailChange = 28, + NeedsMobileConfirmation = 29, + TradingHoldForClearedTradeOffersInitiator = 30, + WouldExceedMaxAssetCount = 31, + OKToDeliver = 50, +} + +export enum EMarketingMessageFlags { + None = 0, + + HighPriority = 1, + PlatformWindows = 2, + PlatformMac = 4, + PlatformLinux = 8, + PlatformRestrictions = PlatformWindows | PlatformMac | PlatformLinux, +} + +export enum ENewsUpdateType { + AppNews = 0, + SteamAds = 1, + SteamNews = 2, + CDDBUpdate = 3, + ClientUpdate = 4, +} + +export enum ESystemIMType { + RawText = 0, + InvalidCard = 1, + RecurringPurchaseFailed = 2, + CardWillExpire = 3, + SubscriptionExpired = 4, + GuestPassReceived = 5, + GuestPassGranted = 6, + GiftRevoked = 7, + SupportMessage = 8, + SupportMessageClearAlert = 9, + + Max = 10, +} + +export enum EChatFlags { + Locked = 1, + InvisibleToFriends = 2, + Moderated = 4, + Unjoinable = 8, +} + +export enum ERemoteStoragePlatform { + None = 0, + + Windows = 1, + OSX = 2, + PS3 = 4, + Linux = 8, + Reserved1 = 8, // removed + Reserved2 = 16, + + All = -1, +} + +export enum EDRMBlobDownloadType { + Error = 0, + + File = 1, + Parts = 2, + Compressed = 4, + AllMask = 7, + IsJob = 8, + HighPriority = 16, + AddTimestamp = 32, + LowPriority = 64, +} + +export enum EDRMBlobDownloadErrorDetail { + None = 0, + + DownloadFailed = 1, + TargetLocked = 2, + OpenZip = 3, + ReadZipDirectory = 4, + UnexpectedZipEntry = 5, + UnzipFullFile = 6, + UnknownBlobType = 7, + UnzipStrips = 8, + UnzipMergeGuid = 9, + UnzipSignature = 10, + ApplyStrips = 11, + ApplyMergeGuid = 12, + ApplySignature = 13, + AppIdMismatch = 14, + AppIdUnexpected = 15, + AppliedSignatureCorrupt = 16, + ApplyValveSignatureHeader = 17, + UnzipValveSignatureHeader = 18, + PathManipulationError = 19, + + TargetLocked_Base = 65536, + TargetLocked_Max = 131071, + + NextBase = 131072, +} + +export enum EClientStat { + P2PConnectionsUDP = 0, + P2PConnectionsRelay = 1, + P2PGameConnections = 2, + P2PVoiceConnections = 3, + BytesDownloaded = 4, + + Max = 5, +} + +export enum EClientStatAggregateMethod { + LatestOnly = 0, + Sum = 1, + Event = 2, + Scalar = 3, +} + +export enum ELeaderboardDataRequest { + Global = 0, + GlobalAroundUser = 1, + Friends = 2, + Users = 3, +} + +export enum ELeaderboardSortMethod { + None = 0, + + Ascending = 1, + Descending = 2, +} + +export enum ELeaderboardDisplayType { + None = 0, + Numeric = 1, + TimeSeconds = 2, + TimeMilliSeconds = 3, +} + +export enum ELeaderboardUploadScoreMethod { + None = 0, + + KeepBest = 1, + ForceUpdate = 2, +} + +export enum EUCMFilePrivacyState { + Invalid = -1, + Private = 2, + FriendsOnly = 4, + Public = 8, + + All = Public | FriendsOnly | Private, // 14 +} + +export enum EResult { + Invalid = 0, + + OK = 1, + Fail = 2, + NoConnection = 3, + InvalidPassword = 5, + LoggedInElsewhere = 6, + InvalidProtocolVer = 7, + InvalidParam = 8, + FileNotFound = 9, + Busy = 10, + InvalidState = 11, + InvalidName = 12, + InvalidEmail = 13, + DuplicateName = 14, + AccessDenied = 15, + Timeout = 16, + Banned = 17, + AccountNotFound = 18, + InvalidSteamID = 19, + ServiceUnavailable = 20, + NotLoggedOn = 21, + Pending = 22, + EncryptionFailure = 23, + InsufficientPrivilege = 24, + LimitExceeded = 25, + Revoked = 26, + Expired = 27, + AlreadyRedeemed = 28, + DuplicateRequest = 29, + AlreadyOwned = 30, + IPNotFound = 31, + PersistFailed = 32, + LockingFailed = 33, + LogonSessionReplaced = 34, + ConnectFailed = 35, + HandshakeFailed = 36, + IOFailure = 37, + RemoteDisconnect = 38, + ShoppingCartNotFound = 39, + Blocked = 40, + Ignored = 41, + NoMatch = 42, + AccountDisabled = 43, + ServiceReadOnly = 44, + AccountNotFeatured = 45, + AdministratorOK = 46, + ContentVersion = 47, + TryAnotherCM = 48, + PasswordRequiredToKickSession = 49, + AlreadyLoggedInElsewhere = 50, + Suspended = 51, + Cancelled = 52, + DataCorruption = 53, + DiskFull = 54, + RemoteCallFailed = 55, + PasswordNotSet = 56, // removed "renamed to PasswordUnset" + PasswordUnset = 56, + ExternalAccountUnlinked = 57, + PSNTicketInvalid = 58, + ExternalAccountAlreadyLinked = 59, + RemoteFileConflict = 60, + IllegalPassword = 61, + SameAsPreviousValue = 62, + AccountLogonDenied = 63, + CannotUseOldPassword = 64, + InvalidLoginAuthCode = 65, + AccountLogonDeniedNoMailSent = 66, // removed "renamed to AccountLogonDeniedNoMail" + AccountLogonDeniedNoMail = 66, + HardwareNotCapableOfIPT = 67, + IPTInitError = 68, + ParentalControlRestricted = 69, + FacebookQueryError = 70, + ExpiredLoginAuthCode = 71, + IPLoginRestrictionFailed = 72, + AccountLocked = 73, // removed "renamed to AccountLockedDown" + AccountLockedDown = 73, + AccountLogonDeniedVerifiedEmailRequired = 74, + NoMatchingURL = 75, + BadResponse = 76, + RequirePasswordReEntry = 77, + ValueOutOfRange = 78, + UnexpectedError = 79, + Disabled = 80, + InvalidCEGSubmission = 81, + RestrictedDevice = 82, + RegionLocked = 83, + RateLimitExceeded = 84, + AccountLogonDeniedNeedTwoFactorCode = 85, // removed "renamed to AccountLoginDeniedNeedTwoFactor" + AccountLoginDeniedNeedTwoFactor = 85, + ItemOrEntryHasBeenDeleted = 86, // removed "renamed to ItemDeleted" + ItemDeleted = 86, + AccountLoginDeniedThrottle = 87, + TwoFactorCodeMismatch = 88, + TwoFactorActivationCodeMismatch = 89, + AccountAssociatedToMultiplePlayers = 90, // removed "renamed to AccountAssociatedToMultiplePartners" + AccountAssociatedToMultiplePartners = 90, + NotModified = 91, + NoMobileDeviceAvailable = 92, // removed "renamed to NoMobileDevice" + NoMobileDevice = 92, + TimeIsOutOfSync = 93, // removed "renamed to TimeNotSynced" + TimeNotSynced = 93, + SMSCodeFailed = 94, + TooManyAccountsAccessThisResource = 95, // removed "renamed to AccountLimitExceeded" + AccountLimitExceeded = 95, + AccountActivityLimitExceeded = 96, + PhoneActivityLimitExceeded = 97, + RefundToWallet = 98, + EmailSendFailure = 99, + NotSettled = 100, + NeedCaptcha = 101, + GSLTDenied = 102, + GSOwnerDenied = 103, + InvalidItemType = 104, + IPBanned = 105, + GSLTExpired = 106, + InsufficientFunds = 107, + TooManyPending = 108, + NoSiteLicensesFound = 109, + WGNetworkSendExceeded = 110, +} diff --git a/types/steam-client/steam-client-tests.ts b/types/steam-client/steam-client-tests.ts new file mode 100644 index 0000000000..e330930c36 --- /dev/null +++ b/types/steam-client/steam-client-tests.ts @@ -0,0 +1,38 @@ +import Steam = require("steam-client"); + +const steamClient = new Steam.CMClient(Steam.EConnectionProtocol.TCP); + +steamClient.connect(); +steamClient.connect(Steam.servers[0]); +steamClient.connect(Steam.servers[0], true); + +steamClient.disconnect(); + +steamClient.on<'connected'>('connected', (serverLoad) => { + steamClient.logOn({ + account_name: serverLoad, + password: "password" + }); +}); + +Steam.servers.forEach((server) => server.host); + +steamClient.on<'logOnResponse'>('logOnResponse', (details) => { + return details.eresult + details.webapi_authenticate_user_nonce; +}); + +steamClient.send({ + msg: Steam.EMsg.ClientGetFinalPrice, + proto: { + eresult: Steam.EResult.AdministratorOK + } +}, new Buffer("lol"), (header, body) => { + return header.msg + body.reverse().toString(); +}); + +steamClient.bind("127.0.0.1", 80); + +if (steamClient.loggedOn) { + console.log(steamClient.steamID); + console.log(steamClient.remoteAddress); +} diff --git a/types/steam-client/tsconfig.json b/types/steam-client/tsconfig.json new file mode 100644 index 0000000000..fee2ca9ea3 --- /dev/null +++ b/types/steam-client/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", + "steam-client-tests.ts" + ] +} diff --git a/types/steam-client/tslint.json b/types/steam-client/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/steam-client/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From ad286caf2b792b55f4cee850b0ab999cf975213c Mon Sep 17 00:00:00 2001 From: Edward Sammut Alessi Date: Wed, 21 Mar 2018 14:38:07 +0100 Subject: [PATCH 155/693] Lint changes --- types/steam-client/index.d.ts | 30 +++++++++++++++--------------- types/steam-client/tsconfig.json | 1 + 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/types/steam-client/index.d.ts b/types/steam-client/index.d.ts index ec9f88565f..ff69e39f46 100644 --- a/types/steam-client/index.d.ts +++ b/types/steam-client/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/DoctorMcKay/node-steam-client // Definitions by: Edward Sammut Alessi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// /// @@ -119,7 +120,7 @@ export type SendMessage = ( callback?: SendMessage | false ) => void; -export type CMEventCallback = { +export interface CMEventCallback { /** * Connection closed by the server. * Only emitted if the encryption handshake is complete, otherwise it will reconnect automatically (unless you disabled autoRetry). @@ -127,7 +128,7 @@ export type CMEventCallback = { * * @param err An Error object. May contain an eresult property. */ - error: (err: Error) => void, + error: (err: Error) => void; /** * Encryption handshake complete. @@ -136,14 +137,14 @@ export type CMEventCallback = { * * @param serverLoad The load value of the CM server you're connected to. Only available if you're connecting using UDP. It's unclear at this time what scale this value uses. */ - connected: (serverLoad: string) => void, + connected: (serverLoad: string) => void; /** * Logon response received. If eresult is EResult.OK, loggedOn is now true. * * @param response An object with the properties in CMsgClientLogonResponse */ - logOnResponse: (response: CMsgClientLogonResponse) => void, + logOnResponse: (response: CMsgClientLogonResponse) => void; /** * CMClient will use this new list when reconnecting, but it will be lost when your application restarts. @@ -154,21 +155,21 @@ export type CMEventCallback = { * * @param servers An array containing the up-to-date server list */ - servers: (servers: Server[]) => void, + servers: (servers: Server[]) => void; /** * You were logged off from Steam. loggedOn is now false. * * @param eresesult A value from EResult */ - loggedOff: (eresesult: EResult) => void, + loggedOff: (eresesult: EResult) => void; - message: SendMessage, -}; + message: SendMessage; +} -export type Server = { - host: string, - port: string | number, +export interface Server { + host: string; + port: string | number; } // Protobufs @@ -191,7 +192,8 @@ export interface CMsgClientLogon { /** * SHA1 hash of your sentry file. - * If not provided, Steam will send you a sentry file through the ClientUpdateMachineAuth message (unless a limit for registered sentries is reached? see https://github.com/seishun/node-steam/issues/178). + * If not provided, Steam will send you a sentry file through the ClientUpdateMachineAuth message + * (unless a limit for registered sentries is reached? see https://github.com/seishun/node-steam/issues/178). * If no Steam Guard code is provided, the hash must be already registered with this account, otherwise it's ignored. * This value will be ignored if you enable 2FA. */ @@ -989,7 +991,6 @@ export enum EMsg { CCSDeleteAllCommentsByAuthor = 3161, CCSDeleteAllCommentsByAuthorResponse = 3162, - BaseLBSRange = 3200, LBSSetScore = 3201, LBSSetScoreResponse = 3202, @@ -2647,7 +2648,7 @@ export enum EChatRoomEnterResponse { // these appear to have been removed NoRankingDataLobby = 12, // removed NoRankingDataUser = 13, // removed - RankOutOfRange = 14, //removed + RankOutOfRange = 14, // removed } export enum EChatRoomType { @@ -2954,7 +2955,6 @@ export enum EActivationCodeClass { Invalid = 4294967295, } - export enum EChatMemberStateChange { Entered = 0x01, Left = 0x02, diff --git a/types/steam-client/tsconfig.json b/types/steam-client/tsconfig.json index fee2ca9ea3..a619b6452a 100644 --- a/types/steam-client/tsconfig.json +++ b/types/steam-client/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From 17805e6b66c507944861b965495cd7a2cb9c1bb9 Mon Sep 17 00:00:00 2001 From: Chris Moyer Date: Wed, 21 Mar 2018 10:24:37 -0400 Subject: [PATCH 156/693] 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 a08461c40539fb1b95492dbfea634b6cfc8e9363 Mon Sep 17 00:00:00 2001 From: Walter Rumsby Date: Thu, 22 Mar 2018 11:10:51 +1300 Subject: [PATCH 157/693] Tidy up --- types/mem-fs/index.d.ts | 16 +++++++++------- types/mem-fs/mem-fs-tests.ts | 2 ++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/types/mem-fs/index.d.ts b/types/mem-fs/index.d.ts index 08a3067637..13d1c27105 100644 --- a/types/mem-fs/index.d.ts +++ b/types/mem-fs/index.d.ts @@ -3,18 +3,20 @@ // Definitions by: My Food Bag // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import events = require('events'); -import stream = require('stream'); -import File = require('vinyl'); +/// -export function create(...args: any[]): create.Store; +import { EventEmitter } from 'events'; +import { Transform } from 'stream'; +import * as File from 'vinyl'; -export namespace create { - interface Store extends events.EventEmitter { +export function create(...args: any[]): memFs.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: () => stream.Transform; + stream: () => Transform; } const prototype: { diff --git a/types/mem-fs/mem-fs-tests.ts b/types/mem-fs/mem-fs-tests.ts index bb925837aa..13a2649f19 100644 --- a/types/mem-fs/mem-fs-tests.ts +++ b/types/mem-fs/mem-fs-tests.ts @@ -4,3 +4,5 @@ const store = fs.create(); const file = store.get('hello'); store.add(file, 'hahahahah'); + +store.each((file, index) => console.log(index, file.path)); From b1c423f0f9e2b07671ba56c72d94cf5e6ef72800 Mon Sep 17 00:00:00 2001 From: marcofalsitta Date: Thu, 22 Mar 2018 08:23:27 +0100 Subject: [PATCH 158/693] 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 159/693] 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 160/693] 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 161/693] 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 162/693] 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 ee4eaf0cff4413f05af3c9f5dabefb9d4a78df35 Mon Sep 17 00:00:00 2001 From: Edward Sammut Alessi Date: Thu, 22 Mar 2018 18:31:50 +0100 Subject: [PATCH 163/693] Extend event emitter --- types/steam-client/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/steam-client/index.d.ts b/types/steam-client/index.d.ts index ff69e39f46..97b386649c 100644 --- a/types/steam-client/index.d.ts +++ b/types/steam-client/index.d.ts @@ -7,7 +7,7 @@ /// /// -export class CMClient { +export class CMClient extends NodeJS.EventEmitter { /** * A boolean that indicates whether you are currently connected and the encryption handshake is complete. * 'connected' is emitted when it changes to true, and 'error' is emitted when it changes to false unless you called disconnect. @@ -81,7 +81,7 @@ export class CMClient { // Events - on(eventType: T, callback: CMEventCallback[T]): void; + on(eventType: T, callback: CMEventCallback[T]): this; } /** From 2efa8936a13d2f8273b04d626658e31f06930780 Mon Sep 17 00:00:00 2001 From: Behind The Math Date: Thu, 22 Mar 2018 15:53:25 -0400 Subject: [PATCH 164/693] 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 bffcb83f7ec54c26ae602245da8c9c69c9ad1c65 Mon Sep 17 00:00:00 2001 From: Hugues Stefanski Date: Thu, 22 Mar 2018 21:20:07 +0100 Subject: [PATCH 165/693] d3-geo v1.10 : added projection.angle method --- types/d3-geo/d3-geo-tests.ts | 3 +++ types/d3-geo/index.d.ts | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/types/d3-geo/d3-geo-tests.ts b/types/d3-geo/d3-geo-tests.ts index c4508351a0..5124694378 100644 --- a/types/d3-geo/d3-geo-tests.ts +++ b/types/d3-geo/d3-geo-tests.ts @@ -395,6 +395,9 @@ constructedProjection = constructedProjection.translate([480, 250]); const center: [number, number] = constructedProjection.center(); constructedProjection = constructedProjection.center([0, 0]); +const angle = constructedProjection.angle(); +constructedProjection = constructedProjection.angle(45); + const rotate: [number, number, number] = constructedProjection.rotate(); constructedProjection = constructedProjection.rotate([0, 0]); constructedProjection = constructedProjection.rotate([0, 0, 0]); diff --git a/types/d3-geo/index.d.ts b/types/d3-geo/index.d.ts index 7efbb72010..a7fc0e9094 100644 --- a/types/d3-geo/index.d.ts +++ b/types/d3-geo/index.d.ts @@ -887,7 +887,15 @@ export interface GeoProjection extends GeoStreamWrapper { * @param precision A numeric value in pixels to use as the threshold for the projection’s adaptive resampling. */ precision(precision: number): this; - + /** + * Returns the projection’s current angle, which defaults to 0°. + */ + angle(): number; + /** + * Sets the projection’s post-projection planar rotation angle to the specified angle in degrees and returns the projection. + * @param angle The new rotation angle of the projection. + */ + angle(angle: number): this; /** * Returns the current rotation [lambda, phi, gamma] specifying the rotation angles in degrees about each spherical axis. * (These correspond to yaw, pitch and roll.) which defaults [0, 0, 0]. From 8a2283e0e6f36f88c708407511e5f5093bad634b Mon Sep 17 00:00:00 2001 From: Hugues Stefanski Date: Thu, 22 Mar 2018 21:23:19 +0100 Subject: [PATCH 166/693] d3-geo version increase --- types/d3-geo/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/d3-geo/index.d.ts b/types/d3-geo/index.d.ts index a7fc0e9094..d9f0931269 100644 --- a/types/d3-geo/index.d.ts +++ b/types/d3-geo/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for D3JS d3-geo module 1.9 +// Type definitions for D3JS d3-geo module 1.10 // Project: https://github.com/d3/d3-geo/ // Definitions by: Hugues Stefanski , Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// Last module patch version validated against: 1.9.0 +// Last module patch version validated against: 1.10.0 import * as GeoJSON from 'geojson'; From dbb40c14f8a9901796e293d64adcad9c1fe9b789 Mon Sep 17 00:00:00 2001 From: Michael Zabka Date: Thu, 22 Mar 2018 21:17:22 +0100 Subject: [PATCH 167/693] 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 168/693] 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 169/693] 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 170/693] 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 47337073e16adc1c22cda1f3237cfa1e231f36ae Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Fri, 23 Mar 2018 03:37:32 +0300 Subject: [PATCH 171/693] add types for seededshuffle --- types/seededshuffle/index.d.ts | 13 ++++++++++++ types/seededshuffle/seededshuffle-tests.ts | 7 +++++++ types/seededshuffle/tsconfig.json | 23 ++++++++++++++++++++++ types/seededshuffle/tslint.json | 1 + 4 files changed, 44 insertions(+) create mode 100644 types/seededshuffle/index.d.ts create mode 100644 types/seededshuffle/seededshuffle-tests.ts create mode 100644 types/seededshuffle/tsconfig.json create mode 100644 types/seededshuffle/tslint.json diff --git a/types/seededshuffle/index.d.ts b/types/seededshuffle/index.d.ts new file mode 100644 index 0000000000..d32e5e3de1 --- /dev/null +++ b/types/seededshuffle/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for seededshuffle 0.2 +// Project: https://github.com/LouisT/SeededShuffle +// Definitions by: Uri Shaked +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export const seed: number; +export const strSeed: string; + +export function shuffle(arr: T[], seed: string|number): T[]; +export function shuffle(arr: ReadonlyArray, seed: string|number, copy: true): T[]; + +export function unshuffle(arr: T[], seed: string|number): T[]; +export function unshuffle(arr: ReadonlyArray, seed: string|number, copy: true): T[]; diff --git a/types/seededshuffle/seededshuffle-tests.ts b/types/seededshuffle/seededshuffle-tests.ts new file mode 100644 index 0000000000..3abbd8ca71 --- /dev/null +++ b/types/seededshuffle/seededshuffle-tests.ts @@ -0,0 +1,7 @@ +import { shuffle, unshuffle } from 'seededshuffle'; + +const a: number[] = shuffle([1, 2, 3] as ReadonlyArray, 'Example seed', true); +const b: number[] = unshuffle(a as ReadonlyArray, 'Example seed', true); + +const c: string[] = shuffle(['a', 'b', 'c'], 'another seed'); +const d: string[] = unshuffle(c, 'another seed'); diff --git a/types/seededshuffle/tsconfig.json b/types/seededshuffle/tsconfig.json new file mode 100644 index 0000000000..e816622b91 --- /dev/null +++ b/types/seededshuffle/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", + "seededshuffle-tests.ts" + ] +} diff --git a/types/seededshuffle/tslint.json b/types/seededshuffle/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/seededshuffle/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 8d0bdd3e2edac1c405035243999848b3fd0ba375 Mon Sep 17 00:00:00 2001 From: Ricardo De Pena Date: Thu, 22 Mar 2018 22:41:18 -0400 Subject: [PATCH 172/693] 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 196d13df6f5dca28bdb6db85d87b3059033f8263 Mon Sep 17 00:00:00 2001 From: Walter Rumsby Date: Fri, 23 Mar 2018 16:09:12 +1300 Subject: [PATCH 173/693] Update based on PR comments --- types/mem-fs/mem-fs-tests.ts | 2 +- types/mem-fs/tslint.json | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/types/mem-fs/mem-fs-tests.ts b/types/mem-fs/mem-fs-tests.ts index 13a2649f19..ada05c22c7 100644 --- a/types/mem-fs/mem-fs-tests.ts +++ b/types/mem-fs/mem-fs-tests.ts @@ -5,4 +5,4 @@ const file = store.get('hello'); store.add(file, 'hahahahah'); -store.each((file, index) => console.log(index, file.path)); +store.each(file => console.dir(store.get(file.path))); diff --git a/types/mem-fs/tslint.json b/types/mem-fs/tslint.json index 2ff396e742..f93cf8562a 100644 --- a/types/mem-fs/tslint.json +++ b/types/mem-fs/tslint.json @@ -1,6 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - - } + "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 174/693] 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 175/693] 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 c7b050517023ebae62e0068c08609ba212679f43 Mon Sep 17 00:00:00 2001 From: Jiaren Liu Date: Fri, 23 Mar 2018 13:48:42 +0800 Subject: [PATCH 176/693] add definition for mini-css-extract-plugin --- types/mini-css-extract-plugin/index.d.ts | 32 ++++++++++ .../mini-css-extract-plugin-tests.ts | 58 +++++++++++++++++++ types/mini-css-extract-plugin/tsconfig.json | 23 ++++++++ types/mini-css-extract-plugin/tslint.json | 1 + 4 files changed, 114 insertions(+) create mode 100644 types/mini-css-extract-plugin/index.d.ts create mode 100644 types/mini-css-extract-plugin/mini-css-extract-plugin-tests.ts create mode 100644 types/mini-css-extract-plugin/tsconfig.json create mode 100644 types/mini-css-extract-plugin/tslint.json diff --git a/types/mini-css-extract-plugin/index.d.ts b/types/mini-css-extract-plugin/index.d.ts new file mode 100644 index 0000000000..f9b57632ef --- /dev/null +++ b/types/mini-css-extract-plugin/index.d.ts @@ -0,0 +1,32 @@ +// Type definitions for mini-css-extract-plugin 0.2 +// Project: https://github.com/webpack-contrib/mini-css-extract-plugin +// Definitions by: JounQin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Loader, Plugin } from 'webpack'; + +/** + * Lightweight CSS extraction webpack plugin + * This plugin extract CSS into separate files. It creates a CSS file per JS file which contains CSS. It supports On-Demand-Loading of CSS and SourceMaps. + * Configuration Detail: https://github.com/webpack-contrib/mini-css-extract-plugin#configuration + */ +declare class MiniCssExtractPlugin extends Plugin { + /** webpack loader used always at the end of loaders list */ + static loader: Loader; + + constructor(options?: MiniCssExtractPlugin.PluginOptions); +} + +declare namespace MiniCssExtractPlugin { + interface PluginOptions { + /** + * Options similar to the same options in webpackOptions.output, both options are optional + * May contain `[name]`, `[id]`, `hash` and `[chunkhash]` + */ + filename?: string; + chunkFilename?: string; + } +} + +export = MiniCssExtractPlugin; diff --git a/types/mini-css-extract-plugin/mini-css-extract-plugin-tests.ts b/types/mini-css-extract-plugin/mini-css-extract-plugin-tests.ts new file mode 100644 index 0000000000..9d418ed211 --- /dev/null +++ b/types/mini-css-extract-plugin/mini-css-extract-plugin-tests.ts @@ -0,0 +1,58 @@ +import webpack = require('webpack'); +import MiniCssExtractPlugin = require('mini-css-extract-plugin'); + +let configuration: webpack.Configuration; + +configuration = { + // The standard entry point and output config + entry: { + posts: './posts', + post: './post', + about: './about', + }, + output: { + filename: '[name].js', + chunkFilename: '[id].js', + }, + module: { + rules: [ + // Extract css files + { + test: /\.css$/, + use: [MiniCssExtractPlugin.loader, 'css-loader'], + }, + // Optionally extract less files + // or any other compile-to-css language + { + test: /\.less$/, + use: [ + MiniCssExtractPlugin.loader, + 'css-loader', + 'style-loader', + ], + }, + // You could also use other loaders the same way. I. e. the autoprefixer-loader + ], + }, + // Use the plugin to specify the resulting filename (and add needed behavior to the compiler) + plugins: [ + new MiniCssExtractPlugin({ + filename: '[name].css', + }), + ], +}; + +configuration = { + // ... + plugins: [new MiniCssExtractPlugin()], +}; + +configuration = { + // ... + plugins: [ + new MiniCssExtractPlugin({ + filename: 'styles.css', + chunkFilename: 'style.css', + }), + ], +}; diff --git a/types/mini-css-extract-plugin/tsconfig.json b/types/mini-css-extract-plugin/tsconfig.json new file mode 100644 index 0000000000..e79daeceef --- /dev/null +++ b/types/mini-css-extract-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", + "mini-css-extract-plugin-tests.ts" + ] +} diff --git a/types/mini-css-extract-plugin/tslint.json b/types/mini-css-extract-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mini-css-extract-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 8d4ee5cd512c407721d8e33d507f1312a6e6f512 Mon Sep 17 00:00:00 2001 From: Jovica Zoric Date: Fri, 23 Mar 2018 10:09:33 +0100 Subject: [PATCH 177/693] 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 178/693] 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 179/693] 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 180/693] [@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 181/693] [@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 182/693] 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 183/693] @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 184/693] 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 185/693] 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 ec2685287a29cdbcd146db59b460391d49487596 Mon Sep 17 00:00:00 2001 From: Justin Chew Date: Fri, 23 Mar 2018 14:14:15 +0000 Subject: [PATCH 186/693] 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 187/693] [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 188/693] 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 189/693] 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 190/693] 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 191/693] 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 192/693] 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 193/693] 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 194/693] 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 195/693] 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 196/693] 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 197/693] 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 198/693] [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 199/693] 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 200/693] =?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 201/693] 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 202/693] [@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 203/693] [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 204/693] 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 205/693] [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 206/693] 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 207/693] 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 c5e3a155758aace83ce97f5615cc1671972f2e9f Mon Sep 17 00:00:00 2001 From: Walter Rumsby Date: Sat, 24 Mar 2018 07:13:02 +1300 Subject: [PATCH 208/693] Remove prototype --- types/mem-fs/index.d.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/types/mem-fs/index.d.ts b/types/mem-fs/index.d.ts index 13d1c27105..da6a209bb6 100644 --- a/types/mem-fs/index.d.ts +++ b/types/mem-fs/index.d.ts @@ -18,7 +18,4 @@ export namespace memFs { get: (filepath: string) => File; stream: () => Transform; } - - const prototype: { - }; } From a9dc8167a09f03aa3c2247ece908cb4abd6c185f Mon Sep 17 00:00:00 2001 From: Walter Rumsby Date: Sat, 24 Mar 2018 07:27:28 +1300 Subject: [PATCH 209/693] Remove readme from project link --- types/mem-fs/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mem-fs/index.d.ts b/types/mem-fs/index.d.ts index da6a209bb6..0cece1da38 100644 --- a/types/mem-fs/index.d.ts +++ b/types/mem-fs/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for mem-fs 1.1 -// Project: https://github.com/sboudrias/mem-fs#readme +// Project: https://github.com/sboudrias/mem-fs // Definitions by: My Food Bag // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 9363c54fa9da9dcf7c7e2264464eee0b9ddf9c48 Mon Sep 17 00:00:00 2001 From: Daniel Imhoff Date: Fri, 23 Mar 2018 14:48:30 -0500 Subject: [PATCH 210/693] 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 211/693] 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 212/693] 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 213/693] 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 214/693] 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 215/693] [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 216/693] 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 217/693] 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 218/693] [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 219/693] 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 220/693] 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 221/693] 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 222/693] 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 223/693] 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 224/693] 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 225/693] 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 226/693] 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 227/693] 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 228/693] 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 229/693] 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 230/693] 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 231/693] 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 232/693] 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 233/693] 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 234/693] [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 235/693] 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 236/693] 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 237/693] 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 238/693] 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 239/693] 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 240/693] 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 241/693] 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 242/693] 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 243/693] 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 244/693] 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 245/693] 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 246/693] 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 247/693] 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 248/693] 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 249/693] 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 250/693] 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 251/693] 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 252/693] 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 253/693] 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 254/693] 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 255/693] 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 256/693] 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 257/693] `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 258/693] 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 259/693] 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 260/693] 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 261/693] 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 262/693] 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 263/693] 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 264/693] 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 265/693] 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 266/693] 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 267/693] 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 268/693] 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 269/693] 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 270/693] 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 271/693] 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 272/693] 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 273/693] 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 274/693] 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 275/693] 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 276/693] 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 277/693] 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 278/693] 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 279/693] 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 280/693] [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 281/693] 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 282/693] 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 283/693] 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 284/693] @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 285/693] 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 286/693] 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 287/693] 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 288/693] 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 289/693] 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 290/693] 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 291/693] 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 292/693] 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 293/693] 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 294/693] 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 295/693] 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 296/693] 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 297/693] 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 298/693] 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 299/693] 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 300/693] 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 301/693] 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 302/693] 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 303/693] 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 304/693] 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 305/693] 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 306/693] 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 307/693] 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 308/693] 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 309/693] 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 310/693] 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 311/693] 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 312/693] 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 313/693] 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 314/693] 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 315/693] 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 316/693] 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 317/693] 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 318/693] 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 319/693] 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 320/693] 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 321/693] 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 322/693] 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 323/693] 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 324/693] 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 325/693] 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 326/693] 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 327/693] 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 328/693] 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 329/693] 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 330/693] 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 331/693] 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 332/693] 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 333/693] 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 334/693] 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 335/693] 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 336/693] 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 337/693] 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 338/693] 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 339/693] 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 340/693] 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 341/693] 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 342/693] 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 343/693] 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 344/693] 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 345/693] 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 346/693] 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 347/693] 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 348/693] 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 349/693] 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 350/693] 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 351/693] 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 352/693] 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 353/693] 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 354/693] 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 355/693] 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 356/693] [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 357/693] 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 358/693] 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 359/693] 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 360/693] 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 361/693] 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 362/693] 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 363/693] 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 364/693] 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 365/693] 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 366/693] 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 367/693] 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 368/693] [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 369/693] [@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 370/693] 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 371/693] 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 372/693] 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 373/693] 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 374/693] 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 375/693] 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 376/693] 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 377/693] 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 378/693] 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 379/693] 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 380/693] 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 381/693] 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 382/693] 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 383/693] 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 384/693] 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 385/693] 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 386/693] 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 387/693] 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 388/693] [@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 389/693] [@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 390/693] 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 391/693] 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 392/693] [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 393/693] 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 394/693] 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 395/693] [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 396/693] 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 397/693] 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 398/693] 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 399/693] 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 400/693] 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 401/693] 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 402/693] 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 403/693] 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 404/693] 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 405/693] 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 406/693] 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 407/693] 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 408/693] 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 409/693] 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 410/693] 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 411/693] 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 412/693] 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 413/693] [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 414/693] 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 415/693] [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 416/693] 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 417/693] 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 418/693] [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 419/693] [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 420/693] 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 421/693] 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 422/693] 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 423/693] 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 424/693] 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 425/693] 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 426/693] 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 427/693] 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 428/693] 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 429/693] 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 430/693] 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 431/693] 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 432/693] 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 433/693] 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 434/693] 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 435/693] 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 436/693] 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 437/693] 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 438/693] 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 439/693] 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 440/693] 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 441/693] 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 442/693] 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 443/693] 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 444/693] [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 445/693] [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 446/693] 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 447/693] 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 448/693] 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 449/693] 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 450/693] 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 451/693] 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 452/693] 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 453/693] 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 454/693] 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 455/693] [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 456/693] 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 457/693] 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 458/693] [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 459/693] [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 460/693] 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 461/693] 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 462/693] 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 463/693] 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 464/693] 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 465/693] [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 466/693] [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 467/693] 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 468/693] 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 469/693] 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 470/693] 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 471/693] 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 472/693] 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 473/693] 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 474/693] 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 475/693] 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 476/693] 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 477/693] 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 478/693] 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 479/693] 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 480/693] [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 481/693] 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 482/693] 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 483/693] 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 484/693] 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 485/693] 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 486/693] 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 487/693] 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 488/693] [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 489/693] 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 490/693] [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 491/693] 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 492/693] 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 493/693] 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 494/693] 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 495/693] 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 496/693] 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 497/693] 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 498/693] 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 499/693] 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 500/693] 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 501/693] 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 502/693] 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 503/693] 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 504/693] [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 505/693] [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 506/693] 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 507/693] [@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 508/693] 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 509/693] 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 510/693] 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 511/693] 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 512/693] 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 513/693] 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 514/693] 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 515/693] 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 516/693] 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 517/693] 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 518/693] 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 519/693] [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 520/693] 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 521/693] 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 522/693] [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 523/693] [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 524/693] 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 525/693] 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 526/693] [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 527/693] [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 528/693] 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 529/693] [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 530/693] 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 531/693] [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 532/693] 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 533/693] [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 534/693] 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 535/693] [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 536/693] 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 537/693] 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 538/693] 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 539/693] 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 540/693] 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 541/693] 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 542/693] 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 543/693] 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 544/693] [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 545/693] [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 546/693] 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 547/693] 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 548/693] [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 549/693] 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 550/693] 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 551/693] 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 552/693] 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 553/693] 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 554/693] 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 555/693] 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 556/693] 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 557/693] 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 558/693] 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 559/693] 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 560/693] [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 561/693] 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 562/693] 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 563/693] 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 564/693] 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 565/693] 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 566/693] 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 567/693] [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 568/693] 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 569/693] 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 570/693] @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 571/693] 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 572/693] 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 573/693] 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 574/693] 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 575/693] [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 576/693] 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 577/693] 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 578/693] [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 579/693] 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 580/693] 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 581/693] 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 582/693] [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 583/693] 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 584/693] 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 585/693] 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 586/693] 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 587/693] 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 588/693] 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 589/693] 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 590/693] 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 591/693] 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 592/693] [@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 593/693] 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 594/693] 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 595/693] 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 596/693] 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 597/693] [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 598/693] 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 599/693] 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 600/693] 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 601/693] 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 602/693] [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 625/693] [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 626/693] 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 627/693] 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 628/693] 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 629/693] @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 630/693] 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 631/693] 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 632/693] [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 633/693] 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 634/693] 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 635/693] 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 636/693] [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 637/693] [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 638/693] 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 639/693] 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 640/693] 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 641/693] 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 642/693] 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 643/693] [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 644/693] 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 645/693] 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 646/693] 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 647/693] 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 648/693] 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 649/693] 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 650/693] 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 651/693] [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 652/693] 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 653/693] [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 654/693] 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 655/693] 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 656/693] [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 657/693] 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 658/693] [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 659/693] 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 660/693] 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 661/693] 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 662/693] 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 663/693] [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 664/693] [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 665/693] 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 666/693] [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 667/693] [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 668/693] 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 669/693] [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 670/693] 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 671/693] 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 672/693] 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 673/693] 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 674/693] 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 675/693] 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 676/693] 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 677/693] 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 678/693] 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 679/693] 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 680/693] 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 681/693] 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 682/693] 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 683/693] 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 684/693] [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 685/693] 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 686/693] 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 687/693] 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 688/693] 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 689/693] 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 690/693] [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 691/693] 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 692/693] 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 693/693] [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