From 60af25b105bdd2b1040366153a14d01502abea3a Mon Sep 17 00:00:00 2001 From: bobby77 Date: Tue, 26 Dec 2017 16:02:27 +0100 Subject: [PATCH 001/496] Update index.d.ts Changed error in "transform" and "inverseTransform" return type: Point instead of Matrix (L307) Changed error in clone parameters : object instead of boolean (L1358-1360) --- types/paper/index.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/types/paper/index.d.ts b/types/paper/index.d.ts index 64d961ed10..2c78fd6e6d 100644 --- a/types/paper/index.d.ts +++ b/types/paper/index.d.ts @@ -290,7 +290,7 @@ declare module paper { * Transforms a point and returns the result. * @param point - the point to be transformed */ - transform(point: Point): Matrix; + transform(point: Point): Point; /** * Transforms an array of coordinates by this matrix and stores the results into the destination array, which is also returned. @@ -304,7 +304,7 @@ declare module paper { * Inverse transforms a point and returns the result. * @param point - the point to be transformed */ - inverseTransform(point: Point): Matrix; + inverseTransform(point: Point): Point; /** * Attempts to decompose the affine transformation described by this matrix into scaling, rotation and shearing, and returns an object with these properties if it succeeded, null otherwise. @@ -1353,9 +1353,11 @@ declare module paper { /** * Clones the item within the same project and places the copy above the item. - * @param insert [optional] - specifies whether the copy should be inserted into the DOM. When set to true, it is inserted above the original. default: true + * @param options [optional] - object with 2 parameters + * insert: specifies whether the copy should be inserted into the DOM. When set to true, it is inserted above the original. default: true + * deep: specifies whether the item’s children should also be cloned — default: true */ - clone(insert?: boolean): Item; + clone(options?: any): Item; /** * When passed a project, copies the item to the project, or duplicates it within the same project. When passed an item, copies the item into the specified item. From 0868ebcbccd557c22955e6568c00c82fad15734a Mon Sep 17 00:00:00 2001 From: tquinlan1992 Date: Sun, 31 Dec 2017 10:39:36 -0500 Subject: [PATCH 002/496] Update type to include OnDragStart OnDragEnter OnDrop --- types/rc-tree/index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/rc-tree/index.d.ts b/types/rc-tree/index.d.ts index 8091b2edd5..793a10bd6f 100644 --- a/types/rc-tree/index.d.ts +++ b/types/rc-tree/index.d.ts @@ -149,6 +149,12 @@ export interface TreeProps extends Props { * whether can drag treeNode. */ draggable?: boolean; + /* + * On Drag Start Called + */ + onDragStart?: Function; + onDragEnter?: Function; + onDrop?: Function; } export default class Tree extends Component { } From d3a97d4d25dc243a44f45d3f0356b83cca50df43 Mon Sep 17 00:00:00 2001 From: tquinlan1992 Date: Sun, 31 Dec 2017 12:00:58 -0500 Subject: [PATCH 003/496] Update onDrag types with Data Interfaces --- types/rc-tree/index.d.ts | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/types/rc-tree/index.d.ts b/types/rc-tree/index.d.ts index 793a10bd6f..4db24c2410 100644 --- a/types/rc-tree/index.d.ts +++ b/types/rc-tree/index.d.ts @@ -58,6 +58,24 @@ export interface SelectData { event: "select"; } +interface OnDragStartData { + event: Event, + node: TreeNode +} + +interface OnDragEnterData { + event: Event; + node: TreeNode; + expandedKeys: string[]; +} + +interface OnDropData { + event: Event; + node: TreeNode; + dragNode: TreeNode; + dragNodesKeys: string[]; +} + export interface TreeProps extends Props { /** * additional css class of root dom node @@ -149,12 +167,18 @@ export interface TreeProps extends Props { * whether can drag treeNode. */ draggable?: boolean; - /* - * On Drag Start Called + /** + * Event on Drag Start */ - onDragStart?: Function; - onDragEnter?: Function; - onDrop?: Function; + onDragStart?: (props: OnDragStartData) => void; + /** + * Event on Drag Enter + */ + onDragEnter?: (props: OnDragEnterData) => void; + /** + * Event on Drag Drop + */ + onDrop?: (props: OnDropData) => void; } export default class Tree extends Component { } From 82a4eba664eba92c8090deec3322399b9b8e246e Mon Sep 17 00:00:00 2001 From: tquinlan1992 Date: Sun, 31 Dec 2017 12:07:31 -0500 Subject: [PATCH 004/496] Fix comma interface to semicolon --- types/rc-tree/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/rc-tree/index.d.ts b/types/rc-tree/index.d.ts index 4db24c2410..df3db12c15 100644 --- a/types/rc-tree/index.d.ts +++ b/types/rc-tree/index.d.ts @@ -59,8 +59,8 @@ export interface SelectData { } interface OnDragStartData { - event: Event, - node: TreeNode + event: Event; + node: TreeNode; } interface OnDragEnterData { From 9a5a154ff88ff68bac20d27c19344a290fecd0ab Mon Sep 17 00:00:00 2001 From: tquinlan1992 Date: Sun, 31 Dec 2017 12:17:34 -0500 Subject: [PATCH 005/496] export onDrag interfaces --- types/rc-tree/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/rc-tree/index.d.ts b/types/rc-tree/index.d.ts index df3db12c15..103bd60adf 100644 --- a/types/rc-tree/index.d.ts +++ b/types/rc-tree/index.d.ts @@ -58,18 +58,18 @@ export interface SelectData { event: "select"; } -interface OnDragStartData { +export interface OnDragStartData { event: Event; node: TreeNode; } -interface OnDragEnterData { +export interface OnDragEnterData { event: Event; node: TreeNode; expandedKeys: string[]; } -interface OnDropData { +export interface OnDropData { event: Event; node: TreeNode; dragNode: TreeNode; From 448e451dc1a188d80dea97e21184d4c4d90bea47 Mon Sep 17 00:00:00 2001 From: tquinlan1992 Date: Sun, 31 Dec 2017 12:26:02 -0500 Subject: [PATCH 006/496] align asteriks for onDrag properties --- types/rc-tree/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/rc-tree/index.d.ts b/types/rc-tree/index.d.ts index 103bd60adf..a8e5780b97 100644 --- a/types/rc-tree/index.d.ts +++ b/types/rc-tree/index.d.ts @@ -169,15 +169,15 @@ export interface TreeProps extends Props { draggable?: boolean; /** * Event on Drag Start - */ + */ onDragStart?: (props: OnDragStartData) => void; /** * Event on Drag Enter - */ + */ onDragEnter?: (props: OnDragEnterData) => void; /** * Event on Drag Drop - */ + */ onDrop?: (props: OnDropData) => void; } From e100608648cb0e61cee3b059c737076fe5a794e4 Mon Sep 17 00:00:00 2001 From: tquinlan1992 Date: Sun, 31 Dec 2017 12:34:21 -0500 Subject: [PATCH 007/496] lowercase letters --- types/rc-tree/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/rc-tree/index.d.ts b/types/rc-tree/index.d.ts index a8e5780b97..4dc789824d 100644 --- a/types/rc-tree/index.d.ts +++ b/types/rc-tree/index.d.ts @@ -168,15 +168,15 @@ export interface TreeProps extends Props { */ draggable?: boolean; /** - * Event on Drag Start + * event on drag start */ onDragStart?: (props: OnDragStartData) => void; /** - * Event on Drag Enter + * event on drag enter */ onDragEnter?: (props: OnDragEnterData) => void; /** - * Event on Drag Drop + * event on drag drop */ onDrop?: (props: OnDropData) => void; } From c3dd0698c4e817274466f89f90e781b25db6a6d2 Mon Sep 17 00:00:00 2001 From: tquinlan1992 Date: Sun, 31 Dec 2017 15:45:17 -0500 Subject: [PATCH 008/496] add onDrag tests --- types/rc-tree/rc-tree-tests.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/types/rc-tree/rc-tree-tests.tsx b/types/rc-tree/rc-tree-tests.tsx index c57866284f..290e3658cc 100644 --- a/types/rc-tree/rc-tree-tests.tsx +++ b/types/rc-tree/rc-tree-tests.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import Tree, { TreeNode, SelectData, CheckData } from 'rc-tree'; +import { TreeNode as TreeNodeInterface } from './index.d.ts'; interface Props { keys: string[]; @@ -43,6 +44,18 @@ export class Demo extends React.Component { onCheck(checkedKeys: string[], info: CheckData) { console.log('onCheck', checkedKeys, info); } + + onDragStart(params: {event: Event, node: TreeNodeInterface}) { + console.log('onDragStart', params.event, params.node); + } + + OnDragEnterData(params: {event: Event, node: TreeNodeInterface, expandedKeys: string[]}) { + console.log('OnDragEnterData', params.event, params.node, params.expandedKeys); + } + + OnDropData(params: {event: Event, node: TreeNode, dragNode: TreeNode, dragNodesKeys: string[]}) { + console.log('OnDropData', params.event, params.node, params.dragNode, params.dragNodesKeys); + } onEdit() { setTimeout(() => { @@ -73,6 +86,8 @@ export class Demo extends React.Component { defaultSelectedKeys={this.state.defaultSelectedKeys} defaultCheckedKeys={this.state.defaultCheckedKeys} onSelect={this.onSelect} onCheck={this.onCheck} + onDragStart={this.onDragStart} OnDragEnterData={this.OnDragEnterData} + OnDragEnterData={this.OnDragEnterData} > From 311b5961e8076626358650a17168cd624fe101a0 Mon Sep 17 00:00:00 2001 From: tquinlan1992 Date: Sun, 31 Dec 2017 16:09:53 -0500 Subject: [PATCH 009/496] OnDropData in Tree Prop --- types/rc-tree/rc-tree-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/rc-tree/rc-tree-tests.tsx b/types/rc-tree/rc-tree-tests.tsx index 290e3658cc..ff73beda86 100644 --- a/types/rc-tree/rc-tree-tests.tsx +++ b/types/rc-tree/rc-tree-tests.tsx @@ -87,7 +87,7 @@ export class Demo extends React.Component { defaultCheckedKeys={this.state.defaultCheckedKeys} onSelect={this.onSelect} onCheck={this.onCheck} onDragStart={this.onDragStart} OnDragEnterData={this.OnDragEnterData} - OnDragEnterData={this.OnDragEnterData} + OnDropData={this.OnDropData} > From ac4424f5a3d88ec14293c7c94abb2b9c3491ac28 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 2 Jan 2018 23:28:50 -0800 Subject: [PATCH 010/496] Fix lint failures --- types/rc-tree/rc-tree-tests.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/rc-tree/rc-tree-tests.tsx b/types/rc-tree/rc-tree-tests.tsx index ff73beda86..2d5f0426ed 100644 --- a/types/rc-tree/rc-tree-tests.tsx +++ b/types/rc-tree/rc-tree-tests.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import Tree, { TreeNode, SelectData, CheckData } from 'rc-tree'; -import { TreeNode as TreeNodeInterface } from './index.d.ts'; +import { TreeNode as TreeNodeInterface } from './index'; interface Props { keys: string[]; @@ -44,15 +44,15 @@ export class Demo extends React.Component { onCheck(checkedKeys: string[], info: CheckData) { console.log('onCheck', checkedKeys, info); } - + onDragStart(params: {event: Event, node: TreeNodeInterface}) { console.log('onDragStart', params.event, params.node); } - + OnDragEnterData(params: {event: Event, node: TreeNodeInterface, expandedKeys: string[]}) { console.log('OnDragEnterData', params.event, params.node, params.expandedKeys); } - + OnDropData(params: {event: Event, node: TreeNode, dragNode: TreeNode, dragNodesKeys: string[]}) { console.log('OnDropData', params.event, params.node, params.dragNode, params.dragNodesKeys); } @@ -86,7 +86,7 @@ export class Demo extends React.Component { defaultSelectedKeys={this.state.defaultSelectedKeys} defaultCheckedKeys={this.state.defaultCheckedKeys} onSelect={this.onSelect} onCheck={this.onCheck} - onDragStart={this.onDragStart} OnDragEnterData={this.OnDragEnterData} + onDragStart={this.onDragStart} OnDragEnter={this.OnDragEnterData} OnDropData={this.OnDropData} > From 4e6d6e05532f82ea79e28e9c79ef0103b12866b8 Mon Sep 17 00:00:00 2001 From: Georg Kaspar Date: Wed, 3 Jan 2018 15:46:00 +0100 Subject: [PATCH 011/496] Added Control.Locate class Control.Locate class was added to type definitions in order to access functions in ts. --- types/leaflet.locatecontrol/index.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/types/leaflet.locatecontrol/index.d.ts b/types/leaflet.locatecontrol/index.d.ts index 35c88be5be..3ed9c7968a 100644 --- a/types/leaflet.locatecontrol/index.d.ts +++ b/types/leaflet.locatecontrol/index.d.ts @@ -8,6 +8,12 @@ import * as L from 'leaflet'; declare module 'leaflet' { namespace Control { + class Locate extends Control { + onAdd(map: Map): HTMLElement; + start(): void; + stop(): void; + setView():void; + } interface LocateOptions { position?: string; layer?: Layer; @@ -40,6 +46,6 @@ declare module 'leaflet' { /** * Creates a Leaflet.Locate control */ - function locate(options?: Control.LocateOptions): Control; + function locate(options?: Control.LocateOptions): Control.Locate; } } From 07c172e5f6dec507f25824c2821f1ad2a81fbfc8 Mon Sep 17 00:00:00 2001 From: dominuskernel Date: Wed, 10 Jan 2018 11:51:11 +0100 Subject: [PATCH 012/496] fix style code error --- types/navigo/index.d.ts | 7 ++++--- types/navigo/navigo-tests.ts | 14 +++++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/types/navigo/index.d.ts b/types/navigo/index.d.ts index 660e44dad7..73131a9d72 100644 --- a/types/navigo/index.d.ts +++ b/types/navigo/index.d.ts @@ -2,9 +2,10 @@ // Project: https://github.com/krasimir/navigo // Definitions by: Adrian Ehrsam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 -type Keys = string -type State = {[k in Keys]: any} +type Keys = string; +type State = {[k in Keys]: any}; type Params = State; interface NavigoHooks { @@ -46,7 +47,7 @@ declare class Navigo { resolve(currentURL?: string): boolean; link(path: string): string; - + lastRouteResolved(): {url: string, query: string}; disableIfAPINotAvailable(): void; diff --git a/types/navigo/navigo-tests.ts b/types/navigo/navigo-tests.ts index a59bf3cfab..1aeb645ce8 100644 --- a/types/navigo/navigo-tests.ts +++ b/types/navigo/navigo-tests.ts @@ -1,14 +1,22 @@ import Navigo = require("navigo"); +type Keys = string; +type State = {[k in Keys]: any}; +type Params = State; + const root = null; const useHash = false; let router = new Navigo(root, useHash); +const before = (done: (suppress?: boolean) => void, params: Params) => done(); + +const after = (params: Params) => params; + router.hooks({ - before: function(done, params) { //do something }, - after: function(params) { //do something } - }); + before, + after +}); router .on('/products/list', () => { From 9774da216ac3232d85878f50ad4fc232782feeca Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Wed, 10 Jan 2018 17:54:09 +0530 Subject: [PATCH 013/496] 15.4.20 added --- types/ej.web.all/ej.web.all-tests.ts | 231 +++-- types/ej.web.all/index.d.ts | 1195 +++++++++++++++++++++++--- 2 files changed, 1235 insertions(+), 191 deletions(-) diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index 678754d5d4..5ab573f418 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -1,11 +1,4 @@ -interface Window { - kanbanData: any; - themeVarient: string; - themeStyle: string; - themeColor: string; -} - -module AccordionComponent { +module AccordionComponent { $(function () { var sample = new ej.Accordion($("#basicAccordion"), { width: "100%", @@ -47,18 +40,20 @@ module AutocompleteComponent{ "Triumph Spitfire", "Toyota 2000GT", "Volvo P1800", "Volkswagen Shirako" ]; - $(function () { - var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { + $(function () { + var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { width: "100%", watermarkText: "Select a car", dataSource: carList, enableAutoFill: true, showPopupButton: true, multiSelectMode: "delimiter" - }); + }); }); } + + module Barcodecomponent { $(function () { var barcodesample = new ej.datavisualization.Barcode($("#Barcode"), { @@ -67,13 +62,13 @@ module Barcodecomponent { }); } + module Bulletgraphcomponent { $(function () { var bulletsample = new ej.datavisualization.BulletGraph($("#BulletGraph"), { isResponsive: true, load: function () { var sender = $("#BulletGraph").data("ejBulletGraph"); - var theme: string; var bulletTheme = window.themeStyle + window.themeColor + window.themeVarient; if (bulletTheme) { switch (bulletTheme) { @@ -127,6 +122,7 @@ module Bulletgraphcomponent { }); } + module ButtonComponent { $(function () { var basicButton = new ej.Button($("#buttonnormal"), { @@ -173,7 +169,6 @@ module ButtonComponent { } module ChartComponent { - var theme = "???"; $(function () { var chartsample = new ej.datavisualization.Chart($("#Chart"), { primaryXAxis: { @@ -185,7 +180,7 @@ module ChartComponent { range: { min: 25, max: 50, interval: 5 }, labelFormat: "{value}%", title: { text: "Efficiency" }, - + }, commonSeriesOptions: { @@ -200,28 +195,28 @@ module ChartComponent { }, visible: true }, - border : {width: 2} - }, - series: + border : {width: 2} + }, + series: [ { - points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, - { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], + points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, + { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], name: 'India' - }, + }, { - points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, - { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], + points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, + { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], name: 'Germany' }, { - points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, - { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], + points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, + { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], name: 'England' - }, + }, { - points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, - { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], + points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, + { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], name: 'France' } ], @@ -251,6 +246,7 @@ module ChartComponent { model.primaryYAxis.labelIntersectAction = "rotate45"; model.primaryYAxis.edgeLabelPlacement = "hide"; } + var theme = window.themeStyle + window.themeColor + window.themeVarient; if (theme) { switch (theme) { case "flatdark": @@ -287,12 +283,13 @@ module ChartComponent { theme = "flatlight"; break; } - sender.model.theme = theme; + sender.model.theme = theme; } }, title: { text: 'Efficiency of oil-fired power production' }, size: { height: "600" }, - legend: { visible: true} + legend: { visible: true}, + load:"loadTheme" }); }); } @@ -343,7 +340,7 @@ module circulargaugecomponent { backgroundColor: "#f5b43f", border: { color: "#f5b43f" } }] - }] + }] }); }); } @@ -356,6 +353,24 @@ module ColorPickerComponent { }); } +module ComboBoxComponent{ + var BikeList = [ + { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, + { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, + { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, + { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } + ]; + $(function () { + var comboboxInstance =new ej.ComboBox($("#selectCar"), { + width: "100%", + placeholder: "Select a Bike", + fields: { text: "text", value: "empid" }, + dataSource: BikeList, + autofill: true + }); + }); +} + module DatePickerComponent { $(function () { var dateSample = new ej.DatePicker($("#datepick"), { @@ -427,7 +442,7 @@ $(function () { createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) ] }); - + }); function createNode(option: ej.datavisualization.Diagram.Node) { @@ -474,6 +489,7 @@ module DialogComponent { }); } + module digitalgaugecomponent { $(function () { var digitalgaugesample = new ej.datavisualization.DigitalGauge($("#DigitalGauge"), { @@ -497,6 +513,7 @@ module digitalgaugecomponent { } + module DropDownListComponent { var BikeList = [ { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, @@ -513,12 +530,12 @@ module DropDownListComponent { enableFilterSearch: true, caseSensitiveSearch: true, enableIncrementalSearch: true, - enablePopupResize: true, + enablePopupResize: true, delimiterChar: ";", multiSelectMode: ej.MultiSelectMode.Delimiter, maxPopupHeight: "300px", - minPopupHeight: "150px", - maxPopupWidth: "500px", + minPopupHeight: "150px", + maxPopupWidth: "500px", minPopupWidth: "350px", showCheckbox: true, showRoundedCorner: true @@ -528,6 +545,7 @@ module DropDownListComponent { } + module ExplorerComponent { $(function () { var file = new ej.FileExplorer($("#fileExplorer"), { @@ -541,13 +559,14 @@ module ExplorerComponent { }); } + module GanttComponent { $(function () { var ganttInstance = new ej.Gantt($("#GanttContainer"), { dataSource: (window).projectData, allowColumnResize: true, allowSorting: true, - allowSelection: true, + allowSelection: true, enableContextMenu: true, taskIdMapping: "taskID", allowDragAndDrop: true, @@ -588,7 +607,7 @@ module GanttComponent { treeColumnIndex: 1, isResponsive: true, }); -}); +}); } module GridComponent { @@ -626,7 +645,7 @@ module GridComponent { }); } -var columns = ["Vegie-spread", "Tofuaa", "Alice Mutton", "Konbu", "Fl�temysost"] +var columns = ["Vegie-spread", "Tofuaa", "Alice Mutton", "Konbu", "Fltemysost"] var itemSource: any[] = []; for (var i = 0; i < columns.length; i++) { for (var j = 0; j < 6; j++) { @@ -671,6 +690,10 @@ $(function () { }); }); +declare var window:myWindow; +export interface myWindow extends Window{ +kanbanData:any; +} module KanbanComponent { $(function () { var sample = new ej.Kanban($("#Kanban"), { @@ -693,6 +716,7 @@ module KanbanComponent { }); } + module lineargaugecomponent { $(function () { var linearsample = new ej.datavisualization.LinearGauge($("#LinearGauge"), { @@ -716,11 +740,12 @@ module lineargaugecomponent { backgroundColor: "#E94649", border: { color: "#E94649" }, startWidth: 4, endWidth: 4 }] - }] + }] }); }); } + module ListBoxComponent { $(function () { var listboxInstance = new ej.ListBox($("#selectcar"), { @@ -732,7 +757,7 @@ module ListBoxComponent { module ListviewComponent { $(function () { var listviewInstance = new ej.ListView($("#defaultlistview"), { - enableCheckMark: true, + enableCheckMark: true, width: 400 }); }); @@ -773,7 +798,7 @@ var world_map= { "type": "Feature", "properties": { "admin": "Switzerland", "name": "Switzerland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[9.594226108446346, 47.525058091820256], [9.632931756232974, 47.347601223329974], [9.479969516649019, 47.102809963563367], [9.932448357796657, 46.920728054382948], [10.442701450246627, 46.893546250997424], [10.36337812667861, 46.483571275409851], [9.922836541390378, 46.314899400409182], [9.182881707403054, 46.440214748716976], [8.966305779667804, 46.036931871111186], [8.489952426801322, 46.005150865251672], [8.316629672894377, 46.163642483090847], [7.755992058959832, 45.824490057959302], [7.273850945676655, 45.776947740250769], [6.843592970414504, 45.991146552100595], [6.500099724970424, 46.429672756529428], [6.022609490593537, 46.272989813820466], [6.037388950229, 46.725778713561859], [6.768713820023605, 47.287708238303686], [6.736571079138058, 47.541801255882838], [7.192202182655505, 47.449765529971003], [7.466759067422228, 47.620581976911794], [8.31730146651415, 47.613579820336255], [8.522611932009765, 47.830827541691285], [9.594226108446346, 47.525058091820256]]] } }, { "type": "Feature", "properties": { "admin": "Chile", "name": "Chile", "continent": "South America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-68.634010227583147, -52.636370458874353], [-68.633349999999879, -54.8695], [-67.56244, -54.87001], [-66.95992, -54.89681], [-67.291029999999878, -55.30124], [-68.148629999999841, -55.61183], [-68.639990810811796, -55.580017999086877], [-69.2321, -55.49906], [-69.95809, -55.19843], [-71.00568, -55.05383], [-72.2639, -54.49514], [-73.2852, -53.957519999999874], [-74.66253, -52.83749], [-73.8381, -53.04743], [-72.43418, -53.7154], [-71.10773, -54.07433], [-70.591779999999787, -53.61583], [-70.26748, -52.93123], [-69.345649999999878, -52.5183], [-68.634010227583147, -52.636370458874353]]], [[[-68.219913092711224, -21.49434661223183], [-67.828179897722634, -22.872918796482178], [-67.106673550063604, -22.735924574476392], [-66.985233934177629, -22.986348565362825], [-67.328442959244128, -24.025303236590908], [-68.417652960876111, -24.518554782816874], [-68.386001146097342, -26.185016371365229], [-68.594799770772667, -26.50690886811126], [-68.295541551370391, -26.899339694935787], [-69.001234910748266, -27.521213881136127], [-69.656130337183143, -28.459141127233686], [-70.013550381129861, -29.367922865518544], [-69.919008348251921, -30.336339206668306], [-70.535068935819439, -31.365010267870279], [-70.074399380153622, -33.09120981214803], [-69.814776984319209, -33.273886000299839], [-69.817309129501453, -34.193571465798279], [-70.388049485949082, -35.169687595359441], [-70.364769253201658, -36.005088799789931], [-71.121880662709771, -36.65812387466233], [-71.118625047475419, -37.576827487947192], [-70.814664272734703, -38.552995293940732], [-71.413516608349042, -38.916022230791107], [-71.680761277946445, -39.808164157878061], [-71.915734015577542, -40.832339369470716], [-71.746803758415453, -42.051386407235988], [-72.148898078078517, -42.254888197601375], [-71.915423956983901, -43.408564548517404], [-71.464056159130493, -43.787611179378324], [-71.793622606071935, -44.207172133156099], [-71.329800788036195, -44.407521661151677], [-71.222778896759721, -44.784242852559409], [-71.659315558545316, -44.973688653341434], [-71.552009446891233, -45.560732924177117], [-71.917258470330196, -46.884838148791786], [-72.44735531278026, -47.738532810253517], [-72.331160854771937, -48.244238376661819], [-72.648247443314929, -48.878618259476774], [-73.415435757120022, -49.318436374712952], [-73.328050910114456, -50.378785088909865], [-72.975746832964617, -50.741450290734299], [-72.309973517532342, -50.677009779666342], [-72.329403856074023, -51.425956312872394], [-71.914803839796321, -52.009022305865912], [-69.498362189396076, -52.142760912637236], [-68.571545376241332, -52.299443855346247], [-69.461284349226617, -52.291950772663924], [-69.94277950710611, -52.537930590373243], [-70.8451016913545, -52.899200528525711], [-71.006332160105217, -53.833252042201345], [-71.429794684520928, -53.856454760300373], [-72.557942877884855, -53.531410001184447], [-73.702756720662862, -52.835069268607249], [-73.702756720662862, -52.835070076051487], [-74.946763475225154, -52.262753588419017], [-75.260026007778507, -51.62935475037321], [-74.976632453089806, -51.043395684615675], [-75.47975419788348, -50.378371677451547], [-75.608015102831942, -48.673772881871784], [-75.182769741502128, -47.711919447623153], [-74.126580980104677, -46.939253431995084], [-75.644395311165439, -46.647643324572016], [-74.69215369332305, -45.76397633238097], [-74.351709357384252, -44.10304412208788], [-73.240356004515192, -44.454960625995611], [-72.717803921179765, -42.383355808278985], [-73.388899909138232, -42.117532240569567], [-73.701335618774834, -43.365776462579738], [-74.33194312203257, -43.224958184584395], [-74.017957119427152, -41.794812920906828], [-73.677099372029943, -39.942212823243111], [-73.217592536090663, -39.258688653318508], [-73.505559455037044, -38.282882582351064], [-73.588060879191076, -37.156284681956016], [-73.166717088499283, -37.123780206044351], [-72.553136969681717, -35.508840020491022], [-71.861732143832555, -33.909092706031522], [-71.438450486929895, -32.418899428030819], [-71.668720669222424, -30.920644626592516], [-71.370082567007714, -30.095682061484997], [-71.48989437527645, -28.861442152625909], [-70.905123867461569, -27.640379734001193], [-70.724953986275963, -25.705924167587209], [-70.403965827095035, -23.628996677344542], [-70.091245897080668, -21.393319187101223], [-70.164419725205974, -19.756468194256183], [-70.372572394477714, -18.347975355708879], [-69.858443569605797, -18.092693780187027], [-69.590423753523979, -17.580011895419286], [-69.100246955019401, -18.260125420812653], [-68.966818406841824, -18.981683444904089], [-68.442225104430918, -19.405068454671419], [-68.757167121033703, -20.37265797290447], [-68.219913092711224, -21.49434661223183]]]] } }, { "type": "Feature", "properties": { "admin": "China", "name": "China", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[110.339187860151526, 18.678395087147603], [109.475209588663702, 18.19770091396861], [108.655207961056135, 18.507681993071397], [108.626217482540426, 19.367887885001974], [109.119055617308007, 19.821038519769385], [110.211598748822837, 20.101253973872073], [110.786550734502228, 20.077534491450077], [111.01005130416462, 19.695929877190732], [110.570646600386794, 19.255879218009305], [110.339187860151526, 18.678395087147603]]], [[[127.657407261262378, 49.760270494172929], [129.397817824420429, 49.440600084015429], [130.58229332898236, 48.729687404976112], [130.987281528853828, 47.790132351261391], [132.506671991099495, 47.788969631534876], [133.373595819228001, 48.183441677434914], [135.026311476786702, 48.478229885443902], [134.500813836810607, 47.578439846377833], [134.112362095272601, 47.212467352886719], [133.76964399631288, 46.116926988299056], [133.097126906466428, 45.14406647397216], [131.883454217659562, 45.32116160743643], [131.025212030156069, 44.967953192721573], [131.288555129115537, 44.111519680348252], [131.144687941614848, 42.929989732426932], [130.633866408409801, 42.903014634770543], [130.640015903852429, 42.39500946712527], [129.994267205933227, 42.985386867843793], [129.596668735879462, 42.424981797854592], [128.05221520397231, 41.994284572917984], [128.208433058790717, 41.466771552082534], [127.343782993683021, 41.503151760415953], [126.869083286649854, 41.816569322266155], [126.18204511932943, 41.107336127276362], [125.079941847840587, 40.569823716792449], [124.265624627785314, 39.928493353834135], [122.86757042856101, 39.637787583976255], [122.131387974130917, 39.170451768544623], [121.054554478032856, 38.89747101496291], [121.585994907722466, 39.360853583324136], [121.376757033372641, 39.750261338859524], [122.168595005381007, 40.422442531896046], [121.640358514493528, 40.946389878903304], [120.768628778161954, 40.593388169917596], [119.639602085449056, 39.898055935214209], [119.023463983233015, 39.252333075511096], [118.042748651197897, 39.204273993479674], [117.532702264477052, 38.73763580988409], [118.05969852098967, 38.061475531561051], [118.878149855628351, 37.897325344385898], [118.911636183753501, 37.448463853498723], [119.702802362142037, 37.156388658185072], [120.823457472823648, 37.870427761377968], [121.711258579597938, 37.481123358707165], [122.357937453298462, 37.454484157860684], [122.519994744965814, 36.930614325501828], [121.104163853033029, 36.651329047180432], [120.63700890511457, 36.111439520811125], [119.66456180224607, 35.609790554337728], [119.151208123858567, 34.909859117160458], [120.227524855633717, 34.360331936168613], [120.620369093916565, 33.37672272392512], [121.229014113450219, 32.460318711877186], [121.908145786630044, 31.692174384074683], [121.891919386890336, 30.949351508095098], [121.264257440273298, 30.676267401648712], [121.503519321784722, 30.14291494396425], [122.092113885589086, 29.832520453403156], [121.93842817595305, 29.018022365834803], [121.684438511238469, 28.225512600206677], [121.125661248866436, 28.135673122667178], [120.395473260582307, 27.053206895449385], [119.585496860839555, 25.740780544532605], [118.656871372554519, 24.547390855400234], [117.281606479970833, 23.624501451099714], [115.890735304835118, 22.782873236578094], [114.763827345846209, 22.668074042241663], [114.152546828265656, 22.223760077396204], [113.806779819800752, 22.548339748621423], [113.241077915501592, 22.051367499270462], [111.843592157032447, 21.550493679281512], [110.78546552942413, 21.39714386645533], [110.444039341271662, 20.34103261970639], [109.88986128137357, 20.282457383703441], [109.627655063924635, 21.008227037026725], [109.864488153118316, 21.395050970947516], [108.522812941524421, 21.715212307211821], [108.050180291782979, 21.552379869060101], [107.043420037872636, 21.8118989120299], [106.567273390735352, 22.21820486092474], [106.725403273548466, 22.794267889898375], [105.811247186305209, 22.976892401617899], [105.329209425886631, 23.352063300056976], [104.476858351664475, 22.819150092046918], [103.504514601660503, 22.703756618739217], [102.706992222100155, 22.708795070887696], [102.170435825613552, 22.464753119389336], [101.652017856861576, 22.318198757409554], [101.803119744882906, 21.174366766845051], [101.27002566936001, 21.201651923095167], [101.180005324307558, 21.436572984294052], [101.150032993578236, 21.849984442629015], [100.416537713627349, 21.558839423096654], [99.983489211021549, 21.742936713136451], [99.240898878987196, 22.118314317304559], [99.53199222208741, 22.949038804612591], [98.898749220782804, 23.142722072842581], [98.66026248575578, 24.063286037690002], [97.604719679762027, 23.897404690033049], [97.724609002679131, 25.083637193293036], [98.671838006589212, 25.91870250091349], [98.712093947344556, 26.743535874940243], [98.682690057370507, 27.508812160750658], [98.246230910233351, 27.747221381129172], [97.91198774616943, 28.335945136014367], [97.327113885490007, 28.261582749946339], [96.248833449287829, 28.411030992134467], [96.586590610747521, 28.830979519154361], [96.117678664131006, 29.452802028922513], [95.404802280664626, 29.031716620392157], [94.565990431702929, 29.27743805593996], [93.413347609432662, 28.640629380807233], [92.503118931043616, 27.896876329046442], [91.696656528696693, 27.771741848251615], [91.258853794319876, 28.040614325466343], [90.730513950567797, 28.064953925075738], [90.015828891971182, 28.296438503527177], [89.475810174521158, 28.042758897406365], [88.814248488320573, 27.299315904239389], [88.730325962278528, 28.086864732367552], [88.120440708369941, 27.876541652939572], [86.954517043000635, 27.974261786403524], [85.823319940131526, 28.203575954698742], [85.011638218123053, 28.642773952747369], [84.23457970575015, 28.839893703724691], [83.89899295444674, 29.320226141877633], [83.337115106137176, 29.463731594352193], [82.327512648450877, 30.115268052688204], [81.525804477874786, 30.422716986608659], [81.111256138029276, 30.183480943313402], [79.721366815107118, 30.882714748654728], [78.738894484374001, 31.515906073527045], [78.458446486326025, 32.61816437431272], [79.176128777995544, 32.483779812137747], [79.208891636068543, 32.994394639613738], [78.811086460285722, 33.506198025032397], [78.912268914713209, 34.321936346975768], [77.83745079947461, 35.494009507787794], [76.192848341785705, 35.89840342868785], [75.896897414050173, 36.666806138651872], [75.158027785140987, 37.133030910789152], [74.980002475895404, 37.419990139305888], [74.829985792952144, 37.990007025701445], [74.864815708316783, 38.378846340481587], [74.25751427602269, 38.606506862943476], [73.928852166646394, 38.505815334622717], [73.675379266254836, 39.431236884105566], [73.960013055318427, 39.660008449861714], [73.822243686828315, 39.893973497063136], [74.776862420556043, 40.366425279291619], [75.467827996730719, 40.56207225194867], [76.526368035797432, 40.427946071935132], [76.90448449087711, 41.066485907549648], [78.187196893226044, 41.185315863604799], [78.543660923175253, 41.582242540038713], [80.119430373051401, 42.12394074153822], [80.259990268885318, 42.34999929459908], [80.180150180994374, 42.920067857426844], [80.866206496101213, 43.180362046881008], [79.966106398441426, 44.917516994804622], [81.947070753918084, 45.317027492853143], [82.458925815769035, 45.539649563166499], [83.180483839860543, 47.330031236350735], [85.164290399113213, 47.000955715516099], [85.720483839870667, 47.452969468773077], [85.76823286330837, 48.455750637396896], [86.59877648310335, 48.549181626980605], [87.359970330762692, 49.214980780629148], [87.751264276076668, 49.297197984405464], [88.013832228551678, 48.599462795600594], [88.854297723346747, 48.069081732773007], [90.280825636763893, 47.693549099307901], [90.970809360724957, 46.88814606382293], [90.585768263718307, 45.719716091487491], [90.945539585334316, 45.286073309910243], [92.133890822318222, 45.115075995456429], [93.480733677141316, 44.97547211362], [94.688928664125356, 44.352331854828456], [95.306875441471504, 44.241330878265458], [95.762454868556688, 43.319449164394619], [96.349395786527808, 42.725635280928643], [97.451757440177971, 42.74888967546007], [99.515817498779995, 42.524691473961688], [100.845865513108279, 42.663804429691417], [101.833040399179936, 42.51487295182627], [103.312278273534787, 41.907468166667613], [104.522281935649005, 41.90834666601662], [104.964993931093431, 41.597409572916334], [106.129315627061658, 42.134327704428891], [107.744772576937976, 42.481515814781908], [109.243595819131428, 42.519446316084149], [110.412103306115299, 42.871233628911014], [111.129682244920218, 43.406834011400171], [111.82958784388137, 43.743118394539486], [111.667737257943202, 44.073175767587706], [111.348376906379428, 44.457441718110047], [111.87330610560025, 45.102079372735112], [112.436062453258842, 45.01164561622425], [113.463906691544196, 44.808893134127111], [114.46033165899604, 45.339816799493875], [115.985096470200133, 45.727235012386004], [116.717868280098855, 46.38820241961524], [117.421701287914246, 46.67273285581421], [118.874325799638711, 46.805412095723646], [119.663269891438745, 46.692679958678944], [119.772823927897562, 47.048058783550132], [118.866574334794947, 47.747060044946195], [118.064142694166719, 48.06673045510373], [117.295507440257438, 47.697709052107385], [116.308952671373234, 47.853410142602812], [115.742837355615734, 47.726544501326273], [115.485282017073018, 48.135382595403442], [116.191802199367601, 49.134598090199056], [116.67880089728618, 49.888531399121398], [117.879244419426371, 49.510983384796944], [119.288460728025839, 50.142882798862033], [119.279365675942358, 50.582907619827282], [120.182049595216924, 51.64356639261802], [120.738191359541972, 51.964115302124547], [120.725789015791975, 52.516226304730814], [120.177088657716865, 52.753886216841195], [121.003084751470226, 53.251401068731226], [122.245747918792858, 53.431725979213681], [123.571506789240843, 53.458804429734627], [125.068211297710434, 53.161044826868832], [125.946348911646169, 52.792798570356936], [126.564399041856959, 51.784255479532689], [126.939156528837657, 51.353894151405896], [127.287455682484904, 50.739797268265434], [127.657407261262378, 49.760270494172929]]]] } }, - { "type": "Feature", "properties": { "admin": "Ivory Coast", "name": "C�te d'Ivoire", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.856125047202397, 4.994475816259508], [-3.311084357100071, 4.984295559098014], [-4.008819545904941, 5.179813340674314], [-4.64991736491791, 5.168263658057084], [-5.834496222344525, 4.993700669775135], [-6.528769090185845, 4.705087795425015], [-7.518941209330434, 4.338288479017307], [-7.712159389669749, 4.364565944837721], [-7.63536821128403, 5.188159084489455], [-7.53971513511176, 5.313345241716517], [-7.570152553731686, 5.707352199725903], [-7.993692592795879, 6.126189683451541], [-8.311347622094017, 6.193033148621081], [-8.602880214868618, 6.467564195171659], [-8.385451626000572, 6.911800645368742], [-8.485445522485348, 7.395207831243068], [-8.439298468448696, 7.686042792181736], [-8.280703497744936, 7.687179673692156], [-8.221792364932197, 8.123328762235571], [-8.299048631208562, 8.316443589710302], [-8.203498907900878, 8.455453192575446], [-7.832100389019186, 8.575704250518625], [-8.079113735374348, 9.376223863152033], [-8.309616461612249, 9.789531968622439], [-8.22933712404682, 10.129020290563897], [-8.029943610048617, 10.206534939001711], [-7.89958980959237, 10.297382106970824], [-7.622759161804808, 10.147236232946792], [-6.850506557635057, 10.138993841996237], [-6.666460944027547, 10.430810655148447], [-6.493965013037267, 10.411302801958268], [-6.205222947606429, 10.524060777219132], [-6.050452032892266, 10.096360785355442], [-5.816926235365286, 10.222554633012191], [-5.404341599946973, 10.370736802609144], [-4.954653286143098, 10.152713934769732], [-4.779883592131966, 9.821984768101741], [-4.330246954760383, 9.610834865757139], [-3.980449184576684, 9.862344061721698], [-3.511898972986272, 9.900326239456216], [-2.827496303712706, 9.642460842319775], [-2.56218950032624, 8.219627793811481], [-2.983584967450326, 7.379704901555511], [-3.244370083011261, 6.2504715031135], [-2.810701463217839, 5.389051215024109], [-2.856125047202397, 4.994475816259508]]] } }, + { "type": "Feature", "properties": { "admin": "Ivory Coast", "name": "Cte d'Ivoire", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.856125047202397, 4.994475816259508], [-3.311084357100071, 4.984295559098014], [-4.008819545904941, 5.179813340674314], [-4.64991736491791, 5.168263658057084], [-5.834496222344525, 4.993700669775135], [-6.528769090185845, 4.705087795425015], [-7.518941209330434, 4.338288479017307], [-7.712159389669749, 4.364565944837721], [-7.63536821128403, 5.188159084489455], [-7.53971513511176, 5.313345241716517], [-7.570152553731686, 5.707352199725903], [-7.993692592795879, 6.126189683451541], [-8.311347622094017, 6.193033148621081], [-8.602880214868618, 6.467564195171659], [-8.385451626000572, 6.911800645368742], [-8.485445522485348, 7.395207831243068], [-8.439298468448696, 7.686042792181736], [-8.280703497744936, 7.687179673692156], [-8.221792364932197, 8.123328762235571], [-8.299048631208562, 8.316443589710302], [-8.203498907900878, 8.455453192575446], [-7.832100389019186, 8.575704250518625], [-8.079113735374348, 9.376223863152033], [-8.309616461612249, 9.789531968622439], [-8.22933712404682, 10.129020290563897], [-8.029943610048617, 10.206534939001711], [-7.89958980959237, 10.297382106970824], [-7.622759161804808, 10.147236232946792], [-6.850506557635057, 10.138993841996237], [-6.666460944027547, 10.430810655148447], [-6.493965013037267, 10.411302801958268], [-6.205222947606429, 10.524060777219132], [-6.050452032892266, 10.096360785355442], [-5.816926235365286, 10.222554633012191], [-5.404341599946973, 10.370736802609144], [-4.954653286143098, 10.152713934769732], [-4.779883592131966, 9.821984768101741], [-4.330246954760383, 9.610834865757139], [-3.980449184576684, 9.862344061721698], [-3.511898972986272, 9.900326239456216], [-2.827496303712706, 9.642460842319775], [-2.56218950032624, 8.219627793811481], [-2.983584967450326, 7.379704901555511], [-3.244370083011261, 6.2504715031135], [-2.810701463217839, 5.389051215024109], [-2.856125047202397, 4.994475816259508]]] } }, { "type": "Feature", "properties": { "admin": "Cameroon", "name": "Cameroon", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[13.07582238124675, 2.267097072759014], [12.951333855855605, 2.321615708826939], [12.359380323952218, 2.19281220133945], [11.751665480199787, 2.326757513839993], [11.276449008843711, 2.261050930180871], [9.649158155972627, 2.283866075037735], [9.795195753629455, 3.073404445809117], [9.404366896205998, 3.734526882335202], [8.948115675501068, 3.904128933117135], [8.744923943729416, 4.352215277519959], [8.488815545290889, 4.495617377129917], [8.500287713259693, 4.771982937026847], [8.757532993208626, 5.47966583904791], [9.233162876023043, 6.444490668153334], [9.522705926154398, 6.453482367372116], [10.118276808318255, 7.038769639509879], [10.497375115611417, 7.055357774275562], [11.058787876030349, 6.644426784690593], [11.745774366918509, 6.981382961449753], [11.839308709366801, 7.397042344589434], [12.063946160539556, 7.799808457872301], [12.218872104550597, 8.305824082874322], [12.753671502339214, 8.717762762888993], [12.955467970438971, 9.417771714714702], [13.1675997249971, 9.64062632897341], [13.308676385153914, 10.160362046748926], [13.572949659894558, 10.798565985553564], [14.415378859116682, 11.572368882692071], [14.468192172918974, 11.90475169519341], [14.57717776862253, 12.085360826053501], [14.181336297266792, 12.483656927943112], [14.213530714584634, 12.802035427293344], [14.495787387762842, 12.859396267137326], [14.893385857816522, 12.219047756392582], [14.960151808337598, 11.555574042197222], [14.923564894274955, 10.891325181517471], [15.467872755605269, 9.982336737503429], [14.909353875394713, 9.99212942142273], [14.627200555081057, 9.920919297724536], [14.171466098699025, 10.021378282099928], [13.954218377344002, 9.549494940626685], [14.544466586981766, 8.965861314322266], [14.979995558337688, 8.796104234243471], [15.120865512765331, 8.382150173369423], [15.436091749745765, 7.692812404811971], [15.279460483469107, 7.421924546737968], [14.776545444404572, 6.408498033062044], [14.536560092841111, 6.22695872642069], [14.459407179429345, 5.451760565610299], [14.558935988023501, 5.03059764243153], [14.478372430080466, 4.732605495620446], [14.950953403389658, 4.21038930909492], [15.036219516671249, 3.851367295747123], [15.405395948964379, 3.335300604664339], [15.862732374747479, 3.013537298998982], [15.907380812247649, 2.557389431158612], [16.01285241055535, 2.267639675298084], [15.940918816805061, 1.727672634280295], [15.14634199388524, 1.964014797367184], [14.337812534246577, 2.22787466064949], [13.07582238124675, 2.267097072759014]]] } }, { "type": "Feature", "properties": { "admin": "Democratic Republic of the Congo", "name": "Dem. Rep. Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[30.833859897593801, 3.50916596111034], [30.773346795380036, 2.339883327642127], [31.174149204235807, 2.204465236821263], [30.852670118948048, 1.849396470543809], [30.468507521290292, 1.58380544677972], [30.086153598762703, 1.062312730306288], [29.875778842902488, 0.597379868976304], [29.819503208136634, -0.205310153813372], [29.587837762172164, -0.58740569417948], [29.579466180140876, -1.341313164885626], [29.29188683443661, -1.620055840667987], [29.254834832483336, -2.215109958508911], [29.117478875451546, -2.292211195488384], [29.02492638521678, -2.839257907730157], [29.276383904749046, -3.293907159034063], [29.339997592900342, -4.499983412294092], [29.519986606572925, -5.419978936386313], [29.41999271008816, -5.939998874539432], [29.620032179490003, -6.520015150583424], [30.199996779101692, -7.079980970898161], [30.740015496551781, -8.340007419470913], [30.34608605319081, -8.238256524288216], [29.002912225060467, -8.40703175215347], [28.734866570762495, -8.526559340044576], [28.449871046672818, -9.164918308146083], [28.673681674928922, -9.605924981324931], [28.496069777141763, -10.789883721564044], [28.372253045370421, -11.793646742401389], [28.642417433392346, -11.971568698782312], [29.341547885869087, -12.36074391037241], [29.616001417771223, -12.178894545137307], [29.699613885219485, -13.257226657771827], [28.934285922976834, -13.248958428605132], [28.52356163912102, -12.698604424696679], [28.15510867687998, -12.272480564017894], [27.38879886242378, -12.132747491100663], [27.164419793412456, -11.608748467661071], [26.55308759939961, -11.924439792532125], [25.752309604604726, -11.784965101776356], [25.418118116973197, -11.330935967659958], [24.783169793402948, -11.238693536018962], [24.314516228947948, -11.262826429899269], [24.257155389103982, -10.951992689663655], [23.912215203555714, -10.926826267137512], [23.456790805767433, -10.867863457892481], [22.837345411884733, -11.017621758674329], [22.402798292742371, -10.99307545333569], [22.155268182064304, -11.084801120653768], [22.208753289486388, -9.894796237836507], [21.87518191904234, -9.523707777548564], [21.801801385187897, -8.908706556842978], [21.949130893652036, -8.305900974158275], [21.746455926203303, -7.920084730667147], [21.728110792739695, -7.2908724910813], [20.514748162526498, -7.299605808138629], [20.601822950938292, -6.93931772219968], [20.091621534920645, -6.943090101756993], [20.037723016040214, -7.116361179231644], [19.417502475673157, -7.155428562044297], [19.166613396896107, -7.738183688999753], [19.016751743249664, -7.988245944860132], [18.464175652752683, -7.847014255406442], [18.134221632569048, -7.98767750410492], [17.472970004962232, -8.068551120641699], [17.089995965247166, -7.545688978712525], [16.860190870845198, -7.222297865429984], [16.573179965896141, -6.622644545115087], [16.326528354567042, -5.877470391466267], [13.375597364971892, -5.864241224799548], [13.02486941900696, -5.984388929878157], [12.735171339578695, -5.965682061388497], [12.322431674863507, -6.100092461779658], [12.182336866920249, -5.789930515163837], [12.436688266660866, -5.684303887559245], [12.468004184629734, -5.248361504745003], [12.631611769265788, -4.991271254092935], [12.995517205465173, -4.781103203961883], [13.258240187237044, -4.882957452009165], [13.600234816144676, -4.500138441590969], [14.144956088933295, -4.510008640158715], [14.209034864975219, -4.793092136253597], [14.582603794013179, -4.970238946150139], [15.170991652088441, -4.3435071753143], [15.753540073314749, -3.855164890156096], [16.006289503654298, -3.535132744972528], [15.972803175529149, -2.712392266453612], [16.407091912510051, -1.740927015798682], [16.86530683764212, -1.225816338713287], [17.523716261472853, -0.743830254726987], [17.638644646889983, -0.424831638189246], [17.663552687254676, -0.058083998213817], [17.826540154703245, 0.288923244626105], [17.774191928791563, 0.855658677571085], [17.89883548347958, 1.741831976728278], [18.09427575040743, 2.365721543788055], [18.39379235197114, 2.90044342692822], [18.453065219809925, 3.504385891123348], [18.542982211997778, 4.201785183118317], [18.932312452884755, 4.709506130385973], [19.467783644293146, 5.031527818212779], [20.290679152108932, 4.691677761245287], [20.927591180106273, 4.322785549329736], [21.659122755630019, 4.224341945813719], [22.405123732195531, 4.02916006104732], [22.704123569436284, 4.633050848810156], [22.841479526468103, 4.710126247573483], [23.297213982850135, 4.609693101414221], [24.41053104014625, 5.108784084489129], [24.805028924262409, 4.897246608902349], [25.128833449003274, 4.927244777847789], [25.278798455514302, 5.170408229997191], [25.650455356557465, 5.256087754737123], [26.402760857862535, 5.150874538590869], [27.044065382604703, 5.127852688004835], [27.374226108517483, 5.233944403500059], [27.979977247842807, 4.408413397637373], [28.428993768026906, 4.287154649264493], [28.696677687298795, 4.455077215996936], [29.159078403446497, 4.38926727947323], [29.715995314256013, 4.600804755060024], [29.953500197069467, 4.173699042167683], [30.833859897593801, 3.50916596111034]]] } }, { "type": "Feature", "properties": { "admin": "Republic of Congo", "name": "Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[12.995517205465173, -4.781103203961883], [12.620759718484491, -4.438023369976135], [12.318607618873923, -4.606230157086187], [11.914963006242086, -5.037986748884789], [11.093772820691923, -3.978826592630546], [11.855121697648114, -3.42687061932105], [11.478038771214299, -2.765618991714241], [11.820963575903189, -2.514161472181982], [12.495702752338159, -2.391688327650242], [12.575284458067639, -1.948511244315134], [13.109618767965626, -2.428740329603513], [13.992407260807706, -2.470804945489099], [14.299210239324564, -1.998275648612213], [14.425455763413593, -1.333406670744971], [14.316418491277741, -0.552627455247048], [13.843320753645653, 0.038757635901149], [14.276265903386953, 1.196929836426619], [14.026668735417214, 1.395677395021153], [13.282631463278816, 1.31418366129688], [13.003113641012074, 1.830896307783319], [13.07582238124675, 2.267097072759014], [14.337812534246577, 2.22787466064949], [15.14634199388524, 1.964014797367184], [15.940918816805061, 1.727672634280295], [16.01285241055535, 2.267639675298084], [16.537058139724135, 3.198254706226278], [17.133042433346297, 3.728196519379451], [17.809900343505259, 3.560196437998569], [18.453065219809925, 3.504385891123348], [18.39379235197114, 2.90044342692822], [18.09427575040743, 2.365721543788055], [17.89883548347958, 1.741831976728278], [17.774191928791563, 0.855658677571085], [17.826540154703245, 0.288923244626105], [17.663552687254676, -0.058083998213817], [17.638644646889983, -0.424831638189246], [17.523716261472853, -0.743830254726987], [16.86530683764212, -1.225816338713287], [16.407091912510051, -1.740927015798682], [15.972803175529149, -2.712392266453612], [16.006289503654298, -3.535132744972528], [15.753540073314749, -3.855164890156096], [15.170991652088441, -4.3435071753143], [14.582603794013179, -4.970238946150139], [14.209034864975219, -4.793092136253597], [14.144956088933295, -4.510008640158715], [13.600234816144676, -4.500138441590969], [13.258240187237044, -4.882957452009165], [12.995517205465173, -4.781103203961883]]] } }, @@ -964,6 +989,7 @@ module mapcomponenet { } + module MenuComponent { $(function () { var sample = new ej.Menu($("#syncfusionProducts"),{ @@ -987,6 +1013,10 @@ module MenuComponent { } + + + + module NavigationDrawerComponent { $(function () { var navigationdrawerInstance = new ej.NavigationDrawer($("#navpane"), { @@ -1021,7 +1051,7 @@ module PivotChartOlap { $(function () { var sample = new ej.PivotChart($("#PivotChart"),{ dataSource: { - data: "http://bi.syncfusion.com/olap/msmdpump.dll", + data: "http://bi.syncfusion.com/olap/msmdpump.dll", catalog: "Adventure Works DW 2008 SE", cube: "Adventure Works", rows: [ @@ -1053,11 +1083,13 @@ module PivotChartOlap { size: { height: "460px", width: "100%" }, primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, primaryYAxis: { title: { text: "Internet Sales Amount" } }, - legend: { visible: true, rowCount: 2 } + legend: { visible: true, rowCount: 2 }, + load:"loadTheme" }); }); } + var pivot_dataset = [ { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, @@ -1125,7 +1157,8 @@ module PivotChartRelational { }, size: { height: "460px", width: "100%" }, primaryYAxis: { title: { text: "Amount" } }, - legend: { visible: true } + legend: { visible: true }, + load:"loadTheme" }); }); } @@ -1185,7 +1218,7 @@ module PivotGaugeOlap { length: 120, width: 7 }, - { + { type: "marker", markerType: "diamond", distanceFromScale: 5, @@ -1214,7 +1247,7 @@ module PivotGaugeOlap { distanceFromScale: -5, backgroundColor: "#fc0606", border: { color: "#fc0606" } - }, + }, { distanceFromScale: -5 }], @@ -1232,9 +1265,10 @@ module PivotGaugeOlap { }] }] }); - }); + }); } + var pivot_dataset = [ { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, @@ -1304,7 +1338,7 @@ module PivotGaugeRelational { length: 120, width: 7 }, - { + { type: "marker", markerType: "diamond", distanceFromScale: 5, @@ -1333,7 +1367,7 @@ module PivotGaugeRelational { distanceFromScale: -5, backgroundColor: "#fc0606", border: { color: "#fc0606" } - }, + }, { distanceFromScale: -5 }], @@ -1351,7 +1385,7 @@ module PivotGaugeRelational { }] }] }); - }); + }); } module PivotGridOlap { @@ -1384,7 +1418,7 @@ module PivotGridOlap { ], filters:[] }, - enableGroupingBar: true, + enableGroupingBar: true, pivotTableFieldListID:"PivotSchemaDesigner" }); $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); @@ -1433,7 +1467,7 @@ module PivotGridRelational { fieldCaption: "State" } ], - columns: + columns: [{ fieldName: "Product", fieldCaption: "Product" @@ -1451,10 +1485,10 @@ module PivotGridRelational { ], filters:[] }, - enableGroupingBar: true, + enableGroupingBar: true, pivotTableFieldListID:"PivotSchemaDesigner" }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); } @@ -1508,6 +1542,7 @@ module ProgressBarComponent { } + declare var rteObj: any; declare var data: any; var radialEle = $('#defaultradialmenu'), action = 0, forRedo = 0; @@ -1551,6 +1586,7 @@ module RadialMenuComponent { }); } + function bold(e: any) { rteObj = rteEle.data("ejRTE"); @@ -1726,7 +1762,7 @@ module RatingComponent { shapeWidth: 25, showTooltip: true }); - + var sample2 = new ej.Rating($("#halfRating"),{ precision: ej.Rating.Precision.Half, value: 3.5, @@ -1757,7 +1793,7 @@ module RatingComponent { shapeHeight: 25, shapeWidth: 25, showTooltip: true - }); + }); }); } @@ -1786,7 +1822,7 @@ module RibbonComponent { toolTip: "Pin the Ribbon" }, applicationTab: { - type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } + type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } }, tabs: [{ id: "home", text: "HOME", groups: [{ @@ -1868,7 +1904,7 @@ module RibbonComponent { width: 60, isBig: false } - }] + }] }, { text: "Font", alignType: "rows", content: [{ @@ -2169,7 +2205,7 @@ module RibbonComponent { groups: [{ id: "zoomin", text: "Zoom In", - toolTip: "Zoom In", + toolTip: "Zoom In", buttonSettings: { width: 58, click: "onClick", @@ -2181,7 +2217,7 @@ module RibbonComponent { { id: "zoomout", text: "Zoom Out", - toolTip: "Zoom Out", + toolTip: "Zoom Out", buttonSettings: { width: 70, click: "onClick", @@ -2193,7 +2229,7 @@ module RibbonComponent { { id: "fullscreen", text: "Full Screen", - toolTip: "Full Screen", + toolTip: "Full Screen", buttonSettings: { width: 73, click: "onClick", @@ -2436,7 +2472,7 @@ module RibbonComponent { } ] } - ], + ], create: function createControl(args) { var ribbon = $("#defaultRibbon").data("ejRibbon"); $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); @@ -2448,7 +2484,7 @@ module RibbonComponent { function colorHandler(args:any) { (this._id.indexOf("fillcolor") != -1) ? $("#contenteditor").css('background-color', args.value) : document.execCommand('forecolor', false, args.value); } -function onClick(args: any) { +function onClick(args) { var val, prop = args.text; val = (ej.isNullOrUndefined(args.model.text)) ? args.model.activeText : args.model.text; if (action1.indexOf(val) != -1) @@ -2464,6 +2500,7 @@ function onClick(args: any) { } + module RotatorComponent { $(function () { var rotatorInstance = new ej.Rotator($("#sliderContent"), { @@ -2621,7 +2658,7 @@ module ScheduleComponent { } }); }); -} +} module ScrollerComponent { $(function () { @@ -2631,9 +2668,7 @@ module ScrollerComponent { }); $(window).bind('resize', function () { scrollerSample.refresh(); - }); - - }); + }); }); } module SignatureComponent { @@ -2664,6 +2699,8 @@ module SliderComponent { } + + module linesparkline { $(function () { @@ -2791,6 +2828,8 @@ module piesparkline4 { }); } + + module SplitterComponent { $(function () { @@ -2822,7 +2861,7 @@ $(function () { pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" }, sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete: () => { + loadComplete: () => { var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; if (!(spreadsheet).isImport) { spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); @@ -2843,13 +2882,13 @@ var default_data: Array = [ { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 70 }, { Category : "Employees", Country : "USA", JobDescription : "Management", EmployeesCount : 40 }, { Category : "Employees", Country : "USA", JobDescription : "Accounts", EmployeesCount : 60 }, - + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 43 }, { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 125}, { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 60 }, { Category : "Employees", Country : "India", JobDescription : "HR Executives", EmployeesCount : 70 }, { Category : "Employees", Country : "India", JobDescription : "Accounts", EmployeesCount : 45 }, - + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Executive", EmployeesCount : 30 }, { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, { Category : "Employees", Country : "Germany", JobDescription : "Marketing", EmployeesCount : 50 }, @@ -2858,13 +2897,13 @@ var default_data: Array = [ { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, { Category : "Employees", Country : "Germany", JobDescription : "Management", EmployeesCount : 33 }, { Category : "Employees", Country : "Germany", JobDescription : "Accounts", EmployeesCount : 55 }, - + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 45 }, { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 96 }, { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, { Category : "Employees", Country : "UK", JobDescription : "HR Executives", EmployeesCount : 60 }, { Category : "Employees", Country : "UK", JobDescription: "Accounts", EmployeesCount: 30 }, - + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, @@ -2874,7 +2913,7 @@ var default_data: Array = [ module sunburstcomponent { $(function () { var sunburstsample = new ej.SunburstChart($("#Sunburst"), { - valueMemberPath: "EmployeesCount", + valueMemberPath: "EmployeesCount", levels: [ {groupMemberPath: "Country"}, {groupMemberPath: "JobDescription"}, @@ -2899,7 +2938,8 @@ module sunburstcomponent { }, title:{text:"Employees Count"}, zoomSettings:{enable:false}, - legend:{visible:true,position:'top'} + legend:{visible:true,position:'top'}, + load:"loadTheme" }); }); } @@ -2918,7 +2958,8 @@ module TabComponent { } module TagCloudComponent { - + + var websiteCollection = [ { text: "Google", url: "http://www.google.com", frequency: 12 }, { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, @@ -2949,7 +2990,7 @@ module TagCloudComponent { text: "text", url: "url", frequency: "frequency" } }); - + }); } @@ -2985,6 +3026,8 @@ module EditorComponent { }); } + + module TileViewComponent { $(function () { var tile1 = new ej.Tile($("#tile1"), { @@ -2994,38 +3037,38 @@ module TileViewComponent { imageUrl:'content/images/tile/windows/people_1.png' }); var tile2 = new ej.Tile($("#tile2"), { - imagePosition:"center", + imagePosition:"center", tileSize:"small", - imageUrl:'content/images/tile/windows/alerts.png', - + imageUrl:'content/images/tile/windows/alerts.png', + }); var tile3 = new ej.Tile($("#tile3"), { - imagePosition:"center", + imagePosition:"center", tileSize:"small", - imageUrl:'content/images/tile/windows/bing.png', + imageUrl:'content/images/tile/windows/bing.png', }); var tile4 = new ej.Tile($("#tile4"), { tileSize:"small", - imageUrl:'content/images/tile/windows/camera.png', + imageUrl:'content/images/tile/windows/camera.png', }); var tile5 = new ej.Tile($("#tile5"), { - imagePosition:"center", + imagePosition:"center", tileSize:"small", - imageUrl:'content/images/tile/windows/messages.png', + imageUrl:'content/images/tile/windows/messages.png', }); var tile6 = new ej.Tile($("#tile6"), { - imagePosition:"center", + imagePosition:"center", tileSize:"medium", - imageUrl:'content/images/tile/windows/games.png', + imageUrl:'content/images/tile/windows/games.png', caption:{text:"Play"} }); - var tile7 = new ej.Tile($("#tile7"), { + var tile7 = new ej.Tile($("#tile7"), { tileSize:"medium", imageUrl:'content/images/tile/windows/map.png', caption:{text:"Maps"} }); var tile8 = new ej.Tile($("#tile8"), { - imagePosition:"fill", + imagePosition:"fill", tileSize:"wide", imageUrl:'content/images/tile/windows/sports.png', caption:{text:"Sports"} @@ -3062,7 +3105,6 @@ module TileViewComponent { }); }); } - module TimePickerComponent { $(function () { var timeSample = new ej.TimePicker($("#timepick"), { @@ -3072,13 +3114,13 @@ module TimePickerComponent { } module ToolbarComponent { - + $(function () { var sample = new ej.Toolbar($("#editingToolbar"),{ width: "100%", cssClass: "gradient-lime", enableSeparator: true, - + isResponsive: true, orientation: ej.Orientation.Horizontal, showRoundedCorner: true @@ -3088,7 +3130,7 @@ module ToolbarComponent { } module TooltipComponent { - + $(function () { var sample1 = new ej.Tooltip($("#link1"),{ @@ -3181,7 +3223,8 @@ module TreeGridComponent { isResponsive: true, }); }); -} +} + var population_data: Array = [ { Continent: "Asia", Country: "Indonesia", Growth: 3, Population: 237641326 }, @@ -3221,6 +3264,8 @@ module treemapcomponent { }); } + + module TreeViewComponent { $(function () { var tree = new ej.TreeView($("#treeView"), { @@ -3233,7 +3278,7 @@ module TreeViewComponent { } module UploadboxComponent { - + $(function () { var sample = new ej.Uploadbox($("#UploadDefault"),{ saveUrl: (window).baseurl + "api/uploadbox/Save", diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index f1aec6bc64..bf6d488f6f 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ej.web.all 15.4 +// Type definitions for ej.web.all 15.4 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,10 +6,9 @@ /// - /*! * filename: ej.web.all.d.ts -* version : 15.4.0.17 +* version : 15.4.0.20 * 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 @@ -94,12 +93,12 @@ declare namespace ej { function avg(json: any, filedName: string): any; function getGuid(prefix: string): number; function group(jsonArray: any, field: string, agg: string, level: number, groupDs: string): any; - function isJson(jsonData: string): string; + function isJSON(jsonData: string): string; function max(jsonArray: any, fieldName?: string, comparer?: string): any; function min(jsonArray: any, fieldName: string, comparer: string): any; function merge(first: string, second: string): any; function mergeshort(jsonArray: any, fieldName: string, comparer: string): any; - function parseJson(jsonText: string): string; + function parseJSON(jsonText: string): string; function parseTable(table: number, headerOption: string, headerRowIndex: string): any; function select(jsonArray: any, fields: string): any; function setTransition(): boolean; @@ -2477,6 +2476,10 @@ declare namespace ej { */ stringFormat?: string; + /** This property allows user to search text for any number of fields in the suggestion list without modifying the selected text format. + */ + searchColumnIndices?: any[]; + /** Field and Header Text collections can be defined and customized through columns field. */ columns?: MultiColumnSettingsColumn[]; @@ -4592,8 +4595,8 @@ declare namespace ej { toolIcon?: string; /** This property allows to define the customized text or content to displayed when mouse over the following elements. This property also allows to use the culture values. - * @Default {{ switcher: Switcher, addbutton: Add Color, basic: Basic, monochrome: Mono Chrome, flatcolors: Flat Color, seawolf: Sea Wolf, webcolors: Web Colors, sandy: Sandy, - * pinkshades: Pink Shades, misty: Misty, citrus: Citrus, vintage: Vintage, moonlight: Moon Light, candycrush: Candy Crush, currentcolor: Current Color, selectedcolor: Selected + * @Default {{ switcher: Switcher, addButton: Add Color, basic: Basic, monoChrome: Mono Chrome, flatColors: Flat Color, seaWolf: Sea Wolf, webColors: Web Colors, sandy: Sandy, + * pinkShades: Pink Shades, misty: Misty, citrus: Citrus, vintage: Vintage, moonLight: Moon Light, candyCrush: Candy Crush, currentColor: Current Color, selectedColor: Selected * Color }} */ tooltipText?: TooltipText; @@ -4749,7 +4752,7 @@ declare namespace ej { /** Sets the tooltip text for the add button. */ - addbutton?: string; + addButton?: string; /** Sets the tooltip text for the basic preset. */ @@ -4757,19 +4760,19 @@ declare namespace ej { /** Sets the tooltip text for the mono chrome preset. */ - monochrome?: string; + monoChrome?: string; /** Sets the tooltip text for the flat colors preset. */ - flatcolors?: string; + flatColors?: string; /** Sets the tooltip text for the sea wolf preset. */ - seawolf?: string; + seaWolf?: string; /** Sets the tooltip text for the web colors preset. */ - webcolors?: string; + webColors?: string; /** Sets the tooltip text for the sandy preset. */ @@ -4777,7 +4780,7 @@ declare namespace ej { /** Sets the tooltip text for the pink shades preset. */ - pinkshades?: string; + pinkShades?: string; /** Sets the tooltip text for the misty preset. */ @@ -4793,19 +4796,19 @@ declare namespace ej { /** Sets the tooltip text for the moon light preset. */ - moonlight?: string; + moonLight?: string; /** Sets the tooltip text for the candy crush preset. */ - candycrush?: string; + candyCrush?: string; /** Sets the tooltip text for the current color area. */ - currentcolor?: string; + currentColor?: string; /** Sets the tooltip text for the selected color area. */ - selectedcolor?: string; + selectedColor?: string; } enum ModelType { @@ -7751,7 +7754,7 @@ declare namespace ej { */ enableRTL?: boolean; - /** The CSS class name to display the favicon in the dialog header. In order to display favicon, you need to set 'showHeader' as true since the favicon will be displayed in the dialog + /** The CSS class name to display the favicon in the dialog header. In order to display favicon, you need to set showHeader as true since the favicon will be displayed in the dialog * header. */ faviconCSS?: string; @@ -8489,6 +8492,11 @@ declare namespace ej { */ enableSorting?: boolean; + /** The property is used to determine whether the popup list is generated dynamically. + * @Default {false} + */ + loadOnDemand?: boolean; + /** Specifies the mapping fields for the data items of the DropDownList. * @Default {null} */ @@ -10888,7 +10896,7 @@ declare namespace ej { /** Fires when keydown in mask edit textbox control. */ - keydown?(e: KeydownEventArgs): void; + onKeyDown?(e: OnKeyDownEventArgs): void; /** Fires when key press in mask edit textbox control. */ @@ -10896,7 +10904,7 @@ declare namespace ej { /** Fires when keyup in mask edit textbox control. */ - keyup?(e: KeyupEventArgs): void; + keyUp?(e: KeyUpEventArgs): void; /** Fires when mouse out in mask edit textbox control. */ @@ -11006,7 +11014,7 @@ declare namespace ej { unmaskedValue?: string; } - export interface KeydownEventArgs { + export interface OnKeyDownEventArgs { /** if the event should be canceled; otherwise, false. */ @@ -11052,7 +11060,7 @@ declare namespace ej { unmaskedValue?: string; } - export interface KeyupEventArgs { + export interface KeyUpEventArgs { /** if the event should be canceled; otherwise, false. */ @@ -11185,9 +11193,10 @@ declare namespace ej { hide(): void; /** Hides the specific items in Menu control. + * @param {string|any[]} ItemID of the Menu item to be hidden * @returns {void} */ - hideItems(): void; + hideItems(itemID: string|any[]): void; /** Insert the menu item as child of target node. * @param {any} Information about Menu item. @@ -11226,9 +11235,10 @@ declare namespace ej { show(locationX: number, locationY: number, targetElement: any, event: any): void; /** Show the specific items in Menu control. + * @param {string|any[]} ItemID of the Menu item to be shown * @returns {void} */ - showItems(): void; + showItems(itemID: string|any[]): void; } export namespace Menu { @@ -11692,6 +11702,26 @@ declare namespace ej { */ gotoPage(pageIndex: number): void; + /** goToFirstPage() helps to navigate to the first page of the pager. + * @returns {void} + */ + goToFirstPage(): void; + + /** goToNextPage() helps to navigate to the next page to the current page of the pager. + * @returns {void} + */ + goToNextPage(): void; + + /** goToLastPage() helps to navigate to the Last page of the pager. + * @returns {void} + */ + goToLastPage(): void; + + /** goToPrevPage() helps to navigate to the previous page to the current page of the pager. + * @returns {void} + */ + goToPrevPage(): void; + /** refreshPager() helps to refresh the model value of pager control. * @returns {void} */ @@ -11710,6 +11740,15 @@ declare namespace ej { */ currentPage?: number; + /** Sets the root CSS class, which can be used for customization of pager control. + */ + cssClass?: string; + + /** Enable or disable the Pager control. + * @Default {true} + */ + enabled?: boolean; + /** Gets or sets a value that indicates whether to display the external Message in Pager. * @Default {false} */ @@ -11729,6 +11768,11 @@ declare namespace ej { */ externalMessage?: string; + /** Enables or disables responsive support for the Pager control items on window resize. + * @Default {false} + */ + isResponsive?: boolean; + /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to * a particular country or region. * @Default {en-US} @@ -11751,6 +11795,15 @@ declare namespace ej { */ pageSizeList?: any[]; + /** Indicates the pageSizeMessage to be displayed in Pager when pageSizeList API is defined. + */ + pageSizeMessage?: String; + + /** Template option allows to customize UI appearance of the ejPager by defining their own page layout. + * @Default {null} + */ + template?: string; + /** Get or sets a value of total number of pages in the pager. The totalPages value is calculated based on page size and total records. * @Default {null} */ @@ -11769,6 +11822,22 @@ declare namespace ej { /** Triggered when pager numeric item is clicked in pager control. */ click?(e: ClickEventArgs): void; + + /** Triggers when the current page value of the Pager control is changed. + */ + change?(e: ChangeEventArgs): void; + + /** Triggered when Pager control is successfully created. + */ + create?(e: CreateEventArgs): void; + + /** Triggered when Pager control is successfully destroyed. + */ + destroy?(e: DestroyEventArgs): void; + + /** Triggered when a value is selected in the pageSizeList dropdown. + */ + pageSizeSelected?(e: PageSizeSelectedEventArgs): void; } export interface ClickEventArgs { @@ -11793,6 +11862,70 @@ declare namespace ej { */ event?: any; } + + export interface ChangeEventArgs { + + /** Returns the current page index. + */ + currentPage?: number; + + /** Returns the pager model. + */ + model?: any; + + /** Returns the name of event + */ + type?: string; + + /** Returns current action event type and its target. + */ + event?: any; + } + + export interface CreateEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the pager model. + */ + model?: any; + + /** Returns the name of event + */ + type?: string; + } + + export interface DestroyEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the pager model. + */ + model?: any; + + /** Returns the name of event + */ + type?: string; + } + + export interface PageSizeSelectedEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the pager model. + */ + model?: any; + + /** Returns the name of event + */ + type?: string; + } } class Print extends ej.Widget { @@ -13988,6 +14121,11 @@ declare namespace ej { */ allowDragAndDrop?: boolean; + /** Gets or sets a value that indicates whether to enable drag and drop behavior between Kanban controls. + * @Default {false} + */ + allowExternalDragAndDrop?: boolean; + /** To enable or disable the title of the card. * @Default {false} */ @@ -14157,6 +14295,11 @@ declare namespace ej { */ locale?: string; + /** Gets or sets a value that indicates whether to render kanban columns using without data source. + * @Default {false} + */ + showColumnWhenEmpty?: boolean; + /** Triggered for every Kanban action before its starts. */ actionBegin?(e: ActionBeginEventArgs): void; @@ -15199,6 +15342,10 @@ declare namespace ej { * @Default {Object} */ colorMapping?: any; + + /** This specifies the Kanban card to drop into particular target element. + */ + externalDropTarget?: string; } export interface CustomToolbarItem { @@ -17639,6 +17786,11 @@ declare namespace ej { */ enableRTL?: boolean; + /** Specifies HTML element string to replace the existing expand/collapse icons. + * @Default {null} + */ + expanderTemplate?: string; + /** Specify height for splitter control. * @Default {null} */ @@ -17673,6 +17825,10 @@ declare namespace ej { */ beforeExpandCollapse?(e: BeforeExpandCollapseEventArgs): void; + /** Triggered when we click on the template icon. (Note: This will work only when expanderTemplate is defined.) + */ + clickOnExpander?(e: ClickOnExpanderEventArgs): void; + /** Fires when splitter control pane has been created. */ create?(e: CreateEventArgs): void; @@ -17717,6 +17873,25 @@ declare namespace ej { type?: string; } + export interface ClickOnExpanderEventArgs { + + /** if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /** returns the splitter model. + */ + model?: ej.Splitter.Model; + + /** returns the name of the event. + */ + type?: string; + + /** returns the target element from which click action is triggered. + */ + targetElement?: any; + } + export interface CreateEventArgs { /** if the event should be canceled; otherwise, false. @@ -23235,6 +23410,10 @@ declare namespace ej { */ rowDrop?(e: RowDropEventArgs): void; + /** Triggered while hover the grid row. + */ + rowHover?(e: RowHoverEventArgs): void; + /** Triggered when refresh the template column elements in the Grid. */ templateRefresh?(e: TemplateRefreshEventArgs): void; @@ -24484,7 +24663,7 @@ declare namespace ej { /** Method to merge the header cells. */ - headerCellMerge?(): void; + headerCellMerge?(startIndex:number,count:number): void /** Returns the column headers. */ @@ -25099,6 +25278,25 @@ declare namespace ej { droppedRecords?: any; } + export interface RowHoverEventArgs { + + /** Returns the hovered row. + */ + row?: any; + + /** Returns the hovered row index. + */ + rowIndex?: any; + + /** Returns the hovered record details + */ + rowData?: any; + + /** Returns the hovered row cell + */ + cell?: any; + } + export interface TemplateRefreshEventArgs { /** Returns the cancel option value. @@ -28277,7 +28475,7 @@ declare namespace ej { enableColumnResizing?: boolean; /** Allows the user to fit the width of the column based on its maximum text width. - * @Default {false} + * @Default {true} */ resizeColumnsToFit?: boolean; @@ -28763,7 +28961,7 @@ declare namespace ej { */ format?: string; - /** This property sets type of display of date. + /** This property is set to display the formatted values with format types in PivotGrid. */ formatString?: string; @@ -28862,7 +29060,7 @@ declare namespace ej { */ format?: string; - /** This property sets type of display of date. + /** This property is set to display the formatted values with format types in PivotGrid. */ formatString?: string; @@ -28931,7 +29129,7 @@ declare namespace ej { */ format?: string; - /** This property sets type of display of date. + /** This property is set to display the formatted values with format types in PivotGrid. */ formatString?: string; @@ -30266,7 +30464,7 @@ declare namespace ej { */ analysisMode?: ej.Pivot.AnalysisMode|string; - /** Allows the user to set the specific chart type for PivotChart inside PivotClient widget. + /** Allows the user to set the specific Chart type for PivotChart inside PivotClient widget. * @Default {ej.PivotChart.ChartTypes.Column} */ chartType?: ej.PivotChart.ChartTypes|string; @@ -30311,6 +30509,11 @@ declare namespace ej { */ showUniqueNameOnPivotButton?: boolean; + /** Allows user to load the saved report collection from the database. + * @Default {false} + */ + showReportCollection?: boolean; + /** Enables the splitter option for resizing the elements inside the control. * @Default {false} */ @@ -30336,7 +30539,7 @@ declare namespace ej { */ enablePaging?: boolean; - /** Allows the user to include the PivotTreeMap component as one of the chart types. + /** Allows the user to include the PivotTreeMap component as one of the Chart types. * @Default {false} */ enablePivotTreeMap?: boolean; @@ -30450,6 +30653,18 @@ declare namespace ej { */ treeMapLoad?(e: TreeMapLoadEventArgs): void; + /** Triggers on clicking any value cell in PivotGrid. + */ + valueCellHyperlinkClick?(e: ValueCellHyperlinkClickEventArgs): void; + + /** Triggers when clicking on any Chart series points in the PivotChart. + */ + pointRegionClick?(e: PointRegionClickEventArgs): void; + + /** Triggers before Chart label rendering in the PivotChart. + */ + axesLabelRendering?(e: AxesLabelRenderingEventArgs): void; + /** Triggers while clicking value cells in PivotGrid. */ drillThrough?(e: DrillThroughEventArgs): void; @@ -30562,9 +30777,9 @@ declare namespace ej { export interface SchemaLoadEventArgs { - /** returns the HTML element of PivotSchemaDesigner control. + /** returns the current action of PivotSchemaDesigner control. */ - element?: any; + action?: string; } export interface TreeMapLoadEventArgs { @@ -30582,6 +30797,59 @@ declare namespace ej { element?: any; } + export interface ValueCellHyperlinkClickEventArgs { + + /** returns the current action of PivotClient control. + */ + type?: string; + + /** returns the clicked cell information. + */ + args?: any; + + /** returns the custom object bounds with PivotClient control. + */ + customerObject?: any; + + /** returns the HTML element of PivotGrid control. + */ + element?: any; + + /** returns the model object bound with PivotClient control. + */ + model?: any; + } + + export interface PointRegionClickEventArgs { + + /** returns the current action of PivotClient control. + */ + type?: string; + + /** returns the clicked Chart series points information. + */ + data?: any; + + /** returns the model object bound with PivotClient control. + */ + model?: any; + } + + export interface AxesLabelRenderingEventArgs { + + /** returns the current action of PivotClient control. + */ + type?: string; + + /** returns the Chart label information. + */ + data?: any; + + /** returns the model object bound with PivotClient control. + */ + model?: any; + } + export interface DrillThroughEventArgs { /** return the JSON records of the generated cells on drill-through operation. @@ -30708,7 +30976,7 @@ declare namespace ej { */ format?: string; - /** This property sets type of display of date. + /** This property is set to display the formatted values with format types in PivotGrid. */ formatString?: string; @@ -30803,7 +31071,7 @@ declare namespace ej { */ format?: string; - /** This property sets type of display of date. + /** This property is set to display the formatted values with format types in PivotGrid. */ formatString?: string; @@ -30868,7 +31136,7 @@ declare namespace ej { */ format?: string; - /** This property sets type of display of date. + /** This property is set to display the formatted values with format types in PivotGrid. */ formatString?: string; @@ -32161,6 +32429,14 @@ declare namespace ej { */ exportSchedule(action: string, serverEvent: string, id: string|number): void; + /** Exports the appointments from the Schedule control and saves it in a Excel file. + * @param {string} It refers the controller action name to redirect. (For MVC) + * @param {string} It refers the server event name.(For ASP) + * @param {boolean} Indicates whether to export all the appointments including or excluding the individual occurrences of the recurrence appointments. + * @returns {void} + */ + exportToExcel(action: string, serverEvent: string, type: boolean): void; + /** Searches and filters the appointments from appointment list of Schedule control. * @param {any[]} Holds array of one or more conditional objects for filtering the appointments based on it. * @returns {any[]} @@ -34088,13 +34364,6 @@ declare namespace ej { */ addRecord(data: any, rowPosition: string): void; - /** To select cell based on the cell and row index dynamically. - * @param {any[]} array of cell indexes to be select - * @param {boolean} Defines that we need to preserve the previously selected cells of not - * @returns {void} - */ - selectCells(Indexes: any[], preservePreviousSelectedCell: boolean): void; - /** Positions the splitter by the specified column index. * @param {number} Set the splitter position based on column index. * @returns {void} @@ -34178,6 +34447,19 @@ declare namespace ej { */ saveEdit(): void; + /** To select cell based on the cell and row index dynamically. + * @param {any[]} array of cell indexes to be select + * @param {boolean} Defines that we need to preserve the previously selected cells of not + * @returns {void} + */ + selectCells(Indexes: any[], preservePreviousSelectedCell: boolean): void; + + /** To select multiple rows dynamically. + * @param {any[]} array of row indexes to select + * @returns {void} + */ + selectMultipleRows(rowIndexes: any[]): void; + /** To search an item with search string provided at the run time * @param {string} you can pass a text to search in Gantt Control. * @returns {void} @@ -34195,6 +34477,13 @@ declare namespace ej { * @returns {void} */ showColumn(headerText: string): void; + + /** To change an existing Gantt ID by new ID value dynamically + * @param {number} you can pass an existing ID value to be change + * @param {number} you can pass a new ID value to be change + * @returns {void} + */ + updateTaskId(currentId: number, newId: number): void; } export namespace Gantt { @@ -35653,6 +35942,11 @@ declare namespace ej { * @Default {ej.Gantt.RowPosition.BelowSelectedRow} */ rowPosition?: ej.Gantt.RowPosition|string; + + /** Enable or disable the confirmation dialog while deleting the record. + * @Default {false} + */ + showDeleteConfirmDialog?: boolean; } export interface Holiday { @@ -36159,6 +36453,11 @@ declare namespace ej { */ zoomFactor?: number; + /** Specifies the token for authorizing reporting service url to process the reports. + * @Default {empty} + */ + serviceAuthorizationToken?: string; + /** Fires when the report viewer is destroyed successfully.If you want to perform any operation after destroying the reportviewer control,you can make use of the destroy event. */ destroy?(e: DestroyEventArgs): void; @@ -36933,6 +37232,11 @@ declare namespace ej { */ allowSorting?: boolean; + /** Enables or disables the toolbar searching in TreeGrid. + * @Default {false} + */ + allowSearching?: boolean; + /** Enables/disables pagination of rows in TreeGrid * @Default {false} */ @@ -37128,6 +37432,10 @@ declare namespace ej { */ stackedHeaderRows?: StackedHeaderRow[]; + /** Specifies the toolbar searching customizations. + */ + searchSettings?: SearchSettings; + /** Specifies the visibility of summary row * @Default {false} */ @@ -37194,10 +37502,6 @@ declare namespace ej { */ collapsing?(e: CollapsingEventArgs): void; - /** Triggered while clicking a row, even when allowSelection property is disabled. - */ - recordClick?(e: RecordClickEventArgs): void; - /** Triggered when you start to drag a column */ columnDragStart?(e: ColumnDragStartEventArgs): void; @@ -37294,6 +37598,14 @@ declare namespace ej { */ rowSelecting?(e: RowSelectingEventArgs): void; + /** Triggered while clicking a row, even when allowSelection property is disabled. + */ + recordClick?(e: RecordClickEventArgs): void; + + /** Triggered during record double click action, even when allowSelection property is disabled. + */ + recordDoubleClick?(e: RecordDoubleClickEventArgs): void; + /** Triggered when toolbar item is clicked in TreeGrid. */ toolbarClick?(e: ToolbarClickEventArgs): void; @@ -37461,37 +37773,6 @@ declare namespace ej { expanded?: boolean; } - export interface RecordClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the element of clicked cell. - */ - cell?: any; - - /** Returns the index of the clicked cell. - */ - cellIndex?: number; - - /** Returns the data of clicked cell. - */ - cellValue?: any; - - /** Returns the element of the clicked row. - */ - row?: any; - - /** Returns the index of the clicked row. - */ - rowIndex?: number; - - /** Returns the column name of the clicked cell. - */ - columnName?: string; - } - export interface ColumnDragStartEventArgs { /** Returns the cancel option value. @@ -37937,6 +38218,10 @@ declare namespace ej { */ draggedRowIndex?: number; + /** Returns the drop position details such as insertAbove,insertBelow,insertAsChild and invalidPosition + */ + dropPosition?: string; + /** Returns the row on which we are dragging. */ targetRow?: any; @@ -38160,6 +38445,68 @@ declare namespace ej { previousTreeGridRow?: any; } + export interface RecordClickEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the element of clicked cell. + */ + cell?: any; + + /** Returns the index of the clicked cell. + */ + cellIndex?: number; + + /** Returns the data of clicked cell. + */ + cellValue?: any; + + /** Returns the element of the clicked row. + */ + row?: any; + + /** Returns the index of the clicked row. + */ + rowIndex?: number; + + /** Returns the column name of the clicked cell. + */ + columnName?: string; + } + + export interface RecordDoubleClickEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the element of clicked cell. + */ + cell?: any; + + /** Returns the index of the clicked cell. + */ + cellIndex?: number; + + /** Returns the data of clicked cell. + */ + cellValue?: any; + + /** Returns the element of the clicked row. + */ + row?: any; + + /** Returns the index of the clicked row. + */ + rowIndex?: number; + + /** Returns the column name of the clicked cell. + */ + columnName?: string; + } + export interface ToolbarClickEventArgs { /** Returns the cancel option value. @@ -38255,6 +38602,11 @@ declare namespace ej { */ filterEditType?: ej.TreeGrid.EditingType|string; + /** Gets or sets a value to render either excel or menu filtering in TreeGrid column filtering. + * @Default {null} + */ + filterType?: ej.TreeGrid.FilterType|string; + /** Header text of the column. * @Default {null} */ @@ -38420,6 +38772,11 @@ declare namespace ej { * @Default {null} */ dialogEditorTemplateID?: string; + + /** Enable or disable the confirmation dialog while deleting the record. + * @Default {false} + */ + showDeleteConfirmDialog?: boolean; } export interface ColumnResizeSettings { @@ -38465,6 +38822,21 @@ declare namespace ej { * @Default {[]} */ filteredColumns?: FilterSettingsFilteredColumn[]; + + /** Gets or sets a value that indicates the maximum number of filter choices that can be showed in the excel styled filter menu. + * @Default {1000} + */ + maxFilterChoice?: number; + + /** Gets or sets a value that indicates to perform the filter operation with case sensitive in excel styled filter menu mode. + * @Default {false} + */ + enableCaseSensitivity?: boolean; + + /** Enables or disables the ability to filter the columns with empty, null and undefined values. + * @Default {true} + */ + enableComplexBlankFilter?: boolean; } export interface PageSettings { @@ -38576,6 +38948,28 @@ declare namespace ej { stackedHeaderColumns?: StackedHeaderRowsStackedHeaderColumn[]; } + export interface SearchSettings { + + /** Default Value + * @Default {[]} + */ + fields?: any[]; + + /** Default Value + */ + key?: string; + + /** Specifies the operator for the search key words in toolbar searching. + * @Default {contains} + */ + operator?: string; + + /** Default Value + * @Default {true} + */ + ignoreCase?: boolean; + } + export interface SummaryRowsSummaryColumn { /** Specifies the summary type to perform calculations in a corresponding summary column. See summaryType. @@ -38703,6 +39097,16 @@ declare namespace ej { } + enum FilterType { + + ///Specifies the filter type as menu. + Menu, + + ///Specifies the filter type as excel. + Excel + } + + enum UnboundType { ///Unbound type to perform edit action @@ -38794,16 +39198,6 @@ declare namespace ej { } - enum FilterType { - - ///Enables the filterbar filtering - FilterBar, - - ///Enables the menu filtering - Menu - } - - enum PageSizeMode { ///To count all the parent and child records. @@ -40585,6 +40979,11 @@ declare namespace ej { */ addNewSheet(): void; + /** This method is used to blank the workbook in Spreadsheet. + * @returns {void} + */ + blankWorkbook(): void; + /** It is used to clear all the data and format in the specified range of cells in Spreadsheet. * @param {string|any[]} Optional. If range is specified, then it will clear all content in the specified range else it will use the current selected range. * @returns {void} @@ -40707,6 +41106,15 @@ declare namespace ej { */ getAutoFillElem(): HTMLElement; + /** This method is used to get the alpha range of the given index in Spreadsheet. + * @param {number} Pass the start row index. + * @param {number} Pass the start column index. + * @param {number} Pass the end row index. + * @param {number} Pass the end column index. + * @returns {String} + */ + getAlphaRange(sRIndex: number, sCIndex: number, eRIndex: number, eCIndex: number): String; + /** This method is used to get the cell element based on specified row and column index in the Spreadsheet. * @param {number} Pass the row index. * @param {number} Pass the column index. @@ -40739,6 +41147,12 @@ declare namespace ej { */ getHyperlink(cell: HTMLElement): any; + /** This method is used to get the keys from the given object in Spreadsheet. + * @param {any} Pass the Object + * @returns {any[]} + */ + getObjectKeys(obj: any): any[]; + /** This method is used to get all cell elements in the specified range. * @param {string} Pass the range that you want to get the cells. * @param {number} Pass the index of the sheet. @@ -40753,6 +41167,14 @@ declare namespace ej { */ getRangeData(options?: any): any[]; + /** This method is used to get the data as object in the specified range. + * @param {any} Pass the start cell. + * @param {any} Pass the end cell. + * @param {boolean} Optional. Pass {{'`true`' | markdownify}}, if you want to skip the hidden rows. + * @returns {any} + */ + getRangeDataAsObject(startcell: any, endcell: any, skipHiddenRow?: boolean): any; + /** This method is used to get the range indices array based on the specified alpha range in Spreadsheet. * @param {string} Pass the alpha range that you want to get range indices. * @returns {any[]} @@ -41432,6 +41854,12 @@ declare namespace ej { */ editCell(rowIdx: number, colIdx: number, oldData: boolean): void; + /** This method is used to get the column index with specified field value in Spreadsheet. + * @param {string} Pass the column field value + * @returns {void} + */ + getColumnIndexByField(field: string): void; + /** This method is used to get the property value of particular cell, based on the row and column index in the Spreadsheet. * @param {number} Pass the row index to get the property value. * @param {number} Pass the column index to get the property value. @@ -41473,6 +41901,15 @@ declare namespace ej { * @returns {void} */ updateCellValue(cellIdx: any, val: string|number, formatClass: string, sheetIdx: number): void; + + /** This method is used to update a particular cell value and its format in the Spreadsheet. + * @param {string} Pass the range. + * @param {string|number} Pass the cell value. + * @param {string} Pass the class name to update format. + * @param {number} Pass sheet index. + * @returns {void} + */ + updateValue(aRange: string, val: string|number, formatClass: string, sheetIdx: number): void; } export interface XLExport { @@ -41517,6 +41954,20 @@ declare namespace ej { */ addFontFamily(fontName: string): void; + /** This method is used to add the new custom cell style in spreadsheet. + * @param {string} Pass the style name. + * @param {any} Pass the format object. + * @returns {void} + */ + addNewCustomStyle(styleName: string, options: any): void; + + /** This method is used to apply the custom cell style in the specified range. + * @param {string} Pass the style name. + * @param {string} Pass the range to applied. + * @returns {void} + */ + applyCustomCellStyle(styleName: string, range: string): void; + /** This method is used to convert table range to normal range. * @param {any} Pass the sheet index and table id. * @returns {void} @@ -41530,6 +41981,12 @@ declare namespace ej { */ createTable(tableObject: any, range: string|any[]): string; + /** This method is used to delete the added custom cell style in spreadsheet. + * @param {string} Pass the cell style name + * @returns {void} + */ + deleteCustomStyle(styleName: string): void; + /** This method is used to set format style and values in a cell or range of cells. * @param {any} Pass the formatObject which contains style, type, format, groupSeparator and decimalPlaces. * @param {string} Pass the range to format cells. @@ -41537,6 +41994,46 @@ declare namespace ej { */ format(formatObj: any, range: string): void; + /** This method is used to get the border from hashcode in the Spreadsheet. + * @param {string} Pass the border hashcode. + * @param {boolean} Optional. pass `true` to get the complete border object + * @returns {any} + */ + getBorderFromHashCode(code: string, isComplete: boolean): any; + + /** This method is used to get the format class in spreadsheet. + * @param {string} Pass the style name. + * @param {boolean} Optional. Pass true to get the border class. + * @returns {void} + */ + getFormatClass(classname: string, isborder: boolean): void; + + /** This method is used to get the format from the given hashcode in spreadsheet. + * @param {string} Pass the hashcode. + * @returns {void} + */ + getFormatFromHashCode(hashCode: string): void; + + /** This method is used to get the hashcode from the given style object in spreadsheet. + * @param {any} Pass the style object that you want to get the hashcode. + * @returns {void} + */ + getFormatHashCode(style: any): void; + + /** This method is used to get the format as array from the given specified range in spreadsheet. + * @param {string} Pass the range. + * @returns {void} + */ + getHashCodeClassAsArray(range: string): void; + + /** This method is used to modify the added custom cell style in spreadsheet. + * @param {string} pass the old style name + * @param {any} pass the format object to be modified + * @param {string} pass the new style name + * @returns {void} + */ + modifyCustomStyle(oldStyleName: string, options: any, newStyleName: 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} @@ -45967,6 +46464,470 @@ declare namespace ej { } } + class ComboBox extends ej.Widget { + static fn: ComboBox; + constructor(element: JQuery | Element, options?: ComboBox.Model); + static Locale: any; + model: ComboBox.Model; + defaults: ComboBox.Model; + + /** Adds a new item to the popup list. By default, new item appends to the list as the last item, but you can insert based on the index parameter. + * @returns {void} + */ + addItem(): void; + + /** Sets the focus to the component for interaction. + * @returns {void} + */ + focusIn(): void; + + /** Moves the focus from the component if the component is already focused. + * @returns {void} + */ + focusOut(): void; + + /** Gets the data object that matches the given value. + * @returns {any} + */ + getDataByValue(): any; + + /** Gets all the list items bound on this component. + * @returns {Element[]} + */ + getItems(): Element[]; + + /** Hides the popup if it is in open state. + * @returns {void} + */ + hidePopup(): void; + + /** Opens the popup that displays the list of items. + * @returns {void} + */ + showPopup(): void; + } + export namespace ComboBox { + + export interface Model { + + /** Accepts the template and assigns it to the popup list content of the component when the data fetch request from the remote server fails. + * @Default {The Request Failed} + */ + actionFailureTemplate?: string; + + /** Specifies whether the component allows user defined value which does not exist in data source. + * @Default {true} + */ + allowCustom?: boolean; + + /** When allowFiltering is set to true, show the filter bar (search box) of the component. The filter action retrieves matched items through the filtering event based on the + * characters typed in the search TextBox. If no match is found, the value of the noRecordsTemplate property will be displayed. + * @Default {false} + */ + allowFiltering?: boolean; + + /** Specifies whether suggest a first matched item in input when searching. No action happens when no matches found. + * @Default {false} + */ + autofill?: boolean; + + /** Sets CSS classes to the root element of the component that helps customize the UI styles. + * @Default {null} + */ + cssClass?: string; + + /** Accepts the list items either through local or remote service and binds it to the component. It can be an array of JSON objects or an instance of DataManager. + * @Default {[]} + */ + dataSource?: any|any[]; + + /** When set to true, enables RTL mode of the component that displays the content in the right-to-left direction. + * @Default {false} + */ + enableRtl?: boolean; + + /** Specifies a value that indicates whether the component is enabled or not. + * @Default {true} + */ + enabled?: boolean; + + /** The fields property maps the columns of the data table and binds the data to the component. + */ + fields?: Fields; + + /** Accepts the template design and assigns it to the footer container of the popup list. + * @Default {null} + */ + footerTemplate?: string; + + /** Accepts the template design and assigns it to the group headers present in the popup list. + * @Default {null} + */ + groupTemplate?: string; + + /** Accepts the template design and assigns it to the header container of the popup list. + * @Default {null} + */ + headerTemplate?: string; + + /** Allows additional HTML attributes such as title, name, etc., and accepts n number of attributes in a key-value pair format. + * @Default {{}} + */ + htmlAttributes?: any; + + /** Gets or sets the index of the selected item in the component. + * @Default {null} + */ + index?: number; + + /** Accepts the template design and assigns it to each list item present in the popup. + * @Default {null} + */ + itemTemplate?: string; + + /** Overrides the global culture and localization value for this component. Default global culture is 'en-US'. + * @Default {en-US} + */ + locale?: string; + + /** Accepts the template design and assigns it to popup list of component when no data is available on the component. + * @Default {No Records Found} + */ + noRecordsTemplate?: string; + + /** Accepts the value to be displayed as a watermark text on the component input. + * @Default {null} + */ + placeholder?: string; + + /** Specifies the height of the popup list. + * @Default {300px} + */ + popupHeight?: string|number; + + /** Specifies the width of the popup list. By default, the popup width sets based on the width of the component. + * @Default {100%} + */ + popupWidth?: string|number; + + /** The query to retrieve the data from the data source. + * @Default {null} + */ + query?: ej.Query; + + /** When set to true, the user interactions on the component are disabled. + * @Default {false} + */ + readonly?: boolean; + + /** Specifies whether to show or hide the clear button. When the clear button is clicked, value, text, and index properties are reset to null. + * @Default {true} + */ + showClearButton?: boolean; + + /** Specifies the sortOrder to sort the data source. The available type of sort orders are + * @Default {ej.SortOrder.None} + */ + sortOrder?: ej.ComboBox.SortOrder|string; + + /** Gets or sets the display text of the selected item in the component. + * @Default {null} + */ + text?: string; + + /** Gets or sets the value of the selected item in the component. + * @Default {null} + */ + value?: number|string; + + /** Specifies the width of the component. By default, the component width sets based on the width of its parent container. You can also set the width in pixel values. + * @Default {100%} + */ + width?: number|string; + + /** Triggers before fetching data from the remote server. + */ + actionBegin?(e: ActionBeginEventArgs): void; + + /** Triggers after data is fetched successfully from the remote server. + */ + actionComplete?(e: ActionCompleteEventArgs): void; + + /** Triggers when the data fetch request from the remote server fails. + */ + actionFailure?(e: ActionFailureEventArgs): void; + + /** Triggers when an item in a popup is selected or when the model value is changed. + */ + change?(e: ChangeEventArgs): void; + + /** Triggers when the popup is closed. + */ + close?(e: CloseEventArgs): void; + + /** Triggers when ComboBox widget is created. + */ + create?(e: CreateEventArgs): void; + + /** Triggers on set a custom value to this component. + */ + customValueSpecifier?(e: CustomValueSpecifierEventArgs): void; + + /** Triggers on typing a character in the component. + */ + filtering?(e: FilteringEventArgs): void; + + /** Triggers when the component is focused. + */ + focus?(e: FocusEventArgs): void; + + /** Triggers after the suggestion list is opened. + */ + open?(e: OpenEventArgs): void; + + /** Triggers when an item in the popup is selected. + */ + select?(e: SelectEventArgs): void; + } + + export interface ActionBeginEventArgs { + + /** if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /** returns the ComboBox model + */ + model?: any; + + /** returns the name of the event + */ + type?: string; + } + + export interface ActionCompleteEventArgs { + + /** if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /** returns the Autocomplete model + */ + model?: any; + + /** Returns the query for data retrieval from the Database + */ + e?: any; + + /** returns the name of the event + */ + type?: string; + } + + export interface ActionFailureEventArgs { + + /** if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /** Returns the error message + */ + e?: any; + + /** returns the Autocomplete model + */ + model?: any; + + /** returns the name of the event + */ + type?: string; + } + + export interface ChangeEventArgs { + + /** Set this option to true to cancel the event. + */ + cancel?: boolean; + + /** Instance of the combobox model object. + */ + model?: ej.ComboBox.Model; + + /** Name of the event. + */ + type?: string; + + /** Value of the combobox textbox. + */ + value?: string|number; + + /** Li element of the selected item. + */ + Item?: any; + + /** Event argument. + */ + e?: any; + + /** value of the interaction + */ + isInteracted?: boolean; + } + + export interface CloseEventArgs { + + /** Element of the combobox popup list + */ + popup?: any; + } + + export interface CreateEventArgs { + + /** Set this option to true to cancel the event. + */ + cancel?: boolean; + + /** Instance of the combobox model object. + */ + model?: ej.ComboBox.Model; + + /** Name of the event. + */ + type?: string; + } + + export interface CustomValueSpecifierEventArgs { + + /** Instance of the combobox model object. + */ + model?: ej.ComboBox.Model; + + /** Name of the event. + */ + type?: string; + + /** text of the combobox. + */ + text?: string; + } + + export interface FilteringEventArgs { + + /** Instance of the combobox model object. + */ + model?: ej.ComboBox.Model; + + /** Name of the event. + */ + type?: string; + + /** text of the combobox. + */ + text?: string; + + /** Function used to update the filtering value. + */ + updateData?: any; + } + + export interface FocusEventArgs { + + /** Set this option to true to cancel the event. + */ + cancel?: boolean; + + /** Instance of the combobox model object. + */ + model?: ej.ComboBox.Model; + + /** Name of the event. + */ + type?: string; + } + + export interface OpenEventArgs { + + /** Element of the combobox popup list + */ + popup?: any; + } + + export interface SelectEventArgs { + + /** Set this option to true to cancel the event. + */ + cancel?: boolean; + + /** Instance of the combobox model object. + */ + model?: ej.ComboBox.Model; + + /** Name of the event. + */ + type?: string; + + /** Value of the combobox textbox. + */ + value?: string|number; + + /** Text of the selected item. + */ + text?: string; + + /** Data object of the selected item. + */ + itemData?: ej.ComboBox.Model; + + /** Li element of the selected item. + */ + Item?: any; + + /** Event argument. + */ + e?: any; + + /** value of the interaction + */ + isInteracted?: boolean; + } + + export interface Fields { + + /** Used to group the popup list items. + * @Default {null} + */ + groupBy?: string; + + /** Defines class for the item. + * @Default {null} + */ + iconCss?: string; + + /** Defines the specific field name which contains unique values for the list items. + * @Default {null} + */ + value?: string; + + /** Defines the specific field name in the data source to load the popup list with data. + * @Default {null} + */ + text?: string; + } + + enum SortOrder { + + ///The data source is not sorting. + None, + + ///The data source is sorting with ascending order. + Ascending, + + ///The data source is sorting with descending order. + Descending + } + + } + } declare namespace ej.datavisualization { class SymbolPalette extends ej.Widget { @@ -64066,7 +65027,7 @@ declare namespace ej.datavisualization { historyManager?: HistoryManager; /** Defines the type of the rendering mode of label. - * @Default {Html} + * @Default {HTML} */ labelRenderingMode?: ej.datavisualization.Diagram.LabelRenderingMode|string; @@ -65424,6 +66385,10 @@ declare namespace ej.datavisualization { */ borderWidth?: number; + /** This property allows you to customize sourceDecorator appearance using user-defined CSS. + */ + cssClass?: string; + /** Sets the fill color of the source decorator * @Default {black} */ @@ -65469,6 +66434,10 @@ declare namespace ej.datavisualization { */ borderColor?: string; + /** This property allows you to customize targetDecorator appearance using user-defined CSS. + */ + cssClass?: string; + /** Sets the color with which the decorator will be filled * @Default {black} */ @@ -65516,7 +66485,7 @@ declare namespace ej.datavisualization { */ cornerRadius?: number; - /** Configures the styles of shapes + /** This property allows you to customize connectors appearance using user-defined CSS. */ cssClass?: string; @@ -66213,6 +67182,11 @@ declare namespace ej.datavisualization { */ stops?: any[]; + /** Defines the type of gradient + * @Default {linear} + */ + type?: string; + /** Defines the left most position(relative to node) of the rectangular region that needs to be painted * @Default {0} */ @@ -66236,6 +67210,11 @@ declare namespace ej.datavisualization { export interface NodesGradientRadialGradient { + /** Defines the type of gradient + * @Default {radial} + */ + type?: string; + /** Defines the position of the outermost circle * @Default {0} */ @@ -66350,6 +67329,10 @@ declare namespace ej.datavisualization { */ borderWidth?: number; + /** This property allows you to customize labels appearance using user-defined CSS. + */ + cssClass?: string; + /** Enables or disables the default behaviors of the label. * @Default {ej.datavisualization.Diagram.LabelConstraints.None} */ @@ -66429,6 +67412,10 @@ declare namespace ej.datavisualization { */ rotateAngle?: number; + /** Sets the id of svg/html templates. Applicable, if the node's label is HTML or native. + */ + templateId?: string; + /** Defines the label text */ text?: string; @@ -66471,6 +67458,10 @@ declare namespace ej.datavisualization { export interface NodesLane { + /** This property allows you to customize lanes appearance using user-defined CSS. + */ + cssClass?: string; + /** Defines the width of lane * @Default {0} */ @@ -66623,6 +67614,10 @@ declare namespace ej.datavisualization { */ constraints?: ej.datavisualization.Diagram.PortConstraints|string; + /** This property allows you to customize ports appearance using user-defined CSS. + */ + cssClass?: string; + /** Sets the fill color of the port * @Default {white} */ @@ -66865,7 +67860,7 @@ declare namespace ej.datavisualization { */ cornerRadius?: number; - /** Configures the styles of shapes + /** This property allows you to customize nodes appearance using user-defined CSS. */ cssClass?: string; @@ -67982,10 +68977,10 @@ declare namespace ej.datavisualization { } namespace Diagram { enum LabelRenderingMode { - //Sets the labelRenderingMode as Html - Html, - //Sets the labelRenderingMode as Svg - Svg, + //Sets the labelRenderingMode as HTML + HTML, + //Sets the labelRenderingMode as SVG + SVG, } } namespace Diagram { @@ -68094,7 +69089,7 @@ declare namespace ej.datavisualization { PointerEvents, //Enables contrast between clean edges for the node over rendering speed and geometric precision CrispEdges, - //Enables all node constraints + //Enables default node interactions such as select,delete,drag,rotate,resize,connect,inheritCrispEdges and inheritTooltip Default, } } @@ -68458,8 +69453,8 @@ declare namespace ej.datavisualization { Text, //Used to specify node type as Image Image, - //Used to specify node type as Html - Html, + //Used to specify node type as HTML + HTML, //Used to specify node type as Native Native, //Used to specify node type as Basic @@ -71150,6 +72145,9 @@ interface JQuery { ejColorPicker(options?: ej.ColorPicker.Model): JQuery; ejColorPicker(memberName: any, value?: any, param?: any): any; + ejComboBox(options?: ej.ComboBox.Model): JQuery; + ejComboBox(memberName: any, value?: any, param?: any): any; + ejDatePicker(options?: ej.DatePicker.Model): JQuery; ejDatePicker(memberName: any, value?: any, param?: any): any; @@ -71378,6 +72376,7 @@ interface JQuery { data(key: "ejCheckBox"): ej.CheckBox; data(key: "ejCircularGauge"): ej.datavisualization.CircularGauge; data(key: "ejColorPicker"): ej.ColorPicker; + data(key: "ejComboBox"): ej.ComboBox; data(key: "ejDatePicker"): ej.DatePicker; data(key: "ejDateRangePicker"): ej.DateRangePicker; data(key: "ejDateTimePicker"): ej.DateTimePicker; From af970ce0943dcf7b7fc3668bee48968f449fc2df Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Wed, 10 Jan 2018 18:20:11 +0530 Subject: [PATCH 014/496] BOM Error Fixed --- types/ej.web.all/ej.web.all-tests.ts | 2 +- types/ej.web.all/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index 5ab573f418..9fac6f2349 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -1,4 +1,4 @@ -module AccordionComponent { +module AccordionComponent { $(function () { var sample = new ej.Accordion($("#basicAccordion"), { width: "100%", diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index bf6d488f6f..c4443b3e70 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ej.web.all 15.4 +// Type definitions for ej.web.all 15.4 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From dcb830efc73c5b1be97255f7a1d751e7c2c157b9 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Wed, 10 Jan 2018 19:10:36 +0530 Subject: [PATCH 015/496] Lint Error Fixed --- types/ej.web.all/ej.web.all-tests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index 9fac6f2349..25aab5c06f 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ module AccordionComponent { $(function () { var sample = new ej.Accordion($("#basicAccordion"), { From 39d8663e2074c15d3bed4b7a1d117ed6ac98b753 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Wed, 10 Jan 2018 19:18:10 +0530 Subject: [PATCH 016/496] Lint Errors Fixed --- types/ej.web.all/ej.web.all-tests.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index 25aab5c06f..9fac6f2349 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -1,4 +1,3 @@ -/* tslint:disable */ module AccordionComponent { $(function () { var sample = new ej.Accordion($("#basicAccordion"), { From 40bd25bd96834f880ebb43014555b5543ace9406 Mon Sep 17 00:00:00 2001 From: Carsten Schumann Date: Sat, 13 Jan 2018 14:59:44 +0100 Subject: [PATCH 017/496] Added missing parameter format Paper.path also accepts an array of commands instead of a path string. Example: paper.path([ ["M", 5, 10], ["l", 15, 2], ["h", 30], ["Z"] ]); --- types/snapsvg/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/snapsvg/index.d.ts b/types/snapsvg/index.d.ts index ff0e9d09a9..539036b36c 100644 --- a/types/snapsvg/index.d.ts +++ b/types/snapsvg/index.d.ts @@ -279,6 +279,7 @@ declare namespace Snap { image(src:string,x:number,y:number,width:number,height:number):Snap.Element; line(x1:number,y1:number,x2:number,y2:number):Snap.Element; path(pathString?:string):Snap.Element; + path(pathSpec:(string | number)[][]):Snap.Element; polygon(varargs:any[]):Snap.Element; polyline(varargs:any[]):Snap.Element; rect(x:number,y:number,width:number,height:number,rx?:number,ry?:number):Snap.Element; From af1e2b71dc65036ef79b70f3bfc53a94c51a1dc1 Mon Sep 17 00:00:00 2001 From: dominuskernel Date: Sun, 14 Jan 2018 18:35:25 +0100 Subject: [PATCH 018/496] add methods types to Navigo and update the version --- types/navigo/index.d.ts | 10 +++++++--- types/navigo/navigo-tests.ts | 9 +++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/types/navigo/index.d.ts b/types/navigo/index.d.ts index 73131a9d72..bb4681dd56 100644 --- a/types/navigo/index.d.ts +++ b/types/navigo/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for navigo 4.0 +// Type definitions for navigo 6.0 // Project: https://github.com/krasimir/navigo // Definitions by: Adrian Ehrsam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -20,7 +20,7 @@ interface GenericHooks { after?(params?: Params): void; } -type RouteHandler = ((parametersObj: any, query: string) => void) | { as: string; uses(parametersObj: any): void }; +type RouteHandler = ((params: Params, query: string) => void) | { as: string; uses(params: Params, query: string): void }; declare class Navigo { /** @@ -44,6 +44,8 @@ declare class Navigo { generate(path: string, params?: any): string; + getLinkPath(link: any): any; + resolve(currentURL?: string): boolean; link(path: string): string; @@ -52,9 +54,11 @@ declare class Navigo { disableIfAPINotAvailable(): void; + historyAPIUpdateMethod(method?: string): void; + hooks(hooks: GenericHooks): void; - pause(): void; + pause(change?: boolean): void; resume(): void; diff --git a/types/navigo/navigo-tests.ts b/types/navigo/navigo-tests.ts index 1aeb645ce8..b702df93c8 100644 --- a/types/navigo/navigo-tests.ts +++ b/types/navigo/navigo-tests.ts @@ -56,7 +56,7 @@ router .resolve(); router - .on('/user/:id/:action', (params: { id: string; action: string }) => { + .on('/user/:id/:action', (params: Params) => { // If we have http://site.com/user/42/save as a url then // params.id = 42 // params.action = save @@ -64,7 +64,7 @@ router .resolve(); router - .on('/user/:id/:action', (params: { id: string; action: string }, query: string) => { + .on('/user/:id/:action', (params: Params, query: string) => { // If we have http://site.com/user/42/save?answer=42 as a url then // params.id = 42 // params.action = save @@ -117,6 +117,11 @@ router.pause(); router.navigate('/en/products'); router.resume(); // or .pause(false) +router.pause(); +router.historyAPIUpdateMethod('replaceState'); +router.disableIfAPINotAvailable(); +router.resume(); + router.on( '/user/edit', () => { From d095efb7a653267e49cb0ed451d866b9226bc5cc Mon Sep 17 00:00:00 2001 From: dominuskernel Date: Mon, 15 Jan 2018 02:22:11 +0100 Subject: [PATCH 019/496] add type for off method --- Abandonando | 0 Añadiendo | 0 Comprimiendo | 0 Generando | 0 types/navigo/index.d.ts | 2 ++ types/navigo/navigo-tests.ts | 5 +++++ 6 files changed, 7 insertions(+) create mode 100644 Abandonando create mode 100644 Añadiendo create mode 100644 Comprimiendo create mode 100644 Generando diff --git a/Abandonando b/Abandonando new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Añadiendo b/Añadiendo new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Comprimiendo b/Comprimiendo new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Generando b/Generando new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/navigo/index.d.ts b/types/navigo/index.d.ts index bb4681dd56..053192b7ec 100644 --- a/types/navigo/index.d.ts +++ b/types/navigo/index.d.ts @@ -36,6 +36,8 @@ declare class Navigo { on(rootHandler: RouteHandler, hooks?: NavigoHooks): Navigo; + off(handler: { [key: string]: RouteHandler }): void; + notFound(handler: ((query: string) => void), hooks?: NavigoHooks): void; navigate(path: string, absolute?: boolean): void; diff --git a/types/navigo/navigo-tests.ts b/types/navigo/navigo-tests.ts index b702df93c8..d0c162702b 100644 --- a/types/navigo/navigo-tests.ts +++ b/types/navigo/navigo-tests.ts @@ -120,6 +120,11 @@ router.resume(); // or .pause(false) router.pause(); router.historyAPIUpdateMethod('replaceState'); router.disableIfAPINotAvailable(); +router.off({ + '/trip/:number': { + as: 'trip', uses: (params, query) => {} + } +}); router.resume(); router.on( From 23525e579310d8b6327f17320c7d6f4e278c8919 Mon Sep 17 00:00:00 2001 From: dominuskernel Date: Mon, 15 Jan 2018 12:22:28 +0100 Subject: [PATCH 020/496] change the off method types --- types/navigo/index.d.ts | 2 +- types/navigo/navigo-tests.ts | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/types/navigo/index.d.ts b/types/navigo/index.d.ts index 053192b7ec..58af71a564 100644 --- a/types/navigo/index.d.ts +++ b/types/navigo/index.d.ts @@ -36,7 +36,7 @@ declare class Navigo { on(rootHandler: RouteHandler, hooks?: NavigoHooks): Navigo; - off(handler: { [key: string]: RouteHandler }): void; + off(location: string, handler: RouteHandler): void; notFound(handler: ((query: string) => void), hooks?: NavigoHooks): void; diff --git a/types/navigo/navigo-tests.ts b/types/navigo/navigo-tests.ts index d0c162702b..b3094c053f 100644 --- a/types/navigo/navigo-tests.ts +++ b/types/navigo/navigo-tests.ts @@ -120,11 +120,7 @@ router.resume(); // or .pause(false) router.pause(); router.historyAPIUpdateMethod('replaceState'); router.disableIfAPINotAvailable(); -router.off({ - '/trip/:number': { - as: 'trip', uses: (params, query) => {} - } -}); +router.off('/trip/:number', { as: 'trip', uses: (params, query) => {}}); router.resume(); router.on( From 71342f54728f77708666588d78521b7431939168 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Tue, 16 Jan 2018 15:53:04 +0530 Subject: [PATCH 021/496] Lint Error has been fixed --- types/ej.web.all/ej.web.all-tests.ts | 724 +++++++++++++-------------- 1 file changed, 362 insertions(+), 362 deletions(-) diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index 9fac6f2349..d2d711fbed 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -18,37 +18,37 @@ module AccordionComponent { }); } -module AutocompleteComponent{ +module AutocompleteComponent { var carList = [ - "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", - "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", - "Chevrolet Camaro", "Cadillac", - "Duesenberg J", "Dodge Sprinter", - "Elantra", "Excavator", - "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", - "GAZ Siber", - "Honda S2000", "Hyundai Santro", - "Isuzu Swift", "Infiniti Skyline", - "Jaguar XJS", - "Kia Sedona EX", "Koenigsegg Agera", - "Lotus Esprit", "Lamborghini Diablo", - "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", - "Nissan Qashqai", - "Oldsmobile S98", "Opel Superboss", - "Porsche 356", "Pontiac Sunbird", - "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", - "Triumph Spitfire", "Toyota 2000GT", - "Volvo P1800", "Volkswagen Shirako" - ]; - $(function () { - var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { + "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", + "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", + "Chevrolet Camaro", "Cadillac", + "Duesenberg J", "Dodge Sprinter", + "Elantra", "Excavator", + "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", + "GAZ Siber", + "Honda S2000", "Hyundai Santro", + "Isuzu Swift", "Infiniti Skyline", + "Jaguar XJS", + "Kia Sedona EX", "Koenigsegg Agera", + "Lotus Esprit", "Lamborghini Diablo", + "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", + "Nissan Qashqai", + "Oldsmobile S98", "Opel Superboss", + "Porsche 356", "Pontiac Sunbird", + "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", + "Triumph Spitfire", "Toyota 2000GT", + "Volvo P1800", "Volkswagen Shirako" + ]; + $(function () { + var autocompleteInstance = new ej.Autocomplete($("#selectCar"), { width: "100%", watermarkText: "Select a car", dataSource: carList, enableAutoFill: true, showPopupButton: true, multiSelectMode: "delimiter" - }); + }); }); } @@ -69,7 +69,7 @@ module Bulletgraphcomponent { isResponsive: true, load: function () { var sender = $("#BulletGraph").data("ejBulletGraph"); - var bulletTheme = window.themeStyle + window.themeColor + window.themeVarient; + var bulletTheme = (window).themeStyle + (window).themeColor + (window).themeVarient; if (bulletTheme) { switch (bulletTheme) { case "flatdark": @@ -82,17 +82,17 @@ module Bulletgraphcomponent { case "gradientsaffrondark": case "flathigh-contrast-01dark": case "flathigh-contrast-02dark": - theme = "flatdark"; + bulletTheme = "flatdark"; break; case "flatoffice-365light": case "flatmateriallight": - theme = "material"; + bulletTheme = "material"; break; default: - theme = "flatlight"; + bulletTheme = "flatlight"; break; } - sender.model.theme = theme; + sender.model.theme = bulletTheme; } }, @@ -246,7 +246,7 @@ module ChartComponent { model.primaryYAxis.labelIntersectAction = "rotate45"; model.primaryYAxis.edgeLabelPlacement = "hide"; } - var theme = window.themeStyle + window.themeColor + window.themeVarient; + var theme = (window).themeStyle + (window).themeColor + (window).themeVarient; if (theme) { switch (theme) { case "flatdark": @@ -288,9 +288,9 @@ module ChartComponent { }, title: { text: 'Efficiency of oil-fired power production' }, size: { height: "600" }, - legend: { visible: true}, - load:"loadTheme" + legend: { visible: true}, }); + chartsample.model.load="loadTheme"; }); } @@ -559,57 +559,55 @@ module ExplorerComponent { }); } - module GanttComponent { - $(function () { - var ganttInstance = new ej.Gantt($("#GanttContainer"), { - dataSource: (window).projectData, - allowColumnResize: true, - allowSorting: true, - allowSelection: true, - enableContextMenu: true, - taskIdMapping: "taskID", - allowDragAndDrop: true, - taskNameMapping: "taskName", - startDateMapping: "startDate", - showColumnChooser: true, - showColumnOptions: true, - progressMapping: "progress", - durationMapping: "duration", - endDateMapping: "endDate", - childMapping: "subtasks", - scheduleStartDate: "02/01/2014", - scheduleEndDate: "04/09/2014", - //Resources mapping - resourceInfoMapping: "resourceId", - resourceNameMapping: "resourceName", - resourceIdMapping: "resourceId", - resources: (window).projectResources, - predecessorMapping: "predecessor", - showResourceNames: true, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add","edit","delete","update","cancel","indent","outdent","expandAll","collapseAll","search"] - }, - editSettings: { - allowEditing: true, - allowAdding: true, - allowDeleting: true, - allowIndent: true, - editMode: "cellEditing" - }, - sizeSettings: { - width: "100%", - height: "100%" - }, - dragTooltip: { showTooltip: true }, - showGridCellTooltip: true, - treeColumnIndex: 1, - isResponsive: true, + $(function () { + var ganttInstance = new ej.Gantt($("#GanttContainer"), { + dataSource: (window).projectData, + allowColumnResize: true, + allowSorting: true, + allowSelection: true, + enableContextMenu: true, + taskIdMapping: "taskID", + allowDragAndDrop: true, + taskNameMapping: "taskName", + startDateMapping: "startDate", + showColumnChooser: true, + showColumnOptions: true, + progressMapping: "progress", + durationMapping: "duration", + endDateMapping: "endDate", + childMapping: "subtasks", + scheduleStartDate: "02/01/2017", + scheduleEndDate: "04/09/2017", + //Resources mapping + resourceInfoMapping: "resourceId", + resourceNameMapping: "resourceName", + resourceIdMapping: "resourceId", + resources: (window).projectResources, + predecessorMapping: "predecessor", + showResourceNames: true, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add", "edit", "delete", "update", "cancel", "indent", "outdent", "expandAll", "collapseAll", "search"] + }, + editSettings: { + allowEditing: true, + allowAdding: true, + allowDeleting: true, + allowIndent: true, + editMode: "cellEditing" + }, + sizeSettings: { + width: "100%", + height: "100%" + }, + dragTooltip: { showTooltip: true }, + showGridCellTooltip: true, + treeColumnIndex: 1, + isResponsive: true, + }); }); -}); } - module GridComponent { $(function () { var gridInstance = new ej.Grid($("#Grid"), { @@ -716,7 +714,6 @@ module KanbanComponent { }); } - module lineargaugecomponent { $(function () { var linearsample = new ej.datavisualization.LinearGauge($("#LinearGauge"), { @@ -740,12 +737,15 @@ module lineargaugecomponent { backgroundColor: "#E94649", border: { color: "#E94649" }, startWidth: 4, endWidth: 4 }] - }] + }] }); }); } - + + + + module ListBoxComponent { $(function () { var listboxInstance = new ej.ListBox($("#selectcar"), { @@ -757,7 +757,7 @@ module ListBoxComponent { module ListviewComponent { $(function () { var listviewInstance = new ej.ListView($("#defaultlistview"), { - enableCheckMark: true, + enableCheckMark: true, width: 400 }); }); @@ -1049,43 +1049,43 @@ module PDFViewerComponent { module PivotChartOlap { $(function () { - var sample = new ej.PivotChart($("#PivotChart"),{ + var sample = new ej.PivotChart($("#PivotChart"), { dataSource: { - data: "http://bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - } - ], - axis: "columns" - } - ], - filters:[] - }, - isResponsive: true,zooming:{enableScrollbar: true}, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, - primaryYAxis: { title: { text: "Internet Sales Amount" } }, - legend: { visible: true, rowCount: 2 }, - load:"loadTheme" + data: "http://bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + } + ], + axis: "columns" + } + ], + filters: [] + }, + isResponsive: true, zooming: { enableScrollbar: true }, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, + primaryYAxis: { title: { text: "Internet Sales Amount" } }, + legend: { visible: true, rowCount: 2 }, }); + sample.model.load = "loadTheme"; }); } @@ -1120,46 +1120,46 @@ var pivot_dataset = [ module PivotChartRelational { $(function () { - var sample = new ej.PivotChart($("#PivotChart"),{ + var sample = new ej.PivotChart($("#PivotChart"), { dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - }, - { - fieldName: "Date", - fieldCaption: "Date" - } - ], - columns: [ - { - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - } - ], - filters:[] - }, - isResponsive: true,zooming:{enableScrollbar: true}, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryYAxis: { title: { text: "Amount" } }, - legend: { visible: true }, - load:"loadTheme" + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + }, + { + fieldName: "Date", + fieldCaption: "Date" + } + ], + columns: [ + { + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + } + ], + filters: [] + }, + isResponsive: true, zooming: { enableScrollbar: true }, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryYAxis: { title: { text: "Amount" } }, + legend: { visible: true }, }); + sample.model.load = "loadTheme"; }); } @@ -1298,128 +1298,128 @@ var pivot_dataset = [ module PivotGaugeRelational { $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"),{ + var sample = new ej.PivotGauge($("#PivotGauge"), { dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - }, - { - fieldName: "State", - } - ], - columns: [ - { - fieldName: "Product", - } - ], + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + }, + { + fieldName: "State", + } + ], + columns: [ + { + fieldName: "Product", + } + ], values: [ - { - fieldName: "Amount", - }, - { - fieldName: "Quantity", - } - ] - }, + { + fieldName: "Amount", + }, + { + fieldName: "Quantity", + } + ] + }, enableTooltip: true, isResponsive: true, labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, - pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 + width: 0.5 }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], + showIndicators: true, showLabels: true, + pointers: [{ + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 + }, + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], ticks: [{ - type: "major", + type: "major", distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, + color: "#8c8c8c" + }], labels: [{ color: "#8c8c8c" - }], - ranges: [{ - distanceFromScale: -5, - backgroundColor: "#fc0606", - border: { color: "#fc0606" } - }, - { - distanceFromScale: -5 }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + ranges: [{ + distanceFromScale: -5, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] }] }); - }); + }); } module PivotGridOlap { $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"),{ + var sample = new ej.PivotGrid($("#PivotGrid"), { dataSource: { - data: "http://bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]", - } - ], - axis: "columns" - } - ], - filters:[] - }, - enableGroupingBar: true, - pivotTableFieldListID:"PivotSchemaDesigner" + data: "http://bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]", + } + ], + axis: "columns" + } + ], + filters: [] + }, + enableGroupingBar: true, + pivotTableFieldListID: "PivotSchemaDesigner" }); $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); @@ -1454,41 +1454,41 @@ var pivot_dataset = [ module PivotGridRelational { $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"),{ + var sample = new ej.PivotGrid($("#PivotGrid"), { dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - } - ], - columns: - [{ - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - }, - { - fieldName: "Quantity", - fieldCaption: "Quantity" - } - ], - filters:[] - }, - enableGroupingBar: true, - pivotTableFieldListID:"PivotSchemaDesigner" + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + } + ], + columns: + [{ + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + }, + { + fieldName: "Quantity", + fieldCaption: "Quantity" + } + ], + filters: [] + }, + enableGroupingBar: true, + pivotTableFieldListID: "PivotSchemaDesigner" }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); } @@ -1655,7 +1655,7 @@ module rangecomponent { }, loaded: function () { var sender = $("#RangeNavigator").data("ejRangeNavigator"); - var theme = window.themeStyle + window.themeColor + window.themeVarient; + var theme = (window).themeStyle + (window).themeColor + (window).themeVarient; if (theme) { switch (theme) { case "flatazurelight": @@ -1747,7 +1747,7 @@ function GetData() { module RatingComponent { $(function () { - var sample1 = new ej.Rating($("#fullRating"),{ + var sample1 = new ej.Rating($("#fullRating"), { value: 4, precision: ej.Rating.Precision.Full, allowReset: true, @@ -1762,8 +1762,8 @@ module RatingComponent { shapeWidth: 25, showTooltip: true }); - - var sample2 = new ej.Rating($("#halfRating"),{ + + var sample2 = new ej.Rating($("#halfRating"), { precision: ej.Rating.Precision.Half, value: 3.5, allowReset: true, @@ -1779,7 +1779,7 @@ module RatingComponent { showTooltip: true }); - var sample3 = new ej.Rating($("#exactRating"),{ + var sample3 = new ej.Rating($("#exactRating"), { precision: ej.Rating.Precision.Exact, value: 3.7, allowReset: true, @@ -1793,7 +1793,7 @@ module RatingComponent { shapeHeight: 25, shapeWidth: 25, showTooltip: true - }); + }); }); } @@ -1822,7 +1822,7 @@ module RibbonComponent { toolTip: "Pin the Ribbon" }, applicationTab: { - type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } + type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } }, tabs: [{ id: "home", text: "HOME", groups: [{ @@ -1846,7 +1846,7 @@ module RibbonComponent { } }] }, - { + { text: "Clipboard", alignType: ej.Ribbon.AlignType.Columns, content: [{ groups: [{ id: "paste", @@ -1868,8 +1868,8 @@ module RibbonComponent { height: 70 } }, - { - groups: [{ + { + groups: [{ id: "cut", text: "Cut", toolTip: "Cut", @@ -1899,14 +1899,14 @@ module RibbonComponent { prefixIcon: "e-icon e-ribbon clearAll" } }], - defaults: { + defaults: { type: "button", width: 60, isBig: false } - }] - }, - { + }] + }, + { text: "Font", alignType: "rows", content: [{ groups: [{ id: "fontfamily", @@ -2205,7 +2205,7 @@ module RibbonComponent { groups: [{ id: "zoomin", text: "Zoom In", - toolTip: "Zoom In", + toolTip: "Zoom In", buttonSettings: { width: 58, click: "onClick", @@ -2217,7 +2217,7 @@ module RibbonComponent { { id: "zoomout", text: "Zoom Out", - toolTip: "Zoom Out", + toolTip: "Zoom Out", buttonSettings: { width: 70, click: "onClick", @@ -2229,7 +2229,7 @@ module RibbonComponent { { id: "fullscreen", text: "Full Screen", - toolTip: "Full Screen", + toolTip: "Full Screen", buttonSettings: { width: 73, click: "onClick", @@ -2245,7 +2245,7 @@ module RibbonComponent { } }] }] - },{ + }, { id: "insert", text: "INSERT", groups: [{ text: "Tables", alignType: ej.Ribbon.AlignType.Columns, content: [{ groups: [{ @@ -2390,7 +2390,7 @@ module RibbonComponent { } ], defaults: { - type: "button", + type: "button", width: 70, height: 70 } @@ -2472,8 +2472,8 @@ module RibbonComponent { } ] } - ], - create: function createControl(args) { + ], + create: function createControl(args: any) { var ribbon = $("#defaultRibbon").data("ejRibbon"); $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); $("#fillcolor").ejColorPicker({ value: "#FF0000", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fillcoloricon", select: colorHandler }); @@ -2658,7 +2658,7 @@ module ScheduleComponent { } }); }); -} +} module ScrollerComponent { $(function () { @@ -2828,7 +2828,6 @@ module piesparkline4 { }); } - module SplitterComponent { @@ -2846,6 +2845,7 @@ module SplitterComponent { }); } + module SpreadsheetComponent { $(function () { var sample = new ej.Spreadsheet($("#basicSpreadsheet"), { @@ -2861,7 +2861,7 @@ $(function () { pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" }, sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete: () => { + loadComplete:() => { var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; if (!(spreadsheet).isImport) { spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); @@ -2882,13 +2882,13 @@ var default_data: Array = [ { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 70 }, { Category : "Employees", Country : "USA", JobDescription : "Management", EmployeesCount : 40 }, { Category : "Employees", Country : "USA", JobDescription : "Accounts", EmployeesCount : 60 }, - + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 43 }, { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 125}, { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 60 }, { Category : "Employees", Country : "India", JobDescription : "HR Executives", EmployeesCount : 70 }, { Category : "Employees", Country : "India", JobDescription : "Accounts", EmployeesCount : 45 }, - + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Executive", EmployeesCount : 30 }, { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, { Category : "Employees", Country : "Germany", JobDescription : "Marketing", EmployeesCount : 50 }, @@ -2897,7 +2897,7 @@ var default_data: Array = [ { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, { Category : "Employees", Country : "Germany", JobDescription : "Management", EmployeesCount : 33 }, { Category : "Employees", Country : "Germany", JobDescription : "Accounts", EmployeesCount : 55 }, - + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 45 }, { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 96 }, { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, @@ -2913,22 +2913,22 @@ var default_data: Array = [ module sunburstcomponent { $(function () { var sunburstsample = new ej.SunburstChart($("#Sunburst"), { - valueMemberPath: "EmployeesCount", + valueMemberPath: "EmployeesCount", levels: [ - {groupMemberPath: "Country"}, - {groupMemberPath: "JobDescription"}, - {groupMemberPath: "JobGroup"}, - {groupMemberPath: "JobRole"} + { groupMemberPath: "Country" }, + { groupMemberPath: "JobDescription" }, + { groupMemberPath: "JobGroup" }, + { groupMemberPath: "JobRole" } ], dataSource: default_data, - dataLabelSettings:{visible:true}, - tooltip:{visible:false}, - enableAnimation:false, - size:{height:"600"}, - innerRadius:0.2, + dataLabelSettings: { visible: true }, + tooltip: { visible: false }, + enableAnimation: false, + size: { height: "600" }, + innerRadius: 0.2, load: function () { var sender = $("#Sunburst").data("ejSunburstChart"); - var SunBurstTheme = window.themeStyle + window.themeColor + window.themeVarient; + var SunBurstTheme = (window).themeStyle + (window).themeColor + (window).themeVarient; SunBurstTheme = SunBurstTheme.toString(); if (SunBurstTheme.indexOf("dark") > -1 || SunBurstTheme.indexOf("contrast") > -1) SunBurstTheme = "flatdark"; @@ -2936,11 +2936,11 @@ module sunburstcomponent { SunBurstTheme = "flatlight"; sender.model.theme = SunBurstTheme; }, - title:{text:"Employees Count"}, - zoomSettings:{enable:false}, - legend:{visible:true,position:'top'}, - load:"loadTheme" + title: { text: "Employees Count" }, + zoomSettings: { enable: false }, + legend: { visible: true, position: 'top' }, }); + sunburstsample.model.load = "loadTheme"; }); } @@ -3051,27 +3051,27 @@ module TileViewComponent { tileSize:"small", imageUrl:'content/images/tile/windows/camera.png', }); - var tile5 = new ej.Tile($("#tile5"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/messages.png', + var tile5 = new ej.Tile($("#tile5"), { + imagePosition: "center", + tileSize: "small", + imageUrl: 'content/images/tile/windows/messages.png', }); - var tile6 = new ej.Tile($("#tile6"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/games.png', - caption:{text:"Play"} + var tile6 = new ej.Tile($("#tile6"), { + imagePosition: "center", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/games.png', + caption: { text: "Play" } }); - var tile7 = new ej.Tile($("#tile7"), { - tileSize:"medium", - imageUrl:'content/images/tile/windows/map.png', - caption:{text:"Maps"} + var tile7 = new ej.Tile($("#tile7"), { + tileSize: "medium", + imageUrl: 'content/images/tile/windows/map.png', + caption: { text: "Maps" } }); - var tile8 = new ej.Tile($("#tile8"), { - imagePosition:"fill", - tileSize:"wide", - imageUrl:'content/images/tile/windows/sports.png', - caption:{text:"Sports"} + var tile8 = new ej.Tile($("#tile8"), { + imagePosition: "fill", + tileSize: "wide", + imageUrl: 'content/images/tile/windows/sports.png', + caption: { text: "Sports" } }); var tile9 = new ej.Tile($("#tile9"), { imagePosition:"fill", @@ -3114,13 +3114,13 @@ module TimePickerComponent { } module ToolbarComponent { - + $(function () { - var sample = new ej.Toolbar($("#editingToolbar"),{ + var sample = new ej.Toolbar($("#editingToolbar"), { width: "100%", cssClass: "gradient-lime", enableSeparator: true, - + isResponsive: true, orientation: ej.Orientation.Horizontal, showRoundedCorner: true @@ -3130,10 +3130,10 @@ module ToolbarComponent { } module TooltipComponent { - + $(function () { - var sample1 = new ej.Tooltip($("#link1"),{ + var sample1 = new ej.Tooltip($("#link1"), { content: "ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262.", associate: "mousefollow", autoCloseTimeout: 5000, @@ -3143,7 +3143,7 @@ module TooltipComponent { showShadow: true }); - var sample2 = new ej.Tooltip($("#link2"),{ + var sample2 = new ej.Tooltip($("#link2"), { content: "The World Wide Web (WWW) is an information space where documents and other web resources are identified by URLs, interlinked by hypertext links, and can be accessed via the Internet.", position: { stem: { @@ -3162,7 +3162,7 @@ module TooltipComponent { showShadow: true }); - var sample3 = new ej.Tooltip($("#link3"),{ + var sample3 = new ej.Tooltip($("#link3"), { content: 'Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic.', position: { stem: { @@ -3223,7 +3223,7 @@ module TreeGridComponent { isResponsive: true, }); }); -} +} var population_data: Array = [ @@ -3264,7 +3264,7 @@ module treemapcomponent { }); } - + module TreeViewComponent { $(function () { @@ -3278,9 +3278,9 @@ module TreeViewComponent { } module UploadboxComponent { - + $(function () { - var sample = new ej.Uploadbox($("#UploadDefault"),{ + var sample = new ej.Uploadbox($("#UploadDefault"), { saveUrl: (window).baseurl + "api/uploadbox/Save", removeUrl: (window).baseurl + "api/uploadbox/Remove", buttonText: { From d6911fcd631a18f20094de3d70c658fe1c61aca6 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Tue, 16 Jan 2018 16:27:23 +0530 Subject: [PATCH 022/496] Lint Error resolved. --- types/ej.web.all/ej.web.all-tests.ts | 148 +++++++++++++-------------- 1 file changed, 73 insertions(+), 75 deletions(-) diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index d2d711fbed..cf656fc20b 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -180,12 +180,12 @@ module ChartComponent { range: { min: 25, max: 50, interval: 5 }, labelFormat: "{value}%", title: { text: "Efficiency" }, - + }, commonSeriesOptions: - { + { type: 'line', enableAnimation: true, - tooltip:{ visible :true, template:'Tooltip'}, + tooltip: { visible: true, template: 'Tooltip' }, marker: { shape: 'circle', @@ -195,30 +195,30 @@ module ChartComponent { }, visible: true }, - border : {width: 2} - }, - series: - [ - { - points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, - { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], - name: 'India' - }, + border: { width: 2 } + }, + series: + [ { - points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, - { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], - name: 'Germany' + points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 }, { x: 2007, y: 26 }, { x: 2008, y: 27 }, + { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], + name: 'India' }, - { - points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, - { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], - name: 'England' - }, { - points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, - { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], - name: 'France' - } + points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 }, { x: 2007, y: 30 }, { x: 2008, y: 36 }, + { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], + name: 'Germany' + }, + { + points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 }, { x: 2007, y: 34 }, { x: 2008, y: 41 }, + { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], + name: 'England' + }, + { + points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 }, { x: 2007, y: 40 }, { x: 2008, y: 44 }, + { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], + name: 'France' + } ], isResponsive: true, load: function () { @@ -283,14 +283,13 @@ module ChartComponent { theme = "flatlight"; break; } - sender.model.theme = theme; + sender.model.theme = theme; } }, title: { text: 'Efficiency of oil-fired power production' }, size: { height: "600" }, - legend: { visible: true}, + legend: { visible: true }, }); - chartsample.model.load="loadTheme"; }); } @@ -340,7 +339,7 @@ module circulargaugecomponent { backgroundColor: "#f5b43f", border: { color: "#f5b43f" } }] - }] + }] }); }); } @@ -353,21 +352,21 @@ module ColorPickerComponent { }); } -module ComboBoxComponent{ +module ComboBoxComponent { var BikeList = [ { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } ]; - $(function () { - var comboboxInstance =new ej.ComboBox($("#selectCar"), { + $(function () { + var comboboxInstance = new ej.ComboBox($("#selectCar"), { width: "100%", placeholder: "Select a Bike", - fields: { text: "text", value: "empid" }, + fields: { text: "text", value: "empid" }, dataSource: BikeList, autofill: true - }); + }); }); } @@ -428,7 +427,8 @@ $(function () { }), createNode({ name: "Project", width: 150, height: 100, offsetX: 300, offsetY: 430, labels: [createLabel({ "text": "Find Project \nmanager" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision }), createNode({ - name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), + name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process + }), createNode({ name: "Decision", width: 250, height: 60, offsetX: 550, offsetY: 60, labels: [createLabel({ "text": "Decision Process for new software ideas" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Card, fillColor: "#858585", borderColor: "#858585" }), createNode({ name: "Reject", width: 150, height: 60, offsetX: 550, offsetY: 285, labels: [createLabel({ "text": "Reject and write report" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), createNode({ name: "Resources", width: 150, height: 60, offsetX: 550, offsetY: 430, labels: [createLabel({ "text": "Hire new resources" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }) @@ -442,7 +442,7 @@ $(function () { createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) ] }); - + }); function createNode(option: ej.datavisualization.Diagram.Node) { @@ -513,7 +513,7 @@ module digitalgaugecomponent { } - + module DropDownListComponent { var BikeList = [ { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, @@ -530,12 +530,12 @@ module DropDownListComponent { enableFilterSearch: true, caseSensitiveSearch: true, enableIncrementalSearch: true, - enablePopupResize: true, + enablePopupResize: true, delimiterChar: ";", multiSelectMode: ej.MultiSelectMode.Delimiter, maxPopupHeight: "300px", - minPopupHeight: "150px", - maxPopupWidth: "500px", + minPopupHeight: "150px", + maxPopupWidth: "500px", minPopupWidth: "350px", showCheckbox: true, showRoundedCorner: true @@ -1085,7 +1085,6 @@ module PivotChartOlap { primaryYAxis: { title: { text: "Internet Sales Amount" } }, legend: { visible: true, rowCount: 2 }, }); - sample.model.load = "loadTheme"; }); } @@ -1159,7 +1158,6 @@ module PivotChartRelational { primaryYAxis: { title: { text: "Amount" } }, legend: { visible: true }, }); - sample.model.load = "loadTheme"; }); } @@ -1218,15 +1216,15 @@ module PivotGaugeOlap { length: 120, width: 7 }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], ticks: [{ type: "major", distanceFromScale: 2, @@ -1247,7 +1245,7 @@ module PivotGaugeOlap { distanceFromScale: -5, backgroundColor: "#fc0606", border: { color: "#fc0606" } - }, + }, { distanceFromScale: -5 }], @@ -1265,7 +1263,7 @@ module PivotGaugeOlap { }] }] }); - }); + }); } @@ -2484,7 +2482,7 @@ module RibbonComponent { function colorHandler(args:any) { (this._id.indexOf("fillcolor") != -1) ? $("#contenteditor").css('background-color', args.value) : document.execCommand('forecolor', false, args.value); } -function onClick(args) { +function onClick(args: any) { var val, prop = args.text; val = (ej.isNullOrUndefined(args.model.text)) ? args.model.activeText : args.model.text; if (action1.indexOf(val) != -1) @@ -2861,14 +2859,15 @@ $(function () { pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" }, sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete:() => { - var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; - if (!(spreadsheet).isImport) { - spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); - xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); - xlFormat.format({ "type": "currency" }, "E2:H11"); - spreadsheet.XLRibbon.updateRibbonIcons(); - }} + loadComplete: () => { + var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; + if (!(spreadsheet).isImport) { + spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); + xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); + xlFormat.format({ "type": "currency" }, "E2:H11"); + spreadsheet.XLRibbon.updateRibbonIcons(); + } + } }); }); } @@ -2903,7 +2902,7 @@ var default_data: Array = [ { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, { Category : "Employees", Country : "UK", JobDescription : "HR Executives", EmployeesCount : 60 }, { Category : "Employees", Country : "UK", JobDescription: "Accounts", EmployeesCount: 30 }, - + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, @@ -2940,7 +2939,6 @@ module sunburstcomponent { zoomSettings: { enable: false }, legend: { visible: true, position: 'top' }, }); - sunburstsample.model.load = "loadTheme"; }); } @@ -3036,20 +3034,20 @@ module TileViewComponent { tileSize:"medium", imageUrl:'content/images/tile/windows/people_1.png' }); - var tile2 = new ej.Tile($("#tile2"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/alerts.png', - + var tile2 = new ej.Tile($("#tile2"), { + imagePosition: "center", + tileSize: "small", + imageUrl: 'content/images/tile/windows/alerts.png', + }); - var tile3 = new ej.Tile($("#tile3"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/bing.png', + var tile3 = new ej.Tile($("#tile3"), { + imagePosition: "center", + tileSize: "small", + imageUrl: 'content/images/tile/windows/bing.png', }); - var tile4 = new ej.Tile($("#tile4"), { - tileSize:"small", - imageUrl:'content/images/tile/windows/camera.png', + var tile4 = new ej.Tile($("#tile4"), { + tileSize: "small", + imageUrl: 'content/images/tile/windows/camera.png', }); var tile5 = new ej.Tile($("#tile5"), { imagePosition: "center", From c27b6a3a26d1a72d579d07b35c603c61655f4edf Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Tue, 16 Jan 2018 16:40:29 +0530 Subject: [PATCH 023/496] Lint Error Resolved --- types/ej.web.all/ej.web.all-tests.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index cf656fc20b..9ccc1ca9f9 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -2956,8 +2956,6 @@ module TabComponent { } module TagCloudComponent { - - var websiteCollection = [ { text: "Google", url: "http://www.google.com", frequency: 12 }, { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, @@ -2988,7 +2986,6 @@ module TagCloudComponent { text: "text", url: "url", frequency: "frequency" } }); - }); } From 38d5845a1e870110a612d642879b8177b482013b Mon Sep 17 00:00:00 2001 From: foxmicha Date: Tue, 16 Jan 2018 09:32:07 -0500 Subject: [PATCH 024/496] Update React-Native Modal prop typings Please fill in this template. - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). Select one of these and delete the others: If changing an existing definition: - [x] Provide a URL to documentation or source code which provides context for the suggested changes: https://github.com/facebook/react-native/blob/master/Libraries/Modal/Modal.js#L161 Additional info: Just like the onShow optional prop, the Modal's onOrientationChange prop can capture a NativeSyntheticEvent at the time of the hardware change. This allows the developer to determine if the orientation change was to the landscape or portrait style and react accordingly. --- types/react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 7368241a9e..86cd2c59f4 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -4363,7 +4363,7 @@ export interface ModalProperties { * The orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render, regardless of the current orientation. * @platform ios */ - onOrientationChange?: () => void; + onOrientationChange?: (event?: NativeSyntheticEvent) => void; /** * The `onDismiss` prop allows passing a function that will be called once the modal has been dismissed. * @platform ios From 534e06cf2df2d7da00fea92e91bb54b385ca3691 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 16 Jan 2018 07:32:55 -0800 Subject: [PATCH 025/496] xterm: Provides its own types (#22869) --- notNeededPackages.json | 6 ++ types/xterm/index.d.ts | 96 --------------------------- types/xterm/tsconfig.json | 24 ------- types/xterm/tslint.json | 79 ----------------------- types/xterm/xterm-tests.ts | 129 ------------------------------------- 5 files changed, 6 insertions(+), 328 deletions(-) delete mode 100644 types/xterm/index.d.ts delete mode 100644 types/xterm/tsconfig.json delete mode 100644 types/xterm/tslint.json delete mode 100644 types/xterm/xterm-tests.ts diff --git a/notNeededPackages.json b/notNeededPackages.json index 8f3270392f..b193a7fa83 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1530,6 +1530,12 @@ "sourceRepoURL": "github.com/node-xmpp/node-xmpp/", "asOfVersion": "1.2.0" }, + { + "libraryName": "xterm.js", + "typingsPackageName": "xterm", + "sourceRepoURL": "https://github.com/sourcelair/xterm.js/", + "asOfVersion": "3.0.0" + }, { "libraryName": "zetapush-js", "typingsPackageName": "zetapush-js", diff --git a/types/xterm/index.d.ts b/types/xterm/index.d.ts deleted file mode 100644 index 37bc104747..0000000000 --- a/types/xterm/index.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -// Type definitions for xterm.js 2.0.1 -// Project: https://github.com/sourcelair/xterm.js/ -// Definitions by: Steven Silvester -// Lucian Buzzo -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** - * Typing for an xterm terminal object. - */ -interface Xterm { - - cols: number; - - rows: number; - - options: Xterm.IOptions; - - element: HTMLElement; - - textarea: HTMLElement; - - attachCustomKeydownHandler(callback: (event: KeyboardEvent) => boolean): void; - - blur(): void; - - clear(): void; - - destroy(): void; - - focus(): void; - - getOption(key: string): any; - - on(event: string, callback: (...args: any[]) => void): void; - - off(event: string, callback: (...args: any[]) => void): void; - - open(parent: HTMLElement, focus?: boolean): void; - - refresh(start: number, end: number, queue?: boolean): void; - - reset(): void; - - resize(x: number, y: number): void; - - scrollDisp(n: number): void; - - setOption(key: string, value: any): void; - - write(text: string): void; - - writeln(text: string): void; - - fit?(): void; -} - - -interface XtermConstructor { - new (options?: Xterm.IOptions): Xterm; - (options?: Xterm.IOptions): Xterm; -} - - -/** - * A terminal options. - */ -declare namespace Xterm { - interface IOptions { - colors?: string[]; - - theme?: string; - - convertEol?: boolean; - - termName?: string; - - geometry?: number[]; - - cursorBlink?: boolean; - - visualBell?: boolean; - - popOnBell?: boolean; - - scrollback?: number; - - debug?: boolean; - - cancelEvents?: boolean; - } -} - - -declare var Xterm: XtermConstructor; -export = Xterm; -export as namespace Xterm; diff --git a/types/xterm/tsconfig.json b/types/xterm/tsconfig.json deleted file mode 100644 index 3d75f99636..0000000000 --- a/types/xterm/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "xterm-tests.ts" - ] -} \ No newline at end of file diff --git a/types/xterm/tslint.json b/types/xterm/tslint.json deleted file mode 100644 index a41bf5d19a..0000000000 --- a/types/xterm/tslint.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} diff --git a/types/xterm/xterm-tests.ts b/types/xterm/xterm-tests.ts deleted file mode 100644 index 238cbcc8be..0000000000 --- a/types/xterm/xterm-tests.ts +++ /dev/null @@ -1,129 +0,0 @@ -import * as Terminal from 'xterm'; - -declare var fetch: any; - -var term: Terminal, - protocol: any, - socketURL: string, - socket: WebSocket, - pid: number, - charWidth: number, - charHeight: number; - -var terminalContainer = document.getElementById('terminal-container'), - optionElements = { - cursorBlink: document.querySelector('#option-cursor-blink') - }, - colsElement = document.getElementById('cols') as any, - rowsElement = document.getElementById('rows') as any; - -function setTerminalSize () { - var cols = parseInt(colsElement.value), - rows = parseInt(rowsElement.value), - width = (cols * charWidth).toString() + 'px', - height = (rows * charHeight).toString() + 'px'; - - terminalContainer.style.width = width; - terminalContainer.style.height = height; - term.resize(cols, rows); -} - -colsElement.addEventListener('change', setTerminalSize); -rowsElement.addEventListener('change', setTerminalSize); - -optionElements.cursorBlink.addEventListener('change', createTerminal); - -createTerminal(); - -function createTerminal() { - // Clean terminal - while (terminalContainer.children.length) { - terminalContainer.removeChild(terminalContainer.children[0]); - } - term = new Terminal({ - cursorBlink: (optionElements.cursorBlink as any).checked - }); - term.on('resize', function (size: any) { - if (!pid) { - return; - } - var cols = size.cols, - rows = size.rows, - url = '/terminals/' + pid + '/size?cols=' + cols + '&rows=' + rows; - - fetch(url, {method: 'POST'}); - }); - protocol = (location.protocol === 'https:') ? 'wss://' : 'ws://'; - socketURL = protocol + location.hostname + ((location.port) ? (':' + location.port) : '') + '/terminals/'; - - term.open(terminalContainer); - // term.fit(); - - var cols = 20, - rows = 30; - - colsElement.value = cols; - rowsElement.value = rows; - - fetch('/terminals?cols=' + cols + '&rows=' + rows, {method: 'POST'}).then(function (res: any) { - - charWidth = Math.ceil(term.element.offsetWidth / cols); - charHeight = Math.ceil(term.element.offsetHeight / rows); - - res.text().then(function (pid: number) { - (window as any).pid = pid; - socketURL += pid; - socket = new WebSocket(socketURL); - socket.onopen = runRealTerminal; - socket.onclose = runFakeTerminal; - socket.onerror = runFakeTerminal; - }); - }); -} - - -function runRealTerminal() { - //term.attach(socket); - //term._initialized = true; -} - -function runFakeTerminal() { - // if (term._initialized) { - // return; - // } - - // term._initialized = true; - - var shellprompt = '$ '; - - // term.prompt = function () { - // term.write('\r\n' + shellprompt); - // }; - - term.writeln('Welcome to xterm.js'); - term.writeln('This is a local terminal emulation, without a real terminal in the back-end.'); - term.writeln('Type some keys and commands to play around.'); - term.writeln(''); - // term.prompt(); - - term.on('key', function (key, ev) { - var printable = ( - !ev.altKey && !ev.altGraphKey && !ev.ctrlKey && !ev.metaKey - ); - - if (ev.keyCode == 13) { - // term.prompt(); - } else if (ev.keyCode == 8) { - // Do not delete the prompt - // if (term.x > 2) { - // term.write('\b \b'); - // } - } else if (printable) { - term.write(key); - } - }); - - term.on('paste', function (data, ev) { - term.write(data); - }); -} From da70da196d612d94d8aab226a6bce40e6622b383 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 16 Jan 2018 07:51:02 -0800 Subject: [PATCH 026/496] node-waves: Provides its own types (#22866) --- notNeededPackages.json | 6 +++ types/node-waves/index.d.ts | 66 ---------------------------- types/node-waves/node-waves-tests.ts | 9 ---- types/node-waves/tsconfig.json | 24 ---------- types/node-waves/tslint.json | 1 - 5 files changed, 6 insertions(+), 100 deletions(-) delete mode 100644 types/node-waves/index.d.ts delete mode 100644 types/node-waves/node-waves-tests.ts delete mode 100644 types/node-waves/tsconfig.json delete mode 100644 types/node-waves/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index b193a7fa83..87fa95e11c 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -912,6 +912,12 @@ "sourceRepoURL": "https://github.com/theoephraim/node-pg-migrate#readme", "asOfVersion": "2.15.0" }, + { + "libraryName": "node-waves", + "typingsPackageName": "node-waves", + "sourceRepoURL": "http://fian.my.id/Waves", + "asOfVersion": "0.7.6" + }, { "libraryName": "Normalizr", "typingsPackageName": "normalizr", diff --git a/types/node-waves/index.d.ts b/types/node-waves/index.d.ts deleted file mode 100644 index fd2cb4937c..0000000000 --- a/types/node-waves/index.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Type definitions for node-waves 0.7 -// Project: http://fian.my.id/Waves -// Definitions by: Stephen Lautier -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export type ElementTarget = string | Element | Element[]; - -export interface WavesConfig { - /** - * Determines how long the waves effect duration (in milliseconds). - * - */ - duration?: number; - - /** - * Delay amount to show waves effect on touch and hide the effect if user scrolls. - * Set to 0 to disable delay (in milliseconds). - * - */ - delay?: number; -} - -export interface RippleOptions { - /** - * Specify how long to wait between starting and stopping the ripple. - * - */ - wait?: number | null; - - /** - * Specify the position inside the element. - * - */ - position?: { - x: number; - y: number; - } | null; -} - -/** - * Initializes waves with an optional config. - */ -export function init(config?: WavesConfig): void; - -/** - * Attach ripple effect by adding `.waves-effect` to HTML element. - * Make sure you call `init` to activate the ripple. - * - * @param elements elements to target. - * @param classes classes to add. - */ -export function attach(elements: ElementTarget, classes?: string | string[]): void; - -/** - * Creates a ripple effect in HTML element programmatically. - * @param elements elements to target (must have `.waves-effect` already applied, ideally via `attach`). - * @param options specify how long to wait between starting and stopping the ripple, and it's position inside the element. - */ -export function ripple(elements: ElementTarget, options?: RippleOptions): void; - -/** - * Removes all ripples from inside an element immediately. - * - * @param elements elements to remove ripples from. - */ -export function calm(elements: ElementTarget): void; diff --git a/types/node-waves/node-waves-tests.ts b/types/node-waves/node-waves-tests.ts deleted file mode 100644 index b9eac6682e..0000000000 --- a/types/node-waves/node-waves-tests.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { init, ripple, attach, calm } from "node-waves"; - -init({ delay: 300 }); - -attach("button", "waves-light"); - -ripple(".box", { wait: null }); - -calm(".box"); diff --git a/types/node-waves/tsconfig.json b/types/node-waves/tsconfig.json deleted file mode 100644 index 06ed81e135..0000000000 --- a/types/node-waves/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "node-waves-tests.ts" - ] -} \ No newline at end of file diff --git a/types/node-waves/tslint.json b/types/node-waves/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/node-waves/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } From f261270cfc1f40d902dab43b0447a78ca8e99ce6 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 16 Jan 2018 08:28:37 -0800 Subject: [PATCH 027/496] linq4js: Provides its own types (#22864) --- notNeededPackages.json | 6 + types/linq4js/index.d.ts | 308 --------------------------------- types/linq4js/linq4js-tests.ts | 13 -- types/linq4js/tsconfig.json | 24 --- types/linq4js/tslint.json | 9 - 5 files changed, 6 insertions(+), 354 deletions(-) delete mode 100644 types/linq4js/index.d.ts delete mode 100644 types/linq4js/linq4js-tests.ts delete mode 100644 types/linq4js/tsconfig.json delete mode 100644 types/linq4js/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 87fa95e11c..40f80ddba1 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -798,6 +798,12 @@ "sourceRepoURL": "https://linqjs.codeplex.com/", "asOfVersion": "2.2.33" }, + { + "libraryName": "Linq4JS", + "typingsPackageName": "linq4js", + "sourceRepoURL": "https://github.com/morrisjdev/Linq4JS", + "asOfVersion": "2.1.8" + }, { "libraryName": "LinqSharp", "typingsPackageName": "linqsharp", diff --git a/types/linq4js/index.d.ts b/types/linq4js/index.d.ts deleted file mode 100644 index 8721040314..0000000000 --- a/types/linq4js/index.d.ts +++ /dev/null @@ -1,308 +0,0 @@ -// Type definitions for Linq4JS 2.1 -// Project: https://github.com/morrisjdev/Linq4JS -// Definitions by: Morris Janatzek -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface Array { - Order: Linq4JS.OrderEntry[]; - GroupValue: any; - /** - * Executes actions defined in the command-string - * @param command The command-string for execution - */ - Evaluate(command: string): any; - /** - * Creates a copy of the array - */ - Clone(): T[]; - /** - * Gets the index of the first item found by a filter - * @param filter A function (or function-string) that returns a boolean when matching element was found - */ - FindIndex(filter: ((item: T) => boolean) | string): number; - /** - * Gets the index of the last item found by a filter - * @param filter A function (or function-string) that returns a boolean when matching element was found - */ - FindLastIndex(filter: ((item: T) => boolean) | string): number; - /** - * Gets the item with the index - * @param index Item index - */ - Get(index: number): T; - /** - * Executes a method for each item in the array - * @param action A function (or function-string) that gets executed for each element. If it returns false the loop stops. - */ - ForEach(action: ((item: T, index?: number) => boolean | any) | string): T[]; - /** - * Updates an object in the array - * @param object The object to update - * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array - */ - Update(object: T, primaryKeySelector?: ((item: T) => any) | string): T[]; - /** - * Updates objects in the array - * @param objects The array of objects to update - * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array - */ - UpdateRange(objects: T[], primaryKeySelector?: ((item: T) => any) | string): T[]; - /** - * Removes an object from the array - * @param object The object to remove - * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array - */ - Remove(object: T, primaryKeySelector?: ((item: T) => any) | string): T[]; - /** - * Removes objects from the array - * @param objects The array of objects to remove - * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array - */ - RemoveRange(objects: T[], primaryKeySelector?: ((item: T) => any) | string): T[]; - /** - * Adds an object to the array - * @param object The object to add - * @param generateId Auto-generate a property to identify object in later processes - */ - Add(object: T, generateId?: boolean): T[]; - /** - * Adds objects to the array - * @param objects The array of objects to add - */ - AddRange(objects: T[], generateId?: boolean): T[]; - /** - * Inserts an entry at a specific position - * @param object The object to insert - * @param index The position to insert - */ - Insert(object: T, index: number): T[]; - /** - * Searches for all items in array that match the given filter - * @param filter A function (or function-string) that returns a boolean when matching element was found - */ - Where(filter: ((item: T, index?: number) => boolean) | string): T[]; - /** - * Takes items in a specific range - * @param start The start position - * @param length The number of elements to take - */ - Range(start: number, length: number): T[]; - /** - * Repeats an object in the array - * @param object The object to repeat - * @param count The count of repeats - */ - Repeat(object: T, count: number): T[]; - /** - * Returns the length of the array - * @param filter If set the function returns count of elements matched by the condition - */ - Count(filter?: ((item: T) => boolean) | string): number; - /** - * Tests if all items in the array match the condition - * @param filter A function (or function-string) that returns a boolean when matching element was found - */ - All(filter: ((item: T) => boolean) | string): boolean; - /** - * Tests if any item is in the array - * @param filter If set the function tests if any item in the array matches the condition - */ - Any(filter?: ((item: T) => boolean) | string): boolean; - /** - * Returns the first item of the array - Throws an exception if no item was found - * @param filter If set the function returns the first item that matches the filter - */ - First(filter?: ((item: T) => boolean) | string): T; - /** - * Returns the first item of the array - returns `null` if no suitable item was found - * @param filter If set the function returns the first item that matches the filter - */ - FirstOrDefault(filter?: ((item: T) => boolean) | string): (T | null); - /** - * Returns the last item of the array - Throws an exception if no item was found - * @param filter If set the function returns the last item that matches the filter - */ - Last(filter?: ((item: T) => boolean) | string): T; - /** - * Returns the last item of the array - returns `null` if no suitable item was found - * @param filter If set the function returns the last item that matches the filter - */ - LastOrDefault(filter?: ((item: T) => boolean) | string): (T | null); - /** - * Select the properties for a new array - * @param selector A function (or a function-string) that returns a new object - */ - Select(selector: ((item: T) => any) | string): any[]; - /** - * Limits the number of entries taken - * @param count The count of elements taken - */ - Take(count: number): T[]; - /** - * Takes entries as long as a condition is true - * @param condition The condition-function (or function-string) that returns a boolean. All elements until a false gets thrown are taken - * @param initial A initial-function (or function-string) that gets executed once at the start of the loop - * @param after A function that gets executed after every element-iteration after the condition-function was evaluated - */ - TakeWhile(condition: ((item: T, storage?: any) => boolean) | string, initial?: ((storage: any) => void) | string, after?: ((item: T, storage: any) => void) | string): T[]; - /** - * Skips entries - * @param count The count of elements skipped - */ - Skip(count: number): T[]; - /** - * Orders array by property or value in ascending direction - * @param valueSelector The selector-function (or function-string) that selects the property for sorting - */ - OrderBy(valueSelector: ((item: T) => any) | string): T[]; - /** - * Orders array by additional properties in ascending direction in combination with OrderBy/OrderByDescending - * @param valueSelector The selector-function (or function-string) that selects the property for sorting - */ - ThenBy(valueSelector: ((item: T) => any) | string): T[]; - /** - * Orders array by property or value in descending direction - * @param valueSelector The selector-function (or function-string) that selects the property for sorting - */ - OrderByDescending(valueSelector: ((item: T) => any) | string): T[]; - /** - * Orders array by additional properties in descending direction in combination with OrderBy/OrderByDescending - * @param valueSelector The selector-function (or function-string) that selects the property for sorting - */ - ThenByDescending(valueSelector: ((item: T) => any) | string): T[]; - /** - * Returns the smallest element in array - * @param valueSelector The selector-function (or function-string) that selects the property for comparison - */ - Min(valueSelector?: ((item: T) => any) | string): (T | null); - /** - * Returns the greates element in array - * @param valueSelector The selector-function (or function-string) that selects the property for comparison - */ - Max(valueSelector?: ((item: T) => any) | string): (T | null); - /** - * Groups array by property - * @param selector The selector-function (or function-string) that selects the property for grouping - */ - GroupBy(selector: ((item: T) => any) | string): T[][]; - /** - * Moves an item from one index to another - * @param oldIndex The current position of the item - * @param newIndex The new position of the item - */ - Move(oldIndex: number, newIndex: number): T[]; - /** - * Makes all values unique - * @param valueSelector A selector-function (or function-string) to select property for comparison and distinction - */ - Distinct(valueSelector?: ((item: T) => any) | string): T[]; - /** - * Tests if array contains specific object - * @param object The object to test for - */ - Contains(object: T): boolean; - /** - * Combines two arrays - * @param array The array to combine - */ - Concat(array: T[]): T[]; - /** - * Combines two arrays but only applies values that are in both arrays - * @param array The array to combine - */ - Intersect(array: T[]): T[]; - /** - * Joins the entries by a given char - * @param character The character for joining - * @param selector A selector-function (or function-string) to select property for joining - */ - Join(character: string, selector?: ((item: T) => any) | string): string; - /** - * Combines the entries using a custom function - * @param method A function (or function-string) for aggregation - * @param startVal The value to start aggregation - */ - Aggregate(method: ((result: any, item: T) => any) | string, startVal?: any): string; - /** - * Reverses the array - */ - Reverse(): T[]; - /** - * Computes the average of the elements - * @param selector A selector-function (or function-string) to select property for average computing - * @param filter If set the function computes the average of elements that match the filter - */ - Average(selector?: ((item: T) => any) | string, filter?: ((item: T) => boolean) | string): number; - /** - * Computes the sum of the elements - * @param selector A selector-function (or function-string) to select property for adding - * @param filter If set the function computes the sum of elements that match the filter - */ - Sum(selector?: ((item: T) => any) | string, filter?: ((item: T) => boolean) | string): number; - /** - * Compares to sequences of objects - * @param array The array to compare - */ - SequenceEqual(array: T[]): boolean; - /** - * Combines the entries of two arrays using a custom function - * @param array The array to combine - * @param result The function (or function-string) to combine elements - */ - Zip(array: X[], result: ((first: T, second: X) => any) | string): any[]; - /** - * Combines two arrays without duplicates - * @param array The array to combine - */ - Union(array: T[]): T[]; - /** - * Converts the array to a dictionary - * @param keySelector The selector-function (or function-string) to select property for key - * @param valueSelector A selector-function (or function-string) to select property for value - */ - ToDictionary(keySelector: ((item: T) => any) | string, valueSelector?: ((item: T) => any) | string): any; -} - -declare namespace Linq4JS { - class GeneratedEntity { - _GeneratedId_: number; - Id: number; - } - - class EvaluateCommand { - Command: string; - SplitRegex: RegExp[]; - Finder: RegExp[]; - constructor(command: string, ...identifier: string[]); - } - class EvaluateCommandResult { - Command: string; - DynamicFunction: string; - constructor(cmd: string, fn: string); - } - - class Helper { - private static ConvertStringFunction(functionString, noAutoReturn?, noBracketReplace?); - static ConvertFunction(testFunction: string | T, noAutoReturn?: boolean, noBracketReplace?: boolean): T; - static OrderCompareFunction(valueSelector: (item: T) => any, a: T, b: T, invert: boolean): number; - static SplitCommand(command: string): string[]; - static MatchCommand(cmd: string): EvaluateCommandResult; - static Commands: EvaluateCommand[]; - } - - class OrderEntry { - Direction: OrderDirection; - ValueSelector: (item: any) => any; - constructor(_direction: OrderDirection, _valueSelector: (item: any) => any); - } - enum OrderDirection { - Ascending = 0, - Descending = 1, - } - - class SelectEntry { - property: string; - name: string; - constructor(n: string, p: string); - } -} diff --git a/types/linq4js/linq4js-tests.ts b/types/linq4js/linq4js-tests.ts deleted file mode 100644 index 42e43ab324..0000000000 --- a/types/linq4js/linq4js-tests.ts +++ /dev/null @@ -1,13 +0,0 @@ -import "linq4js"; - -const array: string[] = ["test", "test2", "test3", "test4", "test5"]; - -array - .Add("test6") - .Remove("test3") - .Insert("test3", 2) - .Distinct() - .OrderBy(x => x) - .OrderByDescending(x => x) - .Select(x => x.length) - .Average(); diff --git a/types/linq4js/tsconfig.json b/types/linq4js/tsconfig.json deleted file mode 100644 index 3479566f16..0000000000 --- a/types/linq4js/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "files": [ - "index.d.ts", - "linq4js-tests.ts" - ], - "compilerOptions": { - "module": "commonjs", - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "target": "es6", - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "lib": [ - "es6" - ], - "noEmit": true, - "forceConsistentCasingInFileNames": true - } -} \ No newline at end of file diff --git a/types/linq4js/tslint.json b/types/linq4js/tslint.json deleted file mode 100644 index bb491510c7..0000000000 --- a/types/linq4js/tslint.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - // TODOs - "no-any-union": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false - } -} From ba0c1cdfaf8a733571f99ca48be8d3d80c14adb0 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 16 Jan 2018 08:41:32 -0800 Subject: [PATCH 028/496] localforage-cordovasqlitedriver: Provides its own types (#22863) * localforage-cordovasqlitedriver: Provides its own types * remove 'module' from libraryName --- notNeededPackages.json | 6 +++ .../index.d.ts | 9 ---- .../localforage-cordovasqlitedriver-tests.ts | 53 ------------------- .../package.json | 6 --- .../tsconfig.json | 24 --------- .../tslint.json | 1 - 6 files changed, 6 insertions(+), 93 deletions(-) delete mode 100644 types/localforage-cordovasqlitedriver/index.d.ts delete mode 100644 types/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver-tests.ts delete mode 100644 types/localforage-cordovasqlitedriver/package.json delete mode 100644 types/localforage-cordovasqlitedriver/tsconfig.json delete mode 100644 types/localforage-cordovasqlitedriver/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 40f80ddba1..174861630d 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -816,6 +816,12 @@ "sourceRepoURL": "https://github.com/localForage/localForage", "asOfVersion": "0.0.34" }, + { + "libraryName": "localforage-cordovasqlitedriver", + "typingsPackageName": "localforage-cordovasqlitedriver", + "sourceRepoURL": "https://github.com/thgreasi/localForage-cordovaSQLiteDriver", + "asOfVersion": "1.5.0" + }, { "libraryName": "lodash-decorators", "typingsPackageName": "lodash-decorators", diff --git a/types/localforage-cordovasqlitedriver/index.d.ts b/types/localforage-cordovasqlitedriver/index.d.ts deleted file mode 100644 index 7c415d3f42..0000000000 --- a/types/localforage-cordovasqlitedriver/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Type definitions for localforage-cordovasqlitedriver module 1.0 -// Project: https://github.com/thgreasi/localForage-cordovaSQLiteDriver -// Definitions by: Thodoris Greasidis -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare var cordovaSQLiteDriver: LocalForageDriver; -export = cordovaSQLiteDriver; diff --git a/types/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver-tests.ts b/types/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver-tests.ts deleted file mode 100644 index 22b550da0b..0000000000 --- a/types/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver-tests.ts +++ /dev/null @@ -1,53 +0,0 @@ -declare const cordovaSQLiteDriver: LocalForageDriver; - -() => { - const driverName: string = cordovaSQLiteDriver._driver; - - const config = { - driver: driverName, - name: 'localforage' - }; - - cordovaSQLiteDriver._initStorage(config); - - cordovaSQLiteDriver.clear((err: any) => { - const newError: any = err; - }); - - cordovaSQLiteDriver.length((err: any, num: number) => { - const newError: any = err; - const newNumber: number = num; - }); - - cordovaSQLiteDriver.key(0, (err: any, value: string) => { - const newError: any = err; - const newValue: string = value; - }); - - cordovaSQLiteDriver.keys((err: any, keys: string[]) => { - const newError: any = err; - const newArray: string[] = keys; - }); - - cordovaSQLiteDriver.getItem("key", (err: any, str: string) => { - const newError: any = err; - const newStr: string = str; - }); - - cordovaSQLiteDriver.setItem("key", "value", (err: any, str: string) => { - const newError: any = err; - const newStr: string = str; - }); - - cordovaSQLiteDriver.setItem("key", "value", (str: string) => { - const newStr: string = str; - }); - - cordovaSQLiteDriver.removeItem("key", (err: any) => { - const newError: any = err; - }); - - cordovaSQLiteDriver.removeItem("key", (err: any) => { - const newError: any = err; - }); -}; diff --git a/types/localforage-cordovasqlitedriver/package.json b/types/localforage-cordovasqlitedriver/package.json deleted file mode 100644 index 9ef28aa765..0000000000 --- a/types/localforage-cordovasqlitedriver/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "dependencies": { - "localforage": "^1.5.0" - } -} diff --git a/types/localforage-cordovasqlitedriver/tsconfig.json b/types/localforage-cordovasqlitedriver/tsconfig.json deleted file mode 100644 index 8e2874eaa8..0000000000 --- a/types/localforage-cordovasqlitedriver/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "localforage-cordovasqlitedriver-tests.ts" - ] -} \ No newline at end of file diff --git a/types/localforage-cordovasqlitedriver/tslint.json b/types/localforage-cordovasqlitedriver/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/localforage-cordovasqlitedriver/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } From ceebbf5a7aae8c9b8164b810c913e8fc4286cadd Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 16 Jan 2018 08:55:59 -0800 Subject: [PATCH 029/496] chai: Remove false `reference types` comment (#22968) --- types/chai/index.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/types/chai/index.d.ts b/types/chai/index.d.ts index 70bc0f2b67..925c7198f0 100644 --- a/types/chai/index.d.ts +++ b/types/chai/index.d.ts @@ -11,8 +11,6 @@ // Satana Charuwichitratana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// - declare namespace Chai { interface ChaiStatic { expect: ExpectStatic; From 5ba5faa1def1550d152d5699ff5a82b672332195 Mon Sep 17 00:00:00 2001 From: "Matt R. Wilson" Date: Tue, 16 Jan 2018 10:41:33 -0700 Subject: [PATCH 030/496] [@types/request] Lint fix. (#22874) I had two PRs merge close together that caused the build to fail. - #22809 fixed a bug - #22821 removed all the overrides from `tslint.json` Unfortunately, the former ended up with a couple lint issues. ``` ./types/request/index.d.ts ERROR: 64:20 unified-signatures This overload and the one on line 63 can be combined into one signature taking `string | RequiredUriUrl & TOptions`. ./types/request/request-tests.ts ERROR: 10:5 prefer-const Identifier 'value' is never reassigned; use 'const' instead of 'let'. ``` --- types/request/index.d.ts | 5 ++--- types/request/request-tests.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/types/request/index.d.ts b/types/request/index.d.ts index a21d0c7f46..7362c18d49 100644 --- a/types/request/index.d.ts +++ b/types/request/index.d.ts @@ -60,8 +60,7 @@ declare namespace request { delete(options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; initParams(uri: string, options?: TOptions, callback?: RequestCallback): RequiredUriUrl & TOptions; - initParams(uri: string, callback?: RequestCallback): RequiredUriUrl & TOptions; - initParams(options: RequiredUriUrl & TOptions, callback?: RequestCallback): RequiredUriUrl & TOptions; + initParams(uriOrOpts: string | RequiredUriUrl & TOptions, callback?: RequestCallback): RequiredUriUrl & TOptions; forever(agentOptions: any, optionsArg: any): TRequest; jar(store?: any): CookieJar; @@ -249,7 +248,7 @@ declare namespace request { multipart(multipart: RequestPart[]): Request; json(val: any): Request; aws(opts: AWSOptions, now?: boolean): Request; - auth(username: string, password: string, sendInmediately?: boolean, bearer?: string): Request; + auth(username: string, password: string, sendImmediately?: boolean, bearer?: string): Request; oauth(oauth: OAuthOptions): Request; jar(jar: CookieJar): Request; diff --git a/types/request/request-tests.ts b/types/request/request-tests.ts index 102e4001b5..aac1566eaa 100644 --- a/types/request/request-tests.ts +++ b/types/request/request-tests.ts @@ -7,7 +7,7 @@ import request = require('request'); import stream = require('stream'); import urlModule = require('url'); -let value: any; +const value: any = 'value'; let str: string; let strOrUndef: string | undefined; let strOrTrueOrUndef: string | true | undefined; From ea7a1a732a54ca2cd8e00143acef7166c95dabf3 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 16 Jan 2018 11:12:35 -0800 Subject: [PATCH 031/496] assertion-error: Provides its own types (#22861) --- notNeededPackages.json | 6 ++ .../assertion-error/assertion-error-tests.ts | 14 ---- types/assertion-error/index.d.ts | 14 ---- types/assertion-error/tsconfig.json | 23 ------ types/assertion-error/tslint.json | 79 ------------------- 5 files changed, 6 insertions(+), 130 deletions(-) delete mode 100644 types/assertion-error/assertion-error-tests.ts delete mode 100644 types/assertion-error/index.d.ts delete mode 100644 types/assertion-error/tsconfig.json delete mode 100644 types/assertion-error/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 174861630d..a698b68ff3 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -78,6 +78,12 @@ "sourceRepoURL": "https://github.com/AlexTeixeira/Askmethat-Rating", "asOfVersion": "0.4.0" }, + { + "libraryName": "assertion-error", + "typingsPackageName": "assertion-error", + "sourceRepoURL": "https://github.com/chaijs/assertion-error", + "asOfVersion": "1.1.0" + }, { "libraryName": "asyncblock", "typingsPackageName": "asyncblock", diff --git a/types/assertion-error/assertion-error-tests.ts b/types/assertion-error/assertion-error-tests.ts deleted file mode 100644 index 96eb520f1c..0000000000 --- a/types/assertion-error/assertion-error-tests.ts +++ /dev/null @@ -1,14 +0,0 @@ - -import AssertionError = require('assertion-error'); - -var e: AssertionError; -var str: string; - -function foo () { - -} - -e = new AssertionError(str); -e = new AssertionError(str, {a:1, b:2}); -e = new AssertionError(str, {a:1, b:2}, foo); - diff --git a/types/assertion-error/index.d.ts b/types/assertion-error/index.d.ts deleted file mode 100644 index 8663df799d..0000000000 --- a/types/assertion-error/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Type definitions for assertion-error 1.0.0 -// Project: https://github.com/chaijs/assertion-error -// Definitions by: Bart van der Schoor -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -declare class AssertionError implements Error { - constructor(message: string, props?: any, ssf?: Function); - name: string; - message: string; - showDiff: boolean; - stack: string; -} -export = AssertionError; diff --git a/types/assertion-error/tsconfig.json b/types/assertion-error/tsconfig.json deleted file mode 100644 index ebe9144d0b..0000000000 --- a/types/assertion-error/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "assertion-error-tests.ts" - ] -} \ No newline at end of file diff --git a/types/assertion-error/tslint.json b/types/assertion-error/tslint.json deleted file mode 100644 index a41bf5d19a..0000000000 --- a/types/assertion-error/tslint.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} From 619403ecc7d3045921ebf50a5f296ef133ff24a2 Mon Sep 17 00:00:00 2001 From: dominuskernel Date: Tue, 16 Jan 2018 23:55:33 +0100 Subject: [PATCH 032/496] change to the las navigo version 7.0.0 --- types/navigo/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/navigo/index.d.ts b/types/navigo/index.d.ts index 58af71a564..68d374449b 100644 --- a/types/navigo/index.d.ts +++ b/types/navigo/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for navigo 6.0 +// Type definitions for navigo 7.0 // Project: https://github.com/krasimir/navigo // Definitions by: Adrian Ehrsam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From a56225abf7ba642002cc334dd44da0dddcb8da62 Mon Sep 17 00:00:00 2001 From: Maksim Karelov Date: Wed, 17 Jan 2018 18:35:53 +0300 Subject: [PATCH 033/496] [ismobilejs] Fix isMobile typings and tests (#22824) * Fix isMobile typings and tests * Fix isMobile export --- types/ismobilejs/index.d.ts | 80 ++++++++++++++++------------ types/ismobilejs/ismobilejs-tests.ts | 19 +++++++ types/ismobilejs/tsconfig.json | 4 +- 3 files changed, 69 insertions(+), 34 deletions(-) diff --git a/types/ismobilejs/index.d.ts b/types/ismobilejs/index.d.ts index c0f7c4ec8b..18eee7ea1a 100644 --- a/types/ismobilejs/index.d.ts +++ b/types/ismobilejs/index.d.ts @@ -3,41 +3,55 @@ // Definitions by: Maksim Karelov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export const any: boolean; -export const phone: boolean; -export const tablet: boolean; -export const seven_inch: boolean; +interface Apple { + phone: boolean; + ipod: boolean; + tablet: boolean; + device: boolean; +} -export const apple: { - phone: boolean; - ipod: boolean; - tablet: boolean; - device: boolean; -}; +interface Android { + phone: boolean; + tablet: boolean; + device: boolean; +} -export const android: { - phone: boolean; - tablet: boolean; - device: boolean; -}; +interface Amazon { + phone: boolean; + tablet: boolean; + device: boolean; +} -export const amazon: { - phone: boolean; - tablet: boolean; - device: boolean; -}; +interface Windows { + phone: boolean; + tablet: boolean; + device: boolean; +} -export const windows: { - phone: boolean; - tablet: boolean; - device: boolean; -}; +interface Other { + blackberry_10: boolean; + blackberry: boolean; + opera: boolean; + firefox: boolean; + chrome: boolean; + device: boolean; +} -export const other: { - blackberry_10: boolean; - blackberry: boolean; - opera: boolean; - firefox: boolean; - chrome: boolean; - device: boolean; -}; +interface IsMobile { + any: boolean; + phone: boolean; + tablet: boolean; + seven_inch: boolean; + + apple: Apple; + android: Android; + amazon: Amazon; + windows: Windows; + other: Other; + + (userAgent?: string): IsMobile; +} + +declare const isMobile: IsMobile; + +export = isMobile; diff --git a/types/ismobilejs/ismobilejs-tests.ts b/types/ismobilejs/ismobilejs-tests.ts index e69de29bb2..d53c674da9 100644 --- a/types/ismobilejs/ismobilejs-tests.ts +++ b/types/ismobilejs/ismobilejs-tests.ts @@ -0,0 +1,19 @@ +import * as isMobile from 'ismobilejs'; + +const MOZILLA_ANDROID_UA = 'Mozilla/5.0 (Android 4.4; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0'; +const MOZILLA_IPHONE_UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4'; + +const CHROME_ANDROID_UA = 'Mozilla/5.0 (Linux; Android 8.0.0; Pixel Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.66 Mobile Safari/537.36'; +const CHROME_IPHONE_UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1'; + +// $ExpectType boolean +isMobile(MOZILLA_ANDROID_UA).android.phone; +// $ExpectType boolean +isMobile(MOZILLA_IPHONE_UA).apple.phone; + +// $ExpectType boolean +isMobile(CHROME_ANDROID_UA).android.phone; +// $ExpectType boolean +isMobile(CHROME_IPHONE_UA).apple.phone; + +console.log(isMobile.apple); diff --git a/types/ismobilejs/tsconfig.json b/types/ismobilejs/tsconfig.json index 3e3a1071d3..ae9975d94e 100644 --- a/types/ismobilejs/tsconfig.json +++ b/types/ismobilejs/tsconfig.json @@ -2,11 +2,13 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From 5244cc0eccd558871890e97bd136dbcdfedc0787 Mon Sep 17 00:00:00 2001 From: Michael Zlatkovsky Date: Wed, 17 Jan 2018 07:40:06 -0800 Subject: [PATCH 034/496] Update maintainers list of office-js (#22972) --- types/office-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index e24b6c4a2c..d974bf45f7 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Office.js // Project: http://dev.office.com -// Definitions by: OfficeDev , Lance Austin +// Definitions by: OfficeDev , Lance Austin , Michael Zlatkovsky , Kim Brandl , Ricky Kirkham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /* From 3524ae0be3b53ddd80da9562393fb8ef01d4cdfc Mon Sep 17 00:00:00 2001 From: Bryan Hughes Date: Wed, 17 Jan 2018 10:40:29 -0500 Subject: [PATCH 035/496] Adds type definitions for raspi-gpio, raspi-i2c, raspi-led, raspi-onewire, raspi-pwm, raspi-serial, raspi-soft-pwm (#22898) * Added peripheral classes from the raspi.js suite. * Refactored type names to match style guide --- types/raspi-gpio/index.d.ts | 31 +++++++++++++++ types/raspi-gpio/raspi-gpio-tests.ts | 24 ++++++++++++ types/raspi-gpio/tsconfig.json | 23 +++++++++++ types/raspi-gpio/tslint.json | 1 + types/raspi-i2c/index.d.ts | 35 +++++++++++++++++ types/raspi-i2c/raspi-i2c-tests.ts | 38 +++++++++++++++++++ types/raspi-i2c/tsconfig.json | 23 +++++++++++ types/raspi-i2c/tslint.json | 1 + types/raspi-led/index.d.ts | 15 ++++++++ types/raspi-led/raspi-led-tests.ts | 7 ++++ types/raspi-led/tsconfig.json | 23 +++++++++++ types/raspi-led/tslint.json | 1 + types/raspi-onewire/index.d.ts | 17 +++++++++ types/raspi-onewire/raspi-onewire-tests.ts | 7 ++++ types/raspi-onewire/tsconfig.json | 23 +++++++++++ types/raspi-onewire/tslint.json | 1 + types/raspi-pwm/index.d.ts | 22 +++++++++++ types/raspi-pwm/raspi-pwm-tests.ts | 15 ++++++++ types/raspi-pwm/tsconfig.json | 23 +++++++++++ types/raspi-pwm/tslint.json | 1 + types/raspi-serial/index.d.ts | 40 ++++++++++++++++++++ types/raspi-serial/raspi-serial-tests.ts | 34 +++++++++++++++++ types/raspi-serial/tsconfig.json | 23 +++++++++++ types/raspi-serial/tslint.json | 1 + types/raspi-soft-pwm/index.d.ts | 23 +++++++++++ types/raspi-soft-pwm/raspi-soft-pwm-tests.ts | 16 ++++++++ types/raspi-soft-pwm/tsconfig.json | 23 +++++++++++ types/raspi-soft-pwm/tslint.json | 1 + 28 files changed, 492 insertions(+) create mode 100644 types/raspi-gpio/index.d.ts create mode 100644 types/raspi-gpio/raspi-gpio-tests.ts create mode 100644 types/raspi-gpio/tsconfig.json create mode 100644 types/raspi-gpio/tslint.json create mode 100644 types/raspi-i2c/index.d.ts create mode 100644 types/raspi-i2c/raspi-i2c-tests.ts create mode 100644 types/raspi-i2c/tsconfig.json create mode 100644 types/raspi-i2c/tslint.json create mode 100644 types/raspi-led/index.d.ts create mode 100644 types/raspi-led/raspi-led-tests.ts create mode 100644 types/raspi-led/tsconfig.json create mode 100644 types/raspi-led/tslint.json create mode 100644 types/raspi-onewire/index.d.ts create mode 100644 types/raspi-onewire/raspi-onewire-tests.ts create mode 100644 types/raspi-onewire/tsconfig.json create mode 100644 types/raspi-onewire/tslint.json create mode 100644 types/raspi-pwm/index.d.ts create mode 100644 types/raspi-pwm/raspi-pwm-tests.ts create mode 100644 types/raspi-pwm/tsconfig.json create mode 100644 types/raspi-pwm/tslint.json create mode 100644 types/raspi-serial/index.d.ts create mode 100644 types/raspi-serial/raspi-serial-tests.ts create mode 100644 types/raspi-serial/tsconfig.json create mode 100644 types/raspi-serial/tslint.json create mode 100644 types/raspi-soft-pwm/index.d.ts create mode 100644 types/raspi-soft-pwm/raspi-soft-pwm-tests.ts create mode 100644 types/raspi-soft-pwm/tsconfig.json create mode 100644 types/raspi-soft-pwm/tslint.json diff --git a/types/raspi-gpio/index.d.ts b/types/raspi-gpio/index.d.ts new file mode 100644 index 0000000000..4daf607b87 --- /dev/null +++ b/types/raspi-gpio/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for raspi-gpio 5.0 +// Project: https://github.com/nebrius/raspi-gpio +// Definitions by: Bryan Hughes +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import { Peripheral } from 'raspi-peripheral'; +export interface Config { + pin: number | string; + pullResistor?: number; +} +export const LOW = 0; +export const HIGH = 1; +export const PULL_NONE: number; +export const PULL_DOWN: number; +export const PULL_UP: number; +export class DigitalOutput extends Peripheral { + private _output; + private _currentValue; + readonly value: number; + constructor(config: number | string | Config); + write(value: number): void; +} +export class DigitalInput extends Peripheral { + private _input; + private _currentValue; + readonly value: number; + constructor(config: number | string | Config); + destroy(): void; + read(): number; +} diff --git a/types/raspi-gpio/raspi-gpio-tests.ts b/types/raspi-gpio/raspi-gpio-tests.ts new file mode 100644 index 0000000000..0f672497da --- /dev/null +++ b/types/raspi-gpio/raspi-gpio-tests.ts @@ -0,0 +1,24 @@ +import { DigitalInput, DigitalOutput, Config, LOW, HIGH, PULL_UP, PULL_DOWN, PULL_NONE } from 'raspi-gpio'; + +const inputConfig: Config = { + pin: 'P1-3', + pullResistor: PULL_UP +}; +const input = new DigitalInput(inputConfig); +input.read(); +input.value; + +new DigitalInput({ + pin: 'P1-3', + pullResistor: PULL_DOWN +}); + +new DigitalInput({ + pin: 'P1-3', + pullResistor: PULL_NONE +}); + +const output = new DigitalOutput('P1-5'); +output.write(LOW); +output.write(HIGH); +output.value; diff --git a/types/raspi-gpio/tsconfig.json b/types/raspi-gpio/tsconfig.json new file mode 100644 index 0000000000..480f995bc6 --- /dev/null +++ b/types/raspi-gpio/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "raspi-gpio-tests.ts" + ] +} \ No newline at end of file diff --git a/types/raspi-gpio/tslint.json b/types/raspi-gpio/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/raspi-gpio/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/raspi-i2c/index.d.ts b/types/raspi-i2c/index.d.ts new file mode 100644 index 0000000000..ce71190055 --- /dev/null +++ b/types/raspi-i2c/index.d.ts @@ -0,0 +1,35 @@ +// Type definitions for raspi-i2c 6.1 +// Project: https://github.com/nebrius/raspi-i2c +// Definitions by: Bryan Hughes +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// +import { Peripheral } from 'raspi-peripheral'; +export type ReadCallback = (err: null | Error | string, data: null | Buffer | number) => void; +export type WriteCallback = (err: null | Error | string) => void; +export class I2C extends Peripheral { + private _devices; + constructor(); + destroy(): void; + private _getDevice(address); + read(address: number, length: number, cb: ReadCallback): void; + read(address: number, register: number, length: number, cb: ReadCallback): void; + readSync(address: number, registerOrLength: number | undefined, length?: number): Buffer; + readByte(address: number, cb: ReadCallback): void; + readByte(address: number, register: number, cb: ReadCallback): void; + readByteSync(address: number, register?: number): number; + readWord(address: number, cb: ReadCallback): void; + readWord(address: number, register: number, cb: ReadCallback): void; + readWordSync(address: number, register?: number): number; + write(address: number, buffer: Buffer, cb?: WriteCallback): void; + write(address: number, register: number, buffer: Buffer, cb?: WriteCallback): void; + writeSync(address: number, buffer: Buffer): void; + writeSync(address: number, register: number, buffer: Buffer): void; + writeByte(address: number, byte: number, cb?: WriteCallback): void; + writeByte(address: number, register: number, byte: number, cb?: WriteCallback): void; + writeByteSync(address: number, registerOrByte: number, byte?: number): void; + writeWord(address: number, word: number, cb?: WriteCallback): void; + writeWord(address: number, register: number, word: number, cb?: WriteCallback): void; + writeWordSync(address: number, registerOrWord: number, word?: number): void; +} diff --git a/types/raspi-i2c/raspi-i2c-tests.ts b/types/raspi-i2c/raspi-i2c-tests.ts new file mode 100644 index 0000000000..8473c8c247 --- /dev/null +++ b/types/raspi-i2c/raspi-i2c-tests.ts @@ -0,0 +1,38 @@ +import { I2C } from 'raspi-i2c'; + +const i2c = new I2C(); + +i2c.read(1, 1, (err, data) => {}); +i2c.read(1, 1, 1, (err, data) => {}); + +i2c.readSync(1, 1); +i2c.readSync(1, 1, 1); + +i2c.readByte(1, (err, data) => {}); +i2c.readByte(1, 1, (err, data) => {}); + +i2c.readByteSync(1); +i2c.readByteSync(1, 1); + +i2c.readWord(1, (err, data) => {}); +i2c.readWord(1, 1, (err, data) => {}); + +const buf = Buffer.alloc(1); + +i2c.write(1, buf, (err) => {}); +i2c.write(1, 1, buf, (err) => {}); + +i2c.writeSync(1, buf); +i2c.writeSync(1, 1, buf); + +i2c.writeByte(1, 1, (err) => {}); +i2c.writeByte(1, 1, 1, (err) => {}); + +i2c.writeByteSync(1, 1); +i2c.writeByteSync(1, 1, 1); + +i2c.writeWord(1, 1, (err) => {}); +i2c.writeWord(1, 1, 1, (err) => {}); + +i2c.writeWordSync(1, 1); +i2c.writeWordSync(1, 1, 1); diff --git a/types/raspi-i2c/tsconfig.json b/types/raspi-i2c/tsconfig.json new file mode 100644 index 0000000000..4e201f4496 --- /dev/null +++ b/types/raspi-i2c/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "raspi-i2c-tests.ts" + ] +} \ No newline at end of file diff --git a/types/raspi-i2c/tslint.json b/types/raspi-i2c/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/raspi-i2c/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/raspi-led/index.d.ts b/types/raspi-led/index.d.ts new file mode 100644 index 0000000000..1c060bb347 --- /dev/null +++ b/types/raspi-led/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for raspi-led 2.0 +// Project: https://github.com/nebrius/raspi-led +// Definitions by: Bryan Hughes +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import { Peripheral } from 'raspi-peripheral'; +export const OFF = 0; +export const ON = 1; +export class LED extends Peripheral { + constructor(); + hasLed(): boolean; + read(): 0 | 1; + write(value: 0 | 1): void; +} diff --git a/types/raspi-led/raspi-led-tests.ts b/types/raspi-led/raspi-led-tests.ts new file mode 100644 index 0000000000..7da1a09761 --- /dev/null +++ b/types/raspi-led/raspi-led-tests.ts @@ -0,0 +1,7 @@ +import { OFF, ON, LED } from 'raspi-led'; + +const led = new LED(); +led.hasLed(); +led.read(); +led.write(OFF); +led.write(ON); diff --git a/types/raspi-led/tsconfig.json b/types/raspi-led/tsconfig.json new file mode 100644 index 0000000000..7e9d3a0fcc --- /dev/null +++ b/types/raspi-led/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "raspi-led-tests.ts" + ] +} \ No newline at end of file diff --git a/types/raspi-led/tslint.json b/types/raspi-led/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/raspi-led/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/raspi-onewire/index.d.ts b/types/raspi-onewire/index.d.ts new file mode 100644 index 0000000000..168b4576b1 --- /dev/null +++ b/types/raspi-onewire/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for raspi-onewire 1.0 +// Project: https://github.com/nebrius/raspi-onewire +// Definitions by: Bryan Hughes +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// +import { Peripheral } from 'raspi-peripheral'; +export class OneWire extends Peripheral { + private _deviceIdMapping; + constructor(); + private _convertIDToMappingKey(deviceID); + private _getNameFromID(deviceID); + searchForDevices(cb: (readErr: string | Error | undefined, devices: number[][] | undefined) => void): void; + read(deviceID: number[], numBytesToRead: number, cb: (err: string | Error | undefined, data: Buffer | undefined) => void): void; + readAllAvailable(deviceID: number[], cb: (err: string | Error | undefined, data: Buffer | undefined) => void): void; +} diff --git a/types/raspi-onewire/raspi-onewire-tests.ts b/types/raspi-onewire/raspi-onewire-tests.ts new file mode 100644 index 0000000000..1f24b21f4b --- /dev/null +++ b/types/raspi-onewire/raspi-onewire-tests.ts @@ -0,0 +1,7 @@ +import { OneWire } from 'raspi-onewire'; + +const oneWire = new OneWire(); + +oneWire.searchForDevices((err, devices) => {}); +oneWire.read([ 1, 2 ], 1, (err, data) => {}); +oneWire.readAllAvailable([ 1, 2 ], (err, data) => {}); diff --git a/types/raspi-onewire/tsconfig.json b/types/raspi-onewire/tsconfig.json new file mode 100644 index 0000000000..d7df314b58 --- /dev/null +++ b/types/raspi-onewire/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "raspi-onewire-tests.ts" + ] +} \ No newline at end of file diff --git a/types/raspi-onewire/tslint.json b/types/raspi-onewire/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/raspi-onewire/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/raspi-pwm/index.d.ts b/types/raspi-pwm/index.d.ts new file mode 100644 index 0000000000..42c122c75d --- /dev/null +++ b/types/raspi-pwm/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for raspi-pwm 5.0 +// Project: https://github.com/nebrius/raspi-pwm +// Definitions by: Bryan Hughes +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import { Peripheral } from 'raspi-peripheral'; +export interface Config { + pin?: number | string; + frequency?: number; +} +export class PWM extends Peripheral { + private _frequencyValue; + private _dutyCycleValue; + private _pwmPort; + private _pwm; + readonly frequency: number; + readonly dutyCycle: number; + constructor(config?: number | string | Config); + destroy(): void; + write(dutyCycle: number): void; +} diff --git a/types/raspi-pwm/raspi-pwm-tests.ts b/types/raspi-pwm/raspi-pwm-tests.ts new file mode 100644 index 0000000000..3b4bf7ef3a --- /dev/null +++ b/types/raspi-pwm/raspi-pwm-tests.ts @@ -0,0 +1,15 @@ +import { Config, PWM } from 'raspi-pwm'; + +const config: Config = { + pin: 'P1-3', + frequency: 1 +}; + +new PWM(); +new PWM(1); +new PWM('P1-3'); +const pwm = new PWM(config); + +pwm.write(1); +pwm.frequency; +pwm.dutyCycle; diff --git a/types/raspi-pwm/tsconfig.json b/types/raspi-pwm/tsconfig.json new file mode 100644 index 0000000000..5e38158098 --- /dev/null +++ b/types/raspi-pwm/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "raspi-pwm-tests.ts" + ] +} \ No newline at end of file diff --git a/types/raspi-pwm/tslint.json b/types/raspi-pwm/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/raspi-pwm/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/raspi-serial/index.d.ts b/types/raspi-serial/index.d.ts new file mode 100644 index 0000000000..033c0682c3 --- /dev/null +++ b/types/raspi-serial/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for raspi-serial 4.0 +// Project: https://github.com/nebrius/raspi-serial +// Definitions by: Bryan Hughes +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// +import { Peripheral } from 'raspi-peripheral'; +export const PARITY_NONE = "none"; +export const PARITY_EVEN = "even"; +export const PARITY_ODD = "odd"; +export const PARITY_MARK = "mark"; +export const PARITY_SPACE = "space"; +export const DEFAULT_PORT = "/dev/ttyAMA0"; +export interface Options { + portId?: string; + baudRate?: 115200 | 57600 | 38400 | 19200 | 9600 | 4800 | 2400 | 1800 | 1200 | 600 | 300 | 200 | 150 | 134 | 110 | 75 | 50 | number; + dataBits?: 8 | 7 | 6 | 5; + stopBits?: 1 | 2; + parity?: 'none' | 'even' | 'mark' | 'odd' | 'space'; +} +export type Callback = () => void; +export type ErrorCallback = (err: Error | string) => void; +export class Serial extends Peripheral { + private _portId; + private _options; + private _portInstance; + private _isOpen; + constructor({ portId, baudRate, dataBits, stopBits, parity }?: Options); + readonly port: string; + readonly baudRate: number; + readonly dataBits: number; + readonly stopBits: number; + readonly parity: string; + destroy(): void; + open(cb?: Callback): void; + close(cb?: ErrorCallback): void; + write(data: Buffer | string, cb?: Callback): void; + flush(cb?: ErrorCallback): void; +} diff --git a/types/raspi-serial/raspi-serial-tests.ts b/types/raspi-serial/raspi-serial-tests.ts new file mode 100644 index 0000000000..176c6e1370 --- /dev/null +++ b/types/raspi-serial/raspi-serial-tests.ts @@ -0,0 +1,34 @@ +import { + PARITY_NONE, + PARITY_EVEN, + PARITY_ODD, + PARITY_MARK, + PARITY_SPACE, + DEFAULT_PORT, + Options, + Serial +} from 'raspi-serial'; + +let options: Options = {}; +options = { + parity: PARITY_EVEN +}; +options = { + parity: PARITY_ODD +}; +options = { + parity: PARITY_MARK +}; +options = { + parity: PARITY_SPACE +}; +options = { + portId: DEFAULT_PORT, + baudRate: 9600, + dataBits: 8, + stopBits: 1, + parity: PARITY_NONE +}; + +new Serial(); +const serial = new Serial(options); diff --git a/types/raspi-serial/tsconfig.json b/types/raspi-serial/tsconfig.json new file mode 100644 index 0000000000..c2a6058397 --- /dev/null +++ b/types/raspi-serial/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "raspi-serial-tests.ts" + ] +} \ No newline at end of file diff --git a/types/raspi-serial/tslint.json b/types/raspi-serial/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/raspi-serial/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/raspi-soft-pwm/index.d.ts b/types/raspi-soft-pwm/index.d.ts new file mode 100644 index 0000000000..098cf9aff7 --- /dev/null +++ b/types/raspi-soft-pwm/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for raspi-soft-pwm 4.0 +// Project: https://github.com/nebrius/raspi-soft-pwm +// Definitions by: Bryan Hughes +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import { Peripheral } from 'raspi-peripheral'; +export interface Config { + pin: number | string; + frequency?: number; + range?: number; +} +export class SoftPWM extends Peripheral { + private _pwm; + private _frequency; + private _range; + private _dutyCycle; + readonly frequency: number; + readonly range: number; + readonly dutyCycle: number; + constructor(config: number | string | Config); + write(dutyCycle: number): void; +} diff --git a/types/raspi-soft-pwm/raspi-soft-pwm-tests.ts b/types/raspi-soft-pwm/raspi-soft-pwm-tests.ts new file mode 100644 index 0000000000..6cefe9a706 --- /dev/null +++ b/types/raspi-soft-pwm/raspi-soft-pwm-tests.ts @@ -0,0 +1,16 @@ +import { Config, SoftPWM } from 'raspi-soft-pwm'; + +const config: Config = { + pin: 'P1-3', + frequency: 1, + range: 1 +}; + +new SoftPWM(1); +new SoftPWM('P1-3'); +const pwm = new SoftPWM(config); + +pwm.write(1); +pwm.frequency; +pwm.dutyCycle; +pwm.range; diff --git a/types/raspi-soft-pwm/tsconfig.json b/types/raspi-soft-pwm/tsconfig.json new file mode 100644 index 0000000000..aab55c4028 --- /dev/null +++ b/types/raspi-soft-pwm/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "raspi-soft-pwm-tests.ts" + ] +} \ No newline at end of file diff --git a/types/raspi-soft-pwm/tslint.json b/types/raspi-soft-pwm/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/raspi-soft-pwm/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file From 8c4e4a9985f4b74c39b67bfb1088443da971a605 Mon Sep 17 00:00:00 2001 From: Dima Sabanin Date: Wed, 17 Jan 2018 12:28:37 -0500 Subject: [PATCH 036/496] [nano] Support for db/_find API with Mango query language. (#22833) * Support for db/_find API with Mango query language. * Clean up for linter. --- types/nano/index.d.ts | 87 ++++++++++++++++++++++++++++++++++++++++ types/nano/nano-tests.ts | 36 +++++++++++++++++ 2 files changed, 123 insertions(+) diff --git a/types/nano/index.d.ts b/types/nano/index.d.ts index 152954190d..7fafa72382 100644 --- a/types/nano/index.d.ts +++ b/types/nano/index.d.ts @@ -261,6 +261,8 @@ declare namespace nano { params: DocumentViewParams, callback?: Callback ): Request; + // http://docs.couchdb.org/en/latest/api/database/find.html#db-find + find(query: MangoQuery, callback?: Callback>): Request; server: ServerScope; } @@ -1044,6 +1046,91 @@ declare namespace nano { // Current update sequence for the database update_seq: any; } + + type MangoValue = number | string | Date | boolean; + + // http://docs.couchdb.org/en/latest/api/database/find.html#selector-syntax + interface MangoSelector { + [key: string]: MangoSelector | MangoValue | MangoValue[]; + } + + // http://docs.couchdb.org/en/latest/api/database/find.html#sort-syntax + type SortOrder = string | string[] | { [key: string]: 'asc' | 'desc' }; + + interface MangoQuery { + // JSON object describing criteria used to select documents. + selector: MangoSelector; + + // Maximum number of results returned. Default is 25. + limit?: number; + + // Skip the first 'n' results, where 'n' is the value specified. + skip?: number; + + // JSON array following sort syntax. + sort?: SortOrder[]; + + // JSON array specifying which fields of each object should be returned. If it is omitted, + // the entire object is returned. + // http://docs.couchdb.org/en/latest/api/database/find.html#filtering-fields + fields?: string[]; + + // Instruct a query to use a specific index. + // Specified either as "" or ["", ""]. + use_index?: string | [string, string]; + + // Read quorum needed for the result. This defaults to 1. + r?: number; + + // A string that enables you to specify which page of results you require. Used for paging through result sets. + bookmark?: string; + + // Whether to update the index prior to returning the result. Default is true. + update?: boolean; + + // Whether or not the view results should be returned from a “stable” set of shards. + stable?: boolean; + + // Combination of update = false and stable = true options.Possible options: "ok", false (default). + stale?: 'ok' | false; + + // Include execution statistics in the query response. Optional, default: false. + execution_stats?: boolean; + } + + interface MangoResponse { + // Array of documents matching the search. In each matching document, the fields specified in + // the fields part of the request body are listed, along with their values. + docs: D[]; + + // A string that enables you to specify which page of results you require. Used for paging through result sets. + bookmark?: string; + + // Execution warnings + warning?: string; + + // Basic execution statistics for a specific request. + execution_stats?: MangoExecutionStats; + } + + // http://docs.couchdb.org/en/latest/api/database/find.html#execution-statistics + interface MangoExecutionStats { + // Number of index keys examined. Currently always 0. + total_keys_examined: number; + + // Number of documents fetched from the database / index, equivalent to using include_docs = true in a view. + total_docs_examined: number; + + // Number of documents fetched from the database using an out - of - band document fetch. + // This is only non - zero when read quorum > 1 is specified in the query parameters. + total_quorum_docs_examined: number; + + // Number of results returned from the query. + results_returned: number; + + // Total execution time in milliseconds as measured by the database. + execution_time_ms: number; + } } export = nano; diff --git a/types/nano/nano-tests.ts b/types/nano/nano-tests.ts index d38f54bae2..4f13e90f43 100644 --- a/types/nano/nano-tests.ts +++ b/types/nano/nano-tests.ts @@ -118,6 +118,42 @@ mydb.show( ); mydb.replicate("database_replica", (error: any) => {}); +const req = mydb.find({ + selector: { + userId: 1234, + name: 'Paul', + status: { $ne: 'suspended' }, + age: { $gt: 69 }, + building: { + number: { + $in: [101, 203, 205] + } + } + }, + skip: 10, + limit: 1, + use_index: "user_index_doc", + fields: ['name', 'age'], + sort: [{ age: 'desc' }, { name: 'asc' }], + r: 2, + stale: 'ok', + execution_stats: true +}, (resp: nano.MangoResponse, error: any) => { + for (const doc of resp.docs) { + console.log(doc.name); + } + + if (resp.warning) { + console.error(resp.warning); + } + + if (resp.execution_stats) { + console.log(`Execution time: ${resp.execution_stats.execution_time_ms} ms.`); + } +}); + +req.abort(); + /* * Attachments */ From 1eab1479b5ce1969a15608e29531593aa2a41c81 Mon Sep 17 00:00:00 2001 From: dyst5422 Date: Wed, 17 Jan 2018 09:37:03 -0800 Subject: [PATCH 037/496] [graphql]: Update to 0.12.x (#22980) * [graphql]: Update to 0.12.x * Changed TypeExtensionNode from TypeExtensionDefinitionNode * Changed some commas to semicolons. --- types/graphql/index.d.ts | 3 +- types/graphql/language/ast.d.ts | 203 ++++++++++++++++++++++++------ types/graphql/language/kinds.d.ts | 6 + 3 files changed, 174 insertions(+), 38 deletions(-) diff --git a/types/graphql/index.d.ts b/types/graphql/index.d.ts index 4bca573210..5e8b2f6bd1 100644 --- a/types/graphql/index.d.ts +++ b/types/graphql/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for graphql 0.11 +// Type definitions for graphql 0.12 // Project: https://www.npmjs.com/package/graphql // Definitions by: TonyYang // Caleb Meredith @@ -10,6 +10,7 @@ // Hagai Cohen // Ricardo Portugal // Tim Griesser +// Dylan Stewart // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/graphql/language/ast.d.ts b/types/graphql/language/ast.d.ts index f4bc343ed2..24344fe904 100644 --- a/types/graphql/language/ast.d.ts +++ b/types/graphql/language/ast.d.ts @@ -31,6 +31,34 @@ export interface Location { source: Source; } +/** + * Represents the different kinds of tokens in a GraphQL document. + * This type is not inlined in `Token` to fix syntax highlighting on GitHub + * *only*. + */ +type TokenKind = + | '' + | '' + | '!' + | '$' + | '(' + | ')' + | '...' + | ':' + | '=' + | '@' + | '[' + | ']' + | '{' + | '|' + | '}' + | 'Name' + | 'Int' + | 'Float' + | 'String' + | 'BlockString' + | 'Comment'; + /** * Represents a range of characters represented by a lexical token * within a Source. @@ -39,27 +67,7 @@ export interface Token { /** * The kind of Token. */ - kind: - | '' - | '' - | '!' - | '$' - | '(' - | ')' - | '...' - | ':' - | '=' - | '@' - | '[' - | ']' - | '{' - | '|' - | '}' - | 'Name' - | 'Int' - | 'Float' - | 'String' - | 'Comment'; + kind: TokenKind; /** * The character offset at which this Node begins. @@ -134,9 +142,62 @@ export type ASTNode = | EnumTypeDefinitionNode | EnumValueDefinitionNode | InputObjectTypeDefinitionNode - | TypeExtensionDefinitionNode + | ScalarTypeExtensionNode + | ObjectTypeExtensionNode + | InterfaceTypeExtensionNode + | UnionTypeExtensionNode + | EnumTypeExtensionNode + | InputObjectTypeExtensionNode | DirectiveDefinitionNode; +/** + * Utility type listing all nodes indexed by their kind. + */ +export interface ASTKindToNode { + Name: NameNode; + Document: DocumentNode; + OperationDefinition: OperationDefinitionNode; + VariableDefinition: VariableDefinitionNode; + Variable: VariableNode; + SelectionSet: SelectionSetNode; + Field: FieldNode; + Argument: ArgumentNode; + FragmentSpread: FragmentSpreadNode; + InlineFragment: InlineFragmentNode; + FragmentDefinition: FragmentDefinitionNode; + IntValue: IntValueNode; + FloatValue: FloatValueNode; + StringValue: StringValueNode; + BooleanValue: BooleanValueNode; + NullValue: NullValueNode; + EnumValue: EnumValueNode; + ListValue: ListValueNode; + ObjectValue: ObjectValueNode; + ObjectField: ObjectFieldNode; + Directive: DirectiveNode; + NamedType: NamedTypeNode; + ListType: ListTypeNode; + NonNullType: NonNullTypeNode; + SchemaDefinition: SchemaDefinitionNode; + OperationTypeDefinition: OperationTypeDefinitionNode; + ScalarTypeDefinition: ScalarTypeDefinitionNode; + ObjectTypeDefinition: ObjectTypeDefinitionNode; + FieldDefinition: FieldDefinitionNode; + InputValueDefinition: InputValueDefinitionNode; + InterfaceTypeDefinition: InterfaceTypeDefinitionNode; + UnionTypeDefinition: UnionTypeDefinitionNode; + EnumTypeDefinition: EnumTypeDefinitionNode; + EnumValueDefinition: EnumValueDefinitionNode; + InputObjectTypeDefinition: InputObjectTypeDefinitionNode; + ScalarTypeExtension: ScalarTypeExtensionNode; + ObjectTypeExtension: ObjectTypeExtensionNode; + InterfaceTypeExtension: InterfaceTypeExtensionNode; + UnionTypeExtension: UnionTypeExtensionNode; + EnumTypeExtension: EnumTypeExtensionNode; + InputObjectTypeExtension: InputObjectTypeExtensionNode; + DirectiveDefinition: DirectiveDefinitionNode; +} + // Name export interface NameNode { @@ -154,9 +215,12 @@ export interface DocumentNode { } export type DefinitionNode = - | OperationDefinitionNode - | FragmentDefinitionNode - | TypeSystemDefinitionNode; // experimental non-spec addition. + | ExecutableDefinitionNode + | TypeSystemDefinitionNode; // experimental non-spec addition. + +export type ExecutableDefinitionNode = + | OperationDefinitionNode + | FragmentDefinitionNode; export interface OperationDefinitionNode { kind: 'OperationDefinition'; @@ -192,9 +256,9 @@ export interface SelectionSetNode { } export type SelectionNode = - | FieldNode - | FragmentSpreadNode - | InlineFragmentNode; + | FieldNode + | FragmentSpreadNode + | InlineFragmentNode; export interface FieldNode { kind: 'Field'; @@ -234,6 +298,9 @@ export interface FragmentDefinitionNode { kind: 'FragmentDefinition'; loc?: Location; name: NameNode; + // Note: fragment variable definitions are experimental and may be changed + // or removed in the future. + variableDefinitions?: VariableDefinitionNode[]; typeCondition: NamedTypeNode; directives?: DirectiveNode[]; selectionSet: SelectionSetNode; @@ -318,9 +385,9 @@ export interface DirectiveNode { // Type Reference export type TypeNode = - | NamedTypeNode - | ListTypeNode - | NonNullTypeNode; + | NamedTypeNode + | ListTypeNode + | NonNullTypeNode; export interface NamedTypeNode { kind: 'NamedType'; @@ -345,7 +412,7 @@ export interface NonNullTypeNode { export type TypeSystemDefinitionNode = | SchemaDefinitionNode | TypeDefinitionNode - | TypeExtensionDefinitionNode + | TypeExtensionNode | DirectiveDefinitionNode; export interface SchemaDefinitionNode { @@ -373,6 +440,7 @@ export type TypeDefinitionNode = export interface ScalarTypeDefinitionNode { kind: 'ScalarTypeDefinition'; loc?: Location; + description?: StringValueNode; name: NameNode; directives?: DirectiveNode[]; } @@ -380,6 +448,7 @@ export interface ScalarTypeDefinitionNode { export interface ObjectTypeDefinitionNode { kind: 'ObjectTypeDefinition'; loc?: Location; + description?: StringValueNode; name: NameNode; interfaces?: NamedTypeNode[]; directives?: DirectiveNode[]; @@ -389,6 +458,7 @@ export interface ObjectTypeDefinitionNode { export interface FieldDefinitionNode { kind: 'FieldDefinition'; loc?: Location; + description?: StringValueNode; name: NameNode; arguments: InputValueDefinitionNode[]; type: TypeNode; @@ -398,6 +468,7 @@ export interface FieldDefinitionNode { export interface InputValueDefinitionNode { kind: 'InputValueDefinition'; loc?: Location; + description?: StringValueNode; name: NameNode; type: TypeNode; defaultValue?: ValueNode; @@ -407,6 +478,7 @@ export interface InputValueDefinitionNode { export interface InterfaceTypeDefinitionNode { kind: 'InterfaceTypeDefinition'; loc?: Location; + description?: StringValueNode; name: NameNode; directives?: DirectiveNode[]; fields: FieldDefinitionNode[]; @@ -415,6 +487,7 @@ export interface InterfaceTypeDefinitionNode { export interface UnionTypeDefinitionNode { kind: 'UnionTypeDefinition'; loc?: Location; + description?: StringValueNode; name: NameNode; directives?: DirectiveNode[]; types: NamedTypeNode[]; @@ -423,6 +496,7 @@ export interface UnionTypeDefinitionNode { export interface EnumTypeDefinitionNode { kind: 'EnumTypeDefinition'; loc?: Location; + description?: StringValueNode; name: NameNode; directives?: DirectiveNode[]; values: EnumValueDefinitionNode[]; @@ -431,6 +505,7 @@ export interface EnumTypeDefinitionNode { export interface EnumValueDefinitionNode { kind: 'EnumValueDefinition'; loc?: Location; + description?: StringValueNode; name: NameNode; directives?: DirectiveNode[]; } @@ -438,20 +513,74 @@ export interface EnumValueDefinitionNode { export interface InputObjectTypeDefinitionNode { kind: 'InputObjectTypeDefinition'; loc?: Location; + description?: StringValueNode; name: NameNode; directives?: DirectiveNode[]; fields: InputValueDefinitionNode[]; } -export interface TypeExtensionDefinitionNode { - kind: 'TypeExtensionDefinition'; - loc?: Location; - definition: ObjectTypeDefinitionNode; -} +export type TypeExtensionNode = + | ScalarTypeExtensionNode + | ObjectTypeExtensionNode + | InterfaceTypeExtensionNode + | UnionTypeExtensionNode + | EnumTypeExtensionNode + | InputObjectTypeExtensionNode; + +export type ScalarTypeExtensionNode = { + kind: 'ScalarTypeExtension', + loc?: Location, + name: NameNode, + directives?: DirectiveNode[], +}; + +export type ObjectTypeExtensionNode = { + kind: 'ObjectTypeExtension', + loc?: Location, + name: NameNode, + interfaces?: NamedTypeNode[], + directives?: DirectiveNode[], + fields?: FieldDefinitionNode[], +}; + +export type InterfaceTypeExtensionNode = { + kind: 'InterfaceTypeExtension', + loc?: Location, + name: NameNode, + directives?: DirectiveNode[], + fields?: FieldDefinitionNode[], +}; + +export type UnionTypeExtensionNode = { + kind: 'UnionTypeExtension', + loc?: Location, + name: NameNode, + directives?: DirectiveNode[], + types?: NamedTypeNode[], +}; + +export type EnumTypeExtensionNode = { + kind: 'EnumTypeExtension', + loc?: Location, + name: NameNode, + directives?: DirectiveNode[], + values?: EnumValueDefinitionNode[], +}; + +export type InputObjectTypeExtensionNode = { + kind: 'InputObjectTypeExtension', + loc?: Location, + name: NameNode, + directives?: DirectiveNode[], + fields?: InputValueDefinitionNode[], +}; + +// Directive Definitions export interface DirectiveDefinitionNode { kind: 'DirectiveDefinition'; loc?: Location; + description?: StringValueNode; name: NameNode; arguments?: InputValueDefinitionNode[]; locations: NameNode[]; diff --git a/types/graphql/language/kinds.d.ts b/types/graphql/language/kinds.d.ts index 626d350818..f92826f891 100644 --- a/types/graphql/language/kinds.d.ts +++ b/types/graphql/language/kinds.d.ts @@ -60,6 +60,12 @@ export const INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition'; // Type Extensions export const TYPE_EXTENSION_DEFINITION: 'TypeExtensionDefinition'; +export const SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension'; +export const OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension'; +export const INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension'; +export const UNION_TYPE_EXTENSION: 'UnionTypeExtension'; +export const ENUM_TYPE_EXTENSION: 'EnumTypeExtension'; +export const INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension'; // Directive Definitions From 39b90ab686fe177c763d995047a688e1612e6f46 Mon Sep 17 00:00:00 2001 From: Nikita Moshensky Date: Wed, 17 Jan 2018 19:37:58 +0200 Subject: [PATCH 038/496] [ramda] fix path() return type according to documentation (#22963) * [ramda] fix path() return type * add tests --- types/ramda/index.d.ts | 4 ++-- types/ramda/ramda-tests.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 869fa0154e..37444ad500 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -1253,8 +1253,8 @@ declare namespace R { /** * Retrieve the value at a given path. */ - path(path: Path, obj: any): T; - path(path: Path): (obj: any) => T; + path(path: Path, obj: any): T | undefined; + path(path: Path): (obj: any) => T | undefined; /** * Determines whether a nested path on an object has a specific value, diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index a90263c0f8..71f8723f9a 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -1856,6 +1856,9 @@ class Rectangle { R.path(testPath, testObj); // => 2 R.path(testPath)(testObj); // => 2 + + R.path(['a', 'b'])({c: {b: 2}}); // => undefined + R.path(['a', 'b'], {c: {b: 2}}); // => undefined }; () => { From 93c2e07a9ba22325970b5c568a769c5a2607bb82 Mon Sep 17 00:00:00 2001 From: Benjamin Lowry Date: Thu, 18 Jan 2018 01:40:16 +0800 Subject: [PATCH 039/496] Fix Expo AuthSession returnUrl to be optional as per documentation (#22984) --- types/expo/expo-tests.tsx | 4 ++++ types/expo/index.d.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index 386cb41b04..9c9cfc979e 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -73,6 +73,10 @@ AuthSession.startAsync({ break; } }); +AuthSession.startAsync({ + authUrl: 'url1', + returnUrl: undefined +}); Audio.setAudioModeAsync({ shouldDuckAndroid: false, diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 89acb6ac10..c9c0ca88f3 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -90,7 +90,7 @@ export class Asset { * AuthSession */ export namespace AuthSession { - function startAsync(options: { authUrl: string; returnUrl: string; }): Promise<{ + function startAsync(options: { authUrl: string; returnUrl?: string; }): Promise<{ type: 'cancel'; } | { type: 'dismissed'; From d4fac01ad6fe6de72355cf31fba4b8d0c1422a83 Mon Sep 17 00:00:00 2001 From: mad-mike Date: Wed, 17 Jan 2018 18:41:59 +0100 Subject: [PATCH 040/496] [p-queue] Update to version 2.3 (#22955) * [p-queue] Update to version 2.3 * Apply hints from tslint --- types/p-queue/index.d.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/types/p-queue/index.d.ts b/types/p-queue/index.d.ts index 3cc6acef53..a3d4608bce 100644 --- a/types/p-queue/index.d.ts +++ b/types/p-queue/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for p-queue 1.1 +// Type definitions for p-queue 2.3 // Project: https://github.com/sindresorhus/p-queue#readme // Definitions by: BendingBender // Evan Shortiss @@ -10,12 +10,21 @@ export = PQueue; declare class PQueue { size: number; pending: number; + isPaused: boolean; constructor(opts?: PQueue.Options); add(fn: PQueue.Task, opts?: O): Promise; - onEmpty(): Promise; + addAll(fns: Array>, opts?: O): Promise; + + pause(): void; + + start(): void; + + onEmpty(): Promise; + + onIdle(): Promise; clear(): void; } @@ -38,8 +47,9 @@ declare namespace PQueue { } interface Options { - queueClass?: QueueClassConstructor; concurrency?: number; + autoStart?: boolean; + queueClass?: QueueClassConstructor; } interface DefaultAddOptions { From c1ebcacdb973c28ac16759ae0dac625a4013b9a6 Mon Sep 17 00:00:00 2001 From: John Marinelli Date: Wed, 17 Jan 2018 18:42:48 +0100 Subject: [PATCH 041/496] Replace Vector3 with Vector2 for lathe geometry type, edit tests (#22895) --- types/three/test/webgl/webgl_geometries.ts | 6 +++--- types/three/three-core.d.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/types/three/test/webgl/webgl_geometries.ts b/types/three/test/webgl/webgl_geometries.ts index 89e0af480c..32ab4270b4 100644 --- a/types/three/test/webgl/webgl_geometries.ts +++ b/types/three/test/webgl/webgl_geometries.ts @@ -76,11 +76,11 @@ // - var points: THREE.Vector3[] = []; + var points: THREE.Vector2[] = []; for (var i = 0; i < 50; i++) { - points.push(new THREE.Vector3(Math.sin(i * 0.2) * Math.sin(i * 0.1) * 15 + 50, 0, (i - 5) * 2)); + points.push(new THREE.Vector2(Math.sin(i * 0.2) * Math.sin(i * 0.1) * 15 + 50, 0)); } @@ -165,4 +165,4 @@ } -} \ No newline at end of file +} diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 880a150a06..06bb1e02d0 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -6644,10 +6644,10 @@ export class IcosahedronGeometry extends PolyhedronGeometry { } export class LatheBufferGeometry extends BufferGeometry { - constructor(points: Vector3[], segments?: number, phiStart?: number, phiLength?: number); + constructor(points: Vector2[], segments?: number, phiStart?: number, phiLength?: number); parameters: { - points: Vector3[]; + points: Vector2[]; segments: number; phiStart: number; phiLength: number; @@ -6655,10 +6655,10 @@ export class LatheBufferGeometry extends BufferGeometry { } export class LatheGeometry extends Geometry { - constructor(points: Vector3[], segments?: number, phiStart?: number, phiLength?: number); + constructor(points: Vector2[], segments?: number, phiStart?: number, phiLength?: number); parameters: { - points: Vector3[]; + points: Vector2[]; segments: number; phiStart: number; phiLength: number; From 16937e5e2872d7c3161d462428227a2ace1e5763 Mon Sep 17 00:00:00 2001 From: Nikola Vidic Date: Wed, 17 Jan 2018 18:43:45 +0100 Subject: [PATCH 042/496] [sequelize] Update addColumn and removeColumn (#22965) * [sequelize] Update addColumn and removeColumn * update squelize-tests.ts --- types/sequelize/index.d.ts | 10 ++++++---- types/sequelize/sequelize-tests.ts | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 2db7dcfe11..6bc7c06dff 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -9,6 +9,7 @@ // Nick Mueller // Philippe D'Alva // Carven Zhang +// Nikola Vidic // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -1332,8 +1333,8 @@ declare namespace sequelize { */ keyType?: DataTypeAbstract; /** - * A string to represent the name of the field to use as the key for an 1 to many association in the source table. - * + * A string to represent the name of the field to use as the key for an 1 to many association in the source table. + * * @see http://docs.sequelizejs.com/class/lib/model.js~Model.html#static-method-hasMany * @see https://github.com/sequelize/sequelize/blob/b4fd46426db9cdbb97074bea121203d565e4195d/lib/associations/has-many.js#L81 */ @@ -4192,13 +4193,14 @@ declare namespace sequelize { /** * Adds a new column to a table */ - addColumn(table: string, key: string, attribute: DefineAttributeColumnOptions | DataTypeAbstract, + addColumn(tableName: string | { tableName?: string, schema?: string }, key: string, attribute: DefineAttributeColumnOptions | DataTypeAbstract, options?: QueryInterfaceOptions): Promise; /** * Removes a column from a table */ - removeColumn(table: string, attribute: string, options?: QueryInterfaceOptions): Promise; + removeColumn(tableName: string | { tableName?: string, schema?: string }, attribute: string, + options?: QueryInterfaceOptions): Promise; /** * Changes a column diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index 29e9252fe4..e32ae0b008 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -1144,6 +1144,9 @@ queryInterface.createTable( 'users', { id : { type : Sequelize.INTEGER, primaryK queryInterface.createTable( 'level', { id : { type : Sequelize.INTEGER, primaryKey : true, autoIncrement : true } } ); queryInterface.addColumn( 'users', 'someEnum', Sequelize.ENUM( 'value1', 'value2', 'value3' ) ); queryInterface.addColumn( 'users', 'so', { type : Sequelize.ENUM, values : ['value1', 'value2', 'value3'] } ); +queryInterface.addColumn({tableName:'users', schema:'test'}, 'enum',{ type : Sequelize.ENUM, values : ['value1', 'value2', 'value3'] }); +queryInterface.removeColumn('users','so'); +queryInterface.removeColumn({tableName:'users', schema:'test'},'enum'); queryInterface.createTable( 'hosts', { id : { type : Sequelize.INTEGER, From 71ca70ae88ed000ad73e997d299ee266c6db8716 Mon Sep 17 00:00:00 2001 From: Johannes Walleboom Date: Wed, 17 Jan 2018 18:44:24 +0100 Subject: [PATCH 043/496] Type fix for checkOrigin (#22925) checkOrigin can also be an array of allowed origins. --- types/iframe-resizer/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/iframe-resizer/index.d.ts b/types/iframe-resizer/index.d.ts index 8d65629da6..70d9c1d4f3 100644 --- a/types/iframe-resizer/index.d.ts +++ b/types/iframe-resizer/index.d.ts @@ -37,7 +37,7 @@ export interface IFrameOptions { * If your iFrame navigates between different domains, ports or protocols; then you will need to * provide an array of URLs or disable this option. */ - checkOrigin?: boolean; + checkOrigin?: boolean | string[]; /** * When enabled in page linking inside the iFrame and from the iFrame to the parent page will be enabled. */ From cc668c2e386ef56a1e2d50811c873481df6787bb Mon Sep 17 00:00:00 2001 From: "Matt R. Wilson" Date: Wed, 17 Jan 2018 10:44:51 -0700 Subject: [PATCH 044/496] [@types/caseless] Add Httpified interface. (#22935) To allow importing libs to extend the interface. Objects passed into `caseless.httpify` are extended with these methods. --- types/caseless/caseless-tests.ts | 19 ++++++++++++++++++- types/caseless/index.d.ts | 10 ++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/types/caseless/caseless-tests.ts b/types/caseless/caseless-tests.ts index 2fb16afaad..57eaae605e 100644 --- a/types/caseless/caseless-tests.ts +++ b/types/caseless/caseless-tests.ts @@ -1,4 +1,4 @@ -import caseless, { Caseless, httpify } from "caseless"; +import caseless, { Caseless, httpify, Httpified } from "caseless"; new Caseless(); // $ExpectError @@ -38,3 +38,20 @@ httpify({}, 1); // $ExpectError httpify({}, "2"); // $ExpectError httpify({}, {}); // $ExpectType Caseless + +const request: Httpified = {}; // $ExpectError + +request.setHeader({}); // $ExpectType void +request.setHeader('foo', 'bar'); // $ExpectType string | false +request.setHeader('foo', 'bar', false); // $ExpectType string | false +request.setHeader('foo', new Date()); // $ExpectType string | false +request.setHeader(10, 'bar'); // $ExpectError + +request.getHeader('foo'); // $ExpectType any +request.getHeader(10); // $ExpectError + +request.hasHeader('foo'); // $ExpectType string | false +request.hasHeader(10); // $ExpectError + +request.removeHeader('foo'); // $ExpectType boolean +request.headers = {}; diff --git a/types/caseless/index.d.ts b/types/caseless/index.d.ts index db295a8f89..9b19f8a150 100644 --- a/types/caseless/index.d.ts +++ b/types/caseless/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for caseless 0.12 // Project: https://github.com/mikeal/caseless // Definitions by: downace +// Matt R. Wilson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -17,6 +18,15 @@ export interface Caseless { del(name: KeyType): boolean; } +export interface Httpified { + headers: RawDict; + setHeader(name: KeyType, value: ValueType, clobber?: boolean): KeyType | false; + setHeader(dict: RawDict): void; + hasHeader(name: KeyType): KeyType | false; + getHeader(name: KeyType): ValueType | undefined; + removeHeader(name: KeyType): boolean; +} + export function httpify(resp: object, headers: RawDict): Caseless; declare function caseless(dict?: RawDict): Caseless; From f1c07c65abc162426a3e4442e52b475d7490f79d Mon Sep 17 00:00:00 2001 From: kuhlebrock Date: Wed, 17 Jan 2018 18:45:20 +0100 Subject: [PATCH 045/496] Add resize.auto as an optional property to ChartConfiguration (#22956) --- types/c3/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/c3/index.d.ts b/types/c3/index.d.ts index 96ecc8c488..322adce77d 100644 --- a/types/c3/index.d.ts +++ b/types/c3/index.d.ts @@ -61,6 +61,13 @@ export interface ChartConfiguration { left?: number; }; + resize?: { + /** + * Indicate if the chart should automatically get resized when the window gets resized. + */ + auto?: boolean; + }; + color?: { /** * Set custom color pattern. From 5076877fc78d994cd6afc440ff0c3afa489e15f7 Mon Sep 17 00:00:00 2001 From: Damian Osipiuk Date: Wed, 17 Jan 2018 18:46:24 +0100 Subject: [PATCH 046/496] react-jsonschema-form: Fixed typo in ArrayFieldTemplateProps definition (#22951) --- types/react-jsonschema-form/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-jsonschema-form/index.d.ts b/types/react-jsonschema-form/index.d.ts index e6ad7c52ab..785ee072e9 100644 --- a/types/react-jsonschema-form/index.d.ts +++ b/types/react-jsonschema-form/index.d.ts @@ -122,7 +122,7 @@ declare module "react-jsonschema-form" { export type ArrayFieldTemplateProps = { DescriptionField: object; TitleField: object; - candAdd: boolean; + canAdd: boolean; className: string; disabled: boolean; idSchema: IdSchema; From 17d8fcc76fc92969b0df61397dfef10ff2189c7c Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Wed, 17 Jan 2018 18:46:52 +0100 Subject: [PATCH 047/496] Add id to mongodb gridfs upload streams (#22930) As seen in http://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucket.html#openUploadStream: ```js var uploadStream = bucket.openUploadStream('test.dat'); var license = fs.readFileSync('./LICENSE'); var id = uploadStream.id; ``` The resulting stream from `openUploadStream` *has* an id. --- types/mongodb/index.d.ts | 12 ++++++++---- types/mongodb/v2/index.d.ts | 8 ++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index ae52d70e14..7fcbecf754 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -31,7 +31,7 @@ export class MongoClient extends EventEmitter { static connect(uri: string, callback: MongoCallback): void; static connect(uri: string, options?: MongoClientOptions): Promise; static connect(uri: string, options: MongoClientOptions, callback: MongoCallback): void; - /** + /** * @deprecated * http://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html#connect */ @@ -830,7 +830,7 @@ export interface CollectionAggregationOptions { collation?: Object; comment?: string session?: ClientSession; - + } /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#insertMany */ @@ -1353,7 +1353,7 @@ export class GridFSBucket { /** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#openUploadStream */ openUploadStream(filename: string, options?: GridFSBucketOpenUploadStreamOptions): GridFSBucketWriteStream; /** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#openUploadStreamWithId */ - openUploadStreamWithId(id: string | number | Object, filename: string, options?: GridFSBucketOpenUploadStreamOptions): GridFSBucketWriteStream; + openUploadStreamWithId(id: GridFSBucketWriteStreamId, filename: string, options?: GridFSBucketOpenUploadStreamOptions): GridFSBucketWriteStream; /** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#rename */ rename(id: ObjectID, filename: string, callback?: GridFSBucketErrorCallback): void; } @@ -1391,6 +1391,7 @@ export interface GridFSBucketOpenUploadStreamOptions { /** https://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucketReadStream.html */ export class GridFSBucketReadStream extends Readable { + id: ObjectID; constructor(chunks: Collection, files: Collection, readPreference: Object, filter: Object, options?: GridFSBucketReadStreamOptions); } @@ -1404,14 +1405,17 @@ export interface GridFSBucketReadStreamOptions { /** https://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucketWriteStream.html */ export class GridFSBucketWriteStream extends Writable { + id: GridFSBucketWriteStreamId; constructor(bucket: GridFSBucket, filename: string, options?: GridFSBucketWriteStreamOptions); } /** https://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucketWriteStream.html */ export interface GridFSBucketWriteStreamOptions { - id?: string | number | Object, + id?: GridFSBucketWriteStreamId, chunkSizeBytes?: number, w?: number, wtimeout?: number, j?: number } + +type GridFSBucketWriteStreamId = string | number | Object | ObjectID; diff --git a/types/mongodb/v2/index.d.ts b/types/mongodb/v2/index.d.ts index 6cf21c04b9..ec3e3965ba 100644 --- a/types/mongodb/v2/index.d.ts +++ b/types/mongodb/v2/index.d.ts @@ -1371,7 +1371,7 @@ export class GridFSBucket { // http://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucket.html#openUploadStream openUploadStream(filename: string, options?: GridFSBucketOpenUploadStreamOptions): GridFSBucketWriteStream; // http://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucket.html#openUploadStreamWithId - openUploadStreamWithId(id: string | number | Object, filename: string, options?: GridFSBucketOpenUploadStreamOptions): GridFSBucketWriteStream; + openUploadStreamWithId(id: GridFSBucketWriteStreamId, filename: string, options?: GridFSBucketOpenUploadStreamOptions): GridFSBucketWriteStream; // http://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucket.html#rename rename(id: ObjectID, filename: string, callback?: GridFSBucketErrorCallback): void; } @@ -1409,6 +1409,7 @@ export interface GridFSBucketOpenUploadStreamOptions { // https://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucketReadStream.html export class GridFSBucketReadStream extends Readable { + id: ObjectID; constructor(chunks: Collection, files: Collection, readPreference: Object, filter: Object, options?: GridFSBucketReadStreamOptions); } @@ -1422,14 +1423,17 @@ export interface GridFSBucketReadStreamOptions { // https://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucketWriteStream.html export class GridFSBucketWriteStream extends Writable { + id: GridFSBucketWriteStreamId; constructor(bucket: GridFSBucket, filename: string, options?: GridFSBucketWriteStreamOptions); } // https://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucketWriteStream.html export interface GridFSBucketWriteStreamOptions { - id?: string | number | Object, + id?: GridFSBucketWriteStreamId, chunkSizeBytes?: number, w?: number, wtimeout?: number, j?: number } + +type GridFSBucketWriteStreamId = string | number | Object | ObjectID; From c2ce00278b94aa3c7b36be5a2030518c963c6106 Mon Sep 17 00:00:00 2001 From: Spencer Elliott Date: Wed, 17 Jan 2018 09:47:22 -0800 Subject: [PATCH 048/496] Define webpack.ProgressPlugin handler with all 5 arguments (#22936) webpack can pass up to 5 arguments to the progress handler: https://github.com/webpack/webpack/blob/b545b519b2024e3f8be3041385bd326bf5d24449/lib/ProgressPlugin.js#L41-L46 For example, simple-progress-webpack-plugin uses all 5 arguments: https://github.com/dominique-mueller/simple-progress-webpack-plugin/blob/246f4795968d49a8b9ecf05ff3f38a100519ac93/logger/verbose-logger.js#L23 --- types/webpack/index.d.ts | 3 ++- types/webpack/webpack-tests.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index 18eed1cc7a..db8bb35c72 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -8,6 +8,7 @@ // Jonathan Creamer // Ahmed T. Ali // Alan Agius +// Spencer Elliott // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -853,7 +854,7 @@ declare namespace webpack { } class ProgressPlugin extends Plugin { - constructor(options?: (percentage: number, msg: string) => void); + constructor(options?: (percentage: number, msg: string, moduleProgress?: string, activeModules?: string, moduleName?: string) => void); } class EnvironmentPlugin extends Plugin { diff --git a/types/webpack/webpack-tests.ts b/types/webpack/webpack-tests.ts index 0816416c2c..becaa20dd6 100644 --- a/types/webpack/webpack-tests.ts +++ b/types/webpack/webpack-tests.ts @@ -453,6 +453,7 @@ plugin = new webpack.LoaderOptionsPlugin({ plugin = new webpack.EnvironmentPlugin(['a', 'b']); plugin = new webpack.EnvironmentPlugin({ a: true, b: 'c' }); plugin = new webpack.ProgressPlugin((percent: number, message: string) => { }); +plugin = new webpack.ProgressPlugin((percent: number, message: string, moduleProgress?: string, activeModules?: string, moduleName?: string) => { }); plugin = new webpack.HashedModuleIdsPlugin(); plugin = new webpack.HashedModuleIdsPlugin({ hashFunction: 'sha256', From ce95a260e0ce1120bd5393de0a985f53b8d0ab3a Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Wed, 17 Jan 2018 10:48:17 -0700 Subject: [PATCH 049/496] =?UTF-8?q?Ember=20Feature=20Flags:=20use=20interf?= =?UTF-8?q?ace=20to=20support=20merging=20user-defined=20pr=E2=80=A6=20(#2?= =?UTF-8?q?2927)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Ember Feature Flags: use interface to support merging user-defined props. * Fix test file name. * Inline (in-file?) `assertType` for ember-feature-flags. --- .../ember-feature-flags-tests.ts | 17 +++++++++++++++-- types/ember-feature-flags/index.d.ts | 2 +- types/ember-feature-flags/tslint.json | 7 ++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/types/ember-feature-flags/ember-feature-flags-tests.ts b/types/ember-feature-flags/ember-feature-flags-tests.ts index 063aeea927..bfcfaae62e 100644 --- a/types/ember-feature-flags/ember-feature-flags-tests.ts +++ b/types/ember-feature-flags/ember-feature-flags-tests.ts @@ -1,14 +1,27 @@ import Features from 'ember-feature-flags'; import 'ember-feature-flags/tests/helpers/with-feature'; +/** Static assertion that `value` has type `T` */ +// Disable tslint here b/c the generic is used to let us do a type coercion and +// validate that coercion works for the type value "passed into" the function. +// tslint:disable-next-line:no-unnecessary-generics +export declare function assertType(value: T): void; + +declare module 'ember-feature-flags' { + export default interface Features { + someFeature: boolean; + } +} + // https://www.npmjs.com/package/ember-feature-flags#withfeature declare var features: Features; features.isEnabled('new-billing-plans'); // $ExpectType boolean features.enable('newHomepage'); // $ExpectType void features.disable('newHomepage'); // $ExpectType void const setup = { - "new-billing-plans": true, - "new-homepage": false + 'new-billing-plans': true, + 'new-homepage': false }; features.setup(setup); // $ExpectType void withFeature('new-homepage'); // $ExpectType void +assertType(features.get('someFeature')); diff --git a/types/ember-feature-flags/index.d.ts b/types/ember-feature-flags/index.d.ts index 8aec1a6f0a..94b443afae 100644 --- a/types/ember-feature-flags/index.d.ts +++ b/types/ember-feature-flags/index.d.ts @@ -7,7 +7,7 @@ import Ember from 'ember'; // https://github.com/kategengler/ember-feature-flags/blob/v3.0.0/addon/services/features.js#L5 -export default class Features extends Ember.Service { +export default interface Features extends Ember.Service { setup(features: { [key: string]: boolean }): void; enable(feature: string): void; disable(feature: string): void; diff --git a/types/ember-feature-flags/tslint.json b/types/ember-feature-flags/tslint.json index 3db14f85ea..4c4fc86ace 100644 --- a/types/ember-feature-flags/tslint.json +++ b/types/ember-feature-flags/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "strict-export-declare-modifiers": false + } +} From 1df22278c5d2e33a82ea353cdd890743bb7de604 Mon Sep 17 00:00:00 2001 From: Garanzha Dmitriy Date: Wed, 17 Jan 2018 19:49:13 +0200 Subject: [PATCH 050/496] @types/nock Multiple set cookie. (#22921) --- types/nock/index.d.ts | 3 ++- types/nock/nock-tests.ts | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/types/nock/index.d.ts b/types/nock/index.d.ts index 8c6e4f2faf..91037b8e54 100644 --- a/types/nock/index.d.ts +++ b/types/nock/index.d.ts @@ -4,6 +4,7 @@ // Horiuchi_H // afharo // Matt R. Wilson +// Garanzha Dmitriy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -34,7 +35,7 @@ declare namespace nock { export var back: NockBack; - type HttpHeaders = { [key: string]: string | { (req: any, res: any, body: string): any; }; }; + type HttpHeaders = { [key: string]: string | string[] | { (req: any, res: any, body: string): any; }; }; type InterceptFunction = ( uri: string | RegExp | { (uri: string): boolean; }, requestBody?: string | RegExp | { (body: any): boolean; } | any, diff --git a/types/nock/nock-tests.ts b/types/nock/nock-tests.ts index 180c7a9c63..e81e3fd096 100644 --- a/types/nock/nock-tests.ts +++ b/types/nock/nock-tests.ts @@ -368,6 +368,12 @@ var scope = nock('http://www.headdy.com') 'X-My-Headers': 'My Header value' }); +var scope = nock('http://www.headdy.com') + .get('/') + .reply(200, 'Hello World!', { + 'X-My-Headers': ['My Header value 1', 'My Header value 2'] + }); + var scope = nock('http://www.headdy.com') .get('/') .reply(200, 'Hello World!', { From 2e11609c20806ceae986969f92ea340cf77aabf3 Mon Sep 17 00:00:00 2001 From: spacejack Date: Wed, 17 Jan 2018 12:49:36 -0500 Subject: [PATCH 051/496] Add WebVRManager, ArrayCamera support (#22900) --- types/three/test/webvr/webvr.ts | 13 +++++++++++++ types/three/three-core.d.ts | 19 +++++++++++++++++++ types/three/tsconfig.json | 5 +++-- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 types/three/test/webvr/webvr.ts diff --git a/types/three/test/webvr/webvr.ts b/types/three/test/webvr/webvr.ts new file mode 100644 index 0000000000..e831e493ee --- /dev/null +++ b/types/three/test/webvr/webvr.ts @@ -0,0 +1,13 @@ +// WebVRManager support + +() => { + const renderer = new THREE.WebGLRenderer(); + renderer.vr.enabled = true; + const camera = new THREE.PerspectiveCamera(); + const vrCamera = renderer.vr.getCamera(camera); + const display: VRDisplay = renderer.vr.getDevice(); + renderer.vr.setDevice(display); + const obj = new THREE.Object3D(); + renderer.vr.setPoseTarget(obj); + renderer.vr.dispose(); +} diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 06bb1e02d0..a2c4b05544 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -656,6 +656,13 @@ export class StereoCamera extends Camera { update(camera: PerspectiveCamera): void; } +export class ArrayCamera extends PerspectiveCamera { + constructor(cameras?: PerspectiveCamera[]); + + cameras: PerspectiveCamera[]; + isArrayCamera: true; +} + // Core /////////////////////////////////////////////////////////////////////////////////////////////// /** @@ -5134,6 +5141,8 @@ export class WebGLRenderer implements Renderer { state: WebGLState; allocTextureUnit: any; + vr: WebVRManager; + /** * Return the WebGL context. */ @@ -7077,3 +7086,13 @@ export class MorphBlendMesh extends Mesh { stopAnimation(name: string): void; update(delta: number): void; } + +export interface WebVRManager { + enabled: boolean; + getDevice(): VRDisplay | null; + setDevice(device: VRDisplay | null): void; + setPoseTarget(object: Object3D | null): void; + getCamera(camera: PerspectiveCamera): PerspectiveCamera | ArrayCamera; + submitFrame(): void; + dispose(): void; +} diff --git a/types/three/tsconfig.json b/types/three/tsconfig.json index 1e615b65b1..4faf2d0b0c 100644 --- a/types/three/tsconfig.json +++ b/types/three/tsconfig.json @@ -54,6 +54,7 @@ "test/examples/controls/vrcontrols.ts", "test/examples/ctm/ctmloader.ts", "test/examples/octree.ts", - "test/examples/loaders/webgl_loader_obj_mtl.ts" + "test/examples/loaders/webgl_loader_obj_mtl.ts", + "test/webvr/webvr.ts" ] -} \ No newline at end of file +} From f2435def782ea259f0e8b04d5c82ba6972c25b38 Mon Sep 17 00:00:00 2001 From: ManeeshSharma17 Date: Wed, 17 Jan 2018 23:20:02 +0530 Subject: [PATCH 052/496] fix(types): add col to CountOptions and FindOptions interface (#22914) * fix(types): add col to CountOptions and FindOptions interface Added missing property 'col' in CountOptions and FindOptions interface. * Added missing property 'col' in CountOptions and FindOptions interface in v3 * added testcase * remove col attribute from FindOptions * Removed whitespaces --- types/sequelize/index.d.ts | 6 +++++- types/sequelize/sequelize-tests.ts | 1 + types/sequelize/v3/index.d.ts | 5 +++++ types/sequelize/v3/sequelize-tests.ts | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 6bc7c06dff..f94d95ec26 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -3322,7 +3322,6 @@ declare namespace sequelize { */ group?: string | string[] | Object; - /** * Apply DISTINCT(col) for FindAndCount(all) */ @@ -3356,6 +3355,11 @@ declare namespace sequelize { */ include?: Array | IncludeOptions>; + /** + * Apply column on which COUNT() should be applied + */ + col?: string; + /** * Apply COUNT(DISTINCT(col)) */ diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index e32ae0b008..0f329171e7 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -980,6 +980,7 @@ User.count( { include : [{ model : User, required : false }] } ); User.count( { distinct : true, include : [{ model : User, required : false }] } ); User.count( { attributes : ['data'], group : ['data'] } ); User.count( { where : { access_level : { gt : 5 } } } ); +User.count( { col: 'title', distinct: true, where : { access_level : { gt : 5 } } } ); User.findAndCountAll( { offset : 5, limit : 1, include : [User, { model : User, as : 'a' }] } ); diff --git a/types/sequelize/v3/index.d.ts b/types/sequelize/v3/index.d.ts index d777303d94..9453a8473d 100644 --- a/types/sequelize/v3/index.d.ts +++ b/types/sequelize/v3/index.d.ts @@ -3243,6 +3243,11 @@ declare namespace sequelize { */ include?: Array | IncludeOptions>; + /** + * Apply column on which COUNT() should be applied + */ + col?: string; + /** * Apply COUNT(DISTINCT(col)) */ diff --git a/types/sequelize/v3/sequelize-tests.ts b/types/sequelize/v3/sequelize-tests.ts index 4a3ba51753..b575271867 100644 --- a/types/sequelize/v3/sequelize-tests.ts +++ b/types/sequelize/v3/sequelize-tests.ts @@ -930,6 +930,7 @@ User.count( { include : [{ model : User, required : false }] } ); User.count( { distinct : true, include : [{ model : User, required : false }] } ); User.count( { attributes : ['data'], group : ['data'] } ); User.count( { where : { access_level : { gt : 5 } } } ); +User.count( { col: 'title', distinct: true, where : { access_level : { gt : 5 } } } ); User.findAndCountAll( { offset : 5, limit : 1, include : [User, { model : User, as : 'a' }] } ); From 3a501549c269956d8dc6140654daef09fb1f0ef9 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Wed, 17 Jan 2018 09:50:17 -0800 Subject: [PATCH 053/496] read-pkg-up: fix return value (#22928) --- types/read-pkg-up/index.d.ts | 8 ++++---- types/read-pkg-up/read-pkg-up-tests.ts | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/types/read-pkg-up/index.d.ts b/types/read-pkg-up/index.d.ts index bdfd304827..9a7e689577 100644 --- a/types/read-pkg-up/index.d.ts +++ b/types/read-pkg-up/index.d.ts @@ -7,8 +7,8 @@ import normalize = require('normalize-package-data'); declare namespace ReadPkgUp { - function sync(options: Options & {normalize: false}): {[k: string]: any}; - function sync(options?: Options): normalize.Package; + function sync(options: Options & {normalize: false}): {path: string, pkg: {[k: string]: any}}; + function sync(options?: Options): {path: string, pkg: Package}; interface Options { /** @@ -28,7 +28,7 @@ declare namespace ReadPkgUp { type Package = normalize.Package; } -declare function ReadPkgUp(options: ReadPkgUp.Options & {normalize: false}): Promise<{[k: string]: any}>; -declare function ReadPkgUp(options?: ReadPkgUp.Options): Promise; +declare function ReadPkgUp(options: ReadPkgUp.Options & {normalize: false}): Promise<{path: string, pkg: {[k: string]: any}}>; +declare function ReadPkgUp(options?: ReadPkgUp.Options): Promise<{path: string, pkg: normalize.Package}>; export = ReadPkgUp; diff --git a/types/read-pkg-up/read-pkg-up-tests.ts b/types/read-pkg-up/read-pkg-up-tests.ts index 32943d57bb..f8d54daaf6 100644 --- a/types/read-pkg-up/read-pkg-up-tests.ts +++ b/types/read-pkg-up/read-pkg-up-tests.ts @@ -1,8 +1,8 @@ import ReadPkgUp = require('read-pkg-up'); -ReadPkgUp().then(pkg => pkg.name); // $ExpectType Promise -ReadPkgUp({cwd: '.', normalize: true}).then(pkg => pkg.name); // $ExpectType Promise -ReadPkgUp({cwd: '.', normalize: false}).then(pkg => pkg['name']); // $ExpectType Promise -ReadPkgUp.sync().name; // $ExpectType string -ReadPkgUp.sync({cwd: '.', normalize: true}).name; // $ExpectType string -ReadPkgUp.sync({cwd: '.', normalize: false})['name']; // $ExpectType any +ReadPkgUp().then(pkg => pkg.pkg.name); // $ExpectType Promise +ReadPkgUp({cwd: '.', normalize: true}).then(pkg => pkg.pkg.name); // $ExpectType Promise +ReadPkgUp({cwd: '.', normalize: false}).then(pkg => pkg.pkg['name']); // $ExpectType Promise +ReadPkgUp.sync().pkg.name; // $ExpectType string +ReadPkgUp.sync({cwd: '.', normalize: true}).pkg.name; // $ExpectType string +ReadPkgUp.sync({cwd: '.', normalize: false}).pkg['name']; // $ExpectType any From 6af5b8d3a5332ae9fa961f3354c4b47f5b64f1ce Mon Sep 17 00:00:00 2001 From: Rob Moran Date: Wed, 17 Jan 2018 17:51:17 +0000 Subject: [PATCH 054/496] Added correct flag type to Interface.release() in usb package (#22832) * Added correct flag type to Interface.release() in usb package * Update Interface.release() to outline both ways of calling it * Added missing fields, fixed the bMaxPacketSize0 field name and highlighted the params are optional in InEndpoint.startPoll() * Add undocumented descriptor fields --- types/usb/index.d.ts | 13 +++++++++++-- types/usb/usb-tests.ts | 28 ++++++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/types/usb/index.d.ts b/types/usb/index.d.ts index 5e24e16bac..7d3a5d8c89 100644 --- a/types/usb/index.d.ts +++ b/types/usb/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for node-usb 1.1 // Project: https://github.com/tessel/node-usb // Definitions by: Eric Brody +// Rob Moran // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -14,6 +15,8 @@ export class Device { portNumbers: number[]; deviceDescriptor: DeviceDescriptor; configDescriptor: ConfigDescriptor; + allConfigDescriptors: ConfigDescriptor[]; + parent: Device; interfaces: Interface[]; __open(): void; @@ -35,7 +38,7 @@ export class DeviceDescriptor { bDeviceClass: number; bDeviceSubClass: number; bDeviceProtocol: number; - bMaxPacketSize: number; + bMaxPacketSize0: number; idVendor: number; idProduct: number; bcdDevice: number; @@ -55,14 +58,18 @@ export class ConfigDescriptor { bmAttributes: number; bMaxPower: number; extra: Buffer; + interfaces: InterfaceDescriptor[][]; } export class Interface { + interface: number; + altSetting: number; descriptor: InterfaceDescriptor; endpoints: Endpoint[]; constructor(device: Device, id: number); claim(): void; - release(closeEndpoints?: (err?: string) => void, cb?: (err?: string) => void): void; + release(cb?: (err?: string) => void): void; + release(closeEndpoints?: boolean, cb?: (err?: string) => void): void; isKernelDriverActive(): boolean; detachKernelDriver(): number; attachKernelDriver(): number; @@ -81,6 +88,7 @@ export class InterfaceDescriptor { bInterfaceProtocol: number; iInterface: number; extra: Buffer; + endpoints: EndpointDescriptor[]; } export interface Endpoint extends EventEmitter { @@ -120,6 +128,7 @@ export class EndpointDescriptor { bInterval: number; bRefresh: number; bSynchAddress: number; + extra: Buffer; } export function findByIds(vid: number, pid: number): Device; diff --git a/types/usb/usb-tests.ts b/types/usb/usb-tests.ts index 53b214460e..44701c655b 100644 --- a/types/usb/usb-tests.ts +++ b/types/usb/usb-tests.ts @@ -25,7 +25,7 @@ deviceDesc.bcdUSB = 1; deviceDesc.bDeviceClass = 1; deviceDesc.bDeviceSubClass = 1; deviceDesc.bDeviceProtocol = 1; -deviceDesc.bMaxPacketSize = 1; +deviceDesc.bMaxPacketSize0 = 1; deviceDesc.idVendor = 1; deviceDesc.idProduct = 1; deviceDesc.bcdDevice = 1; @@ -51,16 +51,37 @@ configDesc.extra = new Buffer([]); const deviceInterface: usb.Interface = device.interface(1); device.interfaces = [deviceInterface]; +device.parent = device; +device.configDescriptor = configDesc; +device.allConfigDescriptors = [configDesc]; const iface = new usb.Interface(device, 1); +iface.interface = 1; +iface.altSetting = 0; iface.claim(); -iface.release((error: string) => null, (error: string) => null); +iface.release((error: string) => null); +iface.release(false, (error: string) => null); const kernelActive: boolean = iface.isKernelDriverActive(); const detachKernel: number = iface.detachKernelDriver(); const attachKernel: number = iface.attachKernelDriver(); iface.setAltSetting(1, (error: string) => null); +const ifaceDesc: usb.InterfaceDescriptor = new usb.InterfaceDescriptor(); + +ifaceDesc.bLength = 1; +ifaceDesc.bDescriptorType = 1; +ifaceDesc.bInterfaceNumber = 1; +ifaceDesc.bAlternateSetting = 1; +ifaceDesc.bNumEndpoints = 1; +ifaceDesc.bInterfaceClass = 1; +ifaceDesc.bInterfaceSubClass = 1; +ifaceDesc.bInterfaceProtocol = 1; +ifaceDesc.iInterface = 1; +ifaceDesc.extra = new Buffer([]); + +iface.descriptor = ifaceDesc; + const endpointDesc: usb.EndpointDescriptor = new usb.EndpointDescriptor(); endpointDesc.bLength = 1; @@ -71,6 +92,7 @@ endpointDesc.wMaxPacketSize = 1; endpointDesc.bInterval = 1; endpointDesc.bRefresh = 1; endpointDesc.bSynchAddress = 1; +endpointDesc.extra = new Buffer([]); const ifaceInEndpoint: usb.Endpoint = iface.endpoint(1) as usb.InEndpoint; const ifaceOutEndpoint: usb.Endpoint = iface.endpoint(1) as usb.OutEndpoint; @@ -98,6 +120,8 @@ inEndpoint.on("error", (err) => null); const xferOutEndpoint: usb.OutEndpoint = outEndpoint.transfer(new Buffer([]), (error: string) => null); outEndpoint.transferWithZLP(new Buffer([]), (error: string) => null); +iface.endpoints = [inEndpoint, outEndpoint]; + const findByDevice: usb.Device = usb.findByIds(1, 1); usb.on("hey", (device: usb.Device) => null); const deviceList: usb.Device[] = usb.getDeviceList(); From 2037b3b9baf6be00bc9a33c0837e16160af0e7ef Mon Sep 17 00:00:00 2001 From: Charles-Philippe Clermont Date: Wed, 17 Jan 2018 12:51:52 -0500 Subject: [PATCH 055/496] propEq with one argument returns a curried function (#22923) --- types/ramda/index.d.ts | 14 ++++++-------- types/ramda/ramda-tests.ts | 7 +++++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 37444ad500..ccd73c53d3 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -1487,14 +1487,12 @@ declare namespace R { * value according to strict equality (`===`). Most likely used to * filter a list. */ - // propEq(name: string, val: T, obj: {[index:string]: T}): boolean; - // propEq(name: string, val: T, obj: {[index:number]: T}): boolean; - propEq(name: string, val: T, obj: any): boolean; - // propEq(name: number, val: T, obj: any): boolean; - propEq(name: string, val: T): (obj: any) => boolean; - // propEq(name: number, val: T): (obj: any) => boolean; - propEq(name: string): (val: T, obj: any) => boolean; - // propEq(name: number): (val: T, obj: any) => boolean; + propEq(name: string | number, val: T, obj: any): boolean; + propEq(name: string | number, val: T): (obj: any) => boolean; + propEq(name: string | number): { + (val: T, obj: any): boolean; + (val: T): (obj: any) => boolean; + }; /** * Returns true if the specified object property is of the given type; false otherwise. diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index 71f8723f9a..e6433df004 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -583,6 +583,13 @@ R.times(i, 5); R.filter(isFamous, users); // => [ user1 ] }; +() => { + const coll = [{ type: 'BUY' }, { type: 'SELL' }, { type: 'BUY' }]; + const typeIs = R.propEq('type'); + const isBuy = typeIs('BUY'); + R.filter(isBuy, coll); // [{ type: 'BUY' }, { type: 'BUY' }] +}; + () => { const xs: { [key: string]: string } = {a: "1", b: "0"}; R.propEq("a", "1", xs); // => true From 8b902e076f7cea92ed98deac36104c4b93ee580f Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Wed, 17 Jan 2018 10:52:29 -0700 Subject: [PATCH 056/496] Add ember-data error types; Ember.ViewUtils.isSimpleClick. (#22924) --- types/ember-data/index.d.ts | 20 ++++--- types/ember-data/test/error.ts | 106 +++++++++++++++++++++++++++++++++ types/ember-data/tsconfig.json | 3 +- types/ember/index.d.ts | 6 +- types/ember/test/route.ts | 8 +++ types/ember/test/view-utils.ts | 5 ++ types/ember/tsconfig.json | 3 +- 7 files changed, 138 insertions(+), 13 deletions(-) create mode 100644 types/ember-data/test/error.ts create mode 100644 types/ember/test/view-utils.ts diff --git a/types/ember-data/index.d.ts b/types/ember-data/index.d.ts index 0ec24fae41..a59ab4de97 100644 --- a/types/ember-data/index.d.ts +++ b/types/ember-data/index.d.ts @@ -208,7 +208,7 @@ declare module "ember-data" { * subclasses are used to indicate specific error states. The following * subclasses are provided: */ - class AdapterError {} + class AdapterError extends Ember.Object {} /** * A `DS.InvalidError` is used by an adapter to signal the external API * was unable to process a request because the content was not @@ -218,27 +218,29 @@ declare module "ember-data" { * transition to the `invalid` state and the errors will be set to the * `errors` property on the record. */ - class InvalidError {} + class InvalidError extends AdapterError { + constructor(errors: any[]); + } /** * A `DS.TimeoutError` is used by an adapter to signal that a request * to the external API has timed out. I.e. no response was received from * the external API within an allowed time period. */ - class TimeoutError {} + class TimeoutError extends AdapterError {} /** * A `DS.AbortError` is used by an adapter to signal that a request to * the external API was aborted. For example, this can occur if the user * navigates away from the current page after a request to the external API * has been initiated but before a response has been received. */ - class AbortError {} + class AbortError extends AdapterError {} /** * A `DS.UnauthorizedError` equates to a HTTP `401 Unauthorized` response * status. It is used by an adapter to signal that a request to the external * API was rejected because authorization is required and has failed or has not * yet been provided. */ - class UnauthorizedError {} + class UnauthorizedError extends AdapterError {} /** * A `DS.ForbiddenError` equates to a HTTP `403 Forbidden` response status. * It is used by an adapter to signal that a request to the external API was @@ -246,13 +248,13 @@ declare module "ember-data" { * provided and is valid, then the authenticated user does not have the * necessary permissions for the request. */ - class ForbiddenError {} + class ForbiddenError extends AdapterError {} /** * A `DS.NotFoundError` equates to a HTTP `404 Not Found` response status. * It is used by an adapter to signal that a request to the external API * was rejected because the resource could not be found on the API. */ - class NotFoundError {} + class NotFoundError extends AdapterError {} /** * A `DS.ConflictError` equates to a HTTP `409 Conflict` response status. * It is used by an adapter to indicate that the request could not be processed @@ -260,13 +262,13 @@ declare module "ember-data" { * creating a record with a client generated id but that id is already known * to the external API. */ - class ConflictError {} + class ConflictError extends AdapterError {} /** * A `DS.ServerError` equates to a HTTP `500 Internal Server Error` response * status. It is used by the adapter to indicate that a request has failed * because of an error in the external API. */ - class ServerError {} + class ServerError extends AdapterError {} /** * Holds validation errors for a given record, organized by attribute names. */ diff --git a/types/ember-data/test/error.ts b/types/ember-data/test/error.ts new file mode 100644 index 0000000000..b8b65ca967 --- /dev/null +++ b/types/ember-data/test/error.ts @@ -0,0 +1,106 @@ +import Ember from 'ember'; +import DS from 'ember-data'; +import { assertType } from './lib/assert'; + +const { AdapterError } = DS; + +// https://emberjs.com/api/ember-data/2.16/classes/DS.AdapterError +const MaintenanceError = DS.AdapterError.extend({ + message: 'Down for maintenance.', +}); +const maintenanceError = new MaintenanceError(); +assertType(maintenanceError); + +// https://emberjs.com/api/ember-data/2.16/classes/DS.InvalidError +const anInvalidError = new DS.InvalidError([ + { + detail: 'Must be unique', + source: { pointer: '/data/attributes/title' }, + }, + { + detail: 'Must not be blank', + source: { pointer: '/data/attributes/content' }, + }, +]); + +// https://emberjs.com/api/ember-data/2.16/classes/DS.TimeoutError +const { TimeoutError } = DS; +const timedOut = Ember.Route.extend({ + actions: { + error(error: any, transition: any) { + if (error instanceof TimeoutError) { + // alert the user + alert('Are you still connected to the internet?'); + return; + } + + // ...other error handling logic + }, + }, +}); + +// This is technically private, but publicly exposed for APIs to use. We just +// check that it is a proper subclass of `AdapterError`. +// https://emberjs.com/api/ember-data/2.16/classes/DS.AbortError +// https://github.com/emberjs/data/blob/v2.16.0/addon/-private/adapters/errors.js#L206-L216 +const { AbortError } = DS; +assertType(AbortError); + +// https://emberjs.com/api/ember-data/2.16/classes/DS.UnauthorizedError +const { UnauthorizedError } = DS; +assertType(UnauthorizedError); +const unauthorized = Ember.Route.extend({ + actions: { + error(error: any, transition: any) { + if (error instanceof UnauthorizedError) { + // go to the sign in route + this.transitionTo('login'); + return; + } + + // ...other error handling logic + }, + }, +}); + +// This is technically private, but publicly exposed for APIs to use. We just +// check that it is a proper subclass of `AdapterError`. +// https://emberjs.com/api/ember-data/2.16/classes/DS.ForbiddenError +// https://github.com/emberjs/data/blob/v2.16.0/addon/-private/adapters/errors.js#L253-L263 +const { ForbiddenError } = DS; +assertType(ForbiddenError); + +// https://emberjs.com/api/ember-data/2.16/classes/DS.NotFoundError +const { NotFoundError } = DS; +assertType(NotFoundError); +const notFound = Ember.Route.extend({ + model(params: { post_id: string }): any { + return this.get('store').findRecord('post', params.post_id); + }, + + actions: { + error(error: any, transition: any): any { + if (error instanceof NotFoundError) { + // redirect to a list of all posts instead + this.transitionTo('posts'); + } else { + // otherwise let the error bubble + return true; + } + }, + }, +}); + +// This is technically private, but publicly exposed for APIs to use. We just +// check that it is a proper subclass of `AdapterError`. +// https://emberjs.com/api/ember-data/2.16/classes/DS.ConflictError +// https://github.com/emberjs/data/blob/v2.16.0/addon/-private/adapters/errors.js#L303-L313 +const { ConflictError } = DS; +assertType(ConflictError); + +// This is technically private, but publicly exposed for APIs to use. We just +// check that it is a proper subclass of `AdapterError`. +// https://emberjs.com/api/ember-data/2.16/classes/DS.ServerError +// https://github.com/emberjs/data/blob/v2.16.0/addon/-private/adapters/errors.js#L315-L323 +const { ServerError } = DS; +assertType(ServerError); diff --git a/types/ember-data/tsconfig.json b/types/ember-data/tsconfig.json index 5f7c297ec7..15f77391aa 100644 --- a/types/ember-data/tsconfig.json +++ b/types/ember-data/tsconfig.json @@ -28,6 +28,7 @@ "test/has-many.ts", "test/belongs-to.ts", "test/record-reference.ts", - "test/injections.ts" + "test/injections.ts", + "test/error.ts" ] } diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 238e895e34..91f78a402b 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -1846,7 +1846,7 @@ declare module 'ember' { be useful, for instance, for retrieving async code from the server that is required to enter a route. */ - beforeModel(transition: Transition): Rsvp.Promise; + beforeModel(transition: Transition): any; /** * Returns the controller for a particular route or name. @@ -2207,7 +2207,9 @@ declare module 'ember' { actionContext: any; } const ViewTargetActionSupport: Mixin; - const ViewUtils: {}; // TODO: define interface + const ViewUtils: { + isSimpleClick(event: Event): boolean; + }; // FYI - RSVP source comes from https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/promise.js const RSVP: typeof Rsvp; diff --git a/types/ember/test/route.ts b/types/ember/test/route.ts index 22193bd88d..fad5bbc634 100755 --- a/types/ember/test/route.ts +++ b/types/ember/test/route.ts @@ -85,3 +85,11 @@ Route.extend({ this.controllerFor('application').set('model', model); }, }); + +class RouteUsingClass extends Route.extend({ + randomProperty: 'the .extend + extends bit type-checks properly', +}) { + beforeModel(this: RouteUsingClass) { + return 'beforeModel can return anything, not just promises'; + } +} diff --git a/types/ember/test/view-utils.ts b/types/ember/test/view-utils.ts new file mode 100644 index 0000000000..a3613064eb --- /dev/null +++ b/types/ember/test/view-utils.ts @@ -0,0 +1,5 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const { ViewUtils: { isSimpleClick } } = Ember; +assertType(isSimpleClick(new Event('wat'))); diff --git a/types/ember/tsconfig.json b/types/ember/tsconfig.json index c0aab2e780..98d2623024 100755 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -44,6 +44,7 @@ "test/run.ts", "test/test.ts", "test/controller.ts", - "test/route.ts" + "test/route.ts", + "test/view-utils.ts" ] } From 6fe41fe2e72992ce874addcfa3dde803bca5910d Mon Sep 17 00:00:00 2001 From: Alec Winograd Date: Wed, 17 Jan 2018 18:52:58 +0100 Subject: [PATCH 057/496] [react-navigation] refine type for createNavigationContainer (#22922) --- types/react-navigation/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 3418004b60..bcef405be9 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -693,7 +693,7 @@ export function createNavigator( */ export function createNavigationContainer( Component: NavigationNavigator -): React.Component; +): NavigationContainer; /** * END MANUAL DEFINITIONS OUTSIDE OF TYPEDEFINITION.JS */ From a025cb184bfdf01f8c697306c3f1848d59efa14d Mon Sep 17 00:00:00 2001 From: smhxx Date: Wed, 17 Jan 2018 11:55:29 -0600 Subject: [PATCH 058/496] atom: fix type of Task.send()'s message parameter (#22907) * atom: fix type of Task.send()'s message parameter * atom: disallow undefined message argument to Task.send() * atom: remove unnecessary linter comment * atom: allow nested arrays to be passed to Task.send() --- types/atom/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/atom/index.d.ts b/types/atom/index.d.ts index 53fa8d5749..a261661144 100644 --- a/types/atom/index.d.ts +++ b/types/atom/index.d.ts @@ -4810,7 +4810,8 @@ export class Task { * Throws an error if this task has already been terminated or if sending a * message to the child process fails. */ - send(message: string): void; + // tslint:disable-next-line:no-any + send(message: string | number | boolean | object | null | any[]): void; /** Call a function when an event is emitted by the child process. */ // tslint:disable-next-line:no-any From be285f96bfb0c24733af51c50d85b352e1816aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Niclas=20Str=C3=BCwer?= Date: Wed, 17 Jan 2018 18:55:43 +0100 Subject: [PATCH 059/496] step() option in animate function is optional. examples in cytoscape js docu (http://js.cytoscape.org/#cy.animate) use animate without step parameter. (#22916) --- types/cytoscape/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts index bf3439324b..ad0c8de371 100644 --- a/types/cytoscape/index.d.ts +++ b/types/cytoscape/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Fabian Schmidt and Fred Eisele // Shenghan Gao // Yuri Pereira Constante +// Jan-Niclas Struewer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // // Translation from Objects in help to Typescript interface. @@ -900,7 +901,7 @@ declare namespace cytoscape { /** complete - A function to call when the animation is done. */ complete?(): void; /** step - A function to call each time the animation steps. */ - step(): void; + step?(): void; } interface AnimationOptions extends AnimateOptionsCommon { /** queue - A transition-timing-function easing style string that shapes the animation progress curve. */ From bb6a407de4c7c05e5e85270e751962cdccda7eec Mon Sep 17 00:00:00 2001 From: SagarFargade <35451543+SagarFargade@users.noreply.github.com> Date: Wed, 17 Jan 2018 23:25:58 +0530 Subject: [PATCH 060/496] Add Alignment and Hide Default Launcher Options for intercom-web (#22920) * Add Alignrment and Hide Default Launcher Options Added Alignment and Hide default launcher options for intercom settings. * Fixed build errors Added Semicolon instaed of comma. --- types/intercom-web/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/intercom-web/index.d.ts b/types/intercom-web/index.d.ts index 1eb038bd07..a0b4e71015 100755 --- a/types/intercom-web/index.d.ts +++ b/types/intercom-web/index.d.ts @@ -8,9 +8,11 @@ declare namespace Intercom_ { interface IntercomSettings { + alignment?: string; app_id?: string; email?: string; created_at?: number; + hide_default_launcher?: boolean; name?: string; user_id?: string; user_hash?: string; From 2c7e6c4f0916cd5b980152a0be918ee5eb244bbc Mon Sep 17 00:00:00 2001 From: smhxx Date: Wed, 17 Jan 2018 11:57:04 -0600 Subject: [PATCH 061/496] atom: fix return type of LinterProvider.lint() (#22904) --- types/atom/linter/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/atom/linter/index.d.ts b/types/atom/linter/index.d.ts index bf085d9859..79fc397ab8 100644 --- a/types/atom/linter/index.d.ts +++ b/types/atom/linter/index.d.ts @@ -78,5 +78,5 @@ export interface LinterProvider { scope: "file"|"project"; lintsOnChange: boolean; grammarScopes: string[]; - lint(textEditor: TextEditor): Message[]|void|Promise; + lint(textEditor: TextEditor): Message[]|null|Promise; } From 6faad9d19989039cc3ab4e053d97028780cc7e9b Mon Sep 17 00:00:00 2001 From: Niklas Wulf Date: Wed, 17 Jan 2018 18:57:36 +0100 Subject: [PATCH 062/496] [boom] isBoom is a type-guard (#22918) Instead of just returning boolean, the `isBoom` function can and should be a type-guard, which enables the obvious benefits. --- types/boom/boom-tests.ts | 6 ++++++ types/boom/index.d.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/types/boom/boom-tests.ts b/types/boom/boom-tests.ts index f989128b4e..4d133b2545 100644 --- a/types/boom/boom-tests.ts +++ b/types/boom/boom-tests.ts @@ -144,6 +144,12 @@ const isBoomError = new Boom.Boom('test') Boom.isBoom(isBoomError); +const maybeBoom = new Boom.Boom('test'); +if(Boom.isBoom(maybeBoom)) { + // isBoom is a type guard that allows accessing these properties: + maybeBoom.output.headers; +} + // constructor const constructorError: Boom.Boom = new Boom.Boom('test'); diff --git a/types/boom/index.d.ts b/types/boom/index.d.ts index 89ca580561..ed48f181cf 100644 --- a/types/boom/index.d.ts +++ b/types/boom/index.d.ts @@ -86,7 +86,7 @@ declare namespace Boom { * Identifies whether an error is a Boom object. Same as calling instanceof Boom. * @param error the error object to identify. */ - export function isBoom(error: Error): boolean + export function isBoom(error: Error): error is Boom // 4xx /** From a27b24d877838cd785df91bc52b3a5a1c3f40a19 Mon Sep 17 00:00:00 2001 From: smhxx Date: Wed, 17 Jan 2018 11:58:00 -0600 Subject: [PATCH 063/496] resolve: fix signature of callback type (#22911) --- types/resolve/index.d.ts | 12 +++++++++--- types/resolve/resolve-tests.ts | 6 ++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/types/resolve/index.d.ts b/types/resolve/index.d.ts index fd3bf8272b..11a46b97a3 100644 --- a/types/resolve/index.d.ts +++ b/types/resolve/index.d.ts @@ -6,13 +6,19 @@ /// +interface PackageMeta { + name: string; + version: string; + [key: string]: any; +} + /** * Callback invoked when resolving asynchronously * * @param error * @param resolved Absolute path to resolved identifier */ -type resolveCallback = (err: Error, resolved?: string) => void; +type resolveCallback = (err: Error | null, resolved?: string, pkg?: PackageMeta) => void; /** * Callback invoked when checking if a file exists @@ -20,7 +26,7 @@ type resolveCallback = (err: Error, resolved?: string) => void; * @param error * @param isFile If the given file exists */ -type isFileCallback = (err: Error, isFile?: boolean) => void; +type isFileCallback = (err: Error | null, isFile?: boolean) => void; /** * Callback invoked when reading a file @@ -28,7 +34,7 @@ type isFileCallback = (err: Error, isFile?: boolean) => void; * @param error * @param isFile If the given file exists */ -type readFileCallback = (err: Error, file?: Buffer) => void; +type readFileCallback = (err: Error | null, file?: Buffer) => void; /** * Asynchronously resolve the module path string id into cb(err, res [, pkg]), where pkg (if defined) is the data from package.json diff --git a/types/resolve/resolve-tests.ts b/types/resolve/resolve-tests.ts index c4b89feb46..28dae63c82 100644 --- a/types/resolve/resolve-tests.ts +++ b/types/resolve/resolve-tests.ts @@ -2,12 +2,13 @@ import * as fs from 'fs'; import * as resolve from 'resolve'; function test_basic_async() { - resolve('typescript', function(error, resolved) { + resolve('typescript', function(error, resolved, pkg) { if (error) { console.error(error.message); return; } console.log(resolved); + console.log(pkg.version); }); } @@ -41,12 +42,13 @@ function test_options_async() { } }); } - }, function(error, resolved) { + }, function(error, resolved, pkg) { if (error) { console.error(error.message); return; } console.log(resolved); + console.log(pkg.version); }); } From c4e95181211121b238d73cff6b585566b0d0fab0 Mon Sep 17 00:00:00 2001 From: Derek Wickern Date: Wed, 17 Jan 2018 09:59:14 -0800 Subject: [PATCH 064/496] ember: allow get/set with dynamic key (#22905) --- types/ember/index.d.ts | 6 ++++++ types/ember/test/observable.ts | 18 ++++++++++++++++++ types/ember/tslint.json | 7 +++++-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 91f78a402b..61bdcb9828 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -3057,10 +3057,12 @@ declare module 'ember' { obj: ComputedProperties, list: K[] ): Pick; + function getProperties(obj: T, list: K[]): Pick; // for dynamic K function getProperties( obj: ComputedProperties, ...list: K[] ): Pick; + function getProperties(obj: T, ...list: K[]): Pick; // for dynamic K /** * A value is blank if it is empty or a whitespace string. */ @@ -3145,6 +3147,7 @@ declare module 'ember' { * object implements the `unknownProperty` method then that will be invoked. */ function get(obj: ComputedProperties, key: K): T[K]; + function get(obj: T, key: K): T[K]; // for dynamic K /** * Retrieves the value of a property from an Object, or a default value in the * case that the property returns `undefined`. @@ -3154,6 +3157,7 @@ declare module 'ember' { key: K, defaultValue: T[K] ): T[K]; + function getWithDefault(obj: T, key: K, defaultValue: T[K]): T[K]; // for dynamic K /** * Sets the value of a property on an object, respecting computed properties * and notifying observers and other listeners of the change. If the @@ -3165,6 +3169,7 @@ declare module 'ember' { key: K, value: V ): V; + function set(obj: T, key: K, value: V): V; // for dynamic K /** * Error-tolerant form of `Ember.set`. Will not blow up if any part of the * chain is `undefined`, `null`, or destroyed. @@ -3179,6 +3184,7 @@ declare module 'ember' { obj: ComputedProperties, hash: Pick ): Pick; + function setProperties(obj: T, hash: Pick): Pick; // for dynamic K /** * Detects when a specific package of Ember (e.g. 'Ember.Application') * has fully loaded and is available for extension. diff --git a/types/ember/test/observable.ts b/types/ember/test/observable.ts index 680b6decf7..cf871807b2 100755 --- a/types/ember/test/observable.ts +++ b/types/ember/test/observable.ts @@ -86,3 +86,21 @@ function testSetProperties() { assertType<{ name: string, capitalized: string }>(person.setProperties({ name: 'Joe', capitalized: 'JOE' })); assertType<{ name: string, age: number }>(Ember.setProperties(pojo, { name: 'Joe', age: 35 })); } + +function testDynamic() { + const obj: any = {}; + const dynamicKey: string = 'dummy'; // tslint:disable-line:no-inferrable-types + + assertType(Ember.get(obj, 'dummy')); + assertType(Ember.get(obj, dynamicKey)); + assertType(Ember.getWithDefault(obj, 'dummy', 'default')); + assertType(Ember.getWithDefault(obj, dynamicKey, 'default')); + assertType<{ dummy: any }>(Ember.getProperties(obj, 'dummy')); + assertType<{ dummy: any }>(Ember.getProperties(obj, [ 'dummy' ])); + assertType(Ember.getProperties(obj, dynamicKey)); + assertType(Ember.getProperties(obj, [ dynamicKey ])); + assertType(Ember.set(obj, 'dummy', 'value')); + assertType(Ember.set(obj, dynamicKey, 'value')); + assertType<{ dummy: string }>(Ember.setProperties(obj, { dummy: 'value '})); + assertType(Ember.setProperties(obj, { [dynamicKey]: 'value' })); +} diff --git a/types/ember/tslint.json b/types/ember/tslint.json index 35e8f3768a..7069614893 100755 --- a/types/ember/tslint.json +++ b/types/ember/tslint.json @@ -23,7 +23,10 @@ "no-void-expression": false, "only-arrow-functions": false, "no-submodule-imports": false, - - "no-unnecessary-class": false + + "no-unnecessary-class": false, + + // false positives + "unified-signatures": false } } From 4dda217e4691c01bbda0931b492a197805e69e84 Mon Sep 17 00:00:00 2001 From: Thomas Sawkins Date: Thu, 18 Jan 2018 04:59:31 +1100 Subject: [PATCH 065/496] add missing NavigationAction consts (#22903) --- types/react-navigation/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index bcef405be9..7c70bb660c 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -613,6 +613,13 @@ export const TabBarBottom: React.ComponentClass; * NavigationActions */ export namespace NavigationActions { + const BACK: 'Navigation/BACK'; + const INIT: 'Navigation/INIT'; + const NAVIGATE: 'Navigation/NAVIGATE'; + const RESET: 'Navigation/RESET'; + const SET_PARAMS: 'Navigation/SET_PARAMS'; + const URI: 'Navigation/URI'; + function init(options?: NavigationInitActionPayload): NavigationInitAction; function navigate(options: NavigationNavigateActionPayload): NavigationNavigateAction; function reset(options: NavigationResetActionPayload): NavigationResetAction; From 9658b51e04cfd39a602f31d9a46d759ec15bfd86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Fr=C3=BCchtenicht?= Date: Wed, 17 Jan 2018 18:59:47 +0100 Subject: [PATCH 066/496] [@types/rpio] Allow null as callback value for poll() (#22891) * [@types/rpio] Fix poll parameter to accept null As written in the `poll` function documentation the `cb` parameter should accept null as a value. * Update rpio-tests.ts * Add myself as contributor --- types/rpio/index.d.ts | 3 ++- types/rpio/rpio-tests.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/rpio/index.d.ts b/types/rpio/index.d.ts index c04202baf8..c5a33eb831 100644 --- a/types/rpio/index.d.ts +++ b/types/rpio/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for node-rpio // Project: https://github.com/jperkin/node-rpio // Definitions by: Dominik Palo +// Hannes Früchtenicht // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -129,7 +130,7 @@ interface Rpio { * @param cb * @param direction */ - poll(pin: number, cb: RPIO.CallbackFunction, direction?: number): void; + poll(pin: number, cb: RPIO.CallbackFunction | null, direction?: number): void; /** * Reset pin to INPUT and clear any pullup/pulldown resistors and poll events. diff --git a/types/rpio/rpio-tests.ts b/types/rpio/rpio-tests.ts index 9faa692e76..149851bbd0 100644 --- a/types/rpio/rpio-tests.ts +++ b/types/rpio/rpio-tests.ts @@ -61,6 +61,8 @@ function regular_button(pin: number) rpio.poll(11, regular_button); rpio.poll(12, nuke_button, rpio.POLL_HIGH); +rpio.poll(12, null, rpio.POLL_HIGH); + rpio.close(11); rpio.i2cBegin(); From dc50262033de1e66e28be30e08262dce7bc24c56 Mon Sep 17 00:00:00 2001 From: Jonathan Alvarez-Gutierrez Date: Wed, 17 Jan 2018 13:00:09 -0500 Subject: [PATCH 067/496] Update Polyhedron Geometries in "three" (#22889) * Add PolyhedronBufferGeometry and subclasses Added PolyhedronBufferGeometry and the four BufferGeometries subclassing it (TetrahedronBufferGeometry, OctahedronBufferGeometry, DodecahedronBufferGeometry, and IcosahedronBufferGeometry). * Fix constructors for PolyhedronGeometry subclasses The PolyhedronGeometry subclasses all have optional parameters for their constructor, but not all the type definitions were in line on this. --- types/three/three-core.d.ts | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index a2c4b05544..c3401a7737 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -6621,9 +6621,13 @@ export class ConeBufferGeometry extends BufferGeometry { export class ConeGeometry extends CylinderGeometry { constructor(radius?: number, height?: number, radialSegment?: number, heightSegment?: number, openEnded?: boolean, thetaStart?: number, thetaLength?: number); } + +export class DodecahedronBufferGeometry extends PolyhedronBufferGeometry { + constructor(radius?: number, detail?: number); +} export class DodecahedronGeometry extends Geometry { - constructor(radius: number, detail: number); + constructor(radius?: number, detail?: number); parameters: { radius: number; @@ -6648,8 +6652,12 @@ export class ExtrudeGeometry extends Geometry { addShape(shape: Shape, options?: any): void; } +export class IcosahedronBufferGeometry extends PolyhedronBufferGeometry { + constructor(radius?: number, detail?: number); +} + export class IcosahedronGeometry extends PolyhedronGeometry { - constructor(radius: number, detail: number); + constructor(radius?: number, detail?: number); } export class LatheBufferGeometry extends BufferGeometry { @@ -6673,9 +6681,13 @@ export class LatheGeometry extends Geometry { phiLength: number; }; } + +export class OctahedronBufferGeometry extends PolyhedronBufferGeometry { + constructor(radius?: number, detail?: number); +} export class OctahedronGeometry extends PolyhedronGeometry { - constructor(radius: number, detail: number); + constructor(radius?: number, detail?: number); } export class ParametricGeometry extends Geometry { @@ -6709,6 +6721,17 @@ export class PlaneGeometry extends Geometry { heightSegments: number; }; } + +export class PolyhedronBufferGeometry extends BufferGeometry { + constructor(vertices: number[], indices: number[], radius: number, detail: number); + + parameters: { + vertices: number[]; + indices: number[]; + radius: number; + detail: number; + } +} export class PolyhedronGeometry extends Geometry { constructor(vertices: number[], indices: number[], radius?: number, detail?: number); @@ -6797,6 +6820,10 @@ export class SphereGeometry extends Geometry { thetaLength: number; }; } + +export class TetrahedronBufferGeometry extends PolyhedronBufferGeometry { + constructor(radius?: number, detail?: number); +} export class TetrahedronGeometry extends PolyhedronGeometry { constructor(radius?: number, detail?: number); From 008daf5924ad65b8180f6d89b453cc921d25c6ff Mon Sep 17 00:00:00 2001 From: JB Nizet Date: Wed, 17 Jan 2018 19:00:59 +0100 Subject: [PATCH 068/496] luxon: fix two typos, and make constants readonly (#22877) the constants should be readonly, since the original source code has getters, but no setters for these constants (see https://github.com/moment/luxon/blob/master/src/datetime.js#L1715-L1850) --- types/luxon/index.d.ts | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/types/luxon/index.d.ts b/types/luxon/index.d.ts index c8ce226220..811768915b 100644 --- a/types/luxon/index.d.ts +++ b/types/luxon/index.d.ts @@ -61,26 +61,26 @@ declare module 'luxon' { }; class DateTime { - static DATETIME_FULL: DateTimeFormatOptions; - static DATETIME_FULL_WITH_SECONDS: DateTimeFormatOptions; - static DATEIME_HUGE: DateTimeFormatOptions; - static DATEIME_HUGE_WITH_SECONDS: DateTimeFormatOptions; - static DATETIME_MED: DateTimeFormatOptions; - static DATETIME_MED_WITH_SECONDS: DateTimeFormatOptions; - static DATETIME_SHORT: DateTimeFormatOptions; - static DATETIME_SHORT_WITH_SECONDS: DateTimeFormatOptions; - static DATE_FULL: DateTimeFormatOptions; - static DATE_HUGE: DateTimeFormatOptions; - static DATE_MED: DateTimeFormatOptions; - static DATE_SHORT: DateTimeFormatOptions; - static TIME_24_SIMPLE: DateTimeFormatOptions; - static TIME_24_WITH_LONG_OFFSET: DateTimeFormatOptions; - static TIME_24_WITH_SECONDS: DateTimeFormatOptions; - static TIME_24_WITH_SHORT_OFFSET: DateTimeFormatOptions; - static TIME_SIMPLE: DateTimeFormatOptions; - static TIME_WITH_LONG_OFFSET: DateTimeFormatOptions; - static TIME_WITH_SECONDS: DateTimeFormatOptions; - static TIME_WITH_SHORT_OFFSET: DateTimeFormatOptions; + static readonly DATETIME_FULL: DateTimeFormatOptions; + static readonly DATETIME_FULL_WITH_SECONDS: DateTimeFormatOptions; + static readonly DATETIME_HUGE: DateTimeFormatOptions; + static readonly DATETIME_HUGE_WITH_SECONDS: DateTimeFormatOptions; + static readonly DATETIME_MED: DateTimeFormatOptions; + static readonly DATETIME_MED_WITH_SECONDS: DateTimeFormatOptions; + static readonly DATETIME_SHORT: DateTimeFormatOptions; + static readonly DATETIME_SHORT_WITH_SECONDS: DateTimeFormatOptions; + static readonly DATE_FULL: DateTimeFormatOptions; + static readonly DATE_HUGE: DateTimeFormatOptions; + static readonly DATE_MED: DateTimeFormatOptions; + static readonly DATE_SHORT: DateTimeFormatOptions; + static readonly TIME_24_SIMPLE: DateTimeFormatOptions; + static readonly TIME_24_WITH_LONG_OFFSET: DateTimeFormatOptions; + static readonly TIME_24_WITH_SECONDS: DateTimeFormatOptions; + static readonly TIME_24_WITH_SHORT_OFFSET: DateTimeFormatOptions; + static readonly TIME_SIMPLE: DateTimeFormatOptions; + static readonly TIME_WITH_LONG_OFFSET: DateTimeFormatOptions; + static readonly TIME_WITH_SECONDS: DateTimeFormatOptions; + static readonly TIME_WITH_SHORT_OFFSET: DateTimeFormatOptions; static fromHTTP(text: string, options?: DateTimeOptions): DateTime; static fromISO(text: string, options?: DateTimeOptions): DateTime; static fromJSDate( From cf941e095cbc7417320f88855481b25ce89a03a5 Mon Sep 17 00:00:00 2001 From: JB Nizet Date: Wed, 17 Jan 2018 19:01:33 +0100 Subject: [PATCH 069/496] luxon: add changes introduced from versions 0.2.10 to 0.3.0 (#22880) --- types/luxon/index.d.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/types/luxon/index.d.ts b/types/luxon/index.d.ts index 811768915b..327fe15ade 100644 --- a/types/luxon/index.d.ts +++ b/types/luxon/index.d.ts @@ -10,6 +10,10 @@ declare module 'luxon' { type DateTimeFormatOptions = Intl.DateTimeFormatOptions; type ZoneOptions = { + keepLocalTime?: boolean; + /** + * @deprecated since 0.2.12. Use keepLocalTime instead + */ keepCalendarTime?: boolean; }; @@ -94,11 +98,27 @@ declare module 'luxon' { options?: DateTimeOptions ): DateTime; static fromSQL(text: string, options?: DateTimeOptions): DateTime; + static fromFormat( + text: string, + format: string, + opts?: DateTimeOptions + ): DateTime; + static fromFormatExplain( + text: string, + format: string, + opts?: DateTimeOptions + ): object; + /** + * @deprecated since 0.3.0. Use fromFormat instead + */ static fromString( text: string, format: string, options?: DateTimeOptions ): DateTime; + /** + * @deprecated 0.3.0. Use fromFormatExplain instead + */ static fromStringExplain( text: string, format: string, From a04b55e68045dab7c60e58530690237474c94d65 Mon Sep 17 00:00:00 2001 From: Thomas Sawkins Date: Thu, 18 Jan 2018 05:02:12 +1100 Subject: [PATCH 070/496] update index.d.ts & update tests (#22795) --- types/react-native-push-notification/index.d.ts | 4 +++- .../react-native-push-notification-tests.ts | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/types/react-native-push-notification/index.d.ts b/types/react-native-push-notification/index.d.ts index 1f8c89b512..1c1577d7c1 100644 --- a/types/react-native-push-notification/index.d.ts +++ b/types/react-native-push-notification/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for react-native-push-notification 3.0 // Project: https://github.com/zo0r/react-native-push-notification#readme // Definitions by: Paito Anderson +// Tom Sawkins // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -18,6 +19,7 @@ export interface PushNotification { badge: number; alert: object; sound: string; + finish: (fetchResult: string) => void; } export class PushNotificationOptions { @@ -77,7 +79,7 @@ export interface PushNotification { cancelAllLocalNotifications(): void; setApplicationIconBadgeNumber(badgeCount: number): void; getApplicationIconBadgeNumber(callback: (badgeCount: number) => void): void; - popInitialNotification(): Promise; + popInitialNotification(callback: (notification: PushNotification | null) => void): void; abandonPermissions(): void; checkPermissions(callback: (permissions: PushNotificationPermissions) => void): void; registerNotificationActions(actions: string[]): void; diff --git a/types/react-native-push-notification/react-native-push-notification-tests.ts b/types/react-native-push-notification/react-native-push-notification-tests.ts index f23ab07ef1..c28779b855 100644 --- a/types/react-native-push-notification/react-native-push-notification-tests.ts +++ b/types/react-native-push-notification/react-native-push-notification-tests.ts @@ -1,7 +1,9 @@ import PushNotification from 'react-native-push-notification'; PushNotification.configure({ - onNotification: (notification) => {}, + onNotification: (notification) => { + notification.finish("UIBackgroundFetchResultNoData"); + }, onRegister: (token) => {}, senderID: 'XXX', popInitialNotification: false, @@ -18,7 +20,7 @@ PushNotification.cancelLocalNotifications = (details) => {}; PushNotification.cancelAllLocalNotifications(); PushNotification.setApplicationIconBadgeNumber(1); PushNotification.getApplicationIconBadgeNumber((badgeCount) => {}); -PushNotification.popInitialNotification(); +PushNotification.popInitialNotification((notification) => {}); PushNotification.checkPermissions((checkPermissions) => {}); PushNotification.abandonPermissions(); PushNotification.registerNotificationActions(['Accept', 'Reject', 'Yes', 'No']); From 08812a10047bef428a2609f2ef7cd7563cb153e8 Mon Sep 17 00:00:00 2001 From: Oscar Busk Date: Wed, 17 Jan 2018 19:02:42 +0100 Subject: [PATCH 071/496] add html attributes to redux-first-router-link (#22870) --- types/redux-first-router-link/index.d.ts | 21 +++---------------- .../redux-first-router-link-tests.tsx | 15 +++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/types/redux-first-router-link/index.d.ts b/types/redux-first-router-link/index.d.ts index c74bdd530b..1136751129 100644 --- a/types/redux-first-router-link/index.d.ts +++ b/types/redux-first-router-link/index.d.ts @@ -9,8 +9,6 @@ import { Location } from 'redux-first-router'; export type To = string | string[] | object; -export type OnClick = false | ((e: React.MouseEvent) => void); - export interface Match

{ params: P; isExact: boolean; @@ -18,14 +16,12 @@ export interface Match

{ url: string; } -export interface LinkProps { +// Unfortunately we can't pass `HTMLAnchorElement` since the `tagName` attribute allows you to use other tags than anchor. +export interface LinkProps extends React.HTMLAttributes { to: To; redirect?: boolean; replace?: boolean; tagName?: string; - children?: React.ReactNode; - onPress?: OnClick; - onClick?: OnClick; down?: boolean; shouldDispatch?: boolean; target?: string; @@ -33,18 +29,7 @@ export interface LinkProps { export default class Link extends React.Component {} -export interface NavLinkProps { - to: To; - redirect?: boolean; - replace?: boolean; - children?: React.ReactNode; - onPress?: OnClick; - onClick?: OnClick; - down?: boolean; - shouldDispatch?: boolean; - target?: string; - className?: string; - style?: React.CSSProperties; +export interface NavLinkProps extends LinkProps { activeClassName?: string; activeStyle?: React.CSSProperties; ariaCurrent?: string; diff --git a/types/redux-first-router-link/redux-first-router-link-tests.tsx b/types/redux-first-router-link/redux-first-router-link-tests.tsx index 01889e5fe1..86f36c14e3 100644 --- a/types/redux-first-router-link/redux-first-router-link-tests.tsx +++ b/types/redux-first-router-link/redux-first-router-link-tests.tsx @@ -17,6 +17,16 @@ export default () => { { /* as an action object (RECOMMENDED APPROACH SO YOU CAN CHANGE ALL URLs FROM YOUR ROUTESMAP): */ } FP + Home + { isActive={(match, location) => (location.payload as Payload).category === 'redux-first-router'} > Redux First Router + + Nav link with class ); }; From 80046ef1ee7217967026fe61041d84d3ee2ac4ae Mon Sep 17 00:00:00 2001 From: Oscar Busk Date: Wed, 17 Jan 2018 19:03:42 +0100 Subject: [PATCH 072/496] @types/redux-first-router: Improve StateGetter and RouteThunk by including State (#22611) * Improve State typing across entire definition * Fix suggested changes on thunk function * Fix dispatch definitons * Revert storeEnhcancer change --- types/redux-first-router/index.d.ts | 106 +++++++++--------- .../redux-first-router-tests.ts | 54 +++++++-- 2 files changed, 99 insertions(+), 61 deletions(-) diff --git a/types/redux-first-router/index.d.ts b/types/redux-first-router/index.d.ts index 22dce972c4..750f8438b6 100644 --- a/types/redux-first-router/index.d.ts +++ b/types/redux-first-router/index.d.ts @@ -18,28 +18,28 @@ import { History } from 'history'; export type Nullable = T | null | undefined; -export type StateGetter = () => object; +export type StateGetter = () => TState; export type RouteString = string; -export type RouteThunk = ( +export type RouteThunk = ( dispatch: Dispatch, - getState: StateGetter + getState: StateGetter, ) => any | Promise; -export type RouteObject = TKeys & { +export type RouteObject = TKeys & { capitalizedWords?: boolean; navKey?: string; path: string; - thunk?: RouteThunk; + thunk?: RouteThunk; fromPath?(path: string, key?: string): string; toPath?(param: string, key?: string): string; }; -export type Route = RouteString | RouteObject; +export type Route = RouteString | RouteObject; -export interface RoutesMap { - [key: string]: Route; +export interface RoutesMap { + [key: string]: Route; } export interface ReceivedAction { @@ -77,7 +77,7 @@ export interface Location { search?: string; } -export interface LocationState { +export interface LocationState { pathname: string; type: string; payload: Payload; @@ -86,7 +86,7 @@ export interface LocationState { prev: Location; kind: Nullable; history: Nullable; - routesMap: RoutesMap; + routesMap: RoutesMap; hasSSR?: boolean; } @@ -138,70 +138,70 @@ export type Listener = ( export type ScrollBehavior = object; -export interface Router { +export interface Router { getStateForActionOriginal( action: object, - state: Nullable - ): Nullable; + state: Nullable + ): Nullable; getStateForAction( action: object, - state: Nullable - ): Nullable; + state: Nullable + ): Nullable; getPathAndParamsForState( - state: object + state: TState ): { path: Nullable; params: Nullable }; getActionForPathAndParams(path: string): Nullable; } -export interface Navigator { - router: Router; +export interface Navigator { + router: Router; } -export interface Navigators { - [key: string]: Navigator; +export interface Navigators { + [key: string]: Navigator; } -export type SelectLocationState = (state: object) => LocationState; -export type SelectTitleState = (state: object) => string; +export type SelectLocationState = (state: TState) => LocationState; +export type SelectTitleState = (state: TState) => string; export interface QuerySerializer { stringify(params: Params): string; parse(queryString: string): object; } -export interface NavigatorsConfig { - navigators: Navigators; - patchNavigators(navigators: Navigators): void; +export interface NavigatorsConfig { + navigators: Navigators; + patchNavigators(navigators: Navigators): void; actionToNavigation( - navigators: Navigators, + navigators: Navigators, action: object, // TODO check this navigationAction: Nullable, - route: Nullable + route: Nullable> ): object; navigationToAction( - navigators: Navigators, - store: Store, - routesMap: RoutesMap, + navigators: Navigators, + store: Store, + routesMap: RoutesMap, action: object ): { - action: object; - navigationAction: Nullable; - }; + action: object; + navigationAction: Nullable; + }; } -export interface Options { - title?: string | SelectTitleState; - location?: string | SelectLocationState; +export interface Options { + title?: string | SelectTitleState; + location?: string | SelectLocationState; notFoundPath?: string; scrollTop?: boolean; - onBeforeChange?(dispatch: Dispatch, getState: StateGetter): void; - onAfterChange?(dispatch: Dispatch, getState: StateGetter): void; - onBackNext?(dispatch: Dispatch, getState: StateGetter): void; + onBeforeChange?(dispatch: Dispatch, getState: StateGetter): void; + onAfterChange?(dispatch: Dispatch, getState: StateGetter): void; + onBackNext?(dispatch: Dispatch, getState: StateGetter): void; restoreScroll?(history: History): ScrollBehavior; initialDispatch?: boolean; querySerializer?: QuerySerializer; - navigators?: NavigatorsConfig; + navigators?: NavigatorsConfig; } export type Params = object; @@ -211,9 +211,9 @@ export type ScrollUpdater = (performedByUser: boolean) => void; export const NOT_FOUND: '@@redux-first-router/NOT_FOUND'; -export function actionToPath( +export function actionToPath( action: ReceivedAction, - routesMap: RoutesMap, + routesMap: RoutesMap, querySerializer?: QuerySerializer ): string; @@ -225,17 +225,17 @@ export function canGoBack(): boolean; export function canGoForward(): boolean; -export function connectRoutes( +export function connectRoutes( history: History, - routesMap: RoutesMap, - options?: Options + routesMap: RoutesMap, + options?: Options ): { - reducer: Reducer; - middleware: Middleware; - thunk(store: Store): Promise>; - enhancer: GenericStoreEnhancer; - initialDispatch?(): void; -}; + reducer: Reducer>; + middleware: Middleware; + thunk(store: Store): Promise>>; + enhancer: GenericStoreEnhancer; + initialDispatch?(): void; + }; export function go(n: number): void; @@ -247,9 +247,9 @@ export function next(): void; export function nextPath(): string | void; -export function pathToAction( +export function pathToAction( pathname: string, - routesMap: RoutesMap + routesMap: RoutesMap ): ReceivedAction; export function prevPath(): string | void; diff --git a/types/redux-first-router/redux-first-router-tests.ts b/types/redux-first-router/redux-first-router-tests.ts index 3c9e69a82e..3168db6ed8 100644 --- a/types/redux-first-router/redux-first-router-tests.ts +++ b/types/redux-first-router/redux-first-router-tests.ts @@ -18,21 +18,36 @@ import { compose, Action, GenericStoreEnhancer, - StoreEnhancerStoreCreator + StoreEnhancerStoreCreator, + combineReducers } from 'redux'; import { History } from 'history'; declare var console: any; declare var history: History; -type State = LocationState; +interface Keys { + role: string; +} +interface State { + location: LocationState; + stale: boolean; +} type StoreCreator = StoreEnhancerStoreCreator; -const routesMap: RoutesMap<{ role: string }> = { +const routesMap: RoutesMap = { HOME: '/', ADMIN: { path: '/admin', role: 'admin' + }, + STATUS: { + path: '/status', + role: 'user', + thunk: (dispatch, getState) => { + dispatch; // $ExpectType Dispatch + getState; // $ExpectType StateGetter + } } }; @@ -40,10 +55,23 @@ const { reducer, middleware, enhancer, - initialDispatch + initialDispatch, + thunk, } = connectRoutes(history, routesMap, { - initialDispatch: false -}); + initialDispatch: false, + onBeforeChange: (dispatch, getState) => { + dispatch; // $ExpectType Dispatch + getState; // $ExpectType StateGetter + }, + location: state => { + const locationState = state.location; // $ExpectType LocationState + return locationState; + }, + title: state => { + const title = state.location.pathname; // $ExpectType string + return title; + } + }); const dumbMiddleware: Middleware = store => next => action => next(action); @@ -54,7 +82,15 @@ const storeEnhancer = compose( composedMiddleware ); -const store = createStore(reducer, storeEnhancer); +const combined = combineReducers({ location: reducer }); + +const store = createStore(combined, storeEnhancer); + +// Test that `thunk()` has correct state types now that `store` is defined +thunk(store) + .then((t) => { + t = t!; // $ExpectType RouteThunk + }); const receivedAction: ReceivedAction = { type: 'HOME', @@ -73,5 +109,7 @@ const action: ReduxFirstRouterAction = { }; redirect(action); // $ExpectType Action -// $ExpectType Store +// $ExpectType Store store; + +store.getState().location.routesMap; // $ExpectType RoutesMap From dfcd4cdeb091ee8bff49c8c82da22c0f0f462f0c Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Wed, 17 Jan 2018 19:04:24 +0100 Subject: [PATCH 073/496] feat: remove `rollup` types (#22876) --- notNeededPackages.json | 6 + .../package.json | 2 +- types/rollup/index.d.ts | 220 ------------------ types/rollup/rollup-tests.ts | 174 -------------- types/rollup/tsconfig.json | 24 -- types/rollup/tslint.json | 6 - 6 files changed, 7 insertions(+), 425 deletions(-) rename types/{rollup => rollup-plugin-json}/package.json (63%) delete mode 100644 types/rollup/index.d.ts delete mode 100644 types/rollup/rollup-tests.ts delete mode 100644 types/rollup/tsconfig.json delete mode 100644 types/rollup/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index a698b68ff3..0da7de39e9 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1218,6 +1218,12 @@ "sourceRepoURL": "https://github.com/EnoF/rest-io", "asOfVersion": "4.1.0" }, + { + "libraryName": "rollup", + "typingsPackageName": "rollup", + "sourceRepoURL": "https://github.com/rollup/rollup", + "asOfVersion": "0.54.0" + }, { "libraryName": "route-recognizer", "typingsPackageName": "route-recognizer", diff --git a/types/rollup/package.json b/types/rollup-plugin-json/package.json similarity index 63% rename from types/rollup/package.json rename to types/rollup-plugin-json/package.json index 100334a89f..60161a270c 100644 --- a/types/rollup/package.json +++ b/types/rollup-plugin-json/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "source-map": "^0.6.1" + "rollup": "^0.54.0" } } diff --git a/types/rollup/index.d.ts b/types/rollup/index.d.ts deleted file mode 100644 index fcd5f799c3..0000000000 --- a/types/rollup/index.d.ts +++ /dev/null @@ -1,220 +0,0 @@ -// Type definitions for rollup 0.51 -// Project: https://github.com/rollup/rollup -// Definitions by: Philipp A. , Christian Svensson -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import { RawSourceMap } from 'source-map' -import * as acorn from 'acorn' - -export type Format = 'amd' | 'cjs' | 'es' | 'iife' | 'umd' -export const VERSION: string - -export interface SourceMap extends RawSourceMap { - toString(): string - toUrl(): string -} - -// https://github.com/rollup/rollup/wiki/JavaScript-API -export interface Warning { - code: string - message: string - loc?: { file: string, line: number, column: number } - frame?: string -} - -export interface BundleOptions { - /** The format of the generated bundle. */ - format: Format - /** What export mode to use. Defaults to auto, which guesses your intentions based on what the `entry` module exports. */ - exports?: 'auto' | 'default' | 'named' | 'none' - /** An ID to use for AMD/UMD bundles. */ - moduleId?: string - /** The name to use for the module for UMD/IIFE bundles (required for bundles with exports). */ - name?: string - /** Mapping of IDs → global variable names. Used for UMD/IIFE bundles. */ - globals?: ((id: string) => string) | { [id: string]: string } - /** - * Function that takes an ID and returns a path, or Object of id: path pairs. - * Where supplied, these paths will be used in the generated bundle instead of the module ID, allowing you to (for example) load dependencies from a CDN. - */ - paths?: ((id: string) => string) | { [id: string]: string } - /** - * The indent string to use, for formats that require code to be indented (AMD, IIFE, UMD). - * Can also be false (no indent), or true (the default – auto-indent) - */ - indent?: string | boolean - /** - * Whether or not to add an 'interop block'. By default (interop: true). - * For safety's sake, Rollup will assign any external dependencies' default exports to a separate variable if it's necessary to distinguish between default and named exports. - * This generally only applies if your external dependencies were transpiled (for example with Babel) – if you're sure you don't need it, you can save a few bytes with interop: false. - */ - interop?: boolean - /** A string to prepend to the bundle. */ - banner?: string - /** A string to append to the bundle. */ - footer?: string - /** A string prepended to the code inside of the format-specific wrapper */ - intro?: string - /** A string appended to the code inside of the format-specific wrapper */ - outro?: string - /** - * Whether to include the 'use strict' pragma at the top of generated non-ES6 bundles. - * Strictly-speaking (geddit?), ES6 modules are always in strict mode, so you shouldn't disable this without good reason. - */ - strict?: boolean -} - -export interface GenerateOptions extends BundleOptions { - /** Whether to generate a sourcemap. If true, the return value from `bundle.generate(...)` will include a map property */ - sourcemap?: boolean - /** - * The location of the generated bundle. If this is an absolute path, all the sources paths in the sourcemap will be relative to it. - * The map.file property is the basename of sourcemapFile, as the location of the sourcemap is assumed to be adjacent to the bundle. - */ - sourcemapFile?: string -} - -export interface WriteOptions extends BundleOptions { - /** The file to write to. If `options.sourcemap === true`, two files will be created – `file` and `file + '.map`. */ - file: string - /** If `true`, a separate sourcemap file will be created. If `'inline'`, the sourcemap will be appended to the resulting file as a data URI. */ - sourcemap?: boolean | 'inline' - /** This option is unnecessary, as it defaults to the value of file. */ - sourcemapFile?: string -} - -export interface Bundle { - /** Generate bundled code as an object */ - generate(options: GenerateOptions): Promise<{ code: string, map: SourceMap | null }> - /** writes the file (and accompanying sourcemap file, if appropriate) to the file system. */ - write(options: WriteOptions): Promise -} - -export interface Options { - /** The bundle's entry point (e.g. your `main.js` or `app.js` or `index.js`) */ - input: string - /** A previous bundle. Use it to speed up subsequent bundles :) */ - cache?: Bundle - /** - * Function that returns if an ID is external or array of IDs of modules that should remain external to the bundle. - * The IDs should be either the name of an external dependency or a resolved ID (like an absolute path to a file) - */ - external?: ((id: string) => boolean) | string[] - /** Function that will intercept warning messages. If not supplied, warnings will be deduplicated and printed to the console. */ - onwarn?(warning: Warning): void - /** Array of plugin objects or a single plugin object */ - plugins?: Plugin | Plugin[] - /** - * Whether or not to apply tree-shaking. (Default: true) - * It's recommended that you omit this option, unless you discover a bug caused by the tree-shaking algorithm in which case use treeshake: false once you've filed an issue! - */ - treeshake?: boolean - /** Any options that should be passed through to Acorn. */ - acorn?: acorn.Options - /** By default, the context of a module – i.e., the value of `this` at the top level – is `undefined`. In rare cases you might need to change this to something else, like `'window'`. */ - context?: any - /** Same as `options.context`, but per-module. */ - moduleContext?: ((id: string) => any) | { [id: string]: any } - /** Adds support for very old environments like IE8, at the cost of some extra code. */ - legacy?: boolean -} - -export interface ConfigFileOptions extends Options { - output: WriteOptions | WriteOptions[] -} - -// https://github.com/rollup/rollup/wiki/Plugins#creating-plugins -export interface Plugin { - /** The name of the plugin, for use in error messages and warnings */ - name?: string - /** A function that replaces or manipulates the options object passed to rollup.rollup */ - options?(options: Options): Options - /** A custom loader. Returning null or undefined defers to other load functions (and eventually the default behavior of loading from the file system). */ - load?(id: string): string | null | undefined - /** - * Custom resolver (useful for e.g. locating third-party dependencies). - * Returning null or undefined defers to other resolveId functions (and eventually the default resolution behavior); - * returning any other falsy value signals that importee should be treated as an external module and not included in the bundle. - */ - resolveId?(importee: string, importer: string | undefined): string | null | undefined | false | 0 | '' - /** A module transformer function */ - transform?(this: TransformContext, source: string, id: string): TransformResult | Promise - /** A bundle transformer function */ - transformBundle?(source: string, options: { format: Format }): TransformResult | Promise - /** Function hook called when bundle.generate() is being executed. */ - ongenerate?(options: GenerateOptions, bundle: Bundle): void - /** Function hook called when bundle.write() is being executed, after the file has been written to disk. */ - onwrite?(options: WriteOptions, bundle: Bundle): void - /** A function for generating intro text */ - intro?(): string - /** A function for generating outro text */ - outro?(): string - /** Prepend to the bundle. */ - banner?: string | (() => string) - /** Apppend to the bundle. */ - footer?: string | (() => string) -} - -// See https://github.com/rollup/rollup/wiki/Plugins#warnings-and-errors -export interface TransformContext { - /** Emit warnings to Rollup which will be logged during bundling */ - warn(message: string | { message: string }, pos?: number | { line: number, column: number }): void - /** Emit an error, which will abort the bundling process */ - error(message: string | { message: string }, pos?: number | { line: number, column: number }): void -} - -export type TransformResult = string | null | undefined | { code: string, map: SourceMap } - -/** Returns a Promise that resolves with a bundle */ -export function rollup(options: Options): Promise - -export interface WatchOptions extends ConfigFileOptions { - watch?: { - /** - * If set to true, will use chokidar for file watching (requires installation). - * If set to object, the settings are passed on to chokidar - */ - chokidar?: boolean | { [key: string]: any }; - /** Limit the file-watching to certain files, e.g. 'src/**' */ - include?: string; - /** Prevent files from being watched, e.g. 'node_modules/**' */ - exclude?: string; - } -} - -export interface StartEvent { - code: 'START' -} -export interface EndEvent { - code: 'END' -} -export interface ErrorEvent { - code: 'ERROR' - error: Error -} -export interface FatalEvent { - code: 'FATAL' - error: Error -} -export interface BundleStartEvent { - code: 'BUNDLE_START' - input: string - output: string[] -} -export interface BundleEndEvent { - code: 'BUNDLE_END' - input: string - output: string[] - duration: number -} -export type WatchEvent = StartEvent | EndEvent | ErrorEvent | FatalEvent | BundleStartEvent | BundleEndEvent - -export class Watcher { - /** Listen to the events that are emitted by rollup during watching */ - on(type: 'event', callback: (e: WatchEvent) => void): void - /** Stop watching for file changes */ - close(): void -} - -/** Starts rollup in watch mode. Returns a watcher instance for closing or listening to events */ -export function watch(options: WatchOptions): Watcher diff --git a/types/rollup/rollup-tests.ts b/types/rollup/rollup-tests.ts deleted file mode 100644 index e2b18d6109..0000000000 --- a/types/rollup/rollup-tests.ts +++ /dev/null @@ -1,174 +0,0 @@ -import { rollup, watch, Bundle, Plugin, ConfigFileOptions } from 'rollup' - -declare const console: { log(...messages: any[]): void, warn(message: string): void } - -let cache: Bundle | undefined -const plugin: Plugin = { - name: 'test-plugin', - resolveId(importee, importer) { - if (importer === undefined) { - return 'custom/entry/point.js' - } - return importer.trim() - }, - transform(source, id) { - if (id === 'rxjs') { - this.error(new Error(`Don't import this directly`)) - return null - } - const indexOfQuote = source.indexOf('"') - if (indexOfQuote >= 0) { - this.warn(`Prefer ' over " for strings`, indexOfQuote) - return undefined - } - if (id === 'foo') { - return Promise.resolve(source) - } - return source - }, - transformBundle(source, options) { - if (options.format === 'iife') { - return `window.nonModule = true\n${source}` - } else if (options.format === 'cjs') { - return null - } - if (options.format !== 'es') { - return Promise.resolve(source) - } - return undefined - } -} - -async function main() { - const bundle = await rollup({ - input: 'main.js', - external: ['external-module'], - plugins: [plugin], - onwarn: ({ code, frame, loc, message }) => { - if (loc) { - const { file, line, column } = loc - console.log(`[${code}] - ${file}(${line},${column}): ${message}`) - } else { - console.log(`[${code}] - ${message}`) - } - - if (frame) console.warn(frame) - }, - cache, - }) - - const bundle2 = await rollup({ - input: 'main.js', - external: id => /^rxjs/.test(id), - plugins: plugin - }) - - const { code, map } = await bundle.generate({ - format: 'cjs', - indent: false, - sourcemap: true, - }) - - console.log(code, map) - - cache = bundle - - await bundle.write({ - format: 'cjs', - file: 'bundle.js', - name: 'myLib', - interop: false, - globals: { - jquery: '$', - lodash: '_', - }, - banner: '/* Banner */', - footer: '/* Footer */', - intro: 'var ENV = "production";', - outro: 'var VERSION = "1.0.0";', - indent: ' ', - sourcemap: 'inline', - sourcemapFile: 'bundle.js.map', - strict: true, - }) - - await bundle.write({ - format: 'cjs', - file: 'bundle.js', - name: 'myLib', - interop: false, - globals: (x: string) => x.replace("", "/"), - banner: '/* Banner */', - footer: '/* Footer */', - intro: 'var ENV = "production";', - outro: 'var VERSION = "1.0.0";', - indent: ' ', - sourcemap: 'inline', - sourcemapFile: 'bundle.js.map', - strict: true, - }) - - const watcher = watch({ - input: 'main.js', - output: { - file: 'bundle.js', - format: 'es' - }, - watch: { - chokidar: true - } - }) - - watcher.on('event', e => { - switch (e.code) { - case 'START': - console.log(`We're rolling!`) - return - case 'END': - console.log(`We're all rolled up!`) - return - case 'ERROR': - case 'FATAL': - console.log(e.error.message) - return - case 'BUNDLE_START': - console.log(`Bundling: ${e.input}`) - return - case 'BUNDLE_END': - console.log(`Bundling: ${e.input}`) - return - } - - assertNever(e) - }) - - watcher.close() -} - -main() - -export const defaultConfig: ConfigFileOptions = { - input: 'main.js', - output: { - file: 'bundle.js', - format: 'iife', - } -} - -export const multiConfig: ConfigFileOptions = { - input: 'main.js', - output: [ - { - file: 'bundle.esm.js', - format: 'es', - }, - { - file: 'bundle.cjs.js', - format: 'cjs', - } - ] -} - -function assertNever(nope: never) { - throw new Error('Oh no!') -} diff --git a/types/rollup/tsconfig.json b/types/rollup/tsconfig.json deleted file mode 100644 index 2fad31b1b1..0000000000 --- a/types/rollup/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "rollup-tests.ts" - ] -} \ No newline at end of file diff --git a/types/rollup/tslint.json b/types/rollup/tslint.json deleted file mode 100644 index ba7f6bc7ae..0000000000 --- a/types/rollup/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "semicolon": [true, "never"] - } -} From 6127769a30c4308b5f0105270349c79045232497 Mon Sep 17 00:00:00 2001 From: daniel tea Date: Wed, 17 Jan 2018 10:04:41 -0800 Subject: [PATCH 074/496] material-ui: Add dropDownMenuProps to SelectField (#22857) --- types/material-ui/index.d.ts | 1 + types/material-ui/material-ui-tests.tsx | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/types/material-ui/index.d.ts b/types/material-ui/index.d.ts index 08a18a752b..32410592ab 100644 --- a/types/material-ui/index.d.ts +++ b/types/material-ui/index.d.ts @@ -1409,6 +1409,7 @@ declare namespace __MaterialUI { // is the element that get the 'other' properties autoWidth?: boolean; disabled?: boolean; + dropDownMenuProps?: Menus.DropDownMenuProps; errorStyle?: React.CSSProperties; errorText?: React.ReactNode; floatingLabelFixed?: boolean; diff --git a/types/material-ui/material-ui-tests.tsx b/types/material-ui/material-ui-tests.tsx index 316a14b78a..b01613cd8c 100644 --- a/types/material-ui/material-ui-tests.tsx +++ b/types/material-ui/material-ui-tests.tsx @@ -5508,6 +5508,31 @@ class SelectFieldExampleSelectionRenderer extends Component<{}, {values?: string } } +class SelectFieldExampleDropDownMenu extends Component<{}, {value?: number}> { + constructor(props) { + super(props); + this.state = {value: null}; + } + + handleChange = (event, index, value) => this.setState({value}); + + render() { + return ( + + + + + + ); + } +} + // "http://www.material-ui.com/#/components/slider" const SliderExampleSimple = () => (
From 4d594ddb559113487cd0d1a5633f1baeb3b8f958 Mon Sep 17 00:00:00 2001 From: Donald Pipowitch Date: Wed, 17 Jan 2018 19:05:28 +0100 Subject: [PATCH 075/496] fixed connection types in auth0 (#22843) --- types/auth0/index.d.ts | 86 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 71 insertions(+), 15 deletions(-) diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index 479bf70c03..609c1ecf0d 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for auth0 2.6 +// Type definitions for auth0 2.7 // Project: https://github.com/auth0/node-auth0 // Definitions by: Wilson Hobbs , Seth Westphal , Amiram Korach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -99,7 +99,6 @@ export interface Rule { order?: number; } - export interface Client { /** * The name of the client. @@ -257,6 +256,66 @@ export interface CreateClientGrant { scope: string[]; } +export type Strategy = + 'ad' | 'adfs' | 'amazon' | 'dropbox' | 'bitbucket' | 'aol' | 'auth0-adldap' | 'auth0-oidc' | + 'auth0' | 'baidu' | 'bitly' | 'box' | 'custom' | 'daccount' | 'dwolla' | 'email' | + 'evernote-sandbox' | 'evernote' | 'exact' | 'facebook' | 'fitbit' | 'flickr' | 'github' | + 'google-apps' | 'google-oauth2' | 'guardian' | 'instagram' | 'ip' | 'linkedin' | 'miicard' | + 'oauth1' | 'oauth2' | 'office365' | 'paypal' | 'paypal-sandbox' | 'pingfederate' | + 'planningcenter' | 'renren' | 'salesforce-community' | 'salesforce-sandbox' | 'salesforce' | + 'samlp' | 'sharepoint' | 'shopify' | 'sms' | 'soundcloud' | 'thecity-sandbox' | 'thecity' | + 'thirtysevensignals' | 'twitter' | 'untappd' | 'vkontakte' | 'waad' | 'weibo' | 'windowslive' | + 'wordpress' | 'yahoo' | 'yammer' | 'yandex'; + +export interface UpdateConnection { + options?: any; + /** + * The identifiers of the clients for which the connection is to + * be enabled. If the array is empty or the property is not + * specified, no clients are enabled. + */ + enabled_clients?: string[]; + /** + * Defines the realms for which the connection will be used + * (ie: email domains). If the array is empty or the property is + * not specified, the connection name will be added as realm. + */ + realms?: string[]; + metadata?: any; + /** + * True if the connection is domain level. + */ + is_domain_connection?: boolean; +} + +export interface Connection extends UpdateConnection { + /** + * The connection's identifier. + */ + id?: string; + /** + * The name of the connection. + */ + name?: string; + /** + * The type of the connection, related to the identity provider. + */ + strategy?: Strategy; +} + +export interface CreateConnection extends UpdateConnection { + /** + * The name of the connection. Must start and end with an + * alphanumeric character and can only contain alphanumeric + * characters and '-'. Max length 128. + */ + name: string; + /** + * The identity provider identifier for the connection. + */ + strategy: Strategy; +} + export interface User { email?: string; email_verified?: boolean; @@ -488,23 +547,20 @@ export class ManagementClient { getClientInfo(): ClientInfo; // Connections - getConnections(): Promise; - getConnections(cb: (err: Error, data: any) => void): void; + getConnections(): Promise; + getConnections(cb: (err: Error, connections: Connection[]) => void): void; - createConnection(data: ObjectWithId): Promise; - createConnection(data: ObjectWithId, cb: (err: Error, data: any) => void): void; + createConnection(data: CreateConnection): Promise; + createConnection(data: CreateConnection, cb: (err: Error, connection: Connection) => void): void; - getConnection(params: ObjectWithId, cb: (err: Error, data: any) => void): void; - getConnection(params: ObjectWithId): Promise; + getConnection(params: ObjectWithId, cb: (err: Error, connection: Connection) => void): void; + getConnection(params: ObjectWithId): Promise; - deleteConnection(params: ObjectWithId, cb: (err: Error, data: any) => void): void; - deleteConnection(params: ObjectWithId): Promise; + deleteConnection(params: ObjectWithId, cb: (err: Error) => void): void; + deleteConnection(params: ObjectWithId): Promise; - deleteConnection(params: ObjectWithId, cb: (err: Error, data: any) => void): void; - deleteConnection(params: ObjectWithId): Promise; - - updateConnection(params: ObjectWithId, data: Data, cb: (err: Error, data: any) => void): void; - updateConnection(params: ObjectWithId, data: Data): Promise; + updateConnection(params: ObjectWithId, data: UpdateConnection, cb: (err: Error, connection: Connection) => void): void; + updateConnection(params: ObjectWithId, data: UpdateConnection): Promise; // Clients From ea600ecad45db552ff93d5765973cf89e33f30dd Mon Sep 17 00:00:00 2001 From: "Juan J. Jimenez-Anca" Date: Wed, 17 Jan 2018 18:07:42 +0000 Subject: [PATCH 076/496] group in namespaces in order type create() environments (#22813) * first sanctuary types * group in namespaces in order type create() environments --- types/sanctuary/index.d.ts | 712 ++++++++++++----------------- types/sanctuary/sanctuary-tests.ts | 5 +- 2 files changed, 295 insertions(+), 422 deletions(-) diff --git a/types/sanctuary/index.d.ts b/types/sanctuary/index.d.ts index 78ec3bfd71..0d61fe22aa 100644 --- a/types/sanctuary/index.d.ts +++ b/types/sanctuary/index.d.ts @@ -4,449 +4,319 @@ // Juan J. Jimenez-Anca // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export type Nullable = A | null; +declare var S: Sanctuary.Environment; +export = S; +export as namespace S; -export type Pair = [A, B]; +type Nullable = A | null; -export type Thunk = () => A; +type Pair = [A, B]; -export type Fn = (a: A) => B; -export type Fn2 = (a: A) => (b: B) => C; -export type Fn3 = (a: A) => (b: B) => (c: C) => D; -export type Fn4 = (a: A) => (b: B) => (c: C) => (d: D) => E; -export type Fn5 = (a: A) => (b: B) => (c: C) => (d: D) => (e: E) => F; -export type Fn2_ = (a: A, b: B) => C; -export type Fn3_ = (a: A, b: B, c: C) => D; -export type Fn4_ = (a: A, b: B, c: C, d: D) => E; -export type Fn5_ = (a: A, b: B, c: C, d: D, e: E) => F; +type Thunk = () => A; -export type Predicate = (a: A) => boolean; +type Fn = (a: A) => B; +type Fn2 = (a: A) => (b: B) => C; +type Fn3 = (a: A) => (b: B) => (c: C) => D; +type Fn4 = (a: A) => (b: B) => (c: C) => (d: D) => E; +type Fn5 = (a: A) => (b: B) => (c: C) => (d: D) => (e: E) => F; +type Fn2_ = (a: A, b: B) => C; +type Fn3_ = (a: A, b: B, c: C) => D; +type Fn4_ = (a: A, b: B, c: C, d: D) => E; +type Fn5_ = (a: A, b: B, c: C, d: D, e: E) => F; -export interface StrMap { [k: string]: A; } +type Predicate = (a: A) => boolean; -export interface Maybe { +interface StrMap { [k: string]: A; } + +interface Maybe { constructor: { '@@type': 'sanctuary/Maybe'; }; } -export interface Either { +interface Either { constructor: { '@@type': 'sanctuary/Either'; }; } -export type ValidNumber = number; -export type FiniteNumber = number; -export type NonZeroFiniteNumber = number; -export type Integer = number; -export type NonNegativeInteger = number; - -export interface TypeRep {} - -export interface Setoid {} -export interface Ord extends Setoid {} -export interface Semigroupoid {} -export interface Category extends Semigroupoid {} -export interface Semigroup {} -export interface Monoid extends Semigroup {} -export interface Functor {} -export interface Bifunctor extends Functor {} -export interface Profunctor extends Functor {} -export interface Apply extends Functor {} -export interface Applicative extends Apply {} -export interface Chain extends Apply {} -export interface ChainRec extends Chain {} -export interface Monad extends Applicative, Chain {} -export interface Alt extends Functor {} -export interface Plus extends Alt {} -export interface Alternative extends Applicative, Plus {} -export interface Foldable {} -export interface Traversable extends Functor, Foldable {} -export interface Extend extends Functor {} -export interface Comonad extends Extend {} -export interface Contravariant {} - -export const Maybe: TypeRep; -export const Nothing: Maybe; -export function Just(x: A): Maybe; - -export const Either: TypeRep; -export function Left(x: A): Either; -export function Right(x: A): Either; - -// TODO: Specify return type -export function create(opts: {checkTypes: boolean, env: any[]}): {}; - -export const env: any[]; - -// Classify -export function type(x: any): { - namespace: Maybe - name: string - version: NonNegativeInteger -}; - -export function is(typeRep: TypeRep): (x: any) => boolean; - -// Showable -export function toString(x: any): string; - -// Fantasy Land -export function equals(x: Setoid): (y: Setoid) => boolean; - -export function lt (x: Ord): (y: Ord) => boolean; -export function lte(x: Ord): (y: Ord) => boolean; -export function gt (x: Ord): (y: Ord) => boolean; -export function gte(x: Ord): (y: Ord) => boolean; - -export function min(x: Ord): (y: Ord) => A; -export function max(x: Ord): (y: Ord) => A; - -export function id(p: TypeRep): Fn | Category; - -export function concat(x: Semigroup): (y: Semigroup) => Semigroup; -export function concat(x: A[]): (y: A[]) => A[]; -export function concat(x: StrMap): (y: StrMap) => StrMap; -export function concat(x: string): (y: string) => string; - -export function empty(p: TypeRep): Monoid; - -export function map(p: Fn): { - (q: Fn): Fn; - (q: A[]): B[]; - (q: StrMap): StrMap; - (q: Functor): Functor; -}; - -export function bimap(p: Fn): (q: Fn) => (r: Bifunctor) => Bifunctor; - -export function promap(p: Fn): (q: Fn) => { - (r: Fn): Fn; - (r: Profunctor): Profunctor; -}; - -export function alt(x: Alt): (y: Alt) => Alt; - -export function zero(p: TypeRep): Plus; - -export function reduce(p: Fn2): (q: B) => (r: A[] | StrMap | Maybe | Either | Foldable) => B; - -export function traverse(typeRep: TypeRep): (f: Fn>) => (traversable: Traversable) => Applicative>; - -export function sequence(typeRep: TypeRep): (traversable: Traversable>) => Applicative>; - -export function ap(p: Apply>): (q: Apply) => Apply; - -export function lift2(f: Fn2): { - (x: Fn): (y: Fn) => Fn; - (x: Apply): (y: Apply) => Apply; -}; - -export function lift3(f: Fn3): { - (x: Fn): (y: Fn) => (z: Fn) => Fn; - (x: Apply): (y: Apply) => (z: Apply) => Apply; -}; - -export function apFirst (x: Apply): (y: Apply) => Apply; -export function apSecond(x: Apply): (y: Apply) => Apply; - -export function of(typeRep: TypeRep): (x: A) => Fn; -export function of(typeRep: TypeRep): (x: A) => Applicative; - -export function chain(f: Fn2): (chain_: Fn) => Fn; -export function chain(f: Fn >): (chain_: Chain) => Chain; - -export function join(chain_: Fn2): Fn; -export function join(chain_: A[][]): A[]; -export function join(chain_: Maybe>): Maybe; -export function join(chain_: Chain>): Chain; - -export function chainRec(typeRep: TypeRep): { - (f: Fn2>): (x: A) => Fn; - (f: Fn >>): (x: A) => ChainRec; -}; - -export function extend(f: Fn, B>): (extend_: Extend) => Extend; - -export function extract(comonad: Comonad): A; - -export function contramap(f: Fn): { - (contravariant: Fn): Fn; - (contravariant: Contravariant): Contravariant; -}; - -export function filter (pred: Predicate): { - (m: A[]): A[]; - (m: Foldable): Foldable; -}; - -export function filterM(pred: Predicate): { - (m: A[]): A[]; - (m: Foldable): Foldable; -}; - -export function takeWhile(pred: Predicate): (foldable: Foldable) => Foldable; -export function dropWhile(pred: Predicate): (foldable: Foldable) => Foldable; - -// Combinator -export function I(x: A): A; - -export function K(x: A): (y: any) => A; - -export function T(x: A): (f: Fn) => B; - -// Function -export function curry2(f: Fn2_): Fn2; - -export function curry3(f: Fn3_): Fn3; - -export function curry4(f: Fn4_): Fn4; - -export function curry5(f: Fn5_): Fn5; - -export function flip(f: Fn2): Fn2; - -// Composition -export function compose(f: Fn): (g: Fn) => Fn; -export function compose(x: Semigroupoid): (y: Semigroupoid) => Semigroupoid; - -export function pipe(fs: [Fn]): (x: A) => B; -export function pipe(fs: [Fn, Fn]): (x: A) => C; -export function pipe(fs: [Fn, Fn, Fn]): (x: A) => D; -export function pipe(fs: [Fn, Fn, Fn, Fn]): (x: A) => E; -export function pipe(fs: [Fn, Fn, Fn, Fn, Fn]): (x: A) => F; -export function pipe(fs: Array>): (x: any) => any; - -export function on(p: Fn2): (q: Fn) => (r: A) => Fn; - -// TODO: Maybe -export function isNothing(p: Maybe): boolean; - -export function isJust(p: Maybe): boolean; - -export function fromMaybe(p: A): (q: Maybe) => A; - -export function fromMaybe_(p: Thunk): (q: Maybe) => A; - -export function maybeToNullable(p: Maybe): Nullable; - -export function toMaybe(p: A | null | undefined): Maybe; - -export function maybe(p: B): (q: Fn) => (r: Maybe) => B; - -export function maybe_(p: Thunk): (q: Fn) => (r: Maybe) => B; - -export function justs(p: Array>): A[]; - -export function mapMaybe(p: Fn>): (q: A[]) => A[]; - -export function encase(p: Fn): Fn>; - -export function encase2(p: Fn2): Fn2>; - -export function encase3(p: Fn3): Fn3>; - -export function maybeToEither(p: A): (q: Maybe) => Either; - -// TODO: Either -export function isLeft(p: Either): boolean; - -export function isRight(p: Either): boolean; - -export function fromEither(p: B): (q: Either) => B; - -export function toEither(p: A): (q: B | null | undefined) => Either; - -export function either(p: Fn): (q: Fn) => (r: Either) => C; - -export function lefts(p: Array>): A[]; - -export function rights(p: Array>): B[]; - -export function tagBy(p: Predicate): (q: A) => Either; - -export function encaseEither(p: Fn): (q: Fn) => Fn>; - -export function encaseEither2(p: Fn): (q: Fn2) => Fn2>; - -export function encaseEither3(p: Fn): (q: Fn3) => Fn3>; - -export function eitherToMaybe(p: Either): Maybe; - -// Logic -export function and(p: boolean): (q: boolean) => boolean; - -export function or(p: boolean): (q: boolean) => boolean; - -export function not(p: boolean): boolean; - -export function complement(p: Predicate): Predicate; - -export function ifElse(p: Predicate): (q: Fn) => (r: Fn) => Fn; - -export function when(p: Predicate): (q: Fn) => Fn; - -export function unless(p: Predicate): (q: Fn) => Fn; - -export function allPass(p: Array>): Predicate; - -export function anyPass(p: Array>): Predicate; - -// List -export interface ListToMaybeList { +type ValidNumber = number; +type FiniteNumber = number; +type NonZeroFiniteNumber = number; +type Integer = number; +type NonNegativeInteger = number; + +interface TypeRep {} + +interface Setoid {} +interface Ord extends Setoid {} +interface Semigroupoid {} +interface Category extends Semigroupoid {} +interface Semigroup {} +interface Monoid extends Semigroup {} +interface Functor {} +interface Bifunctor extends Functor {} +interface Profunctor extends Functor {} +interface Apply extends Functor {} +interface Applicative extends Apply {} +interface Chain extends Apply {} +interface ChainRec extends Chain {} +interface Monad extends Applicative, Chain {} +interface Alt extends Functor {} +interface Plus extends Alt {} +interface Alternative extends Applicative, Plus {} +interface Foldable {} +interface Traversable extends Functor, Foldable {} +interface Extend extends Functor {} +interface Comonad extends Extend {} +interface Contravariant {} + +interface ListToMaybeList { (xs: string): Maybe; (xs: A[]): Maybe; } -export function slice(p: Integer): (q: Integer) => ListToMaybeList; - -export function at(p: Integer): { - (q: string): Maybe; - (q: A[]): Maybe; -}; - -export function head(xs: string): Maybe; -export function head(xs: A[]): Maybe; - -export function last(xs: string): Maybe; -export function last(xs: A[]): Maybe; - -export function tail(xs: string): Maybe; -export function tail(xs: A[]): Maybe; - -export function init(xs: string): Maybe; -export function init(xs: A[]): Maybe; - -export function take(n: Integer): ListToMaybeList; - -export function takeLast(n: Integer): ListToMaybeList; - -export function drop(n: Integer): ListToMaybeList; - -export function dropLast(n: Integer): ListToMaybeList; - -// Array -// TODO: Fantasyland overloads, non-curried versions -export function append(x: A): { - (xs: A[]): A[]; - (xs: Applicative): Applicative; -}; - -export function prepend(x: A): { - (xs: A[]): A[]; - (xs: Applicative): Applicative; -}; - -export function joinWith(p: string): (q: string[]) => string; - -export function elem(p: A): (q: Foldable | StrMap | A[]) => boolean; - -export function find(p: Predicate): (q: A[] | StrMap | Foldable) => Maybe; - -export function pluck(key: string): (xs: Functor) => Functor; - -export function unfoldr(f: Fn>>): (x: B) => A[]; - -export function range(from: Integer): (to: Integer) => Integer[]; - -export function groupBy(f: Fn2): (xs: A[]) => A[][]; - -export function reverse(foldable: A[]): A[]; -export function reverse(foldable: Foldable): Foldable; - -export function sort(foldable: A[]): A[]; -export function sort(foldable: Foldable): Foldable; - -export function sortBy(f: Fn>): { - (foldable: A[]): A[]; - (foldable: Foldable): Foldable; -}; - -// Object -export function prop(p: string): (q: any) => any; - -export function props(p: string[]): (q: any) => any; - -export function get(p: Predicate): (q: string) => (r: any) => Maybe; - -export function gets(p: Predicate): (q: string[]) => (r: any) => Maybe; - -// StrMap -export function keys(p: StrMap): string[]; - -export function values(p: StrMap): A[]; - -export function pairs(p: StrMap): Array>; - -// Number -export function negate(n: ValidNumber): ValidNumber; - -export function add(p: FiniteNumber): (q: FiniteNumber) => FiniteNumber; - -export function sum(p: Foldable | FiniteNumber[]): FiniteNumber; - -export function sub(p: FiniteNumber): (q: FiniteNumber) => FiniteNumber; - -export function mult(x: FiniteNumber): (q: FiniteNumber) => FiniteNumber; - -export function product(p: Foldable | FiniteNumber[]): FiniteNumber; - -export function div(p: NonZeroFiniteNumber): (q: FiniteNumber) => FiniteNumber; - -export function pow(p: FiniteNumber): (q: FiniteNumber) => FiniteNumber; - -export function mean(p: Foldable | FiniteNumber[]): Maybe; - -// Integer -export function even(n: Integer): boolean; - -export function odd(n: Integer): boolean; - -// Parse -export function parseDate(s: string): Maybe; - -export function parseFloat(s: string): Maybe; - -export function parseInt(p: Integer): (q: string) => Maybe; - -export function parseJson(p: Predicate): (q: string) => Maybe; - -// RegExp -export function regex(p: string): (q: string) => RegExp; - -export function regexEscape(s: string): string; - -export function test(pattern: RegExp): Predicate; - -export interface MatchObj { +interface MatchObj { match: string; groups: Array>; } -export function match(pattern: RegExp): (q: string) => Array>; +declare namespace Sanctuary { + interface Static { + Maybe: TypeRep; + Nothing: Maybe; + Just(x: A): Maybe; + Either: TypeRep; + Left(x: A): Either; + Right(x: A): Either; + // Classify + type(x: any): { + namespace: Maybe + name: string + version: NonNegativeInteger + }; + is(typeRep: TypeRep): (x: any) => boolean; + // Showable + toString(x: any): string; + // Fantasy Land + equals(x: Setoid): (y: Setoid) => boolean; + lt (x: Ord): (y: Ord) => boolean; + lte(x: Ord): (y: Ord) => boolean; + gt (x: Ord): (y: Ord) => boolean; + gte(x: Ord): (y: Ord) => boolean; + min(x: Ord): (y: Ord) => A; + max(x: Ord): (y: Ord) => A; + id(p: TypeRep): Fn | Category; + concat(x: Semigroup): (y: Semigroup) => Semigroup; + concat(x: A[]): (y: A[]) => A[]; + concat(x: StrMap): (y: StrMap) => StrMap; + concat(x: string): (y: string) => string; + empty(p: TypeRep): Monoid; + map(p: Fn): { + (q: Fn): Fn; + (q: A[]): B[]; + (q: StrMap): StrMap; + (q: Functor): Functor; + }; + bimap(p: Fn): (q: Fn) => (r: Bifunctor) => Bifunctor; + promap(p: Fn): (q: Fn) => { + (r: Fn): Fn; + (r: Profunctor): Profunctor; + }; + alt(x: Alt): (y: Alt) => Alt; + zero(p: TypeRep): Plus; + reduce(p: Fn2): (q: B) => (r: A[] | StrMap | Maybe | Either | Foldable) => B; + traverse(typeRep: TypeRep): (f: Fn>) => (traversable: Traversable) => Applicative>; + sequence(typeRep: TypeRep): (traversable: Traversable>) => Applicative>; + ap(p: Apply>): (q: Apply) => Apply; + lift2(f: Fn2): { + (x: Fn): (y: Fn) => Fn; + (x: Apply): (y: Apply) => Apply; + }; + lift3(f: Fn3): { + (x: Fn): (y: Fn) => (z: Fn) => Fn; + (x: Apply): (y: Apply) => (z: Apply) => Apply; + }; + apFirst (x: Apply): (y: Apply) => Apply; + apSecond(x: Apply): (y: Apply) => Apply; + of(typeRep: TypeRep): (x: A) => Fn; + of(typeRep: TypeRep): (x: A) => Applicative; + chain(f: Fn2): (chain_: Fn) => Fn; + chain(f: Fn >): (chain_: Chain) => Chain; + join(chain_: Fn2): Fn; + join(chain_: A[][]): A[]; + join(chain_: Maybe>): Maybe; + join(chain_: Chain>): Chain; + chainRec(typeRep: TypeRep): { + (f: Fn2>): (x: A) => Fn; + (f: Fn >>): (x: A) => ChainRec; + }; + extend(f: Fn, B>): (extend_: Extend) => Extend; + extract(comonad: Comonad): A; + contramap(f: Fn): { + (contravariant: Fn): Fn; + (contravariant: Contravariant): Contravariant; + }; + filter (pred: Predicate): { + (m: A[]): A[]; + (m: Foldable): Foldable; + }; + filterM(pred: Predicate): { + (m: A[]): A[]; + (m: Foldable): Foldable; + }; + takeWhile(pred: Predicate): (foldable: Foldable) => Foldable; + dropWhile(pred: Predicate): (foldable: Foldable) => Foldable; + // Combinator + I(x: A): A; + K(x: A): (y: any) => A; + T(x: A): (f: Fn) => B; + // Function + curry2(f: Fn2_): Fn2; + curry3(f: Fn3_): Fn3; + curry4(f: Fn4_): Fn4; + curry5(f: Fn5_): Fn5; + flip(f: Fn2): Fn2; + // Composition + compose(f: Fn): (g: Fn) => Fn; + compose(x: Semigroupoid): (y: Semigroupoid) => Semigroupoid; + pipe(fs: [Fn]): (x: A) => B; + pipe(fs: [Fn, Fn]): (x: A) => C; + pipe(fs: [Fn, Fn, Fn]): (x: A) => D; + pipe(fs: [Fn, Fn, Fn, Fn]): (x: A) => E; + pipe(fs: [Fn, Fn, Fn, Fn, Fn]): (x: A) => F; + pipe(fs: Array>): (x: any) => any; + on(p: Fn2): (q: Fn) => (r: A) => Fn; + // TODO: Maybe + isNothing(p: Maybe): boolean; + isJust(p: Maybe): boolean; + fromMaybe(p: A): (q: Maybe) => A; + fromMaybe_(p: Thunk): (q: Maybe) => A; + maybeToNullable(p: Maybe): Nullable; + toMaybe(p: A | null | undefined): Maybe; + maybe(p: B): (q: Fn) => (r: Maybe) => B; + maybe_(p: Thunk): (q: Fn) => (r: Maybe) => B; + justs(p: Array>): A[]; + mapMaybe(p: Fn>): (q: A[]) => A[]; + encase(p: Fn): Fn>; + encase2(p: Fn2): Fn2>; + encase3(p: Fn3): Fn3>; + maybeToEither(p: A): (q: Maybe) => Either; + // TODO: Either + isLeft(p: Either): boolean; + isRight(p: Either): boolean; + fromEither(p: B): (q: Either) => B; + toEither(p: A): (q: B | null | undefined) => Either; + either(p: Fn): (q: Fn) => (r: Either) => C; + lefts(p: Array>): A[]; + rights(p: Array>): B[]; + tagBy(p: Predicate): (q: A) => Either; + encaseEither(p: Fn): (q: Fn) => Fn>; + encaseEither2(p: Fn): (q: Fn2) => Fn2>; + encaseEither3(p: Fn): (q: Fn3) => Fn3>; + eitherToMaybe(p: Either): Maybe; + // Logic + and(p: boolean): (q: boolean) => boolean; + or(p: boolean): (q: boolean) => boolean; + not(p: boolean): boolean; + complement(p: Predicate): Predicate; + ifElse(p: Predicate): (q: Fn) => (r: Fn) => Fn; + when(p: Predicate): (q: Fn) => Fn; + unless(p: Predicate): (q: Fn) => Fn; + allPass(p: Array>): Predicate; + anyPass(p: Array>): Predicate; + // List + slice(p: Integer): (q: Integer) => ListToMaybeList; + at(p: Integer): { + (q: string): Maybe; + (q: A[]): Maybe; + }; + head(xs: string): Maybe; + head(xs: A[]): Maybe; + last(xs: string): Maybe; + last(xs: A[]): Maybe; + tail(xs: string): Maybe; + tail(xs: A[]): Maybe; + init(xs: string): Maybe; + init(xs: A[]): Maybe; + take(n: Integer): ListToMaybeList; + takeLast(n: Integer): ListToMaybeList; + drop(n: Integer): ListToMaybeList; + dropLast(n: Integer): ListToMaybeList; + // Array + // TODO: Fantasyland overloads, non-curried versions + append(x: A): { + (xs: A[]): A[]; + (xs: Applicative): Applicative; + }; + prepend(x: A): { + (xs: A[]): A[]; + (xs: Applicative): Applicative; + }; + joinWith(p: string): (q: string[]) => string; + elem(p: A): (q: Foldable | StrMap | A[]) => boolean; + find(p: Predicate): (q: A[] | StrMap | Foldable) => Maybe; + pluck(key: string): (xs: Functor) => Functor; + unfoldr(f: Fn>>): (x: B) => A[]; + range(from: Integer): (to: Integer) => Integer[]; + groupBy(f: Fn2): (xs: A[]) => A[][]; + reverse(foldable: A[]): A[]; + reverse(foldable: Foldable): Foldable; + sort(foldable: A[]): A[]; + sort(foldable: Foldable): Foldable; + sortBy(f: Fn>): { + (foldable: A[]): A[]; + (foldable: Foldable): Foldable; + }; + // Object + prop(p: string): (q: any) => any; + props(p: string[]): (q: any) => any; + get(p: Predicate): (q: string) => (r: any) => Maybe; + gets(p: Predicate): (q: string[]) => (r: any) => Maybe; + // StrMap + keys(p: StrMap): string[]; + values(p: StrMap): A[]; + pairs(p: StrMap): Array>; + // Number + negate(n: ValidNumber): ValidNumber; + add(p: FiniteNumber): (q: FiniteNumber) => FiniteNumber; + sum(p: Foldable | FiniteNumber[]): FiniteNumber; + sub(p: FiniteNumber): (q: FiniteNumber) => FiniteNumber; + mult(x: FiniteNumber): (q: FiniteNumber) => FiniteNumber; + product(p: Foldable | FiniteNumber[]): FiniteNumber; + div(p: NonZeroFiniteNumber): (q: FiniteNumber) => FiniteNumber; + pow(p: FiniteNumber): (q: FiniteNumber) => FiniteNumber; + mean(p: Foldable | FiniteNumber[]): Maybe; + // Integer + even(n: Integer): boolean; + odd(n: Integer): boolean; + // Parse + parseDate(s: string): Maybe; + parseFloat(s: string): Maybe; + parseInt(p: Integer): (q: string) => Maybe; + parseJson(p: Predicate): (q: string) => Maybe; + // RegExp + regex(p: string): (q: string) => RegExp; + regexEscape(s: string): string; + test(pattern: RegExp): Predicate; + match(pattern: RegExp): (q: string) => Array>; + matchAll(pattern: RegExp): (q: string) => MatchObj[]; + // String + toUpper(s: string): string; + toLower(s: string): string; + trim(s: string): string; + stripPrefix(prefix: string): (q: string) => Maybe; + stripSuffix(suffix: string): (q: string) => Maybe; + words(s: string): string[]; + unwords(xs: string[]): string; + lines(s: string): string[]; + unlines(xs: string[]): string; + splitOn(separator: string): (q: string) => string[]; + splitOnRegex(pattern: RegExp): (q: string) => string[]; + } -export function matchAll(pattern: RegExp): (q: string) => MatchObj[]; - -// String -export function toUpper(s: string): string; - -export function toLower(s: string): string; - -export function trim(s: string): string; - -export function stripPrefix(prefix: string): (q: string) => Maybe; - -export function stripSuffix(suffix: string): (q: string) => Maybe; - -export function words(s: string): string[]; - -export function unwords(xs: string[]): string; - -export function lines(s: string): string[]; - -export function unlines(xs: string[]): string; - -export function splitOn(separator: string): (q: string) => string[]; - -export function splitOnRegex(pattern: RegExp): (q: string) => string[]; + interface Environment extends Static { + env: any[]; + create(opts: {checkTypes: boolean, env: any[]}): Static; + } +} diff --git a/types/sanctuary/sanctuary-tests.ts b/types/sanctuary/sanctuary-tests.ts index 76c5bb9c7e..663811935c 100644 --- a/types/sanctuary/sanctuary-tests.ts +++ b/types/sanctuary/sanctuary-tests.ts @@ -1,6 +1,9 @@ /// ; -import * as S from "sanctuary"; import * as assert from "assert"; +import { create, env } from "sanctuary"; + +const checkTypes = process.env["NODE_ENV"] !== "production"; +const S = create({checkTypes, env}); assert.equal(S.map(S.concat('@'))(['foo', 'bar', 'baz']), ["@foo", "@bar", "@baz"]); assert.equal(S.reduce(S.add)(0)([1, 2, 3, 4, 5]), 15); From 91ad6517321b4e40f58d92e51379f24045305a61 Mon Sep 17 00:00:00 2001 From: Martin Hochel Date: Wed, 17 Jan 2018 19:09:36 +0100 Subject: [PATCH 077/496] feat(skatejs): add skatejs library types (#22006) * feat(skatejs) add skatejs types - fix(skatejs): udpate tsconfig and fix imports in tests - fix(skatejs): make test pass - feat(skatejs): update to latest api's and add more tests - refactor(skatejs): remove tsx extension as skate is not using VDom at all - fix(skatejs): fix ts next strict errors - ci(skatejs): explicitly use files cause include is not allowed - refactor(skatejs): rename tests folder to test - fix(skatejs): don't use strict within tsconfig - fix(skatejs): fix lint errors - fix(skatejs): use standard dtslint rules without overrides * fix(skatejs): downgrade required TS version * refactor(skatejs): improve PropOptions interface by making it generic * ci(skatejs): mitigate failing build --- types/skatejs/api.d.ts | 72 +++++++++++ types/skatejs/index.d.ts | 28 +++++ types/skatejs/test/components/custom-base.ts | 4 + .../skatejs/test/components/no-shadow-root.ts | 116 ++++++++++++++++++ .../skatejs/test/components/props-set-get.ts | 58 +++++++++ .../test/components/with-custom-base.ts | 43 +++++++ types/skatejs/test/mixins/with-children.ts | 10 ++ types/skatejs/test/mixins/with-component.ts | 41 +++++++ types/skatejs/test/mixins/with-context.ts | 87 +++++++++++++ types/skatejs/test/mixins/with-lifecycle.ts | 19 +++ types/skatejs/test/mixins/with-renderer.ts | 20 +++ types/skatejs/test/mixins/with-update.ts | 37 ++++++ types/skatejs/test/renderers/custom.ts | 21 ++++ types/skatejs/test/renderers/default.ts | 16 +++ types/skatejs/test/utils/define.ts | 12 ++ types/skatejs/test/utils/emit.ts | 18 +++ types/skatejs/test/utils/link.ts | 34 +++++ types/skatejs/test/utils/name.ts | 16 +++ types/skatejs/test/utils/shadow.ts | 7 ++ types/skatejs/tsconfig.json | 42 +++++++ types/skatejs/tslint.json | 3 + types/skatejs/types.d.ts | 112 +++++++++++++++++ 22 files changed, 816 insertions(+) create mode 100644 types/skatejs/api.d.ts create mode 100644 types/skatejs/index.d.ts create mode 100644 types/skatejs/test/components/custom-base.ts create mode 100644 types/skatejs/test/components/no-shadow-root.ts create mode 100644 types/skatejs/test/components/props-set-get.ts create mode 100644 types/skatejs/test/components/with-custom-base.ts create mode 100644 types/skatejs/test/mixins/with-children.ts create mode 100644 types/skatejs/test/mixins/with-component.ts create mode 100644 types/skatejs/test/mixins/with-context.ts create mode 100644 types/skatejs/test/mixins/with-lifecycle.ts create mode 100644 types/skatejs/test/mixins/with-renderer.ts create mode 100644 types/skatejs/test/mixins/with-update.ts create mode 100644 types/skatejs/test/renderers/custom.ts create mode 100644 types/skatejs/test/renderers/default.ts create mode 100644 types/skatejs/test/utils/define.ts create mode 100644 types/skatejs/test/utils/emit.ts create mode 100644 types/skatejs/test/utils/link.ts create mode 100644 types/skatejs/test/utils/name.ts create mode 100644 types/skatejs/test/utils/shadow.ts create mode 100644 types/skatejs/tsconfig.json create mode 100644 types/skatejs/tslint.json create mode 100644 types/skatejs/types.d.ts diff --git a/types/skatejs/api.d.ts b/types/skatejs/api.d.ts new file mode 100644 index 0000000000..4115404608 --- /dev/null +++ b/types/skatejs/api.d.ts @@ -0,0 +1,72 @@ +import { + ComposedCustomEvent, + Constructor, + CustomElement, + HTMLElementClass, + EventOptions, + PropOptions, + WithChildren, + WithRenderer, + WithUpdate, + WithComponent, + WithLifecycle, + WithContext, + Mixed +} from './types'; + +/** + * The define() function is syntactic sugar on top of customElements.define() + * that allows you to specify a static is property on your constructor that is the name of the component, + * or omit it altogether. + */ +export const define: (ctor: T) => T; + +/** + * Emits an Event on elem that is composed, bubbles and is cancelable by default. + * The return value of emit() is the same as dispatchEvent(). + */ +export function emit(elem: EventTarget | HTMLElementClass, eventName: string, eventOptions?: EventOptions): boolean; + +export function link(elem: CustomElement, target?: string): (e: ComposedCustomEvent) => void; + +export const props: Readonly<{ + any: PropOptions & PropertyDecorator; + array: PropOptions & PropertyDecorator; + boolean: PropOptions & PropertyDecorator; + number: PropOptions & PropertyDecorator; + object: PropOptions & PropertyDecorator; + string: PropOptions & PropertyDecorator; +}>; + +export const prop: (ops?: PropOptions) => PropertyDecorator & PropOptions; + +export const shadow: (elem: CustomElement | HTMLElement) => ShadowRoot; + +export const name: (componentName?: string) => string; + +// Mixins +export function withComponent = Constructor>( + Base?: T +): typeof WithComponent; + +export function withComponent< + P = Mixed, + S = Mixed, + C = void, + T extends Constructor = Constructor +>(Base?: T): Constructor> & T; +export function withUpdate

= Constructor>( + Base?: T +): Constructor> & T; +export function withRenderer = Constructor>( + Base?: T +): Constructor> & T; +export function withContext = Constructor>( + Base?: T +): Constructor> & T; +export function withLifecycle = Constructor>( + Base?: T +): Constructor & T; +export function withChildren = Constructor>( + Base?: T +): Constructor & T; diff --git a/types/skatejs/index.d.ts b/types/skatejs/index.d.ts new file mode 100644 index 0000000000..71066da4b5 --- /dev/null +++ b/types/skatejs/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for skatejs 5.0 +// Project: https://github.com/skatejs/skatejs +// Definitions by: Martin Hochel +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +export as namespace skate; + +// Public API: mixins +export { withComponent, withLifecycle, withContext, withChildren, withUpdate, withRenderer } from './api'; + +// Public API: utils +export { prop, props, link, define, emit, shadow, name } from './api'; + +// Public types ( Unfortunately TS doesn't have Opaque Types like Flow ) +export { + Constructor, + CustomElement, + ComponentProps, + PropOptions, + Renderer, + WithComponent, + WithLifecycle, + WithContext, + WithChildren, + WithUpdate, + WithRenderer +} from './types'; diff --git a/types/skatejs/test/components/custom-base.ts b/types/skatejs/test/components/custom-base.ts new file mode 100644 index 0000000000..36b8a55813 --- /dev/null +++ b/types/skatejs/test/components/custom-base.ts @@ -0,0 +1,4 @@ +import { withComponent, WithComponent } from 'skatejs'; + +export const ButtonComponent = withComponent(HTMLButtonElement); +export const InputComponent = withComponent(HTMLInputElement); diff --git a/types/skatejs/test/components/no-shadow-root.ts b/types/skatejs/test/components/no-shadow-root.ts new file mode 100644 index 0000000000..5b7cee16e5 --- /dev/null +++ b/types/skatejs/test/components/no-shadow-root.ts @@ -0,0 +1,116 @@ +import { + define, + Renderer, + WithRenderer, + WithUpdate, + withComponent, + withRenderer, + withChildren, + withUpdate, + WithComponent, + Constructor, + CustomElement +} from 'skatejs'; + +// custom class definition needed to get Generics support for custom mixin composition +interface CustomComponentBase

extends WithUpdate, WithRenderer {} +declare class CustomComponentBase

extends HTMLElement {} + +// Explicitly defined renderer mixin interface type +export interface CustomRenderer extends HTMLElement, Renderer { + renderer(shadowRoot: HTMLElement, render: () => string): void; +} + +export const withCustomRendererAsString = ( + Base = HTMLElement +) => { + class CustomRendererAsString extends Base implements Renderer { + renderer(shadowRoot: HTMLElement, render: () => string): void { + // erease content && re-render + shadowRoot.innerHTML = render(); + } + } + return CustomRendererAsString; +}; + +const customWithComponent = (Base = HTMLElement): typeof WithComponent => + withChildren(withUpdate(withRenderer(Base))) as any; + +const MComponent = customWithComponent(withCustomRendererAsString()); +const MComponent2 = withChildren(withUpdate(withRenderer(withCustomRendererAsString()))); +const MComponent3 = withRenderer(withUpdate(withCustomRendererAsString())) as typeof CustomComponentBase; + +export const Component = withComponent(withCustomRendererAsString()); +// @TODO this doesn't work :( I though this will extend base def and will restrict renderCallback return type +// interface Component

{ +// renderCallback(props?: P): string; +// } + +// tslint:disable-next-line interface-over-type-literal +export type Props = { greet: string }; +// tslint:disable-next-line interface-over-type-literal +export type State = { count: number }; + +class Mo extends MComponent { + foo() { + this.props.greet; + this.state.count; + } +} + +class Mo2 extends MComponent2 { + props: Props; + foo() { + this.props.greet; + } +} + +class Mo3 extends MComponent3 { + foo() { + this.props.greet; + this.state.count; + + // Following will error out, thanks TS ! immutable all the things + // this.props = {greet:'Martin'} + // this.props.greet = Martin' + + // update state + this.state = { count: this.state.count + 1 }; + + // Following will error out, thanks TS ! nope prop is not defined on state ;) + // this.state = {count: this.state.count+1, nope: false} + } +} + +export class Shadowless

extends Component { + get renderRoot() { + return this; + } +} +export class MyComponent extends Component { + static readonly is = 'my-cmp'; + get renderRoot() { + return this; + } + render() { + return ` +

+

Hello World

+
+ `; + } +} +define(MyComponent); + +export class NoShadowCmp extends Shadowless { + static readonly is = 'my-noshadow-cmp'; + render() { + return ` +
+

Hello World ${this.props.greet}

+
how much is the fish? ${this.state.count}
+
+ `; + } +} +define(NoShadowCmp); diff --git a/types/skatejs/test/components/props-set-get.ts b/types/skatejs/test/components/props-set-get.ts new file mode 100644 index 0000000000..bf478d37ef --- /dev/null +++ b/types/skatejs/test/components/props-set-get.ts @@ -0,0 +1,58 @@ +import { withComponent, props, define, PropOptions, WithComponent } from 'skatejs'; + +export const Component = withComponent(); + +// tslint:disable-next-line interface-over-type-literal +export type Props = { + myArray: string[]; + myBoolean: boolean; +}; +// tslint:disable-next-line interface-over-type-literal +export type State = Props; + +export class MyComponent extends Component { + static readonly is = 'my-cmp'; + static readonly props = { + myArray: props.array, + myBoolean: props.boolean + }; + myBoolean = false; + myArray: string[] = []; + private someNonPublicApiProp = 'Who are you?'; + + private readonly button = document.createElement('button'); + + render() { + this.button.textContent = 'Hello World'; + return this.appendChild(this.button); + } + connected() { + this.button.addEventListener('click', this._changeState); + } + disconnected() { + this.button.removeEventListener('click', this._changeState); + } + + private readonly _changeState = (event: MouseEvent) => { + // as Props casting is needed as there is absolutely no way how to differently create + // type definitions for setter and getter + // tslint:disable-next-line no-object-literal-type-assertion + this.state = { myBoolean: true } as State; + // or just directly + this.myBoolean = true; + + console.log(this.props); // { myArray: [], myBoolean: true } + + // tslint:disable-next-line no-object-literal-type-assertion + this.state = { myArray: ['hello'] } as State; + // or just directly + this.myArray = ['hello']; + + console.log(this.props); // { myArray: ['hello'], myBoolean: true } + + // this will not trigger re-render + this.someNonPublicApiProp = 'Im David'; + } +} + +export default define(MyComponent); diff --git a/types/skatejs/test/components/with-custom-base.ts b/types/skatejs/test/components/with-custom-base.ts new file mode 100644 index 0000000000..f4c89afb4a --- /dev/null +++ b/types/skatejs/test/components/with-custom-base.ts @@ -0,0 +1,43 @@ +import { define } from 'skatejs'; + +import { ButtonComponent, InputComponent } from './custom-base'; + +// tslint:disable-next-line interface-over-type-literal +export type ButtonProps = { + raised?: boolean; +}; + +export class MaterialButton extends ButtonComponent { + static readonly props = { + raised: '' + }; + + type?: string; + foo() { + this.props.raised; + + console.log( + // we have to explicitly define HTMLBUttonProps as TS doesn't support Generic mixins ye https://github.com/Microsoft/TypeScript/pull/13743#issuecomment-277716812t + this.type + ); + } + // now our MaterialButton has all