diff --git a/types/applicationinsights-js/applicationinsights-js-tests.ts b/types/applicationinsights-js/applicationinsights-js-tests.ts index 8967356426..ecefb6d41a 100644 --- a/types/applicationinsights-js/applicationinsights-js-tests.ts +++ b/types/applicationinsights-js/applicationinsights-js-tests.ts @@ -118,7 +118,18 @@ const envelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(dat context.track(envelope); -context.addTelemetryInitializer(telemetryEnvelope => false); +context.addTelemetryInitializer(envelope => false); +context.addTelemetryInitializer(envelope => { }); + +// a sample from: https://github.com/Microsoft/ApplicationInsights-JS/blob/master/API-reference.md#example +context.addTelemetryInitializer(envelope => { + let telemetryItem = envelope.data.baseData; + if (envelope.name === Microsoft.ApplicationInsights.Telemetry.PageView.envelopeType) { + telemetryItem.url = "URL CENSORED"; + } + telemetryItem.properties = telemetryItem.properties || {}; + telemetryItem.properties["globalProperty"] = "boo"; +}); // track event const eventObj = new Microsoft.ApplicationInsights.Telemetry.Event("test", null, null); diff --git a/types/applicationinsights-js/index.d.ts b/types/applicationinsights-js/index.d.ts index 0a01d726a4..17137d67dd 100644 --- a/types/applicationinsights-js/index.d.ts +++ b/types/applicationinsights-js/index.d.ts @@ -572,6 +572,7 @@ declare module Microsoft.ApplicationInsights { isPerfAnalyzerEnabled?: boolean; url?: string; isStorageUseDisabled?: boolean; + isBeaconApiDisabled?: boolean; } /** @@ -611,6 +612,7 @@ declare module Microsoft.ApplicationInsights { tags: { [name: string]: any; }; + data: any; } interface ITelemetryContext { @@ -650,7 +652,7 @@ declare module Microsoft.ApplicationInsights { * Adds telemetry initializer to the collection. Telemetry initializers will be called one by one * before telemetry item is pushed for sending and in the order they were added. */ - addTelemetryInitializer(telemetryInitializer: (envelope: Microsoft.ApplicationInsights.IEnvelope) => boolean): any; + addTelemetryInitializer(telemetryInitializer: (envelope: Microsoft.ApplicationInsights.IEnvelope) => boolean | void): any; /** * Tracks telemetry object. */ diff --git a/types/bunyan/index.d.ts b/types/bunyan/index.d.ts index d46396023f..bc1dca298d 100644 --- a/types/bunyan/index.d.ts +++ b/types/bunyan/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-bunyan 1.8 +// Type definitions for bunyan 1.8 // Project: https://github.com/trentm/node-bunyan // Definitions by: Alex Mikhalev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/chartist/chartist-tests.ts b/types/chartist/chartist-tests.ts index 2a4a362e7e..13a7c7dd1c 100644 --- a/types/chartist/chartist-tests.ts +++ b/types/chartist/chartist-tests.ts @@ -401,3 +401,29 @@ var overlappingBarsResponsiveOptions: Array +// Definitions by: Matt Gibbs , Simon Pfeifer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Chartist { @@ -20,6 +20,7 @@ declare namespace Chartist { Pie: IChartistPieChart; Bar: IChartistBarChart; Line: IChartistLineChart; + Candle: IChartistCandleChart; FixedScaleAxis: IFixedScaleAxisStatic; AutoScaleAxis: IAutoScaleAxisStatic; @@ -138,6 +139,10 @@ declare namespace Chartist { new (target: any, data: IChartistData, options?: IBarChartOptions, responsiveOptions?: Array>): IChartistBarChart; } + interface IChartistCandleChart extends IChartistBase { + new (target: any, data: IChartistData, options?: ICandleChartOptions, responsiveOptions?: Array>): IChartistCandleChart; + } + interface IChartOptions { /** * If true the whole data is reversed including labels, the series order as well as the whole series data arrays. @@ -352,6 +357,124 @@ declare namespace Chartist { end?: string; } + interface ICandleChartOptions extends IChartOptions { + + /** + * Options for X-Axis + */ + axisX?: ICandleChartAxis; + + /** + * Options for Y-Axis + */ + axisY?: ICandleChartAxis; + + /** + * Specify a fixed width for the chart as a string (i.e. '100px' or '50%') + */ + width?: number | string; + + /** + * Specify a fixed height for the chart as a string (i.e. '100px' or '50%') + */ + height?: number | string; + + /** + * Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value + */ + hight?: number | string; + + /** + * Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value + */ + low?: number | string; + + /** + * Width of candle body in pixel (IMO is 2 px best minimum value) + */ + candleWidth?: number | string; + + /** + * Width of candle wick in pixel (IMO is 1 px best minimum value) + */ + candleWickWidth?: number | string; + + /** + * Use calculated x-axis step length, depending on the number of quotes to display, as candle width. Otherwise the candleWidth is being used. + */ + useStepLengthAsCandleWidth?: boolean | string; + + /** + * Use 1/3 of candle body width as width for the candle wick, otherwise the candleWickWidth is being used. + */ + useOneThirdAsCandleWickWidth?: boolean | string; + + /** + * Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} + */ + chartPadding?: IChartPadding | number; + + /** + * When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler. + */ + fullWidth?: boolean | string; + + /** + * Override the class names that get used to generate the SVG structure of the chart + */ + classNames?: ICandleChartClasses; + } + + interface ICandleChartAxis { + /** + * The offset of the chart drawing area to the border of the container + */ + offset?: number; + /** + * Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. + */ + position?: string; + /** + * Allows you to correct label positioning on this axis by positive or negative x and y offset. + */ + labelOffset?: { + x?: number; + y?: number; + }; + /** + * If labels should be shown or not + */ + showLabel?: boolean; + /** + * If the axis grid should be drawn or not + */ + showGrid?: boolean; + /** + * Interpolation function that allows you to intercept the value from the axis label + */ + labelInterpolationFnc?: Function; + /** + * Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here. + */ + type?: any; + } + + interface ICandleChartClasses { + chart?: string; + label?: string; + labelGroup?: string; + series?: string; + candlePositive?: string; + candleNegative?: string, + grid?: string, + gridGroup?: string, + gridBackground?: string, + vertical?: string, + horizontal?: string, + start?: string, + end?: string, + } + interface ChartistSvgStatic { new (name: HTMLElement | string, attributes: Object, className?: string, parent?: Object, insertFirst?: boolean): IChartistSvg; diff --git a/types/convict/index.d.ts b/types/convict/index.d.ts index 395d540875..82b22ba2db 100644 --- a/types/convict/index.d.ts +++ b/types/convict/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-convict v3.0.0 +// Type definitions for convict 3.0 // Project: https://github.com/mozilla/node-convict // Definitions by: Wim Looman , Vesa Poikajärvi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/d3-zoom/d3-zoom-tests.ts b/types/d3-zoom/d3-zoom-tests.ts index de213d5149..185b9fd45a 100644 --- a/types/d3-zoom/d3-zoom-tests.ts +++ b/types/d3-zoom/d3-zoom-tests.ts @@ -104,7 +104,7 @@ function zoomedCanvas(this: HTMLCanvasElement, d: CanvasDatum) { let canvasZoom: d3Zoom.ZoomBehavior; -canvasZoom = d3Zoom.zoom() +canvasZoom = d3Zoom.zoom() .scaleExtent([1 / 2, 4]) .on('zoom', zoomedCanvas); diff --git a/types/dygraphs/index.d.ts b/types/dygraphs/index.d.ts index 6d2cedf9d2..fb6f4b997d 100644 --- a/types/dygraphs/index.d.ts +++ b/types/dygraphs/index.d.ts @@ -1266,5 +1266,5 @@ declare class Dygraph { } declare module "dygraphs" { - export = Dygraph; -} \ No newline at end of file + export default Dygraph; +} diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index e304a73863..61698887b8 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -7,7 +7,7 @@ /*! * filename: ej.web.all.d.ts -* version : 15.2.0.40 +* version : 15.2.0.43 * Copyright Syncfusion Inc. 2001 - 2017. 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 @@ -239,6 +239,7 @@ declare namespace ej { convertToQueryString(req: any, query: ej.Query, dm: ej.DataManager): JQueryParam; processResponse(data: any, ds: any, query: ej.Query, xhr: JQueryXHR, request?: any, changes?: Changes): any; onGroup(e: any): void; + onAggregates(e: any): void; batchRequest(dm: ej.DataManager, changes: Changes, e: any): void; beforeSend(dm: ej.DataManager, request: any, settings?: any): void; insert(dm: ej.DataManager, data: any, tableName: string): { url: string; data: any }; @@ -246,14 +247,12 @@ declare namespace ej { update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data: any }; getFiltersFrom(data: any, query: ej.Query): ej.Predicate; } - class WebMethodAdaptor extends ej.UrlAdaptor { constructor(); processQuery(dm: ej.DataManager, query: ej.Query, hierarchyFilters?: any): { type: string; url: string; ejPvtData: any; contentType?: string; data?: any; }; } - class CacheAdaptor extends ej.UrlAdaptor { constructor(); init(adaptor: any, timeStamp: number, pageSize: number): void; @@ -266,7 +265,6 @@ declare namespace ej { batchRequest(dm: ej.DataManager, changes: Changes, e: any): { url: string; type: string; data: any; contentType: string }; } - class ODataAdaptor extends ej.UrlAdaptor { constructor(); options: UrlAdaptorOptions; @@ -280,6 +278,7 @@ declare namespace ej { onSortBy(e: any): string; onGroup(e: any): string; onSelect(e: any): string; + onAggregates(e: any): string; onCount(e: any): string; beforeSend(dm: ej.DataManager, request: any, settings?: any): void; processResponse(data: any, ds: any, query: ej.Query, xhr: any, request: any, changes: Changes): { @@ -313,6 +312,7 @@ declare namespace ej { changeSetContent?: string; batchChangeSetContentType?: string; } + class WebApiAdaptor extends ej.ODataAdaptor { constructor(); insert(dm: ej.DataManager, data: any, tableName?: string): { url: string; type: string; data: any; }; @@ -322,6 +322,7 @@ declare namespace ej { result: any; count: number }; } + class ODataV4Adaptor extends ej.ODataAdaptor { constructor(); options: ODataAdaptorOptions; @@ -329,9 +330,13 @@ declare namespace ej { onEachSearch(e: any): void; onSearch(e: any): string; beforeSend(dm: ej.DataManager, request: any, settings?: any): void; + processQuery(ds: any, query: ej.Query): { + type: string; url: string; ejPvtData: any; contentType?: string; data?: any; + }; processResponse(data: any, ds: any, query: ej.Query, xhr: any, request: any, changes: Changes): { result: any; count: number }; + } interface ODataAdaptorOptions { requestType?: string; @@ -359,6 +364,7 @@ declare namespace ej { processQuery(ds: any, query: ej.Query): string; batchRequest(dm: ej.DataManager, changes: Changes, e: any): Changes; onWhere(ds: any, e: any): any; + onAggregates(ds: any, e: any): any; onSearch(ds: any, e: any): any; onSortBy(ds: any, e: any, query: ej.Query): any; onGroup(ds: any, e: any, query: ej.Query): any; @@ -367,10 +373,16 @@ declare namespace ej { onTake(ds: any, e: any): any; onSkip(ds: any, e: any): any; onSelect(ds: any, e: any): any; - insert(dm: ej.DataManager, data: any): any; + insert(dm: ej.DataManager, data: any, tableName?: string): any; remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): any; update(dm: ej.DataManager, keyField: string, value: any, tableName: string): any; } + class ForeignKeyAdaptor extends ej.JsonAdaptor { + constructor(); + 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 }; + } class remoteSaveAdaptor extends ej.UrlAdaptor { constructor(); batchRequest(dm: ej.DataManager, changes: Changes, e: any): void; @@ -740,7 +752,7 @@ declare namespace ej { /** returns the element which accepts the droppable element. */ - targetElement?: any; + target?: any; } export interface OutEventArgs { @@ -759,7 +771,7 @@ declare namespace ej { /** returns the mouse out over the element */ - targetElement?: any; + target?: any; } export interface OverEventArgs { @@ -778,7 +790,7 @@ declare namespace ej { /** returns the mouse over the element */ - targetElement?: any; + target?: any; } } @@ -3267,7 +3279,10 @@ declare namespace ej { * @Default {false} */ showRoundedCorner?: boolean; - + /** Set to sort ListBox items either by Ascending or Descending order. By default sortOrder is set as enum type of "None".You can use only below mentioned type for sorting purpose. + * @Default {ej.SortOrder.None} + */ + sortOrder?: ej.ListBox.SortOrder | string; /** The template to display the ListBox widget with customized appearance. * @Default {null} */ @@ -3864,6 +3879,14 @@ declare namespace ej { */ value?: string; } + enum SortOrder { + /// The items are not sorted. + None, + /// To sort items in Ascending order. + Ascending, + /// To sort items in Descending order. + Descending + } } class Calculate { @@ -6868,8 +6891,8 @@ declare namespace ej { export interface TimeDrillDown { - /** This is the field to show/hide the timeDrillDown in DateTimePicker. - */ + /** This is the field to show/hide the timeDrillDown in DateTimePicker. + */ enabled?: boolean; /** Sets the interval time of minutes on selected date. @@ -7342,6 +7365,10 @@ declare namespace ej { */ animation?: any; + /** To Enable or disable the scrolling for background element of the modal dialog. This will work only with modal dialog. + */ + backgroundScroll?: boolean; + /** Closes the dialog widget on pressing the ESC key when it is set to true. */ closeOnEscape?: boolean; @@ -9002,6 +9029,10 @@ declare namespace ej { */ target?: string; + /** defines Tooltip size and gap between tooltip against the target element. + */ + tip?: Tip; + /** The title text to be displayed in the Tooltip header. * @Default {null} */ @@ -9936,6 +9967,26 @@ declare namespace ej { */ width?: string | number; + /** Specifies the number of items to be fetched on each scroll. Note: This property works only with Virtual scrolling. + * @Default {5} + */ + itemRequestCount?: number; + + /** Specifies the maximum number of items to be fetched. Note: This will work only with Virtual scrolling + * @Default {null} + */ + totalItemsCount?: number; + + /** Loads the list data on demand via scrolling behavior to improve the application’s performance. There are two ways to load data which can be defined using virtualScrollMode property. + * @Default {false} + */ + allowVirtualScrolling?: boolean; + + /** Specifies the virtual scroll mode to load the list data on demand via scrolling behavior. There are two types of mode. + * @Default {ej.VirtualScrollMode.Normal} + */ + virtualScrollMode?: ej.VirtualScrollMode | string; + /** Event triggers before the AJAX request happens. */ ajaxBeforeLoad?(e: AjaxBeforeLoadEventArgs): void; @@ -10712,6 +10763,11 @@ declare namespace ej { */ contextMenuTarget?: string; + /** Specifies the container element selectors for submenu’s collision. The submenu gets displayed based on spacing available with respect to container element. + * @Default {null} + */ + container?: string; + /** Specify the CSS class to achieve custom theme. */ cssClass?: string; @@ -11990,8 +12046,8 @@ declare namespace ej { export interface MouseoverEventArgs { - /** returns the current value. - */ + /** returns the current value. + */ value?: number; /** if the event should be canceled; otherwise, false. @@ -13609,6 +13665,9 @@ declare namespace ej { /** Triggered initial load. */ load?(e: LoadEventArgs): void; + /** Triggers before swim lane expand or collapse icon is clicked. */ + swimlaneClick?(e: SwimlaneClickEventArgs): void; + /** Triggered every time a single card rendered request is made to access particular card information. */ queryCellInfo?(e: QueryCellInfoEventArgs): void; @@ -14304,6 +14363,37 @@ declare namespace ej { type?: string; } + export interface SwimlaneClickEventArgs { + + /** Current Action name while swim lane clicked. Actions are "expand" or "collapse" + */ + action?: string; + + /** Returns the kanban model. + */ + model?: any; + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the name of the event. + */ + type?: string; + + /** Returns the swim lane group data's. + */ + data?: any; + + /** Returns current swim lane row index. + */ + rowIndex?: number; + + /** Returns current target element. + */ + target?: any; + } + export interface QueryCellInfoEventArgs { /** Returns Kanban card. @@ -14330,8 +14420,8 @@ declare namespace ej { */ model?: any; - /** Returns the name of the event. - */ + /** Returns the name of the event. + */ type?: string; } @@ -15447,6 +15537,11 @@ declare namespace ej { */ autoHeight?: boolean; + /** This API holds configuration setting for paste clenaup behavior. + * @Default {{ listConversion: false, cleanCSS: false, removeStyles: false, cleanElements: false }} + */ + pasteCleanupSettings?: PasteCleanupSettings; + /** Sets the colorCode to display the color of the fontColor and backgroundColor in the font tools of the RTE. * @Default {[000000, FFFFFF, C4C4C4, ADADAD, 595959, 262626, 4f81bd, dbe5f1, b8cce4, 95b3d7, 366092, 244061, c0504d, f2dcdb, e5b9b7, d99694, 953734,632423, 9bbb59, * ebf1dd, d7e3bc, c3d69b, 76923c, 4f6128, 8064a2, e5e0ec, ccc1d9, b2a2c7, 5f497a, 3f3151, f79646, fdeada, fbd5b5, fac08f,e36c09, 974806]} @@ -15695,6 +15790,11 @@ declare namespace ej { */ toolsList?: any[]; + /** Specifies the overflow mode for RTE responsive toolbar + * @Default {Popup} + */ + toolbarOverflowMode?: ej.RTE.ToolbarOverflowMode | string; + /** Display the hints for the tools in the Toolbar. * @Default {{ associate: mouseenter, showShadow: true, position: { stem: { horizontal: left, vertical: top } }, tip: { size: { width: 5, height: 5 }, isBalloon: false }} */ @@ -15897,6 +15997,29 @@ declare namespace ej { event?: any; } + export interface PasteCleanupSettings { + + /** This API is used to convert the list elements pasted from word document to editor. + * @Default {false} + */ + listConversion?: boolean; + + /** This API is used to clean the unwanted css in the elements pasted from word document to editor. + * @Default {false} + */ + cleanCSS?: boolean; + + /** This API is used to remove all styles in the elements pasted from word document to editor. + * @Default {false} + */ + removeStyles?: boolean; + + /** This API is used to clean the unwanted elements pasted from word document to editor. + * @Default {false} + */ + cleanElements?: boolean; + } + export interface ExportToPdfSettings { /** This API is used to receive the server-side handler for export related operations. @@ -16096,6 +16219,16 @@ declare namespace ej { */ customUnorderedList?: ToolsCustomUnorderedList[]; } + + enum ToolbarOverflowMode { + + ///To display the RTE toolbar overflow items as popup + Popup, + + ///To display the RTE toolbar overflow items as inline toolbar + Inline + } + } class Slider extends ej.Widget { @@ -16125,6 +16258,7 @@ declare namespace ej { */ setValue(): void; } + export namespace Slider { export interface Model { @@ -16418,6 +16552,7 @@ declare namespace ej { cancel?: boolean; } } + namespace slider { enum sliderType { //Shows default slider @@ -17233,8 +17368,8 @@ declare namespace ej { */ activeIndex?: number; - /** returns, is it triggered by interaction or not. - */ + /** returns, is it triggered by interaction or not. + */ isInteraction?: boolean; } @@ -21193,6 +21328,12 @@ declare namespace ej { */ addIgnoreOnExport(propertyNames: any[]): void; + /** Adds a grid model property which is to be ignored upon OnServerToolbarClick. + * @param {Array} Pass the array of parameters which need to be ignored on OnServerToolbarClick + * @returns {void} + */ + addIgnoreOnToolbarServerClick(propertyNames: any[]): void; + /** Add a new record in grid control when allowAdding is set as true. * @returns {void} */ @@ -23581,6 +23722,21 @@ declare namespace ej { type?: string; } + export interface MergeHeaderCellInfoEventArgs { + + /** Method to merge the header cells. + */ + headerCellMerge?: any; + + /** Returns the column headers. + */ + columnHeaders?: any; + + /** Returns the grid model. + */ + model?: any; + } + export interface MergeCellInfoEventArgs { /** Returns grid cell. @@ -23593,7 +23749,7 @@ declare namespace ej { /** Returns current row record object (JSON). */ - data?: any; + rowData?: any; /** Returns the text value in the cell. */ @@ -23636,7 +23792,7 @@ declare namespace ej { /** Returns current row record object (JSON). */ - data?: any; + rowData?: any; /** Returns the text value in the cell. */ @@ -24068,7 +24224,7 @@ declare namespace ej { /** Returns the current row data. */ - data?: any; + rowData?: any; /** Returns the grid model. */ @@ -24630,6 +24786,10 @@ declare namespace ej { * @Default {null} */ dropMapper?: string; + /** Gets or sets a value that indicates whether to define the behavior for drag. + * @Default {ej.Grid.DragBehavior.Move} + */ + dragBehavior?: ej.Grid.DragBehavior | string; } export interface SearchSettings { @@ -24872,6 +25032,17 @@ declare namespace ej { wrapMode?: ej.Grid.WrapMode | string; } + export interface ToolbarSettingsCustomToolbarItem { + + /** Gets or sets a value that indicates whether to add custom toolbar item as a template element. + */ + templateID?: string; + + /** Gets or sets a value that indicates whether to add custom toolbar item with a custom tooltip. + */ + tooltip?: string; + } + export interface ToolbarSettings { /** Gets or sets a value that indicates whether to add custom toolbar items within the toolbar to perform any action in the grid @@ -25058,6 +25229,16 @@ declare namespace ej { } + enum DragBehavior { + + ///Moves a dragged row from one grid to another + Move, + + ///Copies a dragged row from one grid to another + Copy + } + + enum SelectionType { ///Specifies the selection type as single. @@ -25225,6 +25406,11 @@ declare namespace ej { */ rangeBandSettings?: RangeBandSettings; + /** Name of the culture based on which sparkline should be localized. + * @Default {en-US} + */ + locale?: string; + /** Name of a field in data source, where the fill color for all the data points is generated. */ palette?: string; @@ -25239,6 +25425,11 @@ declare namespace ej { */ enableCanvasRendering?: boolean; + /** Specify to convert the date object to string, using locale settings. + * @Default {false} + */ + enableGroupSeparator?: boolean; + /** Specifies the dataSource for the series. It can be an array of JSON objects or an instance of ej.DataManager. * @Default {null} */ @@ -25377,8 +25568,8 @@ declare namespace ej { */ cancel?: boolean; - /** Instance of the sparkline model object - */ + /** Instance of the sparkline model object + */ model?: any; /** Name of the event @@ -27022,6 +27213,16 @@ declare namespace ej { */ frozenHeaderSettings?: FrozenHeaderSettings; + /** Allows user to display header name in PivotGrid control. + * @Default {{}} + */ + headerSettings?: HeaderSettings; + + /** Allows user to show appropriate unique name on Pivot button. + * @Default {false} + */ + showUniqueNameOnPivotButton?: boolean; + /** Object utilized to pass additional information between client-end and service-end on operating the control in server mode. * @Default {null} */ @@ -27865,6 +28066,24 @@ declare namespace ej { * @Default {false} */ enableFrozenHeaders?: boolean; + + /** Allows user to set the size of the scrollbar (horizontal and vertical) visible in PivotGrid. + * @Default {18} + */ + scrollerSize?: number; + } + + export interface HeaderSettings { + + /** Allows user to enable/disable row header names in PivotGrid control. + * @Default {false} + */ + showRowItems?: boolean; + + /** Allows user to enable/disable column header names in PivotGrid control. + * @Default {false} + */ + showColumnItems?: boolean; } export interface HyperlinkSettings { @@ -28441,6 +28660,11 @@ declare namespace ej { */ enableRTL?: boolean; + /** Allows user to render complete PivotChart on drill operation, that is, when expanding and collapsing members which are shown in multi-level labels. + * @Default {false} + */ + enableMultiLevelLabels?: boolean; + /** Allows the user to enable PivotChart’s responsiveness in the browser layout. * @Default {false} */ @@ -29005,6 +29229,16 @@ declare namespace ej { */ displaySettings?: DisplaySettings; + /** Allows user to set visibility of icons in toolbar panel. + * @Default {{}} + */ + toolbarIconSettings?: ToolbarIconSettings; + + /** Allows user to show unique name on pivotbutton. + * @Default {false} + */ + showUniqueNameOnPivotButton?: boolean; + /** Enables the splitter option for resizing the elements inside the control. * @Default {false} */ @@ -29626,6 +29860,89 @@ declare namespace ej { mode?: ej.PivotClient.DisplayMode | string; } + export interface ToolbarIconSettings { + + /** Allows user to set the visibility of Add Report icon in toolbar panel. + * @Default {true} + */ + enableAddReport?: boolean; + + /** Allows user to set the visibility of New Report icon in toolbar panel. + * @Default {true} + */ + enableNewReport?: boolean; + + /** Allows user to set the visibility of Rename Report icon in toolbar panel. + * @Default {true} + */ + enableRenameReport?: boolean; + + /** Allows user to set the visibility of DB Manipulation icon in toolbar panel. + * @Default {true} + */ + enableDBManipulation?: boolean; + + /** Allows user to set the visibility of Word Export icon in toolbar panel. + * @Default {true} + */ + enableWordExport?: boolean; + + /** Allows user to set the visibility of Excel Export icon in toolbar panel. + * @Default {true} + */ + enableExcelExport?: boolean; + + /** Allows user to set the visibility of PDF Export icon in toolbar panel. + * @Default {true} + */ + enablePdfExport?: boolean; + + /** Allows user to set the visibility of MDX Query icon in toolbar panel. + * @Default {true} + */ + enableMDXQuery?: boolean; + + /** Allows user to set the visibility of Defer Update icon in toolbar panel. + * @Default {false} + */ + enableDeferUpdate?: boolean; + + /** Allows user to set the visibility of Full Screen icon in toolbar panel. + * @Default {false} + */ + enableFullScreen?: boolean; + + /** Allows user to set the visibility of Sort/Filter Column icon in toolbar panel. + * @Default {true} + */ + enableSortOrFilterColumn?: boolean; + + /** Allows user to set the visibility of Sort/Filter Row icon in toolbar panel. + * @Default {true} + */ + enableSortOrFilterRow?: boolean; + + /** Allows user to set the visibility of Toggle Axis icon in toolbar panel. + * @Default {true} + */ + enableToggleAxis?: boolean; + + /** Allows user to set the visibility of Chart Types icon in toolbar panel. + * @Default {true} + */ + enableChartTypes?: boolean; + + /** Allows user to set the visibility of Remove Report icon in toolbar panel. + * @Default {true} + */ + enableRemoveReport?: boolean; + + /** Allows user to set the visibility of Calculated Member icon in toolbar panel. + * @Default {false} + */ + enableCalculatedMember?: boolean; + } + export interface ServiceMethodSettings { /** Allows the user to set the custom name for the service method responsible for updating the entire report and widget, while changing the Cube. @@ -29887,9 +30204,9 @@ declare namespace ej { */ showHeaderLabel?: boolean; - /** Connects the service using the specified URL for any server updates on server mode operation. - * @Default {“”} - */ + /** Connects the service using the specified URL for any server updates on server mode operation. + * @Default {“”} + */ url?: string; /** Sets the mode for the PivotGauge widget for binding either OLAP or Relational data source. @@ -30843,6 +31160,11 @@ declare namespace ej { */ showAllDayRow?: boolean; + /** When set to false, hides the weekend days on all the Scheduler views. + * @Default {true} + */ + showWeekend?: boolean; + /** When set to true, displays the current time indicator on the Schedule. * @Default {true} */ @@ -32455,6 +32777,13 @@ declare namespace ej { */ setSplitterIndex(index: number): void; + /** To sort the column in required direction + * @param {string} Defines the column's mapping name in which sorting have to be performed + * @param {string} Defines the sort direction whether the column has to sorted in ascending/descending order. By default it is sorting in an ascending order + * @returns {void} + */ + sortColumn(mappingName: string, columnSortDirection: string): void; + /** To cancel the edited state of an item in Gantt * @returns {void} */ @@ -32486,6 +32815,14 @@ declare namespace ej { */ expandCollapseRecord(taskId: number): void; + /** Export the Gantt content to excel or PDF document. + * @param {string} Pass the controller action name corresponding to exporting + * @param {string} optionalASP server event name corresponding to exporting + * @param {boolean} optionalPass the multiple exporting value as true/false + * @returns {void} + */ + export(action: string, serverEvent?: string, multipleExport?: boolean): void; + /** To hide the column by using header text * @param {string} you can pass a header text of a column to hide * @returns {void} @@ -32594,6 +32931,14 @@ declare namespace ej { */ baselineColor?: string; + /** Specifies the mapping property path for the work field of a task in the data source. When it is mapped the end date and duration for a task will be calculated automatically. + */ + workMapping?: string; + + /** Specifies the mapping property path for the expand status of a record in data source. + */ + expandStateMapping?: string; + /** Specifies the mapping property path for baseline end date in datasource */ baselineEndDateMapping?: string; @@ -32643,6 +32988,11 @@ declare namespace ej { */ dateFormat?: string; + /** Specifies the customized working time for tasks in Gantt + * @Default {[{ from: 08:00 AM, to: 12:00 PM }, { from: 01:00 PM, to: 05:00 PM }]} + */ + dayWorkingTime?: any[]; + /** Specifies the mapping property path for duration of a task in datasource */ durationMapping?: string; @@ -32978,6 +33328,11 @@ declare namespace ej { */ taskbarEditingTooltipTemplateId?: string; + /** Specifies the height of taskBar in Gantt. + * @Default {20} + */ + taskbarHeight?: number; + /** Specifies the template for tooltip on mouse action on taskbars */ taskbarTooltipTemplate?: string; @@ -33790,6 +34145,17 @@ declare namespace ej { type?: string; } + export interface AddDialogField { + + /** Specifies mapping name to include required fields in Gantt + */ + field?: string; + + /** Specifies editType of fields to be included in the add dialog in Gantt + */ + editType?: string; + } + export interface DragTooltip { /** Specifies option to enable/disable tooltip while drag and drop a row. @@ -33808,6 +34174,17 @@ declare namespace ej { tooltipTemplate?: string; } + export interface EditDialogField { + + /** Specifies mapping name to include required fields in Gantt + */ + field?: string; + + /** Specifies editType of fields to be included in the edit dialog in Gantt + */ + editType?: string; + } + export interface SplitterSettings { /** Specifies position of the splitter in Gantt , splitter can be placed either based on percentage values or pixel values. @@ -33862,6 +34239,21 @@ declare namespace ej { rowPosition?: ej.Gantt.RowPosition | string; } + export interface Holiday { + + /** Specifies holiday date to be displayed in Gantt + */ + day?: string; + + /** Specifies the background color for holiday date in Gantt Schedule + */ + background?: string; + + /** Specifies the label to be displayed for rendered holiday in Gantt + */ + label?: string; + } + export interface ScheduleHeaderSettings { /** Specified the format for day view in schedule header @@ -33899,9 +34291,9 @@ declare namespace ej { */ weekendBackground?: string; - /** Specified the format for week view in schedule header - * @Default {ddd} - */ + /** Specified the format for week view in schedule header + * @Default {MMM dd , yyyy} + */ weekHeaderFormat?: string; /** Specified the format for year view in schedule header @@ -33945,12 +34337,61 @@ declare namespace ej { cellIndex?: number; } + export interface SortSettingsSortedColumn { + + /** Specifies the field to be sorted in Gantt + */ + field?: string; + + /** Specifies the sort direction in Gantt + */ + direction?: string; + } + export interface SortSettings { /** Specifies the sorted columns for Gantt * @Default {[]} */ - sortedColumns?: any[]; + sortedColumns?: SortSettingsSortedColumn[]; + } + + export interface StripLine { + + /** Specifies date to render striplines in Gantt + */ + day?: string; + + /** Specifies label to be displayed for striplines in Gantt + */ + label?: string; + + /** Specifies line style for rendered striplines in Gantt + */ + lineStyle?: string; + + /** Specifies the line color for rendered striplines in Gantt + */ + lineColor?: string; + + /** Specifies the width of the stripline in Gantt + */ + lineWidth?: string; + } + + export interface ToolbarSettingsCustomToolbarItem { + + /** Allows the user to insert the custom icons in toolbar using CSS class name selector. + */ + text?: string; + + /** Allows the user to insert the custom icons in toolbar using script templates. Using this property we can bind HTML elements and other EJ controls to Gantt toolbar. + */ + templateID?: string; + + /** Allows the user to display custom tooltip text for Gantt custom toolbar items. + */ + tooltipText?: string; } export interface ToolbarSettings { @@ -33964,6 +34405,10 @@ declare namespace ej { * @Default {[]} */ toolbarItems?: any[]; + + /** Allows the user to insert custom toolbar items. + */ + customToolbarItems?: ToolbarSettingsCustomToolbarItem[]; } enum DurationUnit { @@ -34856,12 +35301,6 @@ declare namespace ej { */ saveCell(): void; - /** To search an item with search string provided at the run time - * @param {string} you can pass a searchString to search the tree grid - * @returns {void} - */ - search(searchString: string): void; - /** To show the column by using header text * @param {string} you can pass a header text of a column to show. * @returns {void} @@ -34873,7 +35312,7 @@ declare namespace ej { * @param {string} you can pass a sort direction to sort the column. * @returns {void} */ - sortColumn(columnName: string, columnSortDirection: string): void; + sortColumn(fieldName: string, columnSortDirection: string): void; /** To reorder the column with field name and target index values * @param {string} you can pass a name of column to reorder. @@ -34936,6 +35375,10 @@ declare namespace ej { */ altRowTemplateID?: string; + /** Specifies the mapping property path for the expand status of a record in data source. + */ + expandStateMapping?: string; + /** Specifies the mapping property path for sub tasks in datasource */ childMapping?: string; @@ -34963,9 +35406,9 @@ declare namespace ej { dataSource?: any[]; /** Specifies whether to wrap the header text when it is overflown i.e., when it exceeds the header width. - * @Default {none} + * @Default {ej.TreeGrid.HeaderTextOverflow.None} */ - headerTextOverflow?: string; + headerTextOverflow?: ej.TreeGrid.HeaderTextOverflow | string; /** Options for displaying and customizing the tooltip. This tooltip will show the preview of the row that is being dragged. */ @@ -34999,6 +35442,11 @@ declare namespace ej { */ columnResizeSettings?: ColumnResizeSettings; + /** Defines the common width for all the columns in TreeGrid + * @Default {150} + */ + commonWidth?: number; + /** Options for filtering and customizing filter actions. */ filterSettings?: FilterSettings; @@ -35054,6 +35502,10 @@ declare namespace ej { */ selectedRowIndex?: number; + /** Specifies the selected cell information on rendering TreeGrid. + */ + selectedCellIndexes?: SelectedCellIndex[]; + /** Specifies the settings for row and cell selection. */ selectionSettings?: SelectionSettings; @@ -35172,6 +35624,15 @@ declare namespace ej { /** Triggered when TreeGrid is rendered completely */ create?(e: CreateEventArgs): void; + /** Triggered while rendering details template in TreeGrid */ + detailsDataBound?(e: DetailsDataBoundEventArgs): void; + + /** Triggered when details template pop-up is shown. */ + detailsShown?(e: DetailsShownEventArgs): void; + + /** Triggered when details template pop-up is hidden. */ + detailsHidden?(e: DetailsHiddenEventArgs): void; + /** Triggered after saved the modified cellValue in TreeGrid */ endEdit?(e: EndEditEventArgs): void; @@ -35621,6 +36082,79 @@ declare namespace ej { type?: string; } + export interface DetailsDataBoundEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the data collection of selected row. + */ + data?: any; + + /** Returns the details element of selected row. + */ + detailsElement?: any; + + /** Returns the rowIndex of selected row. + */ + rowIndex?: number; + + /** Returns the TreeGrid model + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; + } + + export interface DetailsShownEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the data collection of selected row. + */ + data?: any; + + /** Returns the details element of selected row. + */ + detailsElement?: any; + + /** Returns the rowIndex of selected row. + */ + rowIndex?: number; + + /** Returns the TreeGrid model + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; + } + + export interface DetailsHiddenEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the TreeGrid model + */ + model?: any; + + /** Returns the data collection of hidden details Template + */ + rowData?: any; + + /** Returns the name of the event. + */ + type?: string; + } + export interface EndEditEventArgs { /** Returns the cancel option value. @@ -36018,6 +36552,11 @@ declare namespace ej { */ allowFiltering?: boolean; + /** Enables the blanks option in ejDropDownList mapped in TreeGrid column + * @Default {true} + */ + allowFilteringBlankContent?: boolean; + /** Enables or disables the ability to sort the rows based on this column/field. * @Default {false} */ @@ -36028,15 +36567,35 @@ declare namespace ej { */ allowCellSelection?: boolean; + /** To customize the ej controls defined in TreeGrid column with their native property. + */ + editParams?: any; + /** Specifies the edit type of the column. * @Default {ej.TreeGrid.EditingType.String} */ editType?: ej.TreeGrid.EditingType | string; + /** To bind the dropdown data for TreeGrid column mapped with ejDropDownList + */ + dropdownData?: string; + /** Specifies the name of the field from the dataSource to bind with this column. */ field?: string; + /** Specifies the template string of the script element to enable column template for a column. + */ + template?: string; + + /** Specifies the template ID of the script element to enable column template for a column. + */ + templateID?: string; + + /** Specifies the template ID or the template string of the AngularJS script element to enable column template for a column. + */ + angularTemplate?: string; + /** Specifies the type of the editor control to be used to filter the rows. * @Default {ej.TreeGrid.EditingType.String} */ @@ -36050,6 +36609,11 @@ declare namespace ej { /** Enables or disables the checkbox visibility in a column to make it as a checkbox column * @Default {false} */ + displayAsCheckbox?: boolean; + + /** Enables or disables the checkbox visibility in a column for checkbox selection. + * @Default {false} + */ showCheckbox?: boolean; /** Controls the visibility of the column. @@ -36090,15 +36654,35 @@ declare namespace ej { */ textAlign?: ej.TextAlign | string; - /** Specifies the template for the TreeGrid column - */ - templateID?: string; - /** Enables or disables the ability to edit a row or cell. * @Default {false} */ allowEditing?: boolean; + /** We can include or exclude particular column from column visibility list in column menu. + * @Default {true} + */ + showInColumnChooser?: boolean; + + /** Sets the clip mode for TreeGrid cell as ellipsis or clipped content(both header and content) + * @Default {ej.TreeGrid.ClipMode.Clip} + */ + clipMode?: ej.TreeGrid.ClipMode | string; + + /** Sets the tooltip template for the specific column. + * @Default {null} + */ + tooltip?: string; + + /** Sets the tooltip template for the column header + * @Default {null} + */ + headerTooltip?: string; + + /** specifies the conditions for saving data to the database while adding or editing the fields. + */ + validationRules?: any; + /** Enables or disables the ability to freeze/unfreeze the columns * @Default {false} */ @@ -36167,14 +36751,37 @@ declare namespace ej { * @Default {top} */ rowPosition?: ej.TreeGrid.RowPosition | string; + /** Specifies the template ID for the custom dialog. + * @Default {null} + */ + dialogEditorTemplateID?: string; } export interface ColumnResizeSettings { /** Specifies the mode for column resizing - * @Default {normal} + * @Default {ej.TreeGrid.ColumnResizeMode.Normal} */ - columnResizeMode?: string; + columnResizeMode?: ej.TreeGrid.ColumnResizeMode | string; + } + + export interface FilterSettingsFilteredColumn { + + /** Specifies the value to be filtered in TreeGrid. + */ + value?: string; + + /** Specifies the field where filtering has to be performed. + */ + field?: string; + + /** Specifies the predicate(and/or) value to perform filtering. + */ + predicate?: string; + + /** Specifies the filter condition to filtered column. See operator + */ + operator?: string; } export interface FilterSettings { @@ -36185,9 +36792,9 @@ declare namespace ej { filterBarMode?: string; /** Specifies the type of column filtering. - * @Default {filterbar} + * @Default {ej.TreeGrid.FilterType.FilterBar} */ - filterType?: string; + filterType?: ej.TreeGrid.FilterType | string; /** Specifies the column collection for filtering the TreeGrid content on initial load * @Default {[]} @@ -36228,6 +36835,18 @@ declare namespace ej { template?: string; } + export interface SelectedCellIndex { + + /** Specifies the row index of the cell to be selected in TreeGrid control + */ + rowIndex?: number; + + /** Specifies the cell index to be selected in the row. + * @Default { } + */ + cellIndex?: number; + } + export interface SelectionSettings { /** Specifies the type of selection whether to select row or cell. @@ -36251,6 +36870,44 @@ declare namespace ej { enableSelectAll?: boolean; } + export interface SummaryRowsSummaryColumn { + + /** Specifies the summary type to perform calculations in a corresponding summary column. See summaryType. + */ + summaryType?: ej.TreeGrid.SummaryType | string; + + /** Specifies summary column used to perform the summary calculation. + */ + dataMember?: string; + + /** Specifies the required column to display the summary. + */ + displayColumn?: string; + + /** Specifies the text to be displayed before the summary column value. + */ + prefix?: string; + + /** Specifies the text to be displayed after the summary column value. + */ + suffix?: string; + + /** Specifies the format to be applied on the summary column value. + */ + format?: string; + } + + export interface SummaryRow { + + /** Specifies the title for summary row collection in TreeGrid + */ + title?: string; + + /** Specifies the summary columns in the summary rows. + */ + summaryColumns?: SummaryRowsSummaryColumn[]; + } + export interface SizeSettings { /** Height of the TreeGrid. @@ -36264,12 +36921,38 @@ declare namespace ej { width?: string; } + export interface SortSettingsSortedColumn { + + /** Specifies the field to be sorted in TreeGrid + */ + field?: string; + + /** Specifies the sort direction in TreeGrid + */ + direction?: string; + } + export interface SortSettings { /** Option to add columns based on which the rows have to be sorted recursively. * @Default {[]} */ - sortedColumns?: any[]; + sortedColumns?: SortSettingsSortedColumn[]; + } + + export interface ToolbarSettingsCustomToolbarItem { + + /** Allows the user to insert the custom icons in toolbar using CSS class name selector. + */ + text?: string; + + /** Allows the user to insert the custom icons in toolbar using script templates. Using this property we can bind HTML elements and other EJ controls to TreeGrid toolbar. + */ + templateID?: string; + + /** Allows the user to display custom tooltip text for TreeGrid custom toolbar items. + */ + tooltipText?: string; } export interface ToolbarSettings { @@ -36283,6 +36966,10 @@ declare namespace ej { * @Default {[]} */ toolbarItems?: any[]; + + /** Allows the user to insert custom toolbar items. + */ + customToolbarItems?: ToolbarSettingsCustomToolbarItem[]; } enum EditingType { @@ -36310,6 +36997,26 @@ declare namespace ej { } + enum ClipMode { + + ///Shows ellipsis for the overflown cell. + Ellipsis, + + ///Truncate the text in the cell. + Clip + } + + + enum HeaderTextOverflow { + + ///You can disable the word wrap + None, + + ///You can wrap the header content + Wrap + } + + enum BeginEditAction { ///you can begin the editing at double click @@ -36349,6 +37056,29 @@ declare namespace ej { } + enum ColumnResizeMode { + + ///At load time column are rendered with given width value, while resizing the column only current column width is changed + FixedColumns, + + ///At load time columns are stretched with control width,while resizing the column, current column width updated based on next column + Normal, + + ///In this mode columns are stretched with control width in load time and on resizing action. + NextColumn + } + + + enum FilterType { + + ///Enables the filterbar filtering + FilterBar, + + ///Enables the menu filtering + Menu + } + + enum PageSizeMode { ///To count all the parent and child records. @@ -36381,6 +37111,37 @@ declare namespace ej { Checkbox } + + enum SummaryType { + + ///Displays the sum of summary column + Sum, + + ///Displays the average of summary column + Average, + + ///Displays the maximum value of summary column + Maximum, + + ///Displays the minimum value of summary column + Minimum, + + ///Displays the total count of summary column + Count, + + ///Displays the minimum date value in summary column + MinimumDate, + + ///Displays the maximum date value in summary column + MaximumDate, + + ///Displays the true count value for boolean summary columns + TrueCount, + + ///Displays the false count value for boolean summary columns + FalseCount + } + } class GroupButton extends ej.Widget { @@ -38233,6 +38994,11 @@ declare namespace ej { */ gotoPage(sheetIdx: number, newSheet: boolean): void; + /** This method is used to hide the pivot table activationPanel in the Spreadsheet. + * @returns {void} + */ + hideActivationPanel(): void; + /** This method is used to hide the entire columns from the specified range (startCol, endCol) in Spreadsheet. * @param {number} Index of the start column. * @param {number} Optional. Index of the end column. @@ -38952,6 +39718,12 @@ declare namespace ej { export interface XLFormat { + /** This method is used to add the font to the Ribbon font family dropdown. + * @param {string} Font name which needs to add into the font family option. + * @returns {void} + */ + addFontFamily(fontName: string): void; + /** This method is used to convert table range to normal range. * @param {any} Pass the sheet index and table id. * @returns {void} @@ -38972,6 +39744,12 @@ declare namespace ej { */ format(formatObj: any, range: string): void; + /** This method is used to remove the font from the Ribbon font family dropdown. + * @param {string} Font name which needs to remove from the font family drop down. + * @returns {void} + */ + removeFontFamily(fontName: string): void; + /** This method is used to remove the style in the specified range. * @param {Array|string} Pass the cell range . * @param {any} Optional. Pass the options for which the style gets removed. @@ -38986,7 +39764,7 @@ declare namespace ej { removeTable(tableId: number): void; /** This method is used to update the decimal places for numeric value for the selected range of cells in the Spreadsheet. - * @param {string} Pass the decimal places type in increment/decrement. + * @param {string} Pass the decimal places type in IncreaseDecimal/DecreaseDecimal. * @param {string|Array} Pass the range. * @returns {void} */ @@ -39475,9 +40253,9 @@ declare namespace ej { */ allowFormulaBar?: boolean; - /** Gets or sets a value that indicates whether to enable or disable freeze pane support in Spreadsheet. After enabling this feature, - * you can use freeze top row, freeze first column and freeze panes options. - * @Default {false} + /** Gets or sets a value that indicates whether to enable or disable freeze pane support in Spreadsheet. By enabling this feature, you can use freeze top row, + * freeze first column and freeze panes options. + * @Default {true} */ allowFreezing?: boolean; @@ -39620,6 +40398,10 @@ declare namespace ej { */ locale?: string; + /** Gets or sets a value that indicates name manager in Spreadsheet. + */ + nameManager?: NameManager[]; + /** Gets or sets an object that indicates to customize the picture behavior in the Spreadsheet. */ pictureSettings?: PictureSettings; @@ -41012,6 +41794,17 @@ declare namespace ej { password?: string; } + export interface NameManager { + + /** Specifies the name for the cell or a range. + */ + name?: string; + + /** Specifies the address for the cell or a range. + */ + refersto?: string; + } + export interface PictureSettings { /** Gets or sets a value that indicates whether to enable or disable picture feature in Spreadsheet. By enabling this, you can add pictures in Spreadsheet. @@ -42238,6 +43031,11 @@ declare namespace ej { */ isResponsive?: boolean; + /** Gets or sets a value that indicates whether to enable the spellcheck operation on Enter/Space key-press. + * @Default {false} + */ + enableValidateOnType?: boolean; + /** It allows to spell check the multiple target HTML element's texts and correct its error words. * @Default {null} */ @@ -42802,6 +43600,7 @@ declare namespace ej { } } + declare namespace ej.datavisualization { class SymbolPalette extends ej.Widget { @@ -43401,6 +44200,16 @@ declare namespace ej.datavisualization { */ isResponsive?: boolean; + /** Used to Convert the date object to string while using the locale settings + * @Default {false} + */ + enableGroupSeparator?: boolean; + + /** Responsiveness of the linear gauge is controlled + * @Default {false} + */ + enableResize?: boolean; + /** Specify frame of linear gauge * @Default {null} */ @@ -43415,6 +44224,10 @@ declare namespace ej.datavisualization { * @Default {null} */ labelColor?: string; + /** Set the localization culture for the Linear gauge + * @Default {en-US} + */ + locale?: string; /** Specifies the maximum value of Linear gauge. * @Default {100} @@ -45412,6 +46225,16 @@ declare namespace ej.datavisualization { */ enableAnimation?: boolean; + /** Specify to convert the date object to string, using locale settings. + * @Default {false} + */ + enableGroupSeparator?: boolean; + + /** Controls whether circular gauge has to be responsive while resizing. + * @Default {false} + */ + enableResize?: boolean; + /** Specify the frame of circular gauge * @Default {Object} */ @@ -45442,6 +46265,11 @@ declare namespace ej.datavisualization { */ isResponsive?: boolean; + /** Name of the culture based on which circular gauge should be localized. + * @Default {en-US} + */ + locale?: string; + /** Specifies the maximum value of circular gauge. * @Default {100} */ @@ -45477,6 +46305,10 @@ declare namespace ej.datavisualization { */ theme?: string; + /** Options to customize the legend. + */ + legend?: Legend; + /** Specify tooltip option of circular gauge * @Default {object} */ @@ -45492,6 +46324,15 @@ declare namespace ej.datavisualization { */ width?: number; + /** Fires before rendering the legend item. This event is fired for each legend item in CircularGauge. You can use this event to customize legend item shape or add custom text to legend item. */ + legendItemRender?(e: LegendItemRenderEventArgs): void; + + /** Fires on clicking the legend item. */ + legendItemClick?(e: LegendItemClickEventArgs): void; + + /** Fires when mouse moving on ranges. */ + rangeMouseMove?(e: RangeMouseMoveEventArgs): void; + /** Triggers while the custom labels are being drawn on the gauge. */ drawCustomLabel?(e: DrawCustomLabelEventArgs): void; @@ -45529,6 +46370,63 @@ declare namespace ej.datavisualization { renderComplete?(e: RenderCompleteEventArgs): void; } + export interface LegendItemRenderEventArgs { + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the circulargauge model object + */ + model?: any; + + /** Name of the event + */ + type?: string; + + /** Instance of the legend item object that is about to be rendered + */ + data?: any; + } + + export interface LegendItemClickEventArgs { + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the circulargauge model object + */ + model?: any; + + /** Name of the event + */ + type?: string; + + /** Instance of the legend item object that is about to be rendered + */ + data?: any; + } + + export interface RangeMouseMoveEventArgs { + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the circulargauge model object + */ + model?: any; + + /** Name of the event + */ + type?: string; + + /** Region of ranges + */ + data?: any; + } + export interface DrawCustomLabelEventArgs { /** returns the object of the gauge. @@ -46171,10 +47069,20 @@ declare namespace ej.datavisualization { */ position?: ScalesCustomLabelsPosition; + /** Specify angle for the rotation of the custom labels in degrees. + * @Default {0} + */ + textAngle?: number; + /** Specify font for custom labels * @Default {Object} */ font?: ScalesCustomLabelsFont; + + /** Specifies the position of the custom labels. See CustomLabelPositionType + * @Default {inner} + */ + positionType?: ej.datavisualization.CircularGauge.CustomLabelPositionType | string; } export interface ScalesIndicatorsPosition { @@ -46540,6 +47448,11 @@ declare namespace ej.datavisualization { */ backgroundColor?: string; + /** Specify text for the ranges of circular gauge + * @Default {null} + */ + legendText?: string; + /** Specify border for ranges of circular gauge * @Default {Object} */ @@ -46798,6 +47711,144 @@ declare namespace ej.datavisualization { ticks?: ScalesTick[]; } + export interface LegendBorder { + + /** Border color of the legend. + * @Default {transparent} + */ + color?: string; + + /** Border width of the legend. + * @Default {1} + */ + width?: number; + } + + export interface LegendItemStyleBorder { + + /** Border color of the legend items. + * @Default {transparent} + */ + color?: string; + + /** Border width of the legend items. + * @Default {1} + */ + width?: number; + } + + export interface LegendItemStyle { + + /** Options for customizing the border of legend items. + */ + border?: LegendItemStyleBorder; + + /** Specifies the height of the legend item shapes. + * @Default {10} + */ + height?: number; + + /** Specifies the width of the legend item shapes. + * @Default {10} + */ + width?: number; + } + + export interface LegendSize { + + /** Specify the height of the legend. Height can be specified in pixel. + * @Default {null} + */ + height?: string; + + /** Specify the width of the legend. Width can be specified in pixel. + * @Default {null} + */ + width?: string; + } + + export interface LegendFont { + + /** Font family for legend item text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style for legend item text. + * @Default {Normal} + */ + fontStyle?: string; + + /** Font weight for legend item text. + * @Default {Regular} + */ + fontWeight?: string; + + /** Font size for legend item text. + * @Default {12px} + */ + size?: string; + + /** Font color of the text for legend items. + * @Default {null} + */ + color?: string; + } + + export interface Legend { + + /** Toggles the visibility of the legend. + * @Default {false} + */ + visible?: boolean; + + /** Specifies the alignment of the legend. + * @Default {Center. See Alignment} + */ + alignment?: ej.datavisualization.CircularGauge.LegendAlignment | string; + + /** Options for customizing the legend border. + */ + border?: LegendBorder; + + /** Fill color for the legend items. By using this property, it displays all legend item shapes in same color.Legend items representing invisible ranges is displayed in gray color. + * @Default {null} + */ + fill?: string; + + /** Gap or padding between the legend items. + * @Default {20} + */ + itemPadding?: number; + + /** Options to customize the style of legend items. + */ + itemStyle?: LegendItemStyle; + + /** Opacity of the legend. + * @Default {1} + */ + opacity?: number; + + /** Places the legend at specified position. Legend can be placed at left, right, top or bottom of the circular gauge. + * @Default {Bottom. See Position} + */ + position?: ej.datavisualization.CircularGauge.LegendPosition | string; + + /** Shape of the legend items. + * @Default {Circle. See Shape} + */ + shape?: ej.datavisualization.CircularGauge.LegendShape | string; + + /** Options to customize the size of the legend. + */ + size?: LegendSize; + + /** Options to customize the font used for legend item text. + */ + font?: LegendFont; + } + export interface Tooltip { /** enable showCustomLabelTooltip of circular gauge @@ -46955,6 +48006,53 @@ declare namespace ej.datavisualization { } } + namespace CircularGauge { + enum LegendAlignment { + //string + Center, + //string + Near, + //string + Far, + } + } + + namespace CircularGauge { + enum LegendPosition { + //string + Left, + //string + Right, + //string + Top, + //string + Bottom, + } + } + + namespace CircularGauge { + enum LegendShape { + //string + Rectangle, + //string + Circle, + //string + Triangle, + //string + Ellipse, + //string + Diamond, + //string + Pentagon, + //string + Slider, + //string + Trapezoid, + //string + Line, + } + } + class DigitalGauge extends ej.Widget { static fn: DigitalGauge; constructor(element: JQuery | Element, options?: DigitalGauge.Model); @@ -47024,6 +48122,11 @@ declare namespace ej.datavisualization { */ isResponsive?: boolean; + /** Specifies the responsiveness of the Digital gauge + * @Default {false} + */ + enableResize?: boolean; + /** Specifies the items for the DigitalGauge. * @Default {null} */ @@ -47384,6 +48487,11 @@ declare namespace ej.datavisualization { */ animate(options: any): void; + /** Prints the rendered chart. + * @returns {void} + */ + print(): void; + /** Exports chart as an image or to an excel file. Chart can be exported as an image only when exportCanvasRendering option is set to true. * @param {string} Type of the export operation to be performed. Following are the two export types that are supported now,1. 'image'2. 'excel'Example * @param {string} URL of the service, where the chart will be exported to excel.Example, @@ -47599,6 +48707,9 @@ declare namespace ej.datavisualization { /** Fires before loading the chart. */ load?(e: LoadEventArgs): void; + /** Fires while performing rectangle zooming in chart. */ + zoomed?(e: ZoomedEventArgs): void; + /** Fires after selected the data in chart. */ rangeSelected?(e: RangeSelectedEventArgs): void; @@ -47694,15 +48805,15 @@ declare namespace ej.datavisualization { /** Instance of the corresponding axis. */ - Axis?: any; + axis?: any; /** Formatted text of the respective label. You can also add custom text to the label. */ - LabelText?: string; + Text?: string; /** Actual value of the label. */ - LabelValue?: string; + Value?: string; /** Set this option to true to cancel the event. */ @@ -48056,6 +49167,42 @@ declare namespace ej.datavisualization { */ type?: string; } + export interface ZoomedEventArgs { + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the chart model object + */ + model?: any; + + /** Name of the event + */ + type?: string; + + /** Selected data collection of object + */ + data?: any; + } + export interface RangeSelectedEventArgs { + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the chart model object + */ + model?: any; + + /** Name of the event + */ + type?: string; + + /** Selected data collection of object + */ + data?: any; + } export interface RangeSelectedEventArgs { @@ -49765,6 +50912,11 @@ declare namespace ej.datavisualization { */ labelPosition?: ej.datavisualization.Chart.LabelPosition | string; + /** Specifies the mode for splitting the data points in pieOfPie series. + * @Default {value. See SplitMode} + */ + splitMode?: ej.datavisualization.Chart.SplitMode | string; + /** Quartile calculation has been performed in three different formulas to render the box and whisker series. * @Default {exclusive} */ @@ -49802,6 +50954,21 @@ declare namespace ej.datavisualization { */ pieCoefficient?: number; + /** Controls the size of the second pie in pieOfPie series. Value ranges from 0 to 1. + * @Default {0.6} + */ + pieOfPieCoefficient?: number; + + /** Split Value of pieofpie series. + * @Default {null} + */ + splitValue?: string; + + /** Distance between the two pie's in pieOfPie series. + * @Default {50} + */ + gapWidth?: number; + /** Name of the property in the datasource that contains fill color for the series. * @Default {null} */ @@ -51141,6 +52308,11 @@ declare namespace ej.datavisualization { */ multiLevelLabels?: PrimaryXAxisMultiLevelLabel[]; + /** Specifies whether the axis elements need to be placed nearby the axis line, while crossing. + * @Default {true} + */ + showNextToAxisLine?: boolean; + /** Options for customizing the strip lines. * @Default {[ ]} */ @@ -51818,6 +52990,11 @@ declare namespace ej.datavisualization { */ multiLevelLabels?: AxesMultiLevelLabel[]; + /** Specifies whether the axis elements need to be placed nearby the axis line, while crossing. + * @Default {true} + */ + showNextToAxisLine?: boolean; + /** Options for customizing the strip lines. * @Default {[ ]} */ @@ -52491,6 +53668,11 @@ declare namespace ej.datavisualization { */ multiLevelLabels?: PrimaryYAxisMultiLevelLabel[]; + /** Specifies whether the axis elements need to be placed nearby the axis line, while crossing. + * @Default {true} + */ + showNextToAxisLine?: boolean; + /** Options for customizing the strip lines. * @Default {[ ]} */ @@ -53719,6 +54901,11 @@ declare namespace ej.datavisualization { */ labelPosition?: ej.datavisualization.Chart.LabelPosition | string; + /** Specifies the mode for splitting the data points in pieOfPie series. + * @Default {value. See SplitMode} + */ + splitMode?: ej.datavisualization.Chart.SplitMode | string; + /** Quartile calculation has been performed in three different formulas to render the boxplot series . * @Default {exclusive} */ @@ -53761,6 +54948,21 @@ declare namespace ej.datavisualization { */ pieCoefficient?: number; + /** Controls the size of the second pie in pieOfPie series. Value ranges from 0 to 1. + * @Default {0.6} + */ + pieOfPieCoefficient?: number; + + /** Split Value of pieofpie series. + * @Default {null} + */ + splitValue?: string; + + /** Distance between the two pie's in pieOfPie series. + * @Default {50} + */ + gapWidth?: number; + /** Options for customizing the empty point in the series. */ emptyPointSettings?: SeriesEmptyPointSettings; @@ -54223,6 +55425,19 @@ declare namespace ej.datavisualization { OutsideExtended, } } + + namespace Chart { + enum SplitMode { + //string + Position, + //string + Value, + //string + Percentage, + //string + Indexes, + } + } namespace Chart { enum boxPlotMode { //string @@ -54719,6 +55934,11 @@ declare namespace ej.datavisualization { */ enableScrollbar?: boolean; + /** Enable the resize option in the rangenavigator. + * @Default {false} + */ + enableAutoResizing?: boolean; + /** Toggles the direction of rendering the range navigator control. * @Default {false} */ @@ -54813,6 +56033,12 @@ declare namespace ej.datavisualization { /** Fires on when starting to change the scrollbar position of range navigator. */ scrollStart?(e: ScrollStartEventArgs): void; + /** Fires on when starting to change the slider position of range navigator. */ + selectedRangeStart?(e: SelectedRangeStartEventArgs): void; + + /** Fires when the selection ends in the range navigator */ + selectedRangeEnd?(e: SelectedRangeEndEventArgs): void; + /** Fires on changes ending the scrollbar position of range navigator. */ scrollEnd?(e: ScrollEndEventArgs): void; } @@ -54928,6 +56154,19 @@ declare namespace ej.datavisualization { type?: string; } + export interface SelectedRangeStartEventArgs { + + /** if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + } + + export interface SelectedRangeEndEventArgs { + + /** if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + } export interface ScrollEndEventArgs { /** parameters from RangeNavigator @@ -55644,6 +56883,24 @@ declare namespace ej.datavisualization { width?: number; } + export interface ValueAxisSettingsRange { + + /** Default Value + * @Default {null} + */ + min?: number; + + /** Default Value + * @Default {null} + */ + max?: number; + + /** Default Value + * @Default {null} + */ + interval?: number; + } + export interface ValueAxisSettings { /** Options for customizing the axis line. @@ -55662,6 +56919,10 @@ declare namespace ej.datavisualization { */ majorTickLines?: ValueAxisSettingsMajorTickLines; + /** You can customize the range of the axis by setting minimum , maximum and interval. + */ + range?: ValueAxisSettingsRange; + /** If the range is not given explicitly, range will be calculated automatically. You can customize the automatic range calculation using rangePadding. * @Default {none} */ @@ -55827,6 +57088,11 @@ declare namespace ej.datavisualization { */ enableAnimation?: boolean; + /** Controls whether bullet graph has to be responsive while resizing. + * @Default {true} + */ + enableResizing?: boolean; + /** Specifies the direction of flow in bullet graph. Neither it may be backward nor forward. * @Default {forward} */ @@ -55842,6 +57108,16 @@ declare namespace ej.datavisualization { */ isResponsive?: boolean; + /** Specifies to convert the date object to string, using locale settings. + * @Default {false} + */ + enableGroupSeparator?: boolean; + + /** Name of the culture based on which bulletgraph should be localized. + * @Default {en-US} + */ + locale?: string; + /** Bullet graph will render in the specified orientation. * @Default {horizontal} */ @@ -55902,6 +57178,9 @@ declare namespace ej.datavisualization { /** Fires on rendering the labels. */ drawLabels?(e: DrawLabelsEventArgs): void; + /** Fires on rendering the ticks. */ + drawTicks?(e: DrawTicksEventArgs): void; + /** Fires on rendering the qualitative ranges. */ drawQualitativeRanges?(e: DrawQualitativeRangesEventArgs): void; @@ -56023,6 +57302,11 @@ declare namespace ej.datavisualization { labelType?: string; } + export interface DrawTicksEventArgs { + /** Returns the cancel option value. + */ + cancel?: boolean; + } export interface DrawQualitativeRangesEventArgs { /** returns the object of the bullet graph. @@ -57952,6 +59236,15 @@ declare namespace ej.datavisualization { /** Triggers on treemap item selected. */ treeMapItemSelected?(e: TreeMapItemSelectedEventArgs): void; + + /** Triggers when drilldown is started */ + drillStarted?(e: DrillStartedEventArgs): void; + + /** Triggers on treemap drilldown item selected. */ + drillDownItemSelected?(e: DrillDownItemSelectedEventArgs): void; + + /** Triggers after refreshing the treemap items. */ + refreshed?(e: RefreshedEventArgs): void; } export interface TreeMapItemSelectedEventArgs { @@ -57961,6 +59254,27 @@ declare namespace ej.datavisualization { originalEvent?: any; } + export interface DrillStartedEventArgs { + + /** Returns selected drilled treeMap object. + */ + originalEvent?: any; + } + + export interface DrillDownItemSelectedEventArgs { + + /** Returns selected drilldown treeMap object. + */ + originalEvent?: any; + } + + export interface RefreshedEventArgs { + + /** Refresh and load the treemap. + */ + originalEvent?: any; + } + export interface UniColorMapping { /** Specifies the uniform color mapping of the treemap @@ -58085,6 +59399,11 @@ declare namespace ej.datavisualization { */ borderThickness?: number; + /** Specifies the space between the leaf items. + * @Default {0} + */ + gap?: number; + /** Specifies the label template of the leaf item. * @Default {null} */ @@ -58392,13 +59711,13 @@ declare namespace ej.datavisualization { */ findNode(name: string): any; - /** Fit the diagram content into diagram viewport - * @param {string} to set the mode of fit to command. See [Fit Mode](/api/js/global#fitmode) - * @param {string} to set whether the region to be fit will be based on diagram elements or page settings [Region](/api/js/global#region) - * @param {any} to set the required margin - * @returns {void} - */ - fitToPage(mode?: string, region?: string, margin?: any): void; + /** Fit the diagram content into diagram viewport + * @param {ej.datavisualization.Diagram.FitMode} to set the mode of fit to command. + * @param {ej.datavisualization.Diagram.Region} to set whether the region to be fit will be based on diagram elements or page settings. + * @param {any} to set the required margin + * @returns {void} + */ + fitToPage(mode?: ej.datavisualization.Diagram.FitMode, region?: ej.datavisualization.Diagram.Region, margin?: any): void; /** Group the selected nodes and connectors * @returns {void} @@ -58617,17 +59936,17 @@ declare namespace ej.datavisualization { */ fileName?: string; - /** format of the exported file/data. See [File Formats](/api/js/global#fileformats). + /** format of the exported file/data. */ - format?: string; + format?: ej.datavisualization.Diagram.FileFormats; - /** to set whether to export diagram as a file or as raw data. See [Export Modes](/api/js/global#exportmodes). + /** to set whether to export diagram as a file or as raw data. */ - mode?: string; + mode?: ej.datavisualization.Diagram.ExportModes; - /** to set the region of the diagram to be exported. See [Region](/api/js/global#region). + /** to set the region of the diagram to be exported. */ - region?: string; + region?: ej.datavisualization.Diagram.Region; /** to export any custom region of diagram. */ @@ -58637,9 +59956,9 @@ declare namespace ej.datavisualization { */ margin?: any; - /** to set stretch to the exported data. + /** to resize the diagram content to fill its allocated space. */ - stretch?: string; + stretch?: ej.datavisualization.Diagram.Stretch; } export interface Zoom { @@ -58925,6 +60244,10 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter to specify whether or not to cancel the event + */ + cancel?: boolean; } export interface ConnectionChangeEventArgs { @@ -59052,6 +60375,17 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + /** parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; + + /** parameter returns the actual click event arguments that explains which button is clicked + */ + model?: any; + + /** parameter returns the type of the event triggered + */ + type?: string; } export interface ContextMenuClickEventArgs { @@ -59083,6 +60417,22 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter to specify whether or not to cancel the event + */ + cancel?: boolean; + + /** parameter returns the elementof the object that was clicked + */ + element?: any; + + /** parameter returns the object that is selected + */ + selectedItem?: any; + + /** parameter returns the model of the diagram + */ + events?: any; } export interface DoubleClickEventArgs { @@ -59098,6 +60448,10 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter to specify whether or not to cancel the event + */ + cancel?: boolean; } export interface DragEventArgs { @@ -59125,6 +60479,10 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter returns the offset of the selecteditems + */ + offset?: any; } export interface DragEnterEventArgs { @@ -59148,6 +60506,10 @@ declare namespace ej.datavisualization { */ element?: any; + /** parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; + /** parameter returns the id of the diagram */ diagramId?: string; @@ -59204,7 +60566,7 @@ declare namespace ej.datavisualization { /** parameter returns the enum which defines the type of the source */ - sourceType?: string; + objectType?: string; /** parameter returns the id of the diagram */ @@ -59212,7 +60574,7 @@ declare namespace ej.datavisualization { } export interface EditorFocusChangeEventArgs { - /** Returns the cancel option value. + /** parameter to specify whether or not to cancel the event */ cancel?: boolean; } @@ -59253,6 +60615,14 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter to specify whether or not to cancel the event + */ + cancel?: boolean; + + /** parameter returns the model of the diagram + */ + cause?: boolean; } export interface ItemClickEventArgs { @@ -59269,7 +60639,7 @@ declare namespace ej.datavisualization { */ cancel?: boolean; - /** parameter returns the actual click event arguments that explains which button is clicked + /** parameter returns the model of the diagram */ event?: any; @@ -59295,6 +60665,10 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; } export interface MouseLeaveEventArgs { @@ -59311,6 +60685,10 @@ declare namespace ej.datavisualization { */ target?: any; + /** parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; + /** parameter returns the id of the diagram */ diagramId?: string; @@ -59330,6 +60708,10 @@ declare namespace ej.datavisualization { */ target?: any; + /** parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; + /** parameter returns the id of the diagram */ diagramId?: string; @@ -59383,6 +60765,10 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter defines whether to cancel the property change or not + */ + cancel?: boolean; } export interface RotationChangeEventArgs { @@ -59406,6 +60792,10 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter returns the actual click event arguments that explains which button is clicked + */ + cause?: string; } export interface ScrollChangeEventArgs { @@ -59418,9 +60808,17 @@ declare namespace ej.datavisualization { */ oldValues?: any; + /** parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; + /** parameter returns the id of the diagram */ diagramId?: string; + + /** Parameter returns the new zoom value, horizontal and vertical scroll offsets. + */ + cause?: string; } export interface SegmentChangeEventArgs { @@ -59472,14 +60870,18 @@ declare namespace ej.datavisualization { */ cancel?: boolean; - /** triggers before and after adding the selection to the object in the diagram which can be differentiated through `state` argument. - * We can cancel the event only before the selection of the object. + /** triggers before and after adding the selection to the object in the diagram which can be differentiated through `state` argument. We can cancel the event only + * before the selection of the object. */ state?: string; /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter returns the actual cause of the event + */ + cause?: string; } export interface SizeChangeEventArgs { @@ -59511,6 +60913,10 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter returns the direction of the node is resized + */ + direction?: string; } export interface TextChangeEventArgs { @@ -59530,6 +60936,10 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter to specify whether or not to cancel the event + */ + cancel?: boolean; } export interface CreateEventArgs { @@ -60173,6 +61583,105 @@ declare namespace ej.datavisualization { showCustomMenuItemsOnly?: boolean; } + export interface DataSourceSettingsCrudAction { + + /** Specifies the create method which is used to get the nodes to be added from client side to the server side + * @Default {null} + */ + create?: string; + + /** Specifies the update method which is used to get the updated data from client side to the server side + * @Default {null} + */ + update?: string; + + /** Specifies the destroy method which is used to get the deleted items data from client side to the server side + * @Default {null} + */ + destroy?: string; + + /** Specifies the read method to get the created nodes from client side to the server side + * @Default {null} + */ + read?: string; + } + + export interface DataSourceSettingsConnectionDataSourceCrudAction { + + /** Specifies the create method which is used to get the connectors to be added from client side to the server side + * @Default {null} + */ + create?: string; + + /** Specifies the update method which is used to get the updated connectors from client side to the server side + * @Default {null} + */ + update?: string; + + /** Specifies the destroy method which is used to get the deleted items data from client side to the server side + * @Default {null} + */ + destroy?: string; + + /** Specifies the read method which is used to get the data from client side to the server side + * @Default {null} + */ + read?: string; + } + + export interface DataSourceSettingsConnectionDataSource { + + /** Sets the datasource for the connection datasource settings items. + * @Default {null} + */ + dataSource?: string; + + /** Sets the unique id of the connection data source item + * @Default {null} + */ + id?: string; + + /** Sets the sourcenode of the connection data source item + * @Default {null} + */ + sourceNode?: string; + + /** Sets the targetnode of the connection data source item + * @Default {null} + */ + targetNode?: string; + + /** Sets the sourcepoint-x value of the connection data source item + * @Default {null} + */ + sourcePointX?: string; + + /** Sets the sourcePoint-y value of the connection data source item + * @Default {null} + */ + sourcePointY?: string; + + /** Sets the targetPoint-x value of the connection data source item + * @Default {null} + */ + targetPointX?: string; + + /** Sets the targetPoint-y value of the connection data source item + * @Default {null} + */ + targetPointY?: string; + + /** Specifies the method name which is used to get updated connectors from client side to the server side + * @Default {null} + */ + crudAction?: DataSourceSettingsConnectionDataSourceCrudAction; + + /** Specifies the customfields to get the updated data from client side to the server side + * @Default {[]} + */ + customFields?: any[]; + } + export interface DataSourceSettings { /** Defines the data source either as a collection of objects or as an instance of ej.DataManager @@ -60202,6 +61711,21 @@ declare namespace ej.datavisualization { * @Default {null} */ tableName?: string; + + /** Specifies the method name which is used to get the updated data from client side to the server side + * @Default {null} + */ + crudAction?: DataSourceSettingsCrudAction; + + /** Specifies the customfields to get the updated data from client side to the server side + * @Default {[]} + */ + customFields?: any[]; + + /** Defines the data source either as a collection of objects or as an instance of ej.DataManager + * @Default {null} + */ + connectionDataSource?: DataSourceSettingsConnectionDataSource; } export interface DefaultSettings { @@ -60285,6 +61809,11 @@ declare namespace ej.datavisualization { */ getLayoutInfo?: any; + /** Defines a method to customize the segments based on source and target nodes. + * @Default {null} + */ + getConnectorSegments?: any; + /** Sets the space to be horizontally left between nodes * @Default {30} */ @@ -61534,6 +63063,10 @@ declare namespace ej.datavisualization { export interface SelectedItemsUserHandle { + /** Defines the name of the user handle + */ + name?: string; + /** Defines the background color of the user handle * @Default {#2382c3} */ @@ -62691,6 +64224,57 @@ declare namespace ej.datavisualization { Mouse, } } + namespace Diagram { + enum FileFormats { + //Used to export the diagram into JPG format. + JPG, + //Used to export the diagram into PNG format. + PNG, + //Used to export the diagram into BMP format. + BMP, + //Used to export the diagram into SVG format. + SVG, + } + } + namespace Diagram { + enum ExportModes { + //Used to export the diagram as a file. + Download, + //Used to export the diagram as raw data. + Data, + } + } + namespace Diagram { + enum Region { + //Used to export the content of the diagram only. + Content, + //Used to export the page region of the diagram. + PageSettings, + } + } + namespace Diagram { + enum Stretch { + //The diagram content preserves its original size. + None, + //The diagram content is resized to fill the destination dimensions. The aspect ratio is not preserved. + Fill, + //The diagram content is resized to fit in the destination dimensions while it preserves its native aspect ratio. + Uniform, + //The diagram content is resized to fill the destination dimensions while it preserves its native aspect ratio. If the aspect ratio of the destination rectangle differs from the source, + //the source content is clipped to fit in the destination dimensions. + UniformToFill, + } + } + namespace Diagram { + enum FitMode { + //Used to fit the diagram content based on page size. + Page, + //Used to fit the diagram content based on diagram width. + Width, + //Used to fit the diagram content based on diagram height. + Height, + } + } namespace Diagram { enum ZoomCommand { //Used to zoom in the Diagram @@ -63378,6 +64962,11 @@ declare namespace ej.datavisualization { */ rangeBandSettings?: RangeBandSettings; + /** Name of the culture based on which sparkline should be localized. + * @Default {en-US} + */ + locale?: string; + /** Name of a field in data source, where the fill color for all the data points is generated. */ palette?: string; @@ -63392,6 +64981,11 @@ declare namespace ej.datavisualization { */ enableCanvasRendering?: boolean; + /** Specify to convert the date object to string, using locale settings. + * @Default {false} + */ + enableGroupSeparator?: boolean; + /** Specifies the dataSource for the series. It can be an array of JSON objects or an instance of ej.DataManager. * @Default {null} */ @@ -65079,6 +66673,7 @@ declare namespace ej.datavisualization { } + interface JQueryXHR { /** * Returns the cancel option value. @@ -65243,6 +66838,9 @@ interface JQuery { ejPivotTreeMap(options?: ej.PivotTreeMap.Model): JQuery; ejPivotTreeMap(memberName: any, value?: any, param?: any): any; + ejPrint(options?: ej.Print.Model): JQuery; + ejPrint(memberName: any, value?: any, param?: any): any; + ejProgressBar(options?: ej.ProgressBar.Model): JQuery; ejProgressBar(memberName: any, value?: any, param?: any): any; @@ -65401,6 +66999,7 @@ interface JQuery { data(key: "ejPivotPager"): ej.PivotPager; data(key: "ejPivotSchemaDesigner"): ej.PivotSchemaDesigner; data(key: "ejPivotTreeMap"): ej.PivotTreeMap; + data(key: "ejPrint"): ej.Print; data(key: "ejProgressBar"): ej.ProgressBar; data(key: "ejRadialMenu"): ej.RadialMenu; data(key: "ejRadialSlider"): ej.RadialSlider; diff --git a/types/express-serve-static-core/index.d.ts b/types/express-serve-static-core/index.d.ts index 8e1f075f03..dd012cab4e 100644 --- a/types/express-serve-static-core/index.d.ts +++ b/types/express-serve-static-core/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Express 4.x // Project: http://expressjs.com -// Definitions by: Boris Yankov , Michał Lytek +// Definitions by: Boris Yankov , Michał Lytek , Kacper Polak // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // This extracts the core definitions from express to prevent a circular dependency between express and serve-static /// @@ -475,7 +475,6 @@ interface MediaType { } interface Send { - (status: number, body?: any): Response; (body?: any): Response; } diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 9b03944e9a..efce9f3dc4 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -1256,13 +1256,14 @@ export interface RoutingTableEntry { /** * [See docs](https://hapijs.com/api/16.1.1#servertablehost) > return value + * For source [See source](https://github.com/hapijs/hapi/blob/v16.1.1/lib/route.js#L71) */ export interface Route { /** * the route config with defaults applied. * TODO check type of RouteConfiguration here is correct */ - settings: RouteConfiguration; + settings: RouteAdditionalConfigurationOptions; /** * the HTTP method in lower case. * TODO, check if it can contain 'head' or not. @@ -1270,6 +1271,18 @@ export interface Route { method: HTTP_METHODS_PARTIAL_lowercase; /** the route path. */ path: string; + + params: string[]; + + connection: ServerConnection; + + fingerprint: string; + + plugin?: any; + + public: RoutePublicInterface; + + server: Server; } /** @@ -1618,8 +1631,8 @@ export interface ServerConnection { /** Described in server.inject [See docs](https://hapijs.com/api/16.1.1#serverinjectoptions-callback) */ inject(options: string | InjectedRequestOptions, callback: (res: InjectedResponseObject) => void): void; inject(options: string | InjectedRequestOptions, ): Promise; - /** Described in server.table [See docs](https://hapijs.com/api/16.1.1#servertablehost) */ - table(host?: string): RoutingTableEntry; + /** Mentioned but not documented under server.connections [See docs](https://hapijs.com/api/16.1.1#serverconnections) */ + table(host?: string): Route[]; /** Described in server.table [See docs](https://hapijs.com/api/16.1.1#serverlookupid) */ lookup(id: string): RoutePublicInterface | null; /** Described in server.table [See docs](https://hapijs.com/api/16.1.1#servermatchmethod-path-host) */ diff --git a/types/hapi/test/connection/table.ts b/types/hapi/test/connection/table.ts index dee4741b07..24eaa28ddc 100644 --- a/types/hapi/test/connection/table.ts +++ b/types/hapi/test/connection/table.ts @@ -18,3 +18,5 @@ const table = connection.table(); } ] */ + +table.map(({method, path, settings: {description}}) => { }); diff --git a/types/jest-matchers/index.d.ts b/types/jest-matchers/index.d.ts new file mode 100644 index 0000000000..27e6a5b9f0 --- /dev/null +++ b/types/jest-matchers/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for jest-matchers 20.0 +// Project: https://github.com/facebook/jest#readme +// Definitions by: Joscha Feth +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +export = expect; diff --git a/types/jest-matchers/jest-matchers-tests.ts b/types/jest-matchers/jest-matchers-tests.ts new file mode 100644 index 0000000000..7484dd5ed8 --- /dev/null +++ b/types/jest-matchers/jest-matchers-tests.ts @@ -0,0 +1,3 @@ +import * as expect from 'jest-matchers'; + +expect('x').toEqual('x'); diff --git a/types/jest-matchers/tsconfig.json b/types/jest-matchers/tsconfig.json new file mode 100644 index 0000000000..37a7e86d8d --- /dev/null +++ b/types/jest-matchers/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", + "jest-matchers-tests.ts" + ] +} diff --git a/types/jest-matchers/tslint.json b/types/jest-matchers/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jest-matchers/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jquery.pnotify/index.d.ts b/types/jquery.pnotify/index.d.ts index 1d222efb26..3355f889ce 100644 --- a/types/jquery.pnotify/index.d.ts +++ b/types/jquery.pnotify/index.d.ts @@ -133,6 +133,10 @@ interface PNotifyOptions { * Whether to escape the content of the text. (Not allow HTML.) */ text_escape?: boolean; + /** + * Support for PNotifyconfirm options + */ + confirm?: PNotifyconfirm /** * What styling classes to use. (Can be either "brighttheme", "jqueryui", "bootstrap2", "bootstrap3", "fontawesome" or a custom style object) */ diff --git a/types/jwt-decode/index.d.ts b/types/jwt-decode/index.d.ts index 5cf3772b68..d27cdf91e9 100644 --- a/types/jwt-decode/index.d.ts +++ b/types/jwt-decode/index.d.ts @@ -1,12 +1,12 @@ -// Type definitions for jwt-decode v1.4.0 +// Type definitions for jwt-decode v2.2.0 // Project: https://github.com/auth0/jwt-decode -// Definitions by: Giedrius Grabauskas +// Definitions by: Giedrius Grabauskas , Mads Madsen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace JwtDecode { interface JwtDecodeStatic { - (token: string): any; + (token: string, options?: { header: boolean }): any; } } diff --git a/types/jwt-decode/jwt-decode-tests.ts b/types/jwt-decode/jwt-decode-tests.ts index 4ec792fde1..7e65c2a5a4 100644 --- a/types/jwt-decode/jwt-decode-tests.ts +++ b/types/jwt-decode/jwt-decode-tests.ts @@ -9,4 +9,10 @@ interface TokenDto { iat: number; } -let decodedToken = jwtDecode(token) as TokenDto; +interface TokenHeaderDto { + typ: string; + alg: string; +} + +let decodedTokenPayload = jwtDecode(token) as TokenDto; +let decodedTokenHeader = jwtDecode(token, { header: true }) as TokenHeaderDto; \ No newline at end of file diff --git a/types/massive/index.d.ts b/types/massive/index.d.ts index 512c9067e2..1ed6b62ac6 100644 --- a/types/massive/index.d.ts +++ b/types/massive/index.d.ts @@ -1,105 +1,42 @@ -// Type definitions for massive-js 2.2 -// Project: https://github.com/robconery/massive-js +// Type definitions for massive 3.x +// Project: https://github.com/dmfay/massive-js.git // Definitions by: Pascal Birchler +// Clarence Ho // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -export namespace massive { - interface ConnectionOptions { - connectionString?: string; - db?: string; - } +/// - interface Doc { - findDoc(context: any, callback: ResultCallback): void; - searchDoc( - options: { keys: string[], term: string }, - callback: ResultCallback): void; - saveDoc(context: string, callback: ResultCallback): void; - destroy(context: any, callback: ResultCallback): void; - } +export = massive; - interface QueryFile { - schema: string; - name: string; - db: Massive; - delimitedName: string; - delimitedSchema: string; - fullname: string; - delimitedFullName: string; - sql: string; - filePath: string; - } +declare function massive( + connection: object | string, + loaderConfig?: object, + driverConfig?: object): Promise; - interface QueryFunction { - find(params: any|any[], callback: ResultCallback): void; - } +declare namespace massive { + interface ConnectionInfo { + user?: string; + database?: string; + password?: string | null; + port?: number; + host?: string; + ssl?: boolean; + application_name?: string; + fallback_application_name?: boolean; + } - interface QueryArguments { - sql: string; - options: any; - params: any; - next: ResultCallback; - } + interface Database { + attach(ctor: any, ...sources: any[]): Promise; + detach(entity: string, collection: string): void; + reload(): void; + query(query: any, params: any, options: any): Promise; + saveDoc(collection: any, doc: any): any; + createDocumentTable(path: any): Promise; + getObject(path: any, collection: any): object; + dropTable(table: string, options: any): void; + createSchema(schemaName: string): void; + dropSchema(schemaName: string, options: any): void; + [name: string]: any; + } } - -export interface Massive { - custom: any; - comment: Table; - friendship: Table; - participation: Table; - person: Table; - practice: Table; - practicesession: Table; - sport: Table; - testdata(callback: ResultCallback): void; - team: Table; - teammember: Table; - teamsport: Table; - scriptsDir: string; - connectionString: string; - query(): void; - stream(): void; - executeSqlFile(args: any, next: ResultCallback): void; - end(): void; - tables: Array; - views: any[]; - queryFiles: massive.QueryFile[]; - schemas: any[]; - functions: any[]; - allowedSchemas: string; - blacklist: string; - exceptions: string; - excludeFunctions: boolean; - functionBlacklist: string; -} - -export type ResultCallback = (err: Error, res: any) => void; -export type ConnectCallback = (err: Error, db: Massive) => void; - -export interface QueryOptions { - limit?: number; - order?: string; - offset?: number; - columns?: string[]; -} - -export interface Table { - count(context: any, callback: ResultCallback): void; - find(context: any, callback: ResultCallback): void; - find(context: any, options: QueryOptions, callback: ResultCallback): void; - findOne(context: any, callback: ResultCallback): void; - findOne(context: any, options: QueryOptions, callback: ResultCallback): void; - insert(context: any, callback: ResultCallback): void; - save(context: any, callback: ResultCallback): void; - update(context: any, callback: ResultCallback): void; - update(context: any, data: any, callback: ResultCallback): void; - destroy(context: any, callback: ResultCallback): void; -} - -export function connectSync(options: massive.ConnectionOptions): Massive; - -export function connect(options: massive.ConnectionOptions, callback: ConnectCallback): void; - -export function run(context: string, filter: number|number[], callback: ResultCallback): void; - -export function saveDoc(name: string, data: any, callback: ResultCallback): void; diff --git a/types/massive/massive-tests.ts b/types/massive/massive-tests.ts index cb53e3e7c8..e43755b7f3 100644 --- a/types/massive/massive-tests.ts +++ b/types/massive/massive-tests.ts @@ -1,5 +1,10 @@ -import * as Massive from 'massive'; +import massive = require('massive'); -Massive.connect({connectionString: 'foo'}, (err: Error, db: Massive.Massive) => {}); +let dbconn: massive.Database; -Massive.run('foo', 123, (err: Error, db: Massive.Massive) => {}); +massive('postgres://app:password@localhost:5432/app').then( db => { + console.log(`DB connected successfully`); + dbconn = db; +}).catch(err => { + console.error(`Error connecting DB`); +}); diff --git a/types/massive/tsconfig.json b/types/massive/tsconfig.json index 7c91e19b44..cfa32399c8 100644 --- a/types/massive/tsconfig.json +++ b/types/massive/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5" + "es2015" ], "noImplicitAny": true, "noImplicitThis": true, @@ -19,4 +19,4 @@ "index.d.ts", "massive-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/material-ui/material-ui-tests.tsx b/types/material-ui/material-ui-tests.tsx index 77a0445fb2..9a0eddd0b9 100644 --- a/types/material-ui/material-ui-tests.tsx +++ b/types/material-ui/material-ui-tests.tsx @@ -319,8 +319,8 @@ class DeepDownTheTree extends React.Component<{} & {muiTheme: MuiTheme}, {}> { } } - -const MuiThemeableFunction = muiThemeable()((props: {label: string, muiTheme?: MuiTheme}) => { +type Props = { label: string, muiTheme?: MuiTheme }; +const MuiThemeableFunction = muiThemeable(), Props>(props => { return ( Applied the Theme to functional component: {props.label}. diff --git a/types/materialize-css/index.d.ts b/types/materialize-css/index.d.ts index 12dbeb5aa0..2c43daf285 100644 --- a/types/materialize-css/index.d.ts +++ b/types/materialize-css/index.d.ts @@ -316,8 +316,9 @@ declare namespace Materialize { * The string function call that you want to make when the user scrolls to the threshold. * It will only be called once. * Example: 'console.log("hello, world!")'; + * or callback: () => { console.log('hello world'); } */ - callback?: string; + callback?: string | (() => void); } interface TabOptions { diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index e115aa0666..ebe427a427 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -48,12 +48,12 @@ export interface MongoClientOptions extends SocketOptions, SSLOptions, HighAvailabilityOptions { - // The logging level (error/warn/info/debug) - loggerLevel?: string; - // Custom logger object - logger?: Object; - // Default: false; - validateOptions?: Object; + // The logging level (error/warn/info/debug) + loggerLevel?: string; + // Custom logger object + logger?: Object; + // Default: false; + validateOptions?: Object; } export interface SSLOptions { @@ -93,7 +93,7 @@ export class ReadPreference { constructor(mode: string, tags: Object); mode: string; tags: any; - options: { maxStalenessSeconds?: number}; // Max Secondary Read Stalleness in Seconds + options: { maxStalenessSeconds?: number }; // Max Secondary Read Stalleness in Seconds static PRIMARY: string; static PRIMARY_PREFERRED: string; static SECONDARY: string; @@ -105,7 +105,7 @@ export class ReadPreference { // http://mongodb.github.io/node-mongodb-native/2.2/api/Db.html export interface DbCreateOptions { - + // If the database authentication is dependent on another databaseName. authSource?: string; // Default: null;https://docs.mongodb.com/manual/reference/write-concern/#write-concern @@ -170,14 +170,14 @@ export interface ServerOptions extends SSLOptions { } // http://mongodb.github.io/node-mongodb-native/2.2/api/Mongos.html -export interface MongosOptions extends SSLOptions, HighAvailabilityOptions{ +export interface MongosOptions extends SSLOptions, HighAvailabilityOptions { // Default: 15; Cutoff latency point in MS for MongoS proxy selection acceptableLatencyMS?: number; socketOptions?: SocketOptions; } // http://mongodb.github.io/node-mongodb-native/2.2/api/ReplSet.html -export interface ReplSetOptions extends SSLOptions, HighAvailabilityOptions { +export interface ReplSetOptions extends SSLOptions, HighAvailabilityOptions { // The max staleness to secondary reads (values under 10 seconds cannot be guaranteed); maxStalenessSeconds?: number; // The name of the replicaset to connect to. @@ -215,20 +215,20 @@ export class Db extends EventEmitter { close(forceClose?: boolean): Promise; close(forceClose: boolean, callback: MongoCallback): void; // http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#collection - collection(name: string): Collection; - collection(name: string, callback: MongoCallback): Collection; - collection(name: string, options: DbCollectionOptions, callback: MongoCallback): Collection; + collection(name: string): Collection; + collection(name: string, callback: MongoCallback>): Collection; + collection(name: string, options: DbCollectionOptions, callback: MongoCallback>): Collection; //http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#collections - collections(): Promise; - collections(callback: MongoCallback): void; + collections(): Promise[]>; + collections(callback: MongoCallback[]>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#command command(command: Object, callback: MongoCallback): void; command(command: Object, options?: { readPreference: ReadPreference | string }): Promise; command(command: Object, options: { readPreference: ReadPreference | string }, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#createCollection - createCollection(name: string, callback: MongoCallback): void; - createCollection(name: string, options?: CollectionCreateOptions): Promise; - createCollection(name: string, options: CollectionCreateOptions, callback: MongoCallback): void; + createCollection(name: string, callback: MongoCallback>): void; + createCollection(name: string, options?: CollectionCreateOptions): Promise>; + createCollection(name: string, options: CollectionCreateOptions, callback: MongoCallback>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#createIndex createIndex(name: string, fieldOrSpec: string | Object, callback: MongoCallback): void; createIndex(name: string, fieldOrSpec: string | Object, options?: IndexOptions): Promise; @@ -270,9 +270,9 @@ export class Db extends EventEmitter { removeUser(username: string, options?: { w?: number | string, wtimeout?: number, j?: boolean }): Promise; removeUser(username: string, options: { w?: number | string, wtimeout?: number, j?: boolean }, callback: MongoCallback): void; // http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#renameCollection - renameCollection(fromCollection: string, toCollection: string, callback: MongoCallback): void; - renameCollection(fromCollection: string, toCollection: string, options?: { dropTarget?: boolean }): Promise; - renameCollection(fromCollection: string, toCollection: string, options: { dropTarget?: boolean }, callback: MongoCallback): void; + renameCollection(fromCollection: string, toCollection: string, callback: MongoCallback>): void; + renameCollection(fromCollection: string, toCollection: string, options?: { dropTarget?: boolean }): Promise>; + renameCollection(fromCollection: string, toCollection: string, options: { dropTarget?: boolean }, callback: MongoCallback>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#stats stats(callback: MongoCallback): void; stats(options?: { scale?: number }): Promise; @@ -443,7 +443,7 @@ export interface FSyncOptions { } // Documentation : http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html -export interface Collection { +export interface Collection { // Get the collection name. collectionName: string; // Get the full collection namespace. @@ -455,10 +455,8 @@ export interface Collection { // Get current index hint for collection. hint: any; //http://mongodb.github.io/node-mongodb-native/2.1/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; + aggregate(pipeline: Object[], callback: MongoCallback): AggregationCursor; + aggregate(pipeline: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback): AggregationCursor; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#bulkWrite bulkWrite(operations: Object[], callback: MongoCallback): void; bulkWrite(operations: Object[], options?: CollectionBluckWriteOptions): Promise; @@ -497,25 +495,25 @@ export interface Collection { dropIndexes(): Promise; dropIndexes(callback?: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#find - find(query?: Object): Cursor; + find(query?: Object): Cursor; /** @deprecated */ - find(query: Object, fields?: Object, skip?: number, limit?: number, timeout?: number): Cursor; + find(query: Object, fields?: Object, skip?: number, limit?: number, timeout?: number): Cursor; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOne - findOne(filter: Object, callback: MongoCallback): void; - findOne(filter: Object, options?: FindOneOptions): Promise; - findOne(filter: Object, options: FindOneOptions, callback: MongoCallback): void; + findOne(filter: Object, callback: MongoCallback): void; + findOne(filter: Object, options?: FindOneOptions): Promise; + findOne(filter: Object, options: FindOneOptions, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndDelete - findOneAndDelete(filter: Object, callback: MongoCallback): void; - findOneAndDelete(filter: Object, options?: { projection?: Object, sort?: Object, maxTimeMS?: number }): Promise; - findOneAndDelete(filter: Object, options: { projection?: Object, sort?: Object, maxTimeMS?: number }, callback: MongoCallback): void; + findOneAndDelete(filter: Object, callback: MongoCallback>): void; + findOneAndDelete(filter: Object, options?: { projection?: Object, sort?: Object, maxTimeMS?: number }): Promise>; + findOneAndDelete(filter: Object, options: { projection?: Object, sort?: Object, maxTimeMS?: number }, callback: MongoCallback>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndReplace - findOneAndReplace(filter: Object, replacement: Object, callback: MongoCallback): void; - findOneAndReplace(filter: Object, replacement: Object, options?: FindOneAndReplaceOption): Promise; - findOneAndReplace(filter: Object, replacement: Object, options: FindOneAndReplaceOption, callback: MongoCallback): void; + findOneAndReplace(filter: Object, replacement: Object, callback: MongoCallback>): void; + findOneAndReplace(filter: Object, replacement: Object, options?: FindOneAndReplaceOption): Promise>; + findOneAndReplace(filter: Object, replacement: Object, options: FindOneAndReplaceOption, callback: MongoCallback>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndUpdate - findOneAndUpdate(filter: Object, update: Object, callback: MongoCallback): void; - findOneAndUpdate(filter: Object, update: Object, options?: FindOneAndReplaceOption): Promise; - findOneAndUpdate(filter: Object, update: Object, options: FindOneAndReplaceOption, callback: MongoCallback): void; + findOneAndUpdate(filter: Object, update: Object, callback: MongoCallback>): void; + findOneAndUpdate(filter: Object, update: Object, options?: FindOneAndReplaceOption): Promise>; + findOneAndUpdate(filter: Object, update: Object, options: FindOneAndReplaceOption, callback: MongoCallback>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#geoHaystackSearch geoHaystackSearch(x: number, y: number, callback: MongoCallback): void; geoHaystackSearch(x: number, y: number, options?: GeoHaystackSearchOptions): Promise; @@ -584,9 +582,9 @@ export interface Collection { /** @deprecated Use use deleteOne, deleteMany or bulkWrite */ remove(selector: Object, options?: CollectionOptions & { single?: boolean }, callback?: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#rename - rename(newName: string, callback: MongoCallback): void; - rename(newName: string, options?: { dropTarget?: boolean }): Promise; - rename(newName: string, options: { dropTarget?: boolean }, callback: MongoCallback): void; + rename(newName: string, callback: MongoCallback>): void; + rename(newName: string, options?: { dropTarget?: boolean }): Promise>; + rename(newName: string, options: { dropTarget?: boolean }, callback: MongoCallback>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#replaceOne replaceOne(filter: Object, doc: Object, callback: MongoCallback): void; replaceOne(filter: Object, doc: Object, options?: ReplaceOneOptions): Promise; @@ -743,9 +741,9 @@ export interface DeleteWriteOpResultObject { } //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#~findAndModifyWriteOpResult -export interface FindAndModifyWriteOpResultObject { +export interface FindAndModifyWriteOpResultObject { //Document returned from findAndModify command. - value?: any; + value?: TSchema; //The raw lastErrorObject returned from the command. lastErrorObject?: any; //Is 1 if the command executed correctly. @@ -1239,7 +1237,7 @@ export interface GridFSBucketOpenUploadStreamOptions { // https://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucketReadStream.html export class GridFSBucketReadStream extends Readable { - constructor(chunks: Collection, files: Collection, readPreference: Object, filter: Object, options?: GridFSBucketReadStreamOptions); + constructor(chunks: Collection, files: Collection, readPreference: Object, filter: Object, options?: GridFSBucketReadStreamOptions); } // https://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucketReadStream.html diff --git a/types/multer/index.d.ts b/types/multer/index.d.ts index 35e71a251d..c1cda87f6b 100644 --- a/types/multer/index.d.ts +++ b/types/multer/index.d.ts @@ -34,6 +34,9 @@ declare namespace multer { parts?: number; /** For multipart forms, the max number of header key=> value pairs to parse Default: 2000(same as node's http). */ headerPairs?: number; + /** Keep the full path of files instead of just the base name (Default: false) */ + preservePath?: boolean; + }; /** A function to control which files to upload and which to skip. */ fileFilter?: (req: Express.Request, file: Express.Multer.File, callback: (error: Error, acceptFile: boolean) => void) => void; diff --git a/types/multiplexjs/index.d.ts b/types/multiplexjs/index.d.ts index eddd801609..0cc38c8c06 100644 --- a/types/multiplexjs/index.d.ts +++ b/types/multiplexjs/index.d.ts @@ -448,9 +448,9 @@ declare namespace multiplex { /** * Performs the specified action on each element of the List. - * @param action The action function to perform on each element of the List. + * @param action The action function to perform on each element of an List; the second parameter of the function represents the index of the source element. */ - forEach(action: (item: T) => void): void + forEach(action: (item: T, index: number) => void): void /** @@ -1741,14 +1741,6 @@ declare namespace multiplex { */ firstOrDefault(predicate: (item: T) => boolean, defaultValue: T): T - - /** - * Performs the specified action on each element of an Enumerable. - * @param action The action function to perform on each element of an Enumerable. - */ - forEach(action: (item: T) => void): void - - /** * Performs the specified action on each element of an Enumerable. * @param action The action function to perform on each element of an Enumerable; the second parameter of the function represents the index of the source element. diff --git a/types/node-getopt/index.d.ts b/types/node-getopt/index.d.ts index 304f09bd4c..afd0a89adf 100644 --- a/types/node-getopt/index.d.ts +++ b/types/node-getopt/index.d.ts @@ -8,8 +8,8 @@ */ -interface StringMap { - [index: string]: string; +interface OptionMap { + [index: string]: string | string[] | boolean; } /** @@ -17,14 +17,14 @@ interface StringMap { */ declare class ParsedOption { public argv: string[]; - public options: StringMap; + public options: OptionMap; - constructor(argv: string[], options: StringMap); + constructor(argv: string[], options: OptionMap); public empty(): boolean; } interface EventCallback { - (args: string[], options: StringMap): void; + (args: string[], options: OptionMap): void; } interface ErrorFunc { diff --git a/types/normalize-url/index.d.ts b/types/normalize-url/index.d.ts new file mode 100644 index 0000000000..94cf9ee522 --- /dev/null +++ b/types/normalize-url/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for normalize-url 1.9 +// Project: https://github.com/sindresorhus/normalize-url +// Definitions by: odin3 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace NormalizeUrl { + interface NormalizeUrlArgs { + normalizeProtocol?: boolean; + normalizeHttps?: boolean; + stripFragment?: boolean; + stripWWW?: boolean; + removeQueryParameters?: string[]; + removeTrailingSlash?: boolean; + removeDirectoryIndex?: RegExp[]; + } + + // tslint:disable-next-line align + function normalizeUrl(url: string, args?: NormalizeUrlArgs): string; +} + +export = NormalizeUrl.normalizeUrl; diff --git a/types/normalize-url/tsconfig.json b/types/normalize-url/tsconfig.json new file mode 100644 index 0000000000..27e01ecd7b --- /dev/null +++ b/types/normalize-url/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} \ No newline at end of file diff --git a/types/normalize-url/tslint.json b/types/normalize-url/tslint.json new file mode 100644 index 0000000000..279473e356 --- /dev/null +++ b/types/normalize-url/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // This package uses the Function type, and it will take effort to fix. + "ban-types": false + } +} diff --git a/types/observe-js/index.d.ts b/types/observe-js/index.d.ts index 4b668bec16..d3321c9a8c 100644 --- a/types/observe-js/index.d.ts +++ b/types/observe-js/index.d.ts @@ -102,7 +102,7 @@ declare namespace observejs { } interface ArrayObserver_instance extends Observable { - open(onChange:(splices:Array)=>any):void + open(onChange: (splices: Array, oldSplices: Array) => any): void } /** diff --git a/types/packery/index.d.ts b/types/packery/index.d.ts index 9141bbfd52..6e27e2a9c0 100644 --- a/types/packery/index.d.ts +++ b/types/packery/index.d.ts @@ -1,293 +1,295 @@ // Type definitions for Packery v1.4.1 // Project: http://packery.metafizzy.co -// Definitions by: Piraveen Kamalathas from Kilix +// Definitions by: Piraveen Kamalathas from Kilix +// Juliën Hanssens // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare module 'packery' { -interface PackeryOptions { - /** - * [itemSelector Specifies which child elements to be used as item elements. Setting itemSelector is always recommended. itemSelector is useful to exclude sizing elements] - * @type {string} - */ - itemSelector?: string; + export interface PackeryOptions { + /** + * [itemSelector Specifies which child elements to be used as item elements. Setting itemSelector is always recommended. itemSelector is useful to exclude sizing elements] + * @type {string} + */ + itemSelector?: string; - /** - * [columnWidth The width of a column of a horizontal grid. When set, Packery will align item elements horizontally to this grid] - * @type {number} - */ - columnWidth?: number; + /** + * [columnWidth The width of a column of a horizontal grid. When set, Packery will align item elements horizontally to this grid] + * @type {number} + */ + columnWidth?: number; - /** - * [rowHeight Height of a row of a vertical grid. When set, Packery will align item elements vertically to this grid] - * @type {number} - */ - rowHeight?: number; + /** + * [rowHeight Height of a row of a vertical grid. When set, Packery will align item elements vertically to this grid] + * @type {number} + */ + rowHeight?: number; - /** - * [gutter The space between item elements, both vertically and horizontally] - * @type {number} - */ - gutter?: number; + /** + * [gutter The space between item elements, both vertically and horizontally] + * @type {number} + */ + gutter?: number; - /** - * [percentPosition Will set item position in percent values, rather than pixel values. percentPosition works well with percent-width items, as items will not transition their position on resize] - * @type {boolean} - */ - percentPosition?: boolean; + /** + * [percentPosition Will set item position in percent values, rather than pixel values. percentPosition works well with percent-width items, as items will not transition their position on resize] + * @type {boolean} + */ + percentPosition?: boolean; - /** - * [stamp Specifies which elements are stamped within the layout. These are special layout elements which will not be laid out by Packery. Rather, Packery will layout item elements around stamped elements] - * @type {string} - */ - stamp?: string; + /** + * [stamp Specifies which elements are stamped within the layout. These are special layout elements which will not be laid out by Packery. Rather, Packery will layout item elements around stamped elements] + * @type {string} + */ + stamp?: string; - /** - * [isHorizontal Arranges items horizontally instead of vertically] - * @type {boolean} - */ - isHorizontal?: boolean; + /** + * [isHorizontal Arranges items horizontally instead of vertically] + * @type {boolean} + */ + isHorizontal?: boolean; - /** - * [isOriginLeft Controls the horizontal flow of the layout. By default, item elements start positioning at the left. Set to false for right-to-left layouts] - * @type {boolean} - */ - isOriginLeft?: boolean; + /** + * [isOriginLeft Controls the horizontal flow of the layout. By default, item elements start positioning at the left. Set to false for right-to-left layouts] + * @type {boolean} + */ + isOriginLeft?: boolean; - /** - * [isOriginTop Controls the vertical flow of the layout. By default, item elements start positioning at the top. Set to false for bottom-up layouts. It’s like Tetris!] - * @type {boolean} - */ - isOriginTop?: boolean; + /** + * [isOriginTop Controls the vertical flow of the layout. By default, item elements start positioning at the top. Set to false for bottom-up layouts. It’s like Tetris!] + * @type {boolean} + */ + isOriginTop?: boolean; - /** - * [transitionDuration The time duration of transitions for item elements] - * @type {string} - */ - transitionDuration?: string; + /** + * [transitionDuration The time duration of transitions for item elements] + * @type {string} + */ + transitionDuration?: string; - /** - * [containerStyle CSS styles that are applied to the container element. To disable Packery from setting any CSS to the container element, set containerStyle: null] - * @type {Object} - */ - containerStyle?: Object; + /** + * [containerStyle CSS styles that are applied to the container element. To disable Packery from setting any CSS to the container element, set containerStyle: null] + * @type {Object} + */ + containerStyle?: Object; - /** - * [isResizeBound Binds layout to window resizing] - * @type {boolean} - */ - isResizeBound?: boolean; + /** + * [isResizeBound Binds layout to window resizing] + * @type {boolean} + */ + isResizeBound?: boolean; - /** - * [isInitLayout Enables layout on initialization. Set this to false to disable layout on initialization, so you can use methods or add events before the initial layout] - * @type {boolean} - */ - isInitLayout?: boolean; -} + /** + * [isInitLayout Enables layout on initialization. Set this to false to disable layout on initialization, so you can use methods or add events before the initial layout] + * @type {boolean} + */ + isInitLayout?: boolean; + } -declare class Packery { - constructor(element: Element, options?: Object); + export class Packery { + constructor(element: Element, options?: Object); - /** - * [addItems Add item elements to the Packery instance] - * @param {Element} elements [description] - */ - addItems(elements: Element): void; + /** + * [addItems Add item elements to the Packery instance] + * @param {Element} elements [description] + */ + addItems(elements: Element): void; - /** - * [addItems Add item elements to the Packery instance] - * @param {NodeList} elements [description] - */ - addItems(elements: NodeList): void; + /** + * [addItems Add item elements to the Packery instance] + * @param {NodeList} elements [description] + */ + addItems(elements: NodeList): void; - /** - * [addItems Add item elements to the Packery instance] - * @param {Array} elements [description] - */ - addItems(elements: Array): void; + /** + * [addItems Add item elements to the Packery instance] + * @param {Array} elements [description] + */ + addItems(elements: Array): void; - /** - * [appended Add and lay out newly appended item elements] - * @param {Element} elements [description] - */ - appended(elements: Element): void; + /** + * [appended Add and lay out newly appended item elements] + * @param {Element} elements [description] + */ + appended(elements: Element): void; - /** - * [appended Add and lay out newly appended item elements] - * @param {NodeList} elements [description] - */ - appended(elements: NodeList): void; + /** + * [appended Add and lay out newly appended item elements] + * @param {NodeList} elements [description] + */ + appended(elements: NodeList): void; - /** - * [appended Add and lay out newly appended item elements] - * @param {Array} elements [description] - */ - appended(elements: Array): void; + /** + * [appended Add and lay out newly appended item elements] + * @param {Array} elements [description] + */ + appended(elements: Array): void; - /** - * [bindDraggabillyEvents Bind Draggabilly events, so that the Packery instance will layout around the dragged element] - * @param {any} draggie [description] - */ - bindDraggabillyEvents(draggie: any): void; + /** + * [bindDraggabillyEvents Bind Draggabilly events, so that the Packery instance will layout around the dragged element] + * @param {any} draggie [description] + */ + bindDraggabillyEvents(draggie: any): void; - /** - * [bindResize Binds event listener to window resize, so layout is triggered when the browser window is resized] - */ - bindResize(): void; + /** + * [bindResize Binds event listener to window resize, so layout is triggered when the browser window is resized] + */ + bindResize(): void; - /** - * [bindUIDraggableEvents Bind jQuery UI Draggable events, so that the Packery instance will layout around the dragged element] - * @param {any} elements [jQuery UI] - */ - bindUIDraggableEvents($element: any): void; + /** + * [bindUIDraggableEvents Bind jQuery UI Draggable events, so that the Packery instance will layout around the dragged element] + * @param {any} elements [jQuery UI] + */ + bindUIDraggableEvents($element: any): void; - /** - * [data Get the Packery instance from an element. Note this method is of Packery, rather than of a Packery instance] - * @param {Element} element [description] - * @return {Packery} [description] - */ - data(element: Element): Packery; + /** + * [data Get the Packery instance from an element. Note this method is of Packery, rather than of a Packery instance] + * @param {Element} element [description] + * @return {Packery} [description] + */ + data(element: Element): Packery; - /** - * [destroy Removes the Packery functionality completely. This will return the element back to its pre-initialized state] - */ - destroy(): void; + /** + * [destroy Removes the Packery functionality completely. This will return the element back to its pre-initialized state] + */ + destroy(): void; - /** - * [fit Fit an item element within the layout, and have other item elements laid out around it. This method is useful when expanding an element, and keeping it in its same position.] - * @param {any} element [description] - * @param {number} x [description] - * @param {number} y [description] - */ - fit(element: Element, x?: number, y?: number): void; + /** + * [fit Fit an item element within the layout, and have other item elements laid out around it. This method is useful when expanding an element, and keeping it in its same position.] + * @param {any} element [description] + * @param {number} x [description] + * @param {number} y [description] + */ + fit(element: Element, x?: number, y?: number): void; - /** - * [getItemElements Get an array of elements used as the Packery instance's items.] - * @return {Array} [description] - */ - getItemElements(): Array; + /** + * [getItemElements Get an array of elements used as the Packery instance's items.] + * @return {Array} [description] + */ + getItemElements(): Array; - /** - * [getItem Get a Packery.Item from an element] - * @param {Element} element [description] - * @return {any} [Packery.item] - */ - getItem(element: Element): any; + /** + * [getItem Get a Packery.Item from an element] + * @param {Element} element [description] + * @return {any} [Packery.item] + */ + getItem(element: Element): any; - /** - * [layout Lay out all item elements.] - */ - layout(): void; + /** + * [layout Lay out all item elements.] + */ + layout(): void; - /** - * [layoutItems Lay out specified items] - * @param {Array} items [description] - */ - layoutItems(items: Array): void; + /** + * [layoutItems Lay out specified items] + * @param {Array} items [description] + */ + layoutItems(items: Array): void; - /** - * [off Remove an event listener] - * @param {string} eventName [description] - * @param {Function} listener [description] - * @return {Packery} [description] - */ - off(eventName: string, listener: Function): Packery; + /** + * [off Remove an event listener] + * @param {string} eventName [description] + * @param {Function} listener [description] + * @return {Packery} [description] + */ + off(eventName: string, listener: Function): Packery; - /** - * [on Add an event listener for certain events] - * @param {string} eventName [description] - * @param {Function} listener [description] - * @return {Packery} [description] - */ - on(eventName: string, listener: Function): Packery; + /** + * [on Add an event listener for certain events] + * @param {string} eventName [description] + * @param {Function} listener [description] + * @return {Packery} [description] + */ + on(eventName: string, listener: Function): Packery; - /** - * [once Add an event listener for certain events, to be triggered once] - * @param {string} eventName [description] - * @param {Function} listener [description] - */ - once(eventName: string, listener: Function): void; + /** + * [once Add an event listener for certain events, to be triggered once] + * @param {string} eventName [description] + * @param {Function} listener [description] + */ + once(eventName: string, listener: Function): void; - /** - * [prepended Add and lay out newly prepended item elements at the beginning of layout] - * @param {Element} elements [description] - */ - prepended(elements: Element): void; + /** + * [prepended Add and lay out newly prepended item elements at the beginning of layout] + * @param {Element} elements [description] + */ + prepended(elements: Element): void; - /** - * [prepended Add and lay out newly prepended item elements at the beginning of layout] - * @param {NodeList} elements [description] - */ - prepended(elements: NodeList): void; + /** + * [prepended Add and lay out newly prepended item elements at the beginning of layout] + * @param {NodeList} elements [description] + */ + prepended(elements: NodeList): void; - /** - * [prepended Add and lay out newly prepended item elements at the beginning of layout] - * @param {Array} elements [description] - */ - prepended(elements: Array): void; + /** + * [prepended Add and lay out newly prepended item elements at the beginning of layout] + * @param {Array} elements [description] + */ + prepended(elements: Array): void; - /** - * [reloadItems Recollect all item elements] - */ - reloadItems(): void; + /** + * [reloadItems Recollect all item elements] + */ + reloadItems(): void; - /** - * [remove Remove elements from the Packery instance, then from the DOM] - * @param {Element} elements [description] - */ - remove(elements: Element): void; + /** + * [remove Remove elements from the Packery instance, then from the DOM] + * @param {Element} elements [description] + */ + remove(elements: Element): void; - /** - * [remove Remove elements from the Packery instance, then from the DOM] - * @param {NodeList} elements [description] - */ - remove(elements: NodeList): void; + /** + * [remove Remove elements from the Packery instance, then from the DOM] + * @param {NodeList} elements [description] + */ + remove(elements: NodeList): void; - /** - * [remove Remove elements from the Packery instance, then from the DOM] - * @param {Array} elements [description] - */ - remove(elements: Array): void; + /** + * [remove Remove elements from the Packery instance, then from the DOM] + * @param {Array} elements [description] + */ + remove(elements: Array): void; - /** - * [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element] - * @param {Element} elements [description] - */ - stamp(elements: Element): void; + /** + * [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element] + * @param {Element} elements [description] + */ + stamp(elements: Element): void; - /** - * [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element] - * @param {NodeList} elements [description] - */ - stamp(elements: NodeList): void; + /** + * [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element] + * @param {NodeList} elements [description] + */ + stamp(elements: NodeList): void; - /** - * [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element] - * @param {Array} elements [description] - */ - stamp(elements: Array): void; + /** + * [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element] + * @param {Array} elements [description] + */ + stamp(elements: Array): void; - /** - * [unbindResize Un-bind layout to window resize event] - */ - unbindResize(): void; + /** + * [unbindResize Un-bind layout to window resize event] + */ + unbindResize(): void; - /** - * [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them] - * @param {Element} element [description] - */ - unstamp(element: Element): void; + /** + * [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them] + * @param {Element} element [description] + */ + unstamp(element: Element): void; - /** - * [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them] - * @param {NodeList} element [description] - */ - unstamp(element: NodeList): void; + /** + * [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them] + * @param {NodeList} element [description] + */ + unstamp(element: NodeList): void; - /** - * [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them] - * @param {Array} element [description] - */ - unstamp(element: Array): void; -} + /** + * [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them] + * @param {Array} element [description] + */ + unstamp(element: Array): void; + } -export = Packery; +} \ No newline at end of file diff --git a/types/packery/packery-tests.ts b/types/packery/packery-tests.ts index e8faff1b3f..91065331c0 100644 --- a/types/packery/packery-tests.ts +++ b/types/packery/packery-tests.ts @@ -1,7 +1,5 @@ - -/// - -import Packery = require('packery'); +import { Packery, PackeryOptions } from 'packery'; +import * as $ from 'jquery'; // TODO Add Draggabilly to bind Draggabilly Events var container = document.querySelector('#container'); diff --git a/types/parse/parse-tests.ts b/types/parse/parse-tests.ts index 79d583f3be..282913d17e 100644 --- a/types/parse/parse-tests.ts +++ b/types/parse/parse-tests.ts @@ -198,7 +198,7 @@ function test_file() { // The file either could n ot be read, or could not be saved to Parse. }); - Parse.Cloud.httpRequest({ url: file.url() }).then((response: Parse.Promise) => { + Parse.Cloud.httpRequest({ url: file.url() }).then((response: Parse.Cloud.HttpResponse) => { // result }); diff --git a/types/passport-local-mongoose/passport-local-mongoose-tests.ts b/types/passport-local-mongoose/passport-local-mongoose-tests.ts index 7b428561fe..63c82a9913 100644 --- a/types/passport-local-mongoose/passport-local-mongoose-tests.ts +++ b/types/passport-local-mongoose/passport-local-mongoose-tests.ts @@ -31,13 +31,13 @@ interface User extends PassportLocalDocument { last: Date; } -const UserSchema: PassportLocalSchema = new Schema({ +const UserSchema = new Schema({ username: String, hash: String, salt: String, attempts: Number, last: Date -}); +}) as PassportLocalSchema; let options: PassportLocalOptions = {}; options.iterations = 25000; diff --git a/types/pixi.js/index.d.ts b/types/pixi.js/index.d.ts index 88ed75eced..bcf403d475 100644 --- a/types/pixi.js/index.d.ts +++ b/types/pixi.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Pixi.js 4.4 +// Type definitions for Pixi.js 4.5 // Project: https://github.com/pixijs/pixi.js/tree/dev // Definitions by: clark-stevenson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -20,8 +20,10 @@ declare namespace PIXI { const GC_MODES: typeof CONST.GC_MODES; const SHAPES: typeof CONST.SHAPES; const TEXT_GRADIENT: typeof CONST.TEXT_GRADIENT; + const UPDATE_PRIORITY: typeof CONST.UPDATE_PRIORITY; - function autoDetectRenderer(width: number, height: number, options?: PIXI.IRendererOptions, noWebGL?: boolean): PIXI.WebGLRenderer | PIXI.CanvasRenderer; + function autoDetectRenderer(width: number, height: number, options?: PIXI.RendererOptions, forceCanvas?: boolean): PIXI.WebGLRenderer | PIXI.CanvasRenderer; + function autoDetectRenderer(options?: PIXI.RendererOptions): PIXI.WebGLRenderer | PIXI.CanvasRenderer; const loader: PIXI.loaders.Loader; ////////////////////////////////////////////////////////////////////////////// @@ -46,6 +48,9 @@ declare namespace PIXI { clearBeforeRender: boolean, preserveDrawingBuffer: boolean, roundPixels: boolean + width: number, + height: number, + legacy: boolean, }; let TRANSFORM_MODE: number; let GC_MODE: number; @@ -53,6 +58,8 @@ declare namespace PIXI { let GC_MAX_CHECK_COUNT: number; let WRAP_MODE: number; let SCALE_MODE: number; + let PRECISION_VERTEX: string; + let PRECISION_FRAGMENT: string; let PRECISION: string; let UPLOADS_PER_FRAME: number; let CAN_UPLOAD_SAME_BUFFER: boolean; @@ -66,20 +73,19 @@ declare namespace PIXI { // accessibility class AccessibilityManager { constructor(renderer: CanvasRenderer | WebGLRenderer); - + activate(): void; + deactivate(): void; protected div: HTMLElement; protected pool: HTMLElement[]; protected renderId: number; debug: boolean; renderer: SystemRenderer; - protected children: IAccessibleTarget[]; + protected children: AccessibleTarget[]; protected isActive: boolean; - protected activate(): void; - protected deactivate(): void; protected updateAccessibleObjects(displayObject: DisplayObject): void; protected update(): void; - protected capHitArea(hitArea: IHitArea): void; + protected capHitArea(hitArea: HitArea): void; protected addChild(displayObject: DisplayObject): void; protected _onClick(e: interaction.InteractionEvent): void; protected _onFocus(e: interaction.InteractionEvent): void; @@ -89,7 +95,7 @@ declare namespace PIXI { destroy(): void; } - interface IAccessibleTarget { + interface AccessibleTarget { accessible: boolean; accessibleTitle: string | null; accessibleHint: string | null; @@ -132,6 +138,9 @@ declare namespace PIXI { SATURATION: number; COLOR: number; LUMINOSITY: number; + NORMAL_NPM: number; + ADD_NPM: number; + SCREEN_NPM: number; }; const DRAW_MODES: { POINTS: number; @@ -179,11 +188,18 @@ declare namespace PIXI { LINEAR_VERTICAL: number; LINEAR_HORIZONTAL: number; }; + const UPDATE_PRIORITY: { + INTERACTION: number; + HIGH: number; + NORMAL: number; + LOW: number; + UTILITY: number; + }; } // display - interface IApplicationOptions extends IRendererOptions { + interface ApplicationOptions extends RendererOptions { view?: HTMLCanvasElement; transparent?: boolean; autoResize?: boolean; @@ -195,10 +211,16 @@ declare namespace PIXI { context?: WebGLRenderingContext; preserveDrawingBuffer?: boolean; legacy?: boolean; + width?: number; + height?: number; + forceCanvas?: boolean; + sharedTicker?: boolean; + sharedLoader?: boolean; } class Application { - constructor(width?: number, height?: number, options?: IApplicationOptions, noWebGL?: boolean, useSharedTicker?: boolean); + constructor(options?: ApplicationOptions) + constructor(width?: number, height?: number, options?: ApplicationOptions, noWebGL?: boolean, sharedTicker?: boolean, sharedLoader?: boolean); private _ticker: ticker.Ticker; @@ -214,7 +236,7 @@ declare namespace PIXI { readonly view: HTMLCanvasElement; } - interface IDestroyOptions { + interface DestroyOptions { children?: boolean; texture?: boolean; baseTexture?: boolean; @@ -266,17 +288,18 @@ declare namespace PIXI { protected _renderWebGL(renderer: WebGLRenderer): void; protected _renderCanvas(renderer: CanvasRenderer): void; renderCanvas(renderer: CanvasRenderer): void; - destroy(options?: IDestroyOptions | boolean): void; + destroy(options?: DestroyOptions | boolean): void; - once(event: "added", fn: (displayObject: DisplayObject) => void, context?: any): this; - once(event: "removed", fn: (DisplayObject: DisplayObject) => void, context?: any): this; + once(event: "added" | "removed", fn: (displayObject: DisplayObject) => void, context?: any): this; + //tslint:disable-next-line:ban-types forbidden-types once(event: string, fn: Function, context?: any): this; - on(event: "added", fn: (displayObject: DisplayObject) => void, context?: any): this; - on(event: "removed", fn: (DisplayObject: DisplayObject) => void, context?: any): this; + on(event: "added" | "removed", fn: (displayObject: DisplayObject) => void, context?: any): this; + //tslint:disable-next-line:ban-types forbidden-types on(event: string, fn: Function, context?: any): this; - off(event: string, fn: Function, context?: any): this; + //tslint:disable-next-line:ban-types forbidden-types + off(event: "added" | "removed" | string, fn?: Function, context?: any): this; } - class DisplayObject extends utils.EventEmitter implements interaction.InteractiveTarget, accessibility.IAccessibleTarget { + class DisplayObject extends utils.EventEmitter implements interaction.InteractiveTarget, accessibility.AccessibleTarget { // begin extras.cacheAsBitmap protected _cacheAsBitmap: boolean; protected _cacheData: boolean; @@ -288,7 +311,7 @@ declare namespace PIXI { protected _calculateCachedBounds(): Rectangle; protected _getCachedLocalBounds(): Rectangle; protected _destroyCachedDisplayObject(): void; - protected _cacheAsBitmapDestroy(): void; + protected _cacheAsBitmapDestroy(options: boolean | any): void; // end extras.cacheAsBitmap // begin extras.getChildByName @@ -332,14 +355,15 @@ declare namespace PIXI { protected _boundsRect: Rectangle; protected _localBoundsRect: Rectangle; protected _mask: PIXI.Graphics | PIXI.Sprite; + protected readonly _destroyed: boolean; x: number; y: number; worldTransform: Matrix; localTransform: Matrix; - position: Point; - scale: Point; - pivot: Point; - skew: Point; + position: Point | ObservablePoint; + scale: Point | ObservablePoint; + pivot: Point | ObservablePoint; + skew: ObservablePoint; rotation: number; worldVisible: boolean; mask: PIXI.Graphics | PIXI.Sprite; @@ -350,55 +374,27 @@ declare namespace PIXI { protected _recursivePostUpdateTransform(): void; getBounds(skipUpdate?: boolean, rect?: Rectangle): Rectangle; getLocalBounds(rect?: Rectangle): Rectangle; - toGlobal(position: Point, point?: Point, skipUpdate?: boolean): Point; - toLocal(position: Point, from?: DisplayObject, point?: Point, skipUpdate?: boolean): Point; + //creates and returns a new point + toGlobal(position: PointLike): Point; + //modifies the x and y of the passed point and returns it + toGlobal(position: PointLike, point?: T, skipUpdate?: boolean): T; + //creates and returns a new point + toLocal(position: PointLike, from?: DisplayObject): Point; + //modifies the x and y of the passed point and returns it + toLocal(position: PointLike, from?: DisplayObject, point?: T, skipUpdate?: boolean): T; renderWebGL(renderer: WebGLRenderer): void; renderCanvas(renderer: CanvasRenderer): void; setParent(container: Container): Container; setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): DisplayObject; destroy(): void; - on(event: string, fn: Function, context?: any): this; - once(event: string, fn: Function, context?: any): this; - off(event: string, fn: Function, context?: any): this; - - /* - on(event: 'click', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'mousedown', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'mouseout', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'mouseover', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'mouseup', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'mouseclick', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'mouseupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'rightclick', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'rightdown', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'rightup', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'rightupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'tap', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'touchend', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'touchendoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'touchmove', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'touchstart', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - - once(event: 'click', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'mousedown', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'mouseout', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'mouseover', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'mouseup', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'mouseclick', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'mouseupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'rightclick', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'rightdown', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'rightup', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'rightupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'tap', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'touchend', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'touchendoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'touchmove', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'touchstart', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - */ + on(event: interaction.InteractionEventTypes, fn: (event: interaction.InteractionEvent) => void, context?: any): this; + once(event: interaction.InteractionEventTypes, fn: (event: interaction.InteractionEvent) => void, context?: any): this; + removeListener(event: interaction.InteractionEventTypes, fn?: (event: interaction.InteractionEvent) => void, context?: any): this; + removeAllListeners(event: interaction.InteractionEventTypes): this; + off(event: interaction.InteractionEventTypes, fn?: (event: interaction.InteractionEvent) => void, context?: any): this; + addListener(event: interaction.InteractionEventTypes, fn: (event: interaction.InteractionEvent) => void, context?: any): this; } - class TransformBase { static IDENTITY: TransformBase; @@ -429,7 +425,6 @@ declare namespace PIXI { updateLocalTransform(): void; updateTransform(parentTransform: TransformBase): void; setFromMatrix(matrix: Matrix): void; - rotation: number; } class Transform extends TransformBase { @@ -453,9 +448,7 @@ declare namespace PIXI { rotation: number; } - // graphics - class GraphicsData { constructor( lineWidth: number, @@ -465,8 +458,7 @@ declare namespace PIXI { fillAlpha: number, fill: boolean, nativeLines: boolean, - shape: IShape | Circle | Rectangle | RoundedRectangle | Ellipse | Polygon); - + shape: Circle | Rectangle | Ellipse | Polygon | RoundedRectangle | any); lineWidth: number; nativeLines: boolean; lineColor: number; @@ -476,12 +468,12 @@ declare namespace PIXI { fillAlpha: number; protected _fillTint: number; fill: boolean; - protected holes: IShape[]; - shape: IShape | Circle | Rectangle | RoundedRectangle | Ellipse | Polygon; + protected holes: Circle[] | Rectangle[] | Ellipse[] | Polygon[] | RoundedRectangle[] | any[]; + shape: Circle | Rectangle | Ellipse | Polygon | RoundedRectangle | any; type?: number; clone(): GraphicsData; - addHole(shape: IShape | Circle | Rectangle | RoundedRectangle | Ellipse | Polygon): void; - destroy(options?: IDestroyOptions | boolean): void; + addHole(shape: Circle | Rectangle | Ellipse | Polygon | RoundedRectangle | any): void; + destroy(options?: DestroyOptions | boolean): void; } class Graphics extends Container { constructor(nativeLines?: boolean); @@ -499,7 +491,7 @@ declare namespace PIXI { isMask: boolean; boundsPadding: number; protected _localBounds: Bounds; - dirty: boolean; + dirty: number; fastRectDirty: number; clearDirty: number; boundsDirty: number; @@ -531,11 +523,11 @@ declare namespace PIXI { protected _renderSpriteRect(renderer: PIXI.SystemRenderer): void; containsPoint(point: Point): boolean; updateLocalBounds(): void; - drawShape(shape: IShape | Circle | Rectangle | Ellipse | Polygon | RoundedRectangle): GraphicsData; + drawShape(shape: Circle | Rectangle | Ellipse | Polygon | RoundedRectangle | any): GraphicsData; generateCanvasTexture(scaleMode?: number, resolution?: number): Texture; protected closePath(): Graphics; protected addHole(): Graphics; - destroy(options?: IDestroyOptions | boolean): void; + destroy(options?: DestroyOptions | boolean): void; } class CanvasGraphicsRenderer { constructor(renderer: SystemRenderer); @@ -556,10 +548,10 @@ declare namespace PIXI { destroy(): void; render(graphics: Graphics): void; protected updateGraphics(graphics: PIXI.Graphics): void; - getWebGLData(webGL: WebGLRenderingContext, type: number): WebGLGraphicsData; + getWebGLData(webGL: WebGLRenderingContext, type: number, nativeLines: number): WebGLGraphicsData; } class WebGLGraphicsData { - constructor(gl: WebGLRenderingContext, shader: glCore.GLShader, attribsState: glCore.IAttribState); + constructor(gl: WebGLRenderingContext, shader: glCore.GLShader, attribsState: glCore.AttribState); gl: WebGLRenderingContext; color: number[]; @@ -572,6 +564,7 @@ declare namespace PIXI { glIndices: number[]; shader: glCore.GLShader; vao: glCore.VertexArrayObject; + nativeLines: boolean; reset(): void; upload(): void; @@ -592,7 +585,6 @@ declare namespace PIXI { const NE: number; const MIRROR_HORIZONTAL: number; const MIRROR_VERTICAL: number; - function uX(ind: number): number; function uY(ind: number): number; function vX(ind: number): number; @@ -635,32 +627,24 @@ declare namespace PIXI { static IDENTITY: Matrix; static TEMP_MATRIX: Matrix; } - class ObservablePoint { - constructor(cb: Function, scope?: any, x?: number, y?: number); - + class PointLike { x: number; y: number; + + set(x?: number, y?: number): void; + copy(point: PointLike): void; + } + class ObservablePoint extends PointLike { + constructor(cb: () => any, scope?: any, x?: number, y?: number); cb: () => any; scope: any; - - set(x?: number, y?: number): void; - copy(point: Point | ObservablePoint): void; } - class Point { + class Point extends PointLike { constructor(x?: number, y?: number); - - x: number; - y: number; - clone(): Point; - copy(p: Point): void; - equals(p: Point): boolean; - set(x?: number, y?: number): void; + equals(p: PointLike): boolean; } - - interface IShape { - } - interface IHitArea extends IShape { + interface HitArea { contains(x: number, y: number): boolean; } class Circle { @@ -690,7 +674,10 @@ declare namespace PIXI { } class Polygon { constructor(points: Point[] | number[]); + // Note - Rest Params cannot be combined with | + //tslint:disable-next-line:unified-signatures constructor(...points: Point[]); + //tslint:disable-next-line:unified-signatures constructor(...points: number[]); closed: boolean; @@ -736,10 +723,8 @@ declare namespace PIXI { clone(): RoundedRectangle; contains(x: number, y: number): boolean; } - // renderers - - interface IRendererOptions { + interface RendererOptions { view?: HTMLCanvasElement; transparent?: boolean; autoResize?: boolean; @@ -749,11 +734,16 @@ declare namespace PIXI { backgroundColor?: number; roundPixels?: boolean; context?: WebGLRenderingContext; + width?: number; + height?: number; + forceCanvas?: boolean; } class SystemRenderer extends utils.EventEmitter { - constructor(system: string, screenWidth?: number, screenHeight?: number, options?: IRendererOptions); + constructor(system: string, options?: RendererOptions); + constructor(system: string, screenWidth?: number, screenHeight?: number, options?: RendererOptions); type: number; + options: RendererOptions; screen: Rectangle; readonly width: number; readonly height: number; @@ -770,7 +760,6 @@ declare namespace PIXI { protected _backgroundColorString: string; protected _tempDisplayObjectParent: Container; protected _lastObjectRendered: DisplayObject; - backgroundColor: number; resize(screenWidth: number, screenHeight: number): void; generateTexture(displayObject: DisplayObject, scaleMode?: number, resolution?: number): RenderTexture; @@ -779,7 +768,8 @@ declare namespace PIXI { } class CanvasRenderer extends SystemRenderer { // plugintarget mixin start - static __plugins: Object; + static __plugins: any; + //tslint:disable-next-line:ban-types forbidden-types static registerPlugin(pluginName: string, ctor: Function): void; plugins: any; initPlugins(): void; @@ -789,7 +779,8 @@ declare namespace PIXI { // from InteractionManager interaction?: interaction.InteractionManager; - constructor(screenWidth?: number, screenHeight?: number, options?: IRendererOptions); + constructor(options?: RendererOptions); + constructor(screenWidth?: number, screenHeight?: number, options?: RendererOptions); rootContext: CanvasRenderingContext2D; rootResolution?: number; @@ -805,13 +796,12 @@ declare namespace PIXI { destroy(removeView?: boolean): void; clear(clearColor?: string): void; - on(event: "prerender", fn: () => void, context?: any): this; - on(event: "postrender", fn: () => void, context?: any): this; - on(event: string, fn: Function, context?: any): this; - once(event: "prerender", fn: () => void, context?: any): this; - once(event: "postrender", fn: () => void, context?: any): this; - once(event: string, fn: Function, context?: any): this; - off(event: string, fn: Function, context?: any): this; + on(event: "prerender" | "postrender", fn: () => void, context?: any): this; + once(event: "prerender" | "postrender", fn: () => void, context?: any): this; + removeListener(event: "prerender" | "postrender", fn?: () => void, context?: any): this; + removeAllListeners(event: "prerender" | "postrender"): this; + off(event: "prerender" | "postrender", fn?: () => void, context?: any): this; + addListener(event: "prerender" | "postrender", fn: () => void, context?: any): this; } class CanvasMaskManager { constructor(renderer: CanvasRenderer); @@ -835,16 +825,25 @@ declare namespace PIXI { resize(width: number, height: number): void; destroy(): void; } - - interface IWebGLRendererOptions extends IRendererOptions { + interface WebGLRendererOptions { + view?: HTMLCanvasElement; + transparent?: boolean; + autoResize?: boolean; + antialias?: boolean; forceFXAA?: boolean; + resolution?: number; + clearBeforeRender?: boolean; + backgroundColor?: number; preserveDrawingBuffer?: boolean; + roundPixels?: boolean; legacy?: boolean; + width?: number; + height?: number; } - class WebGLRenderer extends SystemRenderer { // plugintarget mixin start - static __plugins: Object; + static __plugins: any; + //tslint:disable-next-line:ban-types forbidden-types static registerPlugin(pluginName: string, ctor: Function): void; plugins: any; initPlugins(): void; @@ -854,7 +853,8 @@ declare namespace PIXI { // from InteractionManager interaction: interaction.InteractionManager; - constructor(screenWidth?: number, screenHeight?: number, options?: IWebGLRendererOptions); + constructor(options?: WebGLRendererOptions); + constructor(screenWidth?: number, screenHeight?: number, options?: WebGLRendererOptions); protected _contextOptions: { alpha: boolean; @@ -875,6 +875,7 @@ declare namespace PIXI { boundTextures: Texture[]; filterManager: FilterManager; textureManager?: TextureManager; + textureGC?: TextureGarbageCollector; extract: extract.WebGLExtract; protected drawModes: any; protected _activeShader: Shader; @@ -900,15 +901,17 @@ declare namespace PIXI { handleContextRestored: () => void; destroy(removeView?: boolean): void; + on(event: "prerender" | "postrender", fn: () => void, context?: any): this; on(event: "context", fn: (gl: WebGLRenderingContext) => void, context?: any): this; - on(event: "prerender", fn: () => void, context?: any): this; - on(event: "postrender", fn: () => void, context?: any): this; - on(event: string, fn: Function, context?: any): this; + once(event: "prerender" | "postrender", fn: () => void, context?: any): this; once(event: "context", fn: (gl: WebGLRenderingContext) => void, context?: any): this; - once(event: "prerender", fn: () => void, context?: any): this; - once(event: "postrender", fn: () => void, context?: any): this; - once(event: string, fn: Function, context?: any): this; - off(event: string, fn: Function, context?: any): this; + removeListener(event: "prerender" | "postrender", fn?: () => void, context?: any): this; + removeListener(event: "context", fn?: (gl: WebGLRenderingContext) => void, context?: any): this; + removeAllListeners(event: "prerender" | "postrender" | "context"): this; + off(event: "prerender" | "postrender", fn?: () => void, context?: any): this; + off(event: "context", fn?: (gl: WebGLRenderingContext) => void, context?: any): this; + addListener(event: "prerender" | "postrender", fn: () => void, context?: any): this; + addListener(event: "context", fn: (gl: WebGLRenderingContext) => void, context?: any): this; } class WebGLState { constructor(gl: WebGLRenderingContext); @@ -919,7 +922,7 @@ declare namespace PIXI { stack: number[]; gl: WebGLRenderingContext; maxAttribs: number; - attribState: glCore.IAttribState; + attribState: glCore.AttribState; nativeVaoExtension: any; push(): void; @@ -938,7 +941,7 @@ declare namespace PIXI { renderer: WebGLRenderer; gl: WebGLRenderingContext; - protected _managedTextures: WebGLTexture[]; + protected _managedTextures: Texture[]; bindTexture(): void; getTexture(): WebGLTexture; @@ -985,6 +988,11 @@ declare namespace PIXI { upload(): Quad; destroy(): void; } + interface FilterDataStackItem { + renderTarget: RenderTarget; + filter: any[]; + bounds: Rectangle; + } class RenderTarget { constructor(gl: WebGLRenderingContext, width: number, height: number, scaleMode: number, resolution: number, root?: boolean); @@ -1004,11 +1012,7 @@ declare namespace PIXI { stencilMaskStack: Graphics[]; filterData: { index: number, - stack: Array<{ - renderTarget: RenderTarget, - filter: any[]; - bounds: Rectangle - }> + stack: FilterDataStackItem[]; }; scaleMode: number; root: boolean; @@ -1029,19 +1033,19 @@ declare namespace PIXI { setBlendMode(blendMode: number): boolean; } + interface FilterManagerStackItem { + renderTarget: RenderTarget; + sourceFrame: Rectangle; + destinationFrame: Rectangle; + filters: Filter[]; + target: any; + resolution: number; + } class FilterManager extends WebGLManager { constructor(renderer: WebGLRenderer); - gl: WebGLRenderingContext; quad: Quad; - stack: Array<{ - renderTarget: RenderTarget; - sourceFrame: Rectangle; - destinationFrame: Rectangle; - filters: Filter[]; - target: any; - resolution: number; - }>; + stack: FilterManagerStackItem[]; stackIndex: number; shaderCache: any; filterData: any; @@ -1098,7 +1102,7 @@ declare namespace PIXI { onContextChange(): void; destroy(): void; } - interface IUniformData { + interface UniformData { type: string; value: any; @@ -1106,19 +1110,20 @@ declare namespace PIXI { name?: string; } class Filter { - constructor(vertexSrc?: string, fragmentSrc?: string, uniforms?: { [name: string]: IUniformData }); + constructor(vertexSrc?: string, fragmentSrc?: string, uniforms?: { [name: string]: UniformData }); vertextSrc?: string; fragmentSrc: string; blendMode: number; - protected uniformData: { [name: string]: IUniformData }; + protected uniformData: { [name: string]: UniformData }; uniforms: { [name: string]: any } | any; glShaders: any; glShaderKey?: number; padding: number; resolution: number; enabled: boolean; - apply(filterManager: FilterManager, input: RenderTarget, output: RenderTarget, clear?: boolean): void; + autoFit: boolean; + apply(filterManager: FilterManager, input: RenderTarget, output: RenderTarget, clear?: boolean, currentState?: any): void; static defaultVertexSrc: string; static defaultFragmentSrc: string; @@ -1167,7 +1172,7 @@ declare namespace PIXI { protected _renderCanvas(renderer: CanvasRenderer): void; getLocalBounds(): Rectangle; containsPoint(point: Point): boolean; - destroy(options?: IDestroyOptions | boolean): void; + destroy(options?: DestroyOptions | boolean): void; static from(source: number | string | BaseTexture | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): Sprite; static fromFrame(frameId: string): Sprite; @@ -1222,7 +1227,7 @@ declare namespace PIXI { let cacheStepsPerColorChannel: number; let convertTintToImage: boolean; let canUseMultiply: boolean; - let tintMethod: Function; + let tintMethod: number; } // text @@ -1318,12 +1323,35 @@ declare namespace PIXI { wordWrap: boolean; protected _wordWrapWidth: number; wordWrapWidth: number; + toFontString(): string; } + class TextMetrics { + protected _canvas: HTMLCanvasElement; + protected _context: CanvasRenderingContext2D; + protected _fonts: FontMetrics; + text: string; + style: TextStyle; + width: number; + height: number; + lines: number[]; + lineWidgets: number[]; + lineHeight: number; + maxLineWidth: number; + fontProperties: any; + + constructor(text: string, style: TextStyle, width: number, height: number, lines: number[], lineWidths: number[], lineHeight: number, maxLineWidth: number, fontProperties: any); + + static measureText(text: string, style: TextStyle, wordWrap?: boolean, canvas?: HTMLCanvasElement): TextMetrics; + static wordWrap(text: string, style: TextStyle, canvas?: HTMLCanvasElement): string; + static measureFont(font: string): FontMetrics; + } + interface FontMetrics { + ascent: number; + descent: number; + fontSize: number; + } class Text extends Sprite { - static getFontStyle(style: TextStyleOptions): string; - static calculateFontProperties(style: string): any; - constructor(text?: string, style?: TextStyleOptions, canvas?: HTMLCanvasElement); canvas: HTMLCanvasElement; @@ -1331,14 +1359,11 @@ declare namespace PIXI { resolution: number; protected _text: string; protected _style: TextStyle; + //tslint:disable-next-line:ban-types forbidden-types protected _styleListener: Function; protected _font: string; protected localStyleID: number; - static fontPropertiesCache: any; - static fontPropertiesCanvas: HTMLCanvasElement; - static fontPropertiesContext: CanvasRenderingContext2D; - width: number; height: number; style: TextStyle; @@ -1349,17 +1374,14 @@ declare namespace PIXI { protected updateTexture(): void; renderWebGL(renderer: WebGLRenderer): void; protected _renderCanvas(renderer: CanvasRenderer): void; - protected wordWrap(text: string): string; getLocalBounds(rect?: Rectangle): Rectangle; protected _calculateBounds(): void; protected _onStyleChange: () => void; protected _generateFillStyle(style: TextStyle, lines: string[]): string | number | CanvasGradient; - destroy(options?: IDestroyOptions | boolean): void; + destroy(options?: DestroyOptions | boolean): void; dirty: boolean; } - // textures - class BaseRenderTexture extends BaseTexture { constructor(width?: number, height?: number, scaleMode?: number, resolution?: number); @@ -1377,11 +1399,12 @@ declare namespace PIXI { resize(width: number, height: number): void; destroy(): void; - once(event: "update", fn: (baseRenderTexture: BaseRenderTexture) => void, context?: any): this; - once(event: string, fn: Function, context?: any): this; on(event: "update", fn: (baseRenderTexture: BaseRenderTexture) => void, context?: any): this; - on(event: string, fn: Function, context?: any): this; - off(event: string, fn: Function, context?: any): this; + once(event: "update", fn: (baseRenderTexture: BaseRenderTexture) => void, context?: any): this; + removeListener(event: "update", fn?: (baseRenderTexture: BaseRenderTexture) => void, context?: any): this; + removeAllListeners(event: "update"): this; + off(event: "update", fn?: (baseRenderTexture: BaseRenderTexture) => void, context?: any): this; + addListener(event: "update", fn: (baseRenderTexture: BaseRenderTexture) => void, context?: any): this; } class BaseTexture extends utils.EventEmitter { static from(source: string | HTMLImageElement | HTMLCanvasElement, scaleMode?: number, sourceScale?: number): BaseTexture; @@ -1411,6 +1434,9 @@ declare namespace PIXI { protected _glTextures: any; protected _enabled: number; protected _id?: number; + protected _virtualBoundId: number; + protected readonly _destroyed: boolean; + textureCacheIds: string[]; update(): void; protected _updateDimensions(): void; @@ -1426,19 +1452,16 @@ declare namespace PIXI { updateSourceImage(newSrc: string): void; static fromImage(imageUrl: string, crossorigin?: boolean, scaleMode?: number, sourceScale?: number): BaseTexture; - static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number): BaseTexture; + static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number, origin?: string): BaseTexture; + static addToCache(baseTexture: BaseTexture, id: string): void; + static removeFromCache(baseTexture: string | BaseTexture): BaseTexture; - on(event: "update", fn: (baseTexture: BaseTexture) => void, context?: any): this; - on(event: "loaded", fn: (baseTexture: BaseTexture) => void, context?: any): this; - on(event: "error", fn: (baseTexture: BaseTexture) => void, context?: any): this; - on(event: "dispose", fn: (baseTexture: BaseTexture) => void, context?: any): this; - on(event: string, fn: Function, context?: any): this; - once(event: "update", fn: (baseTexture: BaseTexture) => void, context?: any): this; - once(event: "loaded", fn: (baseTexture: BaseTexture) => void, context?: any): this; - once(event: "error", fn: (baseTexture: BaseTexture) => void, context?: any): this; - once(event: "dispose", fn: (baseTexture: BaseTexture) => void, context?: any): this; - once(event: string, fn: Function, context?: any): this; - off(event: string, fn: Function, context?: any): this; + on(event: "update" | "loaded" | "error" | "dispose", fn: (baseTexture: BaseTexture) => void, context?: any): this; + once(event: "update" | "loaded" | "error" | "dispose", fn: (baseTexture: BaseTexture) => void, context?: any): this; + removeListener(event: "update" | "loaded" | "error" | "dispose", fn?: (baseTexture: BaseTexture) => void, context?: any): this; + removeAllListeners(event: "update" | "loaded" | "error" | "dispose"): this; + off(event: "update" | "loaded" | "error" | "dispose", fn?: (baseTexture: BaseTexture) => void, context?: any): this; + addListener(event: "update" | "loaded" | "error" | "dispose", fn: (baseTexture: BaseTexture) => void, context?: any): this; } class RenderTexture extends Texture { constructor(baseRenderTexture: BaseRenderTexture, frame?: Rectangle); @@ -1451,8 +1474,6 @@ declare namespace PIXI { static create(width?: number, height?: number, scaleMode?: number, resolution?: number): RenderTexture; } class Texture extends utils.EventEmitter { - static from(source: number | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | BaseTexture): Texture; - constructor(baseTexture: BaseTexture, frame?: Rectangle, orig?: Rectangle, trim?: Rectangle, rotate?: number); noFrame: boolean; @@ -1465,6 +1486,7 @@ declare namespace PIXI { orig: Rectangle; protected _updateID: number; transform: any; + textureCacheIds: string[]; update(): void; protected onBaseTextureLoaded(baseTexture: BaseTexture): void; @@ -1475,12 +1497,17 @@ declare namespace PIXI { static fromImage(imageUrl: string, crossOrigin?: boolean, scaleMode?: number, sourceScale?: number): Texture; static fromFrame(frameId: string): Texture; - static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number): Texture; + static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number, origin?: string): Texture; static fromVideo(video: HTMLVideoElement | string, scaleMode?: number): Texture; static fromVideoUrl(videoUrl: string, scaleMode?: number): Texture; + static from(source: number | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | BaseTexture): Texture; static fromLoader(source: HTMLImageElement | HTMLCanvasElement, imageUrl: string, name?: string): Texture; + static addToCache(texture: Texture, id: string): void; + static removeFromCache(texture: string | Texture): Texture; + + // depreciation static addTextureToCache(texture: Texture, id: string): void; - static removeTextureFromCache(id: string): Texture | undefined; + static removeTextureFromCache(id: string): Texture; frame: Rectangle; protected _rotate: boolean | 0; @@ -1489,12 +1516,14 @@ declare namespace PIXI { height: number; static EMPTY: Texture; + static WHITE: Texture; on(event: "update", fn: (texture: Texture) => void, context?: any): this; - on(event: string, fn: Function, context?: any): this; once(event: "update", fn: (texture: Texture) => void, context?: any): this; - once(event: string, fn: Function, context?: any): this; - off(event: string, fn: Function, context?: any): this; + removeListener(event: "update", fn?: (texture: Texture) => void, context?: any): this; + removeAllListeners(event: "update"): this; + off(event: "update", fn?: (texture: Texture) => void, context?: any): this; + addListener(event: "update", fn: (texture: Texture) => void, context?: any): this; } class TextureUvs { x0: number; @@ -1560,16 +1589,26 @@ declare namespace PIXI { namespace ticker { const shared: Ticker; + class TickerListener { + constructor(fn: (deltaTime: number) => void, context?: any, priority?: number, once?: boolean); + fn: (deltaTime: number) => void; + context: any; + priority: number; + once: boolean; + next: TickerListener; + previous: TickerListener; + protected _destroyed: boolean; + match(fn: (deltaTime: number) => void, context?: any): boolean; + emit(deltaTime: number): TickerListener; + connect(previous: TickerListener): void; + destroy(hard?: boolean): void; + } class Ticker { - protected _tick(time: number): void; - protected _emitter: utils.EventEmitter; + protected _tick: (time: number) => void; + protected _head: TickerListener; protected _requestId: number | null; protected _maxElapsedMS: number; - protected _requestIfNeeded(): void; - protected _cancelIfNeeded(): void; - protected _startIfPossible(): void; - autoStart: boolean; deltaTime: number; elapsedMS: number; @@ -1577,15 +1616,22 @@ declare namespace PIXI { speed: number; started: boolean; - FPS: number; + protected _requestIfNeeded(): void; + protected _cancelIfNeeded(): void; + protected _startIfPossible(): void; + + add(fn: (deltaTime: number) => void, context?: any, priority?: number): Ticker; + addOnce(fn: (deltaTime: number) => void, context?: any, priority?: number): Ticker; + //tslint:disable-next-line:ban-types forbidden-types + remove(fn: Function, context?: any, priority?: number): Ticker; + protected _addListener(listener: TickerListener): Ticker; + readonly FPS: number; minFPS: number; - add(fn: (deltaTime: number) => void, context?: any): Ticker; - addOnce(fn: (deltaTime: number) => void, context?: any): Ticker; - remove(fn: (deltaTime: number) => void, context?: any): Ticker; start(): void; stop(): void; - update(): void; + destroy(): void; + update(currentTime?: number): void; } } @@ -1629,7 +1675,7 @@ declare namespace PIXI { ////////////////////////////////////////////////////////////////////////////// namespace extras { - interface IBitmapTextStyle { + interface BitmapTextStyle { font?: string | { name?: string; size?: number; @@ -1640,7 +1686,7 @@ declare namespace PIXI { class BitmapText extends Container { static registerFont(xml: XMLDocument, texture: Texture): any; - constructor(text: string, style?: IBitmapTextStyle); + constructor(text: string, style?: BitmapTextStyle); protected _textWidth: number; protected _textHeight: number; @@ -1656,7 +1702,9 @@ declare namespace PIXI { size?: number; }; protected _text: string; + protected _maxWidth: number; maxWidth: number; + protected _maxLineHeight: number; maxLineHeight: number; protected _anchor: ObservablePoint; dirty: boolean; @@ -1672,17 +1720,22 @@ declare namespace PIXI { static fonts: any; } + interface AnimatedSpriteTextureTimeObject { + texture: Texture; + time?: number; + } class AnimatedSprite extends Sprite { - constructor(textures: Texture[] | Array<{ texture: Texture, time?: number }>, autoUpdate?: boolean); + constructor(textures: Texture[] | AnimatedSpriteTextureTimeObject[], autoUpdate?: boolean); protected _autoUpdate: boolean; protected _textures: Texture[]; protected _durations: number[]; - textures: Texture[] | Array<{ texture: Texture, time?: number }>; + textures: Texture[] | AnimatedSpriteTextureTimeObject[]; animationSpeed: number; loop: boolean; onComplete: () => void; onFrameChange: (currentFrame: number) => void; + onLoop: () => void; protected _currentTime: number; playing: boolean; totalFrames: number; @@ -1692,7 +1745,7 @@ declare namespace PIXI { gotoAndStop(frameNumber: number): void; gotoAndPlay(frameNumber: number): void; protected update(deltaTime: number): void; - destroy(): void; + destroy(options?: DestroyOptions | boolean): void; static fromFrames(frame: string[]): AnimatedSprite; static fromImages(images: string[]): AnimatedSprite; @@ -1711,7 +1764,7 @@ declare namespace PIXI { texture: Texture; - update(forceUpdate?: boolean): void; + update(forceUpdate?: boolean): boolean; } class TilingSprite extends Sprite { constructor(texture: Texture, width?: number, height?: number); @@ -1727,13 +1780,14 @@ declare namespace PIXI { tileScale: Point | ObservablePoint; tilePosition: Point | ObservablePoint; + multiplyUvs(uvs: Float32Array, out: Float32Array): Float32Array; protected _onTextureUpdate(): void; protected _renderWebGL(renderer: WebGLRenderer): void; protected _renderCanvas(renderer: CanvasRenderer): void; protected _calculateBounds(): void; getLocalBounds(rect?: Rectangle): Rectangle; containsPoint(point: Point): boolean; - destroy(): void; + destroy(options?: DestroyOptions | boolean): void; static from(source: number | string | BaseTexture | HTMLCanvasElement | HTMLVideoElement, width?: number, height?: number): TilingSprite; static fromFrame(frameId: string, width?: number, height?: number): TilingSprite; @@ -1802,6 +1856,7 @@ declare namespace PIXI { protected _colorMatrix(matrix: number[]): void; matrix: number[]; + alpha: number; brightness(b: number, multiply?: boolean): void; greyscale(scale: number, multiply?: boolean): void; @@ -1837,7 +1892,9 @@ declare namespace PIXI { // pixi-filters.d.ts todo // https://github.com/pixijs/pixi-filters/ class NoiseFilter extends Filter { + constructor(noise?: number, seed?: number); noise: number; + seed: number; } } @@ -1876,11 +1933,33 @@ declare namespace PIXI { class InteractionData { global: Point; target: DisplayObject; - originalEvent: Event; - identifier?: number; - + originalEvent: MouseEvent | TouchEvent | PointerEvent; + identifier: number; + isPrimary: boolean; + button: number; + buttons: number; + width: number; + height: number; + tiltX: number; + tiltY: number; + pointerType: string; + pressure: number; + rotationAngle: number; + twist: number; + tangentialPressure: number; + readonly pointerID: number; + protected _copyEvent(event: Touch | MouseEvent | PointerEvent): void; + protected _reset(): void; getLocalPosition(displayObject: DisplayObject, point?: Point, globalPos?: Point): Point; } + type InteractionPointerEvents = "pointerdown" | "pointercancel" | "pointerup" | + "pointertap" | "pointerupoutside" | "pointermove" | "pointerover" | "pointerout"; + type InteractionTouchEvents = "touchstart" | "touchcancel" | "touchend" | + "touchendoutside" | "touchmove" | "tap"; + type InteractionMouseEvents = "rightdown" | "mousedown" | "rightup" | "mouseup" | + "rightclick" | "click" | "rightupoutside" | "mouseupoutside" | "mousemove" | + "mouseover" | "mouseout" | "mouseover"; + type InteractionEventTypes = InteractionPointerEvents | InteractionTouchEvents | InteractionMouseEvents; interface InteractionManagerOptions { autoPreventDefault?: boolean; interactionFrequency?: number; @@ -1920,6 +1999,7 @@ declare namespace PIXI { cursor: string; protected _tempPoint: Point; resolution: number; + hitTest(globalPoint: Point, root?: Container): DisplayObject; protected setTargetElement(element: HTMLCanvasElement, resolution?: number): void; protected addEvents(): void; protected removeEvents(): void; @@ -1927,15 +2007,22 @@ declare namespace PIXI { setCursorMode(mode: string): void; protected dispatchEvent(displayObject: Container | Sprite | extras.TilingSprite, eventString: string, eventData: any): void; mapPositionToPoint(point: Point, x: number, y: number): void; + //tslint:disable-next-line:ban-types forbidden-types protected processInteractive( interactionEvent: InteractionEvent, displayObject: PIXI.Container | PIXI.Sprite | PIXI.extras.TilingSprite, func?: Function, hitTest?: boolean, - interactive?: boolean): boolean; - protected onPointerComplete(originalEvent: PointerEvent, cancelled: boolean, func: Function): void; + interactive?: boolean + ): boolean; + //tslint:disable-next-line:ban-types forbidden-types + protected onPointerComplete( + originalEvent: PointerEvent, + cancelled: boolean, + func: Function + ): void; protected getInteractionDataForPointerId(pointerId: number): InteractionData; - protected releaseInteractionDataForPointerId(pointerId: number): void; + protected releaseInteractionDataForPointerId(event: PointerEvent): void; protected configureInteractionEventForDOMEvent(interactionEvent: InteractionEvent, pointerEvent: PointerEvent, interactionData: InteractionData): InteractionEvent; protected normalizeToPointerData(event: TouchEvent | MouseEvent | PointerEvent): PointerEvent[]; destroy(): void; @@ -1955,8 +2042,10 @@ declare namespace PIXI { // 2.0.6 class MiniSignalBinding { + //tslint:disable-next-line:ban-types forbidden-types constructor(fn: Function, once?: boolean, thisArg?: any); + //tslint:disable-next-line:ban-types forbidden-types protected _fn: Function; protected _once: boolean; protected _thisArg: any; @@ -1978,14 +2067,16 @@ declare namespace PIXI { has(node: MiniSignalBinding): boolean; dispatch(): boolean; + //tslint:disable-next-line:ban-types forbidden-types add(fn: Function, thisArg?: any): any; + //tslint:disable-next-line:ban-types forbidden-types once(fn: Function, thisArg?: any): any; detach(node: MiniSignalBinding): MiniSignal; detachAll(): MiniSignal; } namespace loaders { - interface ILoaderOptions { + interface LoaderOptions { crossOrigin?: boolean | string; loadType?: number; xhrType?: string; @@ -1993,7 +2084,7 @@ declare namespace PIXI { loadElement?: HTMLImageElement | HTMLAudioElement | HTMLVideoElement; skipSource?: boolean; } - interface IResourceDictionary { + interface ResourceDictionary { [index: string]: PIXI.loaders.Resource; } @@ -2001,6 +2092,7 @@ declare namespace PIXI { // However, for depreciation reasons, it remains. class Loader extends utils.EventEmitter { // pixi overrides here + //tslint:disable-next-line:ban-types forbidden-types static addPixiMiddleware(fn: Function): void; // below this line is the original non-pixi loader @@ -2016,13 +2108,16 @@ declare namespace PIXI { loading: boolean; defaultQueryString: string; + //tslint:disable-next-line:ban-types forbidden-types protected _beforeMiddleware: Function[]; + //tslint:disable-next-line:ban-types forbidden-types protected _afterMiddleware: Function[]; protected _resourcesParsing: Resource[]; + //tslint:disable-next-line:ban-types forbidden-types protected _boundLoadResource: (r: Resource, d: Function) => void; protected _queue: any; - resources: IResourceDictionary; + resources: ResourceDictionary; onProgress: MiniSignal; onError: MiniSignal; @@ -2031,44 +2126,49 @@ declare namespace PIXI { onComplete: MiniSignal; add(...params: any[]): this; - add(name: string, url: string, options?: ILoaderOptions, cb?: Function): this; - add(url: string, options?: ILoaderOptions, cb?: Function): this; - add(obj: any | any[], options?: ILoaderOptions, cb?: Function): this; + //tslint:disable-next-line:ban-types forbidden-types + add(name: string, url: string, options?: LoaderOptions, cb?: Function): this; + //tslint:disable-next-line:ban-types forbidden-types + add(obj: string | any | any[], options?: LoaderOptions, cb?: Function): this; + //tslint:disable-next-line:ban-types forbidden-types pre(fn: Function): this; + //tslint:disable-next-line:ban-types forbidden-types use(fn: Function): this; reset(): this; + //tslint:disable-next-line:ban-types forbidden-types load(cb?: Function): this; protected _prepareUrl(url: string): string; + //tslint:disable-next-line:ban-types forbidden-types protected _loadResource(resource: Resource, dequeue: Function): void; protected _onComplete(): void; protected _onLoad(resource: Resource): void; + destroy(): void; + // depreciation on(event: "complete", fn: (loader: loaders.Loader, object: any) => void, context?: any): this; on(event: "error", fn: (error: Error, loader: loaders.Loader, resource: Resource) => void, context?: any): this; - on(event: "load", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): this; - on(event: "progress", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): this; + on(event: "load" | "progress", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): this; on(event: "start", fn: (loader: loaders.Loader) => void, context?: any): this; - on(event: string, fn: Function, context?: any): this; once(event: "complete", fn: (loader: loaders.Loader, object: any) => void, context?: any): this; once(event: "error", fn: (error: Error, loader: loaders.Loader, resource: Resource) => void, context?: any): this; - once(event: "load", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): this; - once(event: "progress", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): this; + once(event: "load" | "progress", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): this; once(event: "start", fn: (loader: loaders.Loader) => void, context?: any): this; - once(event: string, fn: Function, context?: any): this; + //tslint:disable-next-line:ban-types forbidden-types + off(event: "complete" | "error" | "load" | "progress" | "start" | string, fn?: Function, context?: any): this; } - interface ITextureDictionary { + interface TextureDictionary { [index: string]: PIXI.Texture; } class Resource { static setExtensionLoadType(extname: string, loadType: number): void; static setExtensionXhrType(extname: string, xhrType: string): void; - constructor(name: string, url: string | string[], options?: ILoaderOptions); + constructor(name: string, url: string | string[], options?: LoaderOptions); protected _flags: number; @@ -2086,14 +2186,23 @@ declare namespace PIXI { type: number; progressChunk: number; + //tslint:disable-next-line:ban-types forbidden-types protected _dequeue: Function; + //tslint:disable-next-line:ban-types forbidden-types protected _onLoadBinding: Function; + //tslint:disable-next-line:ban-types forbidden-types protected _boundComplete: Function; + //tslint:disable-next-line:ban-types forbidden-types protected _boundOnError: Function; + //tslint:disable-next-line:ban-types forbidden-types protected _boundOnProgress: Function; + //tslint:disable-next-line:ban-types forbidden-types protected _boundXhrOnError: Function; + //tslint:disable-next-line:ban-types forbidden-types protected _boundXhrOnAbort: Function; + //tslint:disable-next-line:ban-types forbidden-types protected _boundXhrOnLoad: Function; + //tslint:disable-next-line:ban-types forbidden-types protected _boundXdrOnTimeout: Function; onStart: MiniSignal; @@ -2106,6 +2215,7 @@ declare namespace PIXI { isLoading: boolean; complete(): void; abort(message?: string): void; + //tslint:disable-next-line:ban-types forbidden-types load(cb?: Function): void; protected _hasFlag(flag: number): boolean; @@ -2165,7 +2275,7 @@ declare namespace PIXI { texture: Texture; spineAtlas: any; spineData: any; - textures?: ITextureDictionary; + textures?: TextureDictionary; } } @@ -2192,6 +2302,11 @@ declare namespace PIXI { texture: Texture; tintRgb: Float32Array; protected _glDatas: { [n: number]: any; }; + protected _uvTransform: extras.TextureTransform; + uploadUvTransform: boolean; + multiplyUvs(): void; + refresh(forceUpdate?: boolean): void; + protected _refresh(): void; protected _renderWebGL(renderer: WebGLRenderer): void; protected _renderCanvas(renderer: CanvasRenderer): void; protected _onTextureUpdate(): void; @@ -2262,6 +2377,7 @@ declare namespace PIXI { updateHorizontalVertices(): void; updateVerticalVertices(): void; protected drawSegment(context: CanvasRenderingContext2D | WebGLRenderingContext, textureSource: any, w: number, h: number, x1: number, y1: number, x2: number, y2: number): void; + protected _refresh(): void; } class Rope extends Mesh { @@ -2269,20 +2385,17 @@ declare namespace PIXI { points: Point[]; colors: number[]; - protected _ready: boolean; - refresh(): void; + autoUpdate: boolean; + protected _refresh(): void; - protected _onTextureUpdate(): void; - updateTransform(): void; + refreshVertices(): void; } } - ////////////////////////////////////////////////////////////////////////////// /////////////////////////////PARTICLES//////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// - namespace particles { - interface IParticleContainerProperties { + interface ParticleContainerProperties { scale?: boolean; position?: boolean; rotation?: boolean; @@ -2290,8 +2403,10 @@ declare namespace PIXI { alpha?: boolean; } class ParticleContainer extends Container { - constructor(size?: number, properties?: IParticleContainerProperties, batchSize?: number); - + constructor(size?: number, properties?: ParticleContainerProperties, batchSize?: number); + protected _tint: number; + protected tintRgb: number | any[]; + tint: number; protected _properties: boolean[]; protected _maxSize: number; protected _batchSize: number; @@ -2302,10 +2417,10 @@ declare namespace PIXI { roundPixels: boolean; baseTexture: BaseTexture; - setProperties(properties: IParticleContainerProperties): void; + setProperties(properties: ParticleContainerProperties): void; protected onChildrenChange: (smallestChildIndex?: number) => void; - destroy(options?: IDestroyOptions | boolean): void; + destroy(options?: DestroyOptions | boolean): void; } class ParticleBuffer { constructor(gl: WebGLRenderingContext, properties: any, dynamicPropertyFlags: any[], size: number); @@ -2325,7 +2440,7 @@ declare namespace PIXI { destroy(): void; } - interface IParticleRendererProperty { + interface ParticleRendererProperty { attribute: number; size: number; uploadFunction(children: PIXI.DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; @@ -2336,7 +2451,7 @@ declare namespace PIXI { shader: glCore.GLShader; indexBuffer: WebGLBuffer; - properties: IParticleRendererProperty[]; + properties: ParticleRendererProperty[]; protected tempMatrix: Matrix; start(): void; @@ -2350,13 +2465,10 @@ declare namespace PIXI { indices: Uint16Array; } - interface IParticleShader extends glCore.GLShader { } } - ////////////////////////////////////////////////////////////////////////////// ////////////////////////////PREPARE/////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// - namespace prepare { type AddHook = (item: any, queue: any[]) => boolean; type UploadHook = (prepare: UploadHookSource, item: any) => boolean; @@ -2369,14 +2481,20 @@ declare namespace PIXI { protected queue: any[]; protected addHooks: AddHook[]; protected uploadHooks: Array>; + //tslint:disable-next-line:ban-types forbidden-types protected completes: Function[]; protected ticking: boolean; protected delayedTick: () => void; + //tslint:disable-next-line:ban-types forbidden-types upload(item: Function | DisplayObject | Container | BaseTexture | Texture | Graphics | Text | any, done?: () => void): void; protected tick(): void; protected prepareItems(): void; - register(addHook?: AddHook, uploadHook?: UploadHook): this; + registerFindHook(addHook: AddHook): this; + registerUploadHook(uploadHook: UploadHook): this; + protected findMultipleBaseTextures(item: PIXI.DisplayObject, queue: any[]): boolean; + protected findBaseTexture(item: PIXI.DisplayObject, queue: any[]): boolean; + protected findTexture(item: PIXI.DisplayObject, queue: any[]): boolean; add(item: PIXI.DisplayObject | PIXI.Container | PIXI.BaseTexture | PIXI.Texture | PIXI.Graphics | PIXI.Text | any): this; destroy(): void; } @@ -2410,7 +2528,7 @@ declare namespace PIXI { // sharedArrayBuffer as a type is not available yet. // need to fully define what an `Attrib` is. namespace glCore { - interface IContextOptions { + interface ContextOptions { /** * Boolean that indicates if the canvas contains an alpha buffer. */ @@ -2440,8 +2558,8 @@ declare namespace PIXI { */ failIfMajorPerformanceCaveat?: boolean; } - function createContext(view: HTMLCanvasElement, options?: IContextOptions): WebGLRenderingContext; - function setVertexAttribArrays(gl: WebGLRenderingContext, attribs: IAttrib[], state?: WebGLState): WebGLRenderingContext | undefined; + function createContext(view: HTMLCanvasElement, options?: ContextOptions): WebGLRenderingContext; + function setVertexAttribArrays(gl: WebGLRenderingContext, attribs: Attrib[], state?: WebGLState): WebGLRenderingContext | undefined; class GLBuffer { constructor(gl: WebGLRenderingContext, type: number, data: ArrayBuffer | ArrayBufferView | any, drawType: number); @@ -2483,7 +2601,7 @@ declare namespace PIXI { static createFloat32(gl: WebGLRenderingContext, width: number, height: number, data: ArrayBuffer | ArrayBufferView | any): GLFramebuffer; } class GLShader { - constructor(gl: WebGLRenderingContext, vertexSrc: string | string[], fragmentSrc: string | string[], precision: string, attributeLocations: { [key: string]: number }); + constructor(gl: WebGLRenderingContext, vertexSrc: string | string[], fragmentSrc: string | string[], precision?: string, attributeLocations?: { [key: string]: number }); gl: WebGLRenderingContext; program?: WebGLProgram | null; @@ -2507,7 +2625,7 @@ declare namespace PIXI { type: number; upload(source: HTMLImageElement | ImageData | HTMLVideoElement | HTMLCanvasElement): void; - uploadData(data: number, width: number, height: number): void; + uploadData(data: ArrayBuffer | ArrayBufferView, width: number, height: number): void; bind(location?: number): void; unbind(): void; minFilter(linear: boolean): void; @@ -2523,9 +2641,9 @@ declare namespace PIXI { static fromSource(gl: WebGLRenderingContext, source: HTMLImageElement | ImageData | HTMLVideoElement | HTMLCanvasElement, premultipleAlpha?: boolean): GLTexture; static fromData(gl: WebGLRenderingContext, data: number[], width: number, height: number): GLTexture; } - interface IAttrib { + interface Attrib { attribute: { - location: boolean; + location: number; size: number; }; normalized: boolean; @@ -2533,7 +2651,7 @@ declare namespace PIXI { start: number; buffer: ArrayBuffer; } - interface IWebGLRenderingContextAttribute { + interface WebGLRenderingContextAttribute { buffer: WebGLBuffer; attribute: any; type: number; @@ -2541,28 +2659,27 @@ declare namespace PIXI { stride: number; start: number; } - interface IAttribState { - tempAttribState: IAttrib[]; - attribState: IAttrib[]; + interface AttribState { + tempAttribState: Attrib[]; + attribState: Attrib[]; } - class VertexArrayObject { static FORCE_NATIVE: boolean; constructor(gl: WebGLRenderingContext, state: WebGLState); protected nativeVaoExtension: any; - protected nativeState: IAttribState; + protected nativeState: AttribState; protected nativeVao: VertexArrayObject; gl: WebGLRenderingContext; - attributes: IAttrib[]; + attributes: Attrib[]; indexBuffer: GLBuffer; dirty: boolean; bind(): VertexArrayObject; unbind(): VertexArrayObject; activate(): VertexArrayObject; - addAttribute(buffer: GLBuffer, attribute: IAttrib, type: number, normalized: boolean, stride: number, start: number): VertexArrayObject; + addAttribute(buffer: GLBuffer, attribute: Attrib, type: number, normalized: boolean, stride: number, start: number): VertexArrayObject; addIndex(buffer: GLBuffer, options?: any): VertexArrayObject; clear(): VertexArrayObject; draw(type: number, size: number, start: number): VertexArrayObject; @@ -2574,7 +2691,7 @@ declare namespace PIXI { ///////////////////////////////UTILS////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// - interface IDecomposedDataUri { + interface DecomposedDataUri { mediaType: string; subType: string; encoding: string; @@ -2585,11 +2702,11 @@ declare namespace PIXI { function uid(): number; function hex2rgb(hex: number, out?: number[]): number[]; function hex2string(hex: number): string; - function rgb2hex(rgb: Number[]): number; + function rgb2hex(rgb: number[]): number; function canUseNewCanvasBlendModes(): boolean; function getResolutionOfUrl(url: string, defaultValue?: number): number; function getSvgSize(svgString: string): any; - function decomposeDataUri(dataUri: string): IDecomposedDataUri | void; + function decomposeDataUri(dataUri: string): DecomposedDataUri | void; function getUrlFileExtension(url: string): string | void; function sayHello(type: string): void; function skipHello(): void; @@ -2635,22 +2752,107 @@ declare namespace PIXI { const phone: boolean; const tablet: boolean; } - // https://github.com/primus/eventemitter3 class EventEmitter { - listeners(event: string, exists?: boolean): Function[]; - emit(event: string, ...args: any[]): boolean; - on(event: string, fn: Function, context?: any): this; - once(event: string, fn: Function, context?: any): this; - removeListener(event: string, fn: Function, context?: any, once?: boolean): this; - removeAllListeners(event?: string): this; - eventNames(): string[]; - - off(event: string, fn: Function, context?: any, once?: boolean): this; - addListener(event: string, fn: Function, context?: any): this; + static prefixed: string | boolean; + static EventEmitter: { + new (): EventEmitter; + prefixed: string | boolean; + }; + /** + * Minimal EventEmitter interface that is molded against the Node.js + * EventEmitter interface. + * + * @constructor + * @api public + */ + constructor(); + /** + * Return an array listing the events for which the emitter has registered listeners. + * + * @returns {(string | symbol)[]} + */ + eventNames(): Array<(string | symbol)>; + /** + * Return the listeners registered for a given event. + * + * @param {(string | symbol)} event The event name. + * @returns {Function[]} + */ + //tslint:disable-next-line:ban-types forbidden-types + listeners(event: string | symbol): Function[]; + /** + * Check if there listeners for a given event. + * If `exists` argument is not `true` lists listeners. + * + * @param {(string | symbol)} event The event name. + * @param {boolean} exists Only check if there are listeners. + * @returns {boolean} + */ + listeners(event: string | symbol, exists: boolean): boolean; + /** + * Calls each of the listeners registered for a given event. + * + * @param {(string | symbol)} event The event name. + * @param {...*} args Arguments that are passed to registered listeners + * @returns {boolean} `true` if the event had listeners, else `false`. + */ + emit(event: string | symbol, ...args: any[]): boolean; + /** + * Add a listener for a given event. + * + * @param {(string | symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + */ + //tslint:disable-next-line:ban-types forbidden-types + on(event: string | symbol, fn: Function, context?: any): this; + /** + * Add a one-time listener for a given event. + * + * @param {(string | symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + */ + //tslint:disable-next-line:ban-types forbidden-types + once(event: string | symbol, fn: Function, context?: any): this; + /** + * Remove the listeners of a given event. + * + * @param {(string | symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + */ + //tslint:disable-next-line:ban-types forbidden-types + removeListener(event: string | symbol, fn?: Function, context?: any, once?: boolean): this; + /** + * Remove all listeners, or those of the specified event. + * + * @param {(string | symbol)} event The event name. + * @returns {EventEmitter} `this`. + */ + removeAllListeners(event?: string | symbol): this; + /** + * Alias method for `removeListener` + */ + //tslint:disable-next-line:ban-types forbidden-types + off(event: string | symbol, fn?: Function, context?: any, once?: boolean): this; + /** + * Alias method for `on` + */ + //tslint:disable-next-line:ban-types forbidden-types + addListener(event: string | symbol, fn: Function, context?: any): this; + /** + * This function doesn't apply anymore. + * @deprecated + */ + setMaxListeners(): this; } } - ////////////////////////////////////////////////////////////////////////////// /////////////////////////////depreciation///////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// @@ -2748,6 +2950,16 @@ declare namespace PIXI { */ type TilingSprite = extras.TilingSprite; + /** + * @class + * @private + * @name BaseTextureCache + * @memberof PIXI + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 + */ + type BaseTextureCache = any; + /** * @class * @private @@ -2857,6 +3069,15 @@ declare namespace PIXI { * @deprecated since version 4.2.0 */ type DEFAULT_RENDER_OPTIONS = number; + + /** + * @static + * @name PRECISION + * @memberof PIXI.settings + * @see PIXI.PRECISION + * @deprecated since version 4.4.0 + */ + type PRECISION = string; } namespace extras { @@ -2869,12 +3090,23 @@ declare namespace PIXI { */ type MovieClip = extras.AnimatedSprite; } + namespace settings { + /** + * @static + * @name PRECISION + * @memberof PIXI.settings + * @see PIXI.PRECISION + * @deprecated since version 4.4.0 + */ + type PRECISION = number; + } } declare namespace pixi { const gl: typeof PIXI.glCore; } +//tslint:disable-next-line:no-single-declare-module declare module "pixi.js" { export = PIXI; } diff --git a/types/pixi.js/pixi.js-tests.ts b/types/pixi.js/pixi.js-tests.ts index f73dfd7021..d14d3e0e71 100644 --- a/types/pixi.js/pixi.js-tests.ts +++ b/types/pixi.js/pixi.js-tests.ts @@ -24,7 +24,7 @@ function basics() { private renderer: PIXI.WebGLRenderer; constructor() { // Renderer should allow options from both WebGLRenderer and underlying SystemRenderer - this.renderer = new PIXI.WebGLRenderer(0, 0, { backgroundColor : 0x272d37, forceFXAA: true }); + this.renderer = new PIXI.WebGLRenderer(0, 0, { backgroundColor: 0x272d37, forceFXAA: true }); } } @@ -1507,7 +1507,8 @@ function filters() { maggot.position.y = Math.random() * bounds.height; maggot.scale.set(1 + Math.random() * 0.3); - maggot.original = maggot.scale.clone(); + //tslint:disable-next-line:whitespace + maggot.original = (maggot.scale).clone(); this.maggots.push(maggot); } diff --git a/types/quill/quill-tests.ts b/types/quill/quill-tests.ts index b16c90b384..eba77f8b68 100644 --- a/types/quill/quill-tests.ts +++ b/types/quill/quill-tests.ts @@ -170,7 +170,7 @@ function test_addContainer() function test_on_EventType1(){ var quillEditor = new Quill('#editor'); - quillEditor.on('text-change', (newDelta, oldDelta, source)=>{ + quillEditor.on('text-change', (newDelta: T, oldDelta: T, source: string)=>{ // happened }); diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 9666c1b78f..79d1b1f6cf 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -1,6 +1,10 @@ // Type definitions for ramda // Project: https://github.com/donnut/typescript-ramda -// Definitions by: Erwin Poeze , Matt DeKrey , Liam Goodacre , Matt Dziuban +// Definitions by: Erwin Poeze +// Matt DeKrey +// Liam Goodacre +// Matt Dziuban +// Stephen King // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -75,6 +79,41 @@ declare namespace R { } // @see https://gist.github.com/donnut/fd56232da58d25ceecf1, comment by @albrow + interface CurriedTypeGuard2 { + (t1: T1): (t2: T2) => t2 is R; + (t1: T1, t2: T2): t2 is R; + } + + interface CurriedTypeGuard3 { + (t1: T1): CurriedTypeGuard2; + (t1: T1, t2: T2): (t3: T3) => t3 is R; + (t1: T1, t2: T2, t3: T3): t3 is R; + } + + interface CurriedTypeGuard4 { + (t1: T1): CurriedTypeGuard3; + (t1: T1, t2: T2): CurriedTypeGuard2; + (t1: T1, t2: T2, t3: T3): (t4: T4) => t4 is R; + (t1: T1, t2: T2, t3: T3, t4: T4): t4 is R; + } + + interface CurriedTypeGuard5 { + (t1: T1): CurriedTypeGuard4; + (t1: T1, t2: T2): CurriedTypeGuard3; + (t1: T1, t2: T2, t3: T3): CurriedTypeGuard2; + (t1: T1, t2: T2, t3: T3, t4: T4): (t5: T5) => t5 is R; + (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): t5 is R; + } + + interface CurriedTypeGuard6 { + (t1: T1): CurriedTypeGuard5; + (t1: T1, t2: T2): CurriedTypeGuard4; + (t1: T1, t2: T2, t3: T3): CurriedTypeGuard3; + (t1: T1, t2: T2, t3: T3, t4: T4): CurriedTypeGuard2; + (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): (t6: T6) => t6 is R; + (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6): t6 is R; + } + interface CurriedFunction2 { (t1: T1): (t2: T2) => R; (t1: T1, t2: T2): R; @@ -392,6 +431,11 @@ declare namespace R { * Returns a curried equivalent of the provided function. The curried function has two unusual capabilities. * First, its arguments needn't be provided one at a time. */ + curry(fn: (a: T1, b: T2) => b is TResult): CurriedTypeGuard2 + curry(fn: (a: T1, b: T2, c: T3) => c is TResult): CurriedTypeGuard3 + curry(fn: (a: T1, b: T2, c: T3, d: T4) => d is TResult): CurriedTypeGuard4 + curry(fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => e is TResult): CurriedTypeGuard5 + curry(fn: (a: T1, b: T2, c: T3, d: T4, e: T5, f: T6) => f is TResult): CurriedTypeGuard6 curry(fn: (a: T1, b: T2) => TResult): CurriedFunction2 curry(fn: (a: T1, b: T2, c: T3) => TResult): CurriedFunction3 curry(fn: (a: T1, b: T2, c: T3, d: T4) => TResult): CurriedFunction4 diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index f9b272f8ca..8fbbb5c7ba 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -86,6 +86,25 @@ class F2 { var z2:number = addTwoNumbersCurried(2,3); } +() => { + interface Car { speed?: number; } + interface FastCar { speed: number; } + + const typeGuard = function(a: number, b: number, c: number, d: number, e: number, car: Car): car is FastCar { + return car.speed !== undefined; + } + const typeGuardCurried = R.curry(typeGuard); + + const drive = function(fastCar: FastCar) {}; + + const cars: Car[] = [{ speed: 65 }, {}]; + for (const car of cars) { + if (typeGuardCurried(1)(2)(3)(4)(5)(car)) { + drive(car); + } + } +} + () => { const addFour = (a:number) => (b:number) => (c:number) => (d:number) => a + b + c + d; const uncurriedAddFour = R.uncurryN(4, addFour); diff --git a/types/react-icon-base/index.d.ts b/types/react-icon-base/index.d.ts index 600d33dff7..121b846ed8 100644 --- a/types/react-icon-base/index.d.ts +++ b/types/react-icon-base/index.d.ts @@ -1,15 +1,20 @@ // Type definitions for react-icon-base 2.0 // Project: https://github.com/gorangajic/react-icon-base#readme -// Definitions by: Alexandre Paré +// Definitions by: Alexandre Paré , Karol Janyst // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -import * as React from 'react'; +import * as React from "react"; -export interface IconBaseProps { - color?: string; - size?: string | number; - style?: React.CSSProperties; +export = IconBaseClass; + +declare namespace IconBaseClass { + interface IconBaseProps { + color?: string; + size?: string | number; + style?: React.CSSProperties; + viewBox?: string; + } } -export default class IconBase extends React.Component {} +declare class IconBaseClass extends React.Component {} diff --git a/types/react-icon-base/react-icon-base-tests.tsx b/types/react-icon-base/react-icon-base-tests.tsx index 16ebafd133..c0d56f03f2 100644 --- a/types/react-icon-base/react-icon-base-tests.tsx +++ b/types/react-icon-base/react-icon-base-tests.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; -import IconBase from 'react-icon-base'; +import * as React from "react"; +import * as IconBase from "react-icon-base"; -export default ; +export default ; diff --git a/types/react-motion/index.d.ts b/types/react-motion/index.d.ts index 8254ad78aa..abdfd27048 100644 --- a/types/react-motion/index.d.ts +++ b/types/react-motion/index.d.ts @@ -111,7 +111,7 @@ interface TransitionProps { * */ styles: Array | InterpolateFunction; - children: (interpolatedStyles: Array) => ReactElement; + children?: (interpolatedStyles: Array) => ReactElement; /** * Triggers when new elements appears * @param styleThatEntered @@ -123,7 +123,7 @@ interface TransitionProps { */ willLeave?: (styleThatLeft: TransitionStyle) => Style | void; } -export class TransitionMotion extends Component { } +export class TransitionMotion extends Component { } interface StaggeredMotionProps { diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 22930ea00c..01942e2267 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -7273,9 +7273,9 @@ export interface SettingsStatic { /** - * @enum('default', 'light-content') + * @enum('default', 'light-content', 'dark-content') */ -export type StatusBarStyle = "default" | "light-content" +export type StatusBarStyle = "default" | "light-content" | "dark-content" /** * @enum('fade', 'slide') diff --git a/types/react-select/index.d.ts b/types/react-select/index.d.ts index 361dcfecc2..a3c2cf7881 100644 --- a/types/react-select/index.d.ts +++ b/types/react-select/index.d.ts @@ -434,7 +434,9 @@ declare namespace ReactSelectClass { /** * function to call to load options asynchronously */ - loadOptions: (input: string, callback: (err: any, result: AutocompleteResult) => any) => any; + loadOptions: + | ((input: string) => Promise) + | ((input: string, callback: (err: any, result: AutocompleteResult) => void) => void); /** * replaces the placeholder while options are loading diff --git a/types/react-select/react-select-tests.tsx b/types/react-select/react-select-tests.tsx index 972a1dacdc..5d603c9259 100644 --- a/types/react-select/react-select-tests.tsx +++ b/types/react-select/react-select-tests.tsx @@ -209,6 +209,52 @@ class SelectAsyncTest extends React.Component, {}> { } +class SelectAsyncPromiseTest extends React.Component, {}> { + + render() { + const getOptions = (input: string): Promise => { + return new Promise(resolve => { + setTimeout(function() { + return resolve({ + options: options, + complete: true + }); + }, 500); + }); + }; + const options: Option[] = [{ label: "Foo", value: "bar" }]; + const onChange = (value: any) => console.log(value); + + const asyncSelectProps: ReactAsyncSelectProps = { + name: "test-select-async-promise", + className: "test-select", + key: "1", + matchPos: "any", + matchProp: "any", + multi: true, + onValueClick: onChange, + valueKey: "github", + labelKey: "name", + onChange: onChange, + simpleValue: undefined, + value: options, + loadOptions: getOptions, + cache: {}, + ignoreAccents: false, + ignoreCase: true, + isLoading: false, + minimumInput: 5, + searchPromptText: "search...", + searchingText: "searching...", + }; + + return
+ +
; + } + +} + class SelectCreatableTest extends React.Component, {}> { render() { diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 7d71c2d183..a8f827ee0a 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -185,7 +185,7 @@ declare namespace React { setState(f: (prevState: S, props: P) => Pick, callback?: () => any): void; setState(state: Pick, callback?: () => any): void; forceUpdate(callBack?: () => any): void; - render(): JSX.Element | null; + render(): JSX.Element | null | false; // React.Props is now deprecated, which means that the `children` // property is not available on `P` by default, even though you can @@ -2728,7 +2728,7 @@ declare global { namespace JSX { interface Element extends React.ReactElement { } interface ElementClass extends React.Component { - render(): JSX.Element | null; + render(): JSX.Element | null | false; } interface ElementAttributesProperty { props: {}; } interface ElementChildrenAttribute { children: {}; } diff --git a/types/reactstrap/lib/Dropdown.d.ts b/types/reactstrap/lib/Dropdown.d.ts index 57e4532a31..c89150fd83 100644 --- a/types/reactstrap/lib/Dropdown.d.ts +++ b/types/reactstrap/lib/Dropdown.d.ts @@ -3,6 +3,7 @@ export interface UncontrolledProps { isOpen?: boolean; toggle?: () => void; + className?: string; } export interface Props extends UncontrolledProps { @@ -12,7 +13,6 @@ export interface Props extends UncontrolledProps { size?: string; tag?: React.ReactType; tether?: boolean | Tether.ITetherOptions; - className?: string; } declare var Dropdown: React.StatelessComponent; diff --git a/types/reactstrap/lib/Row.d.ts b/types/reactstrap/lib/Row.d.ts index b318b6e6f5..61529c4a48 100644 --- a/types/reactstrap/lib/Row.d.ts +++ b/types/reactstrap/lib/Row.d.ts @@ -1,8 +1,8 @@ -interface Props { +interface Props extends React.HTMLProps< HTMLElement> { className?: string; tag?: React.ReactType; noGutters?: boolean; } -declare var Row: React.StatelessComponent>; +declare var Row: React.StatelessComponent; export default Row; \ No newline at end of file diff --git a/types/reactstrap/reactstrap-tests.tsx b/types/reactstrap/reactstrap-tests.tsx index ba5f5e38e1..331436760e 100644 --- a/types/reactstrap/reactstrap-tests.tsx +++ b/types/reactstrap/reactstrap-tests.tsx @@ -549,7 +549,7 @@ const Example26 = (props: any) => { const Example27 = (props: any) => { return ( - + Special Title Treatment @@ -1051,7 +1051,7 @@ class Example43 extends React.Component { function Example44() { return ( - + Dropdown diff --git a/types/redux-mock-store/index.d.ts b/types/redux-mock-store/index.d.ts index 9183423bfd..e8d4cced5e 100644 --- a/types/redux-mock-store/index.d.ts +++ b/types/redux-mock-store/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Redux Mock Store v0.0.6 +// Type definitions for Redux Mock Store v0.0.7 // Project: https://github.com/arnaudbenard/redux-mock-store // Definitions by: Marian Palkus , Cap3 // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -6,19 +6,16 @@ /// declare module 'redux-mock-store' { - import * as Redux from 'redux' + import * as Redux from 'redux'; function createMockStore(middlewares?: Redux.Middleware[]): mockStore; - export type mockStore = (state?: T) => IStore; - - export interface IStore { - dispatch(action: any): any; - getState(): T; + interface MockStore extends Redux.Store { getActions(): any[]; clearActions(): void; - subscribe(listener: Function): Function; } - export default createMockStore + export type mockStore = (state?: T) => MockStore; + + export default createMockStore; } diff --git a/types/redux-mock-store/package.json b/types/redux-mock-store/package.json index e52256ea90..1c5803bcd8 100644 --- a/types/redux-mock-store/package.json +++ b/types/redux-mock-store/package.json @@ -1,5 +1,6 @@ { "dependencies": { - "redux": "^3.6.0" + "redux": "^3.6.0", + "redux-mock-store": "^1.2.3" } -} \ No newline at end of file +} diff --git a/types/redux-mock-store/redux-mock-store-tests.ts b/types/redux-mock-store/redux-mock-store-tests.ts index 15d51d1f23..0937e70654 100644 --- a/types/redux-mock-store/redux-mock-store-tests.ts +++ b/types/redux-mock-store/redux-mock-store-tests.ts @@ -1,5 +1,5 @@ import * as Redux from 'redux'; -import configureStore, {IStore} from 'redux-mock-store'; +import configureStore from 'redux-mock-store'; // Redux store API tests // The following test are taken from ../redux/redux-tests.ts @@ -26,9 +26,8 @@ function loggingMiddleware() { const storeMock = configureStore([loggingMiddleware]); const initialState = 0 -let store: IStore; -store = storeMock(initialState); +const store = storeMock(initialState); store.subscribe(() => { // ... @@ -44,4 +43,4 @@ store.clearActions(); // actions access without the need to cast var actions2 = store.getActions(); -actions2[10].payload.id; \ No newline at end of file +actions2[10].payload.id; diff --git a/types/restify/index.d.ts b/types/restify/index.d.ts index 5f7e0ccb21..a7781f933c 100644 --- a/types/restify/index.d.ts +++ b/types/restify/index.d.ts @@ -483,13 +483,14 @@ export interface Client { basicAuth(username: string, password: string): any; } -export interface HttpClient extends Client { +export interface HttpClient { get(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any; head(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any; post(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any; put(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any; patch(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any; del(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any; + basicAuth(username: string, password: string): any; } export interface ThrottleOptions { diff --git a/types/rx-core-binding/index.d.ts b/types/rx-core-binding/index.d.ts index e8ba93bd3a..3b7cf59369 100644 --- a/types/rx-core-binding/index.d.ts +++ b/types/rx-core-binding/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace Rx { interface ISubject extends Observable, Observer, IDisposable { diff --git a/types/rx-lite-aggregates/index.d.ts b/types/rx-lite-aggregates/index.d.ts index 72c2ae402f..2b2ce8d6b7 100644 --- a/types/rx-lite-aggregates/index.d.ts +++ b/types/rx-lite-aggregates/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace Rx { interface Observable { diff --git a/types/rx-lite-async/index.d.ts b/types/rx-lite-async/index.d.ts index 94117a1562..8979b9dd36 100644 --- a/types/rx-lite-async/index.d.ts +++ b/types/rx-lite-async/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: zoetrope , Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace Rx { interface ObservableStatic { diff --git a/types/rx-lite-backpressure/index.d.ts b/types/rx-lite-backpressure/index.d.ts index fa997f03c6..73e9f2e8d1 100644 --- a/types/rx-lite-backpressure/index.d.ts +++ b/types/rx-lite-backpressure/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace Rx { interface Observable { diff --git a/types/rx-lite-coincidence/index.d.ts b/types/rx-lite-coincidence/index.d.ts index 3682126071..7649b234be 100644 --- a/types/rx-lite-coincidence/index.d.ts +++ b/types/rx-lite-coincidence/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace Rx { interface Observable { diff --git a/types/rx-lite-time/index.d.ts b/types/rx-lite-time/index.d.ts index e5abaf3832..e1cf93dc07 100644 --- a/types/rx-lite-time/index.d.ts +++ b/types/rx-lite-time/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace Rx { interface Observable { diff --git a/types/rx-lite-virtualtime/index.d.ts b/types/rx-lite-virtualtime/index.d.ts index 7413ec2604..1ff855f532 100644 --- a/types/rx-lite-virtualtime/index.d.ts +++ b/types/rx-lite-virtualtime/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: gsino , Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace Rx { interface VirtualTimeScheduler extends Scheduler { diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 68c68a854f..70c637e25a 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -811,7 +811,7 @@ declare namespace sequelize { */ ( newAssociations?: Array, - options?: BelongsToManySetAssociationsMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | TJoinTableAttributes + options?: BelongsToManySetAssociationsMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | { through: TJoinTableAttributes } ): Promise; } @@ -860,7 +860,7 @@ declare namespace sequelize { */ ( newAssociations?: Array, - options?: BelongsToManyAddAssociationsMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | TJoinTableAttributes + options?: BelongsToManyAddAssociationsMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | { through: TJoinTableAttributes } ): Promise; } @@ -909,7 +909,7 @@ declare namespace sequelize { */ ( newAssociation?: TInstance | TInstancePrimaryKey, - options?: BelongsToManyAddAssociationMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | TJoinTableAttributes + options?: BelongsToManyAddAssociationMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | { through: TJoinTableAttributes } ): Promise; } @@ -952,7 +952,7 @@ declare namespace sequelize { */ ( values?: TAttributes, - options?: BelongsToManyCreateAssociationMixinOptions | CreateOptions | TJoinTableAttributes + options?: BelongsToManyCreateAssociationMixinOptions | CreateOptions | { through: TJoinTableAttributes } ): Promise; } diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index c5c494a454..d786dfc4a2 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -270,19 +270,19 @@ warehouse.getBranches({ where: {} }).then((branches) => branches[0].rank); warehouse.setBranches(); warehouse.setBranches([branch]); -warehouse.setBranches([branch, 2], { validate: true, distance: 1 }).then(() => { }); +warehouse.setBranches([branch, 2], { validate: true, through: { distance: 1 } }).then(() => { }); warehouse.addBranches(); warehouse.addBranches([branch]); -warehouse.addBranches([branch, 2], { validate: false, distance: 1 }).then(() => { }); +warehouse.addBranches([branch, 2], { validate: false, through: { distance: 1 } }).then(() => { }); warehouse.addBranch(); warehouse.addBranch(branch); -warehouse.addBranch(2, { validate: true, distance: 1 }).then(() => { }); +warehouse.addBranch(2, { validate: true, through: { distance: 1 } }).then(() => { }); warehouse.createBranch(); warehouse.createBranch({ id: 1, address: 'baz' }); -warehouse.createBranch({ id: 1 }, { silent: true, distance: 1 }).then((branch) => { }); +warehouse.createBranch({ id: 1 }, { silent: true, through: { distance: 1 } }).then((branch) => { }); warehouse.removeBranches(); warehouse.removeBranches([branch]); diff --git a/types/sharepoint/index.d.ts b/types/sharepoint/index.d.ts index 3520e12f06..b4e4e4cb9d 100644 --- a/types/sharepoint/index.d.ts +++ b/types/sharepoint/index.d.ts @@ -179,6 +179,13 @@ declare class _spPageContextInfo { static webUIVersion: number; // 15 } +declare class _spFriendlyUrlPageContextInfo { + static termId: string; + static termSetId: string; + static termStoreId: string; + static title: string; +} + declare function STSHtmlEncode(value: string): string; declare function STSHtmlDecode(value: string): string; diff --git a/types/stacktrace-js/index.d.ts b/types/stacktrace-js/index.d.ts index 9f3078b102..96be8bfbf5 100644 --- a/types/stacktrace-js/index.d.ts +++ b/types/stacktrace-js/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for stacktrace.js // Project: https://github.com/stacktracejs/stacktrace.js // Definitions by: Exceptionless +// Chun-Yan Ho // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace StackTrace { @@ -34,7 +35,7 @@ declare namespace StackTrace { isNative: boolean; toString(): string; } - + export interface RequestOptions { headers: { [id: string]: string }; } @@ -46,6 +47,13 @@ declare namespace StackTrace { */ export function get(options?: StackTraceOptions): Promise; + /** + * Get a backtrace from invocation point synchronously. + * @param options Options Object + * @return Array[StackFrame] + */ + export function getSync(options?: StackTraceOptions): StackFrame[]; + /** * Given an error object, parse it. * @param error Error object diff --git a/types/stacktrace-js/stacktrace-js-tests.ts b/types/stacktrace-js/stacktrace-js-tests.ts index da263a6485..6fac703c7f 100644 --- a/types/stacktrace-js/stacktrace-js-tests.ts +++ b/types/stacktrace-js/stacktrace-js-tests.ts @@ -29,6 +29,7 @@ const options: StackTrace.StackTraceOptions = { const error = new Error('BOOM!'); StackTrace.get(options).then(logger); +logger(StackTrace.getSync(options)) StackTrace.fromError(error, options).then(logger); StackTrace.generateArtificially(options).then(logger); diff --git a/types/stale-lru-cache/index.d.ts b/types/stale-lru-cache/index.d.ts index f5ab3733b3..80be52905d 100644 --- a/types/stale-lru-cache/index.d.ts +++ b/types/stale-lru-cache/index.d.ts @@ -22,7 +22,7 @@ declare class Cache { } declare namespace Cache { - type OptionsCallback = (error: any, value: V, options?: string | SetOptions) => void; + type OptionsCallback = (error: any, value?: V, options?: string | SetOptions) => void; type RevalidationCallback = (key: K, callback: OptionsCallback) => void; interface CacheOptions { diff --git a/types/verror/verror-tests.ts b/types/verror/verror-tests.ts index c3b560bfb2..17f7fe1bd7 100644 --- a/types/verror/verror-tests.ts +++ b/types/verror/verror-tests.ts @@ -12,7 +12,7 @@ const verror3 = new VError({ name: "fooError", cause: error, info: { - "info0": "baz" + info0: "baz" } }, "bar"); diff --git a/types/vinyl/v0/vinyl-tests.ts b/types/vinyl/v0/vinyl-tests.ts index 910b5b7bc7..e9017f7235 100644 --- a/types/vinyl/v0/vinyl-tests.ts +++ b/types/vinyl/v0/vinyl-tests.ts @@ -72,9 +72,9 @@ describe('File', () => { }); it('should set stat to given value', done => { - var val = {}; - var file = new File({stat: val}); - file.stat.should.equal(val); + var stat = {} as fs.Stats; + var file = new File({ stat }); + file.stat.should.equal(stat); done(); }); diff --git a/types/webdriverio/index.d.ts b/types/webdriverio/index.d.ts index 5c856575b2..666da7f5bf 100644 --- a/types/webdriverio/index.d.ts +++ b/types/webdriverio/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for WebdriverIO 4.7 // Project: http://www.webdriver.io/ -// Definitions by: Nick Malaguti , Tim Brust +// Definitions by: Nick Malaguti +// Tim Brust +// Fredrik Smedberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -1551,7 +1553,7 @@ declare namespace WebdriverIO { $(selector: string): Client> & RawResult; $

(selector: string): Client

; - $$(selector: string): Client> & RawResult; + $$(selector: string): Client>> & Array>; $$

(selector: string): Client

; addCommand( diff --git a/types/webix/index.d.ts b/types/webix/index.d.ts index f5d2954d7a..2ddc28403a 100755 --- a/types/webix/index.d.ts +++ b/types/webix/index.d.ts @@ -200,7 +200,7 @@ function delay(code:WebixCallback, owner?:any, params?:any[], delay?:number):num function detachEvent(id:string):void; function dp(name:string):any; function editStop():void; -function event(node:HTMLElement|string, event:string, handler:WebixCallback, context?:any):string|number; +function event(node:HTMLElement|Window|string, event:string, handler:WebixCallback, context?:any):string|number; function eventRemove(id:string|number):void; function exec(code:string):void; function extend(target:any, source:any, overwrite?:boolean):any; @@ -811,7 +811,7 @@ interface TreeCollection{ clearAll():void; clearValidation():void; copy(sid:string|number, tindex:number, tobj?:any, details?:any):void; - count():number; + count():number; define(property:string, value:any):void; destructor():void; detachEvent(id:string):void; diff --git a/types/webpack/webpack-tests.ts b/types/webpack/webpack-tests.ts index 066bdfb740..6c7095483d 100644 --- a/types/webpack/webpack-tests.ts +++ b/types/webpack/webpack-tests.ts @@ -585,14 +585,6 @@ class TestResolvePlugin implements webpack.ResolvePlugin { } } -const resolve: webpack.Resolve = { - plugins: [ - new TestResolvePlugin() - ], - symlinks: false, - cachePredicate: 'boo' // why does this test _not_ fail!? -}; - const performance: webpack.Options.Performance = { hints: 'error', maxEntrypointSize: 400000,