From 74c9f02a5ade3a2716849c27b40bba05e6ebeb38 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 13 Jul 2016 10:15:59 -0700 Subject: [PATCH 01/14] Do not use the namespace for OC --- oclazyload/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oclazyload/index.d.ts b/oclazyload/index.d.ts index 4480978e6d..c4ef1857e2 100644 --- a/oclazyload/index.d.ts +++ b/oclazyload/index.d.ts @@ -145,6 +145,6 @@ declare module 'angular' { * @param requires The names of modules this module depends on, and/or ocLazyLoad module configurations. If specified then new module is being created. If unspecified then the module is being retrieved for further configuration. * @param configFn Optional configuration function for the module. */ - module(name: string, requires?: (string|oc.IModuleConfig)[], configFn?: Function): IModule; + module(name: string, requires?: (string | IModuleConfig)[], configFn?: Function): IModule; } } From 89f7ea700516fd57b1686653527ec855462be707 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 13 Jul 2016 12:00:16 -0700 Subject: [PATCH 02/14] Fix #10082: remove angular package dependency on itself (#10086) * Fix #10082: Remove dependency of angular on itself * Disable forceConsistentCasingInFileNames for now --- angular/angular-mocks.d.ts | 2 +- angular/tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/angular/angular-mocks.d.ts b/angular/angular-mocks.d.ts index ae3d1252f5..a5c0db7ac6 100644 --- a/angular/angular-mocks.d.ts +++ b/angular/angular-mocks.d.ts @@ -3,7 +3,7 @@ // Definitions by: Diego Vilar , Tony Curtis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import * as angular from 'angular'; +import * as angular from './index'; declare module "angular-mocks/ngMock" { var _: string; diff --git a/angular/tsconfig.json b/angular/tsconfig.json index 3b296f824e..294ae03d1b 100644 --- a/angular/tsconfig.json +++ b/angular/tsconfig.json @@ -14,6 +14,6 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": false } } \ No newline at end of file From 03adbf1483141b198fde49acb8f4cca674962e25 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 13 Jul 2016 21:51:19 -0700 Subject: [PATCH 03/14] Fix use of FormEvent in antd --- antd/antd-tests.tsx | 2 ++ antd/index.d.ts | 40 ++++++++++++++++++++-------------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/antd/antd-tests.tsx b/antd/antd-tests.tsx index 142ca6ccdd..1319455e91 100644 --- a/antd/antd-tests.tsx +++ b/antd/antd-tests.tsx @@ -1,4 +1,5 @@ /// + /*import { Affix, Button, @@ -48,6 +49,7 @@ } from 'antd';*/ +import * as React from 'react' import Affix from 'antd/lib/Affix' import Button from 'antd/lib/Button' import Alert from 'antd/lib/Alert' diff --git a/antd/index.d.ts b/antd/index.d.ts index 0f14303a19..e2865c6927 100644 --- a/antd/index.d.ts +++ b/antd/index.d.ts @@ -536,7 +536,7 @@ declare namespace Antd { /** 经 `Form.create()` 包装过的组件会自带 `this.props.form` 属性,直接传给 Form 即可*/ form?: Object, /** 数据验证成功后回调事件*/ - onSubmit?: (e: React.FormEvent) => void, + onSubmit?: (e: React.FormEvent
) => void, } /** * #Form @@ -1560,11 +1560,11 @@ declare namespace Antd { 选项卡切换组件。 ## 何时使用 - + 提供平级的区域将大块内容进行收纳和展现,保持界面整洁。 - + Ant Design 依次提供了三级选项卡,分别用于不同的场景。 - + - 卡片式的页签,提供可关闭的样式,常用于容器顶部。 - 标准线条式页签,用于容器内部的主功能切换,这是最常用的 Tabs。 - [RadioButton](/components/radio/#demo-radiobutton) 可作为更次级的页签来使用。*/ @@ -1590,9 +1590,9 @@ declare namespace Antd { /** * #Tag 进行标记和分类的小标签。 - + ## 何时使用 - + - 用于标记事物的属性和维度。 - 进行分类。*/ export class Tag extends React.Component { @@ -1633,10 +1633,10 @@ declare namespace Antd { /** * #TimePicker 输入或选择时间的控件。 - + 何时使用 -------- - + 当用户需要输入一个时间,可以点击标准输入框,弹出时间面板进行选择。 */ export class TimePicker extends React.Component { @@ -1662,9 +1662,9 @@ declare namespace Antd { /** * #Timeline 垂直展示的时间流信息。 - + ## 何时使用 - + - 当有一系列信息需要从上至下按时间排列时; - 需要有一条时间轴进行视觉上的串联时;*/ export class Timeline extends React.Component { @@ -1685,11 +1685,11 @@ declare namespace Antd { /** * #Tooltip 简单的文字提示气泡框。 - + ## 何时使用 - + 鼠标移入则显示提示,移出消失,气泡浮层不承载复杂文本和操作。 - + 可用来代替系统默认的 `title` 提示,提供一个`按钮/文字/操作`的文案解释。*/ export class Tooltip extends React.Component { render(): JSX.Element @@ -1729,9 +1729,9 @@ declare namespace Antd { /** * #Transfer 双栏穿梭选择框。 - + ## 何时使用 - + 用直观的方式在两栏中移动元素,完成选择行为。 */ export class Transfer extends React.Component { @@ -1882,9 +1882,9 @@ declare namespace Antd { /** * #TreeSelect 树型选择控件。 - + ## 何时使用 - + 类似 Select 的选择控件,可选择的数据结构是一个树形结构时,可以使用 TreeSelect,例如公司层级、学科系统、分类目录等等。 */ export class TreeSelect extends React.Component { @@ -1926,11 +1926,11 @@ declare namespace Antd { /** * #Upload 文件选择上传和拖拽上传控件。 - + ## 何时使用 - + 上传是将信息(网页、文字、图片、视频等)通过网页或者上传工具发布到远程服务器上的过程。 - + - 当需要上传一个或一些文件时。 - 当需要展现上传的进度时。 - 当需要使用拖拽交互时。*/ From 197da689005dea0e949af87db8aec20d2a464910 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 13 Jul 2016 21:56:51 -0700 Subject: [PATCH 04/14] Fix use of HTMLAttributes to use generics --- enzyme/enzyme-tests.tsx | 6 +++--- enzyme/index.d.ts | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/enzyme/enzyme-tests.tsx b/enzyme/enzyme-tests.tsx index 41a630f0eb..7114780ffb 100644 --- a/enzyme/enzyme-tests.tsx +++ b/enzyme/enzyme-tests.tsx @@ -42,7 +42,7 @@ namespace ShallowWrapperTest { objectVal: Object, boolVal: Boolean, stringVal: String, - elementWrapper: ShallowWrapper + elementWrapper: ShallowWrapper, {}> function test_find() { elementWrapper = shallowWrapper.find('.selector'); @@ -236,7 +236,7 @@ namespace ReactWrapperTest { objectVal: Object, boolVal: Boolean, stringVal: String, - elementWrapper: ReactWrapper + elementWrapper: ReactWrapper, {}> function test_find() { elementWrapper = reactWrapper.find('.selector'); @@ -418,7 +418,7 @@ namespace CheerioWrapperTest { objectVal: Object, boolVal: Boolean, stringVal: String, - elementWrapper: ReactWrapper + elementWrapper: ReactWrapper, {}> function test_find() { elementWrapper = cheerioWrapper.find('.selector'); diff --git a/enzyme/index.d.ts b/enzyme/index.d.ts index 3966e1cb14..5d3b55ed0b 100644 --- a/enzyme/index.d.ts +++ b/enzyme/index.d.ts @@ -29,7 +29,7 @@ interface CommonWrapper { */ find(component: ComponentClass): CommonWrapper; find(statelessComponent: StatelessComponent): CommonWrapper; - find(selector: string): CommonWrapper; + find(selector: string): CommonWrapper, any>; /** * Finds every node in the render tree that returns true for the provided predicate function. @@ -43,7 +43,7 @@ interface CommonWrapper { */ filter(component: ComponentClass): CommonWrapper; filter(statelessComponent: StatelessComponent): CommonWrapper; - filter(selector: string): CommonWrapper; + filter(selector: string): CommonWrapper, any>; /** * Returns a new wrapper with only the nodes of the current wrapper that, when passed into the provided predicate function, return true. @@ -83,7 +83,7 @@ interface CommonWrapper { */ children(component: ComponentClass): CommonWrapper; children(statelessComponent: StatelessComponent): CommonWrapper; - children(selector: string): CommonWrapper; + children(selector: string): CommonWrapper, any>; children(): CommonWrapper; /** @@ -95,7 +95,7 @@ interface CommonWrapper { */ parents(component: ComponentClass): CommonWrapper; parents(statelessComponent: StatelessComponent): CommonWrapper; - parents(selector: string): CommonWrapper; + parents(selector: string): CommonWrapper, any>; parents(): CommonWrapper; /** @@ -112,7 +112,7 @@ interface CommonWrapper { */ closest(component: ComponentClass): CommonWrapper; closest(statelessComponent: StatelessComponent): CommonWrapper; - closest(selector: string): CommonWrapper; + closest(selector: string): CommonWrapper, any>; /** * Returns a string of the rendered text of the current render tree. This function should be looked at with @@ -320,7 +320,7 @@ export interface ShallowWrapper extends CommonWrapper { */ find(component: ComponentClass): ShallowWrapper; find(statelessComponent: (props: P2) => JSX.Element): ShallowWrapper; - find(selector: string): ShallowWrapper; + find(selector: string): ShallowWrapper, any>; /** * Removes nodes in the current wrapper that do not match the provided selector. @@ -328,7 +328,7 @@ export interface ShallowWrapper extends CommonWrapper { */ filter(component: ComponentClass): ShallowWrapper; filter(statelessComponent: StatelessComponent): ShallowWrapper; - filter(selector: string): ShallowWrapper; + filter(selector: string): ShallowWrapper, any>; /** * Finds every node in the render tree that returns true for the provided predicate function. @@ -343,7 +343,7 @@ export interface ShallowWrapper extends CommonWrapper { */ children(component: ComponentClass): ShallowWrapper; children(statelessComponent: StatelessComponent): ShallowWrapper; - children(selector: string): ShallowWrapper; + children(selector: string): ShallowWrapper, any>; children(): ShallowWrapper; /** @@ -355,7 +355,7 @@ export interface ShallowWrapper extends CommonWrapper { */ parents(component: ComponentClass): ShallowWrapper; parents(statelessComponent: StatelessComponent): ShallowWrapper; - parents(selector: string): ShallowWrapper; + parents(selector: string): ShallowWrapper, any>; parents(): ShallowWrapper; /** @@ -367,7 +367,7 @@ export interface ShallowWrapper extends CommonWrapper { */ closest(component: ComponentClass): ShallowWrapper; closest(statelessComponent: StatelessComponent): ShallowWrapper; - closest(selector: string): ShallowWrapper; + closest(selector: string): ShallowWrapper, any>; /** * Returns a wrapper with the direct parent of the node in the current wrapper. From 275ffe25190669789052544da78f53c5c1799798 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 13 Jul 2016 22:00:32 -0700 Subject: [PATCH 05/14] Fix use of React.SyntheticEvent --- fixed-data-table/fixed-data-table-tests.tsx | 10 +++++----- fixed-data-table/index.d.ts | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fixed-data-table/fixed-data-table-tests.tsx b/fixed-data-table/fixed-data-table-tests.tsx index 918ef29350..7dfac22230 100644 --- a/fixed-data-table/fixed-data-table-tests.tsx +++ b/fixed-data-table/fixed-data-table-tests.tsx @@ -174,11 +174,11 @@ class MyTable5 extends React.Component<{}, {}> { onScrollStart={(x: number, y: number) => {}} onScrollEnd={(x: number, y: number) => {}} onContentHeightChange={(newHeight: number) => {}} - onRowClick={(event: React.SyntheticEvent, rowIndex: number) => {}} - onRowDoubleClick={(event: React.SyntheticEvent, rowIndex: number) => {}} - onRowMouseDown={(event: React.SyntheticEvent, rowIndex: number) => {}} - onRowMouseEnter={(event: React.SyntheticEvent, rowIndex: number) => {}} - onRowMouseLeave={(event: React.SyntheticEvent, rowIndex: number) => {}} + onRowClick={(event: React.SyntheticEvent, rowIndex: number) => {}} + onRowDoubleClick={(event: React.SyntheticEvent
, rowIndex: number) => {}} + onRowMouseDown={(event: React.SyntheticEvent
, rowIndex: number) => {}} + onRowMouseEnter={(event: React.SyntheticEvent
, rowIndex: number) => {}} + onRowMouseLeave={(event: React.SyntheticEvent
, rowIndex: number) => {}} onColumnResizeEndCallback={(newColumnWidth: number, columnKey: string) => {}}> // add columns
diff --git a/fixed-data-table/index.d.ts b/fixed-data-table/index.d.ts index d7eba851c1..cb5809bf5a 100644 --- a/fixed-data-table/index.d.ts +++ b/fixed-data-table/index.d.ts @@ -212,30 +212,30 @@ declare namespace FixedDataTable { /** * Callback that is called when a row is clicked. */ - onRowClick?: (event: React.SyntheticEvent, rowIndex: number) => void; + onRowClick?: (event: React.SyntheticEvent, rowIndex: number) => void; /** * Callback that is called when a row is double clicked. */ - onRowDoubleClick?: (event: React.SyntheticEvent, rowIndex: number) => void; + onRowDoubleClick?: (event: React.SyntheticEvent
, rowIndex: number) => void; /** * Callback that is called when a mouse-down event happens * on a row. */ - onRowMouseDown?: (event: React.SyntheticEvent, rowIndex: number) => void; + onRowMouseDown?: (event: React.SyntheticEvent
, rowIndex: number) => void; /** * Callback that is called when a mouse-enter event happens * on a row. */ - onRowMouseEnter?: (event: React.SyntheticEvent, rowIndex: number) => void; + onRowMouseEnter?: (event: React.SyntheticEvent
, rowIndex: number) => void; /** * Callback that is called when a mouse-leave event happens * on a row. */ - onRowMouseLeave?: (event: React.SyntheticEvent, rowIndex: number) => void; + onRowMouseLeave?: (event: React.SyntheticEvent
, rowIndex: number) => void; /** * Callback that is called when resizer has been released @@ -464,7 +464,7 @@ declare namespace FixedDataTable { * /> * ); */ - export interface CellProps extends React.HTMLAttributes { + export interface CellProps extends React.HTMLAttributes { /** * The row index of the cell. */ From 7ca36265b762d9764e856e3c2a3a1d7a1d03e31e Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 13 Jul 2016 22:02:20 -0700 Subject: [PATCH 06/14] Fix use of React.HTMLAttributes --- react-holder/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-holder/index.d.ts b/react-holder/index.d.ts index f7861c3370..ea2cf79945 100644 --- a/react-holder/index.d.ts +++ b/react-holder/index.d.ts @@ -7,7 +7,7 @@ import * as React from "react"; -interface ReactHolderProp extends React.HTMLAttributes { +interface ReactHolderProp extends React.HTMLAttributes { width: string | number; height: string | number; updateOnResize: boolean; From 1848a0de409e158910b82270cbbcf4f72ced4600 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 13 Jul 2016 22:03:50 -0700 Subject: [PATCH 07/14] Fix use of React.SyntheticEvent --- react-input-calendar/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-input-calendar/index.d.ts b/react-input-calendar/index.d.ts index cd58d86a78..5cebd1896a 100644 --- a/react-input-calendar/index.d.ts +++ b/react-input-calendar/index.d.ts @@ -49,7 +49,7 @@ declare namespace reactInputCalendar { /** * Set a function that will be triggered the when input field is blurred. It will return the event and the date in the props.computableFormat format. */ - onBlur?: (event: React.SyntheticEvent, computableDate: string) => void; + onBlur?: (event: React.SyntheticEvent, computableDate: string) => void; /** * Define state when date picker would close once the user has clicked on a date. */ From ef98075fbfa71d7e84dbfd7304af9c150810f2bf Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 13 Jul 2016 22:11:35 -0700 Subject: [PATCH 08/14] Fix use of generic react event handlers --- react-mdl/index.d.ts | 282 +++++++++++++++++++++---------------------- 1 file changed, 141 insertions(+), 141 deletions(-) diff --git a/react-mdl/index.d.ts b/react-mdl/index.d.ts index 8581c07cb8..8d81a8f723 100644 --- a/react-mdl/index.d.ts +++ b/react-mdl/index.d.ts @@ -12,7 +12,7 @@ declare namespace __ReactMDL { type __MDLOtherProps = React.HTMLProps; class __MDLComponent

extends React.Component {} class __MDLBasicComponent extends __MDLComponent<__MDLOtherProps> {} - + interface ShadowedComponent { shadow ?: number; } @@ -22,8 +22,8 @@ declare namespace __ReactMDL { interface CustomRenderedComponent { component ?: string | JSX.Element | Function; } - - + + // HTMLAttributes (minus the 'data', 'icon', 'label', 'name', 'rows', 'size', 'title', 'value' attributes) interface MDLHTMLAttributes { // React-specific Attributes @@ -173,7 +173,7 @@ declare namespace __ReactMDL { [key: string]: any; } // DOMAttributes (minus 'onClick', 'onChange') - interface MDLDOMAttributes { + interface MDLDOMAttributes { // DOMAttributes (minus onClick) children?: React.ReactNode; dangerouslySetInnerHTML?: { @@ -181,93 +181,93 @@ declare namespace __ReactMDL { }; // Clipboard Events - onCopy?: React.ClipboardEventHandler; - onCut?: React.ClipboardEventHandler; - onPaste?: React.ClipboardEventHandler; + onCopy?: React.ClipboardEventHandler; + onCut?: React.ClipboardEventHandler; + onPaste?: React.ClipboardEventHandler; // Composition Events - onCompositionEnd?: React.CompositionEventHandler; - onCompositionStart?: React.CompositionEventHandler; - onCompositionUpdate?: React.CompositionEventHandler; + onCompositionEnd?: React.CompositionEventHandler; + onCompositionStart?: React.CompositionEventHandler; + onCompositionUpdate?: React.CompositionEventHandler; // Focus Events - onFocus?: React.FocusEventHandler; - onBlur?: React.FocusEventHandler; + onFocus?: React.FocusEventHandler; + onBlur?: React.FocusEventHandler; // Form Events - onInput?: React.FormEventHandler; - onSubmit?: React.FormEventHandler; + onInput?: React.FormEventHandler; + onSubmit?: React.FormEventHandler; // Image Events - onLoad?: React.ReactEventHandler; - onError?: React.ReactEventHandler; // also a Media Event + onLoad?: React.ReactEventHandler; + onError?: React.ReactEventHandler; // also a Media Event // Keyboard Events - onKeyDown?: React.KeyboardEventHandler; - onKeyPress?: React.KeyboardEventHandler; - onKeyUp?: React.KeyboardEventHandler; + onKeyDown?: React.KeyboardEventHandler; + onKeyPress?: React.KeyboardEventHandler; + onKeyUp?: React.KeyboardEventHandler; // Media Events - onAbort?: React.ReactEventHandler; - onCanPlay?: React.ReactEventHandler; - onCanPlayThrough?: React.ReactEventHandler; - onDurationChange?: React.ReactEventHandler; - onEmptied?: React.ReactEventHandler; - onEncrypted?: React.ReactEventHandler; - onEnded?: React.ReactEventHandler; - onLoadedData?: React.ReactEventHandler; - onLoadedMetadata?: React.ReactEventHandler; - onLoadStart?: React.ReactEventHandler; - onPause?: React.ReactEventHandler; - onPlay?: React.ReactEventHandler; - onPlaying?: React.ReactEventHandler; - onProgress?: React.ReactEventHandler; - onRateChange?: React.ReactEventHandler; - onSeeked?: React.ReactEventHandler; - onSeeking?: React.ReactEventHandler; - onStalled?: React.ReactEventHandler; - onSuspend?: React.ReactEventHandler; - onTimeUpdate?: React.ReactEventHandler; - onVolumeChange?: React.ReactEventHandler; - onWaiting?: React.ReactEventHandler; + onAbort?: React.ReactEventHandler; + onCanPlay?: React.ReactEventHandler; + onCanPlayThrough?: React.ReactEventHandler; + onDurationChange?: React.ReactEventHandler; + onEmptied?: React.ReactEventHandler; + onEncrypted?: React.ReactEventHandler; + onEnded?: React.ReactEventHandler; + onLoadedData?: React.ReactEventHandler; + onLoadedMetadata?: React.ReactEventHandler; + onLoadStart?: React.ReactEventHandler; + onPause?: React.ReactEventHandler; + onPlay?: React.ReactEventHandler; + onPlaying?: React.ReactEventHandler; + onProgress?: React.ReactEventHandler; + onRateChange?: React.ReactEventHandler; + onSeeked?: React.ReactEventHandler; + onSeeking?: React.ReactEventHandler; + onStalled?: React.ReactEventHandler; + onSuspend?: React.ReactEventHandler; + onTimeUpdate?: React.ReactEventHandler; + onVolumeChange?: React.ReactEventHandler; + onWaiting?: React.ReactEventHandler; // MouseEvents - onContextMenu?: React.MouseEventHandler; - onDoubleClick?: React.MouseEventHandler; - onDrag?: React.DragEventHandler; - onDragEnd?: React.DragEventHandler; - onDragEnter?: React.DragEventHandler; - onDragExit?: React.DragEventHandler; - onDragLeave?: React.DragEventHandler; - onDragOver?: React.DragEventHandler; - onDragStart?: React.DragEventHandler; - onDrop?: React.DragEventHandler; - onMouseDown?: React.MouseEventHandler; - onMouseEnter?: React.MouseEventHandler; - onMouseLeave?: React.MouseEventHandler; - onMouseMove?: React.MouseEventHandler; - onMouseOut?: React.MouseEventHandler; - onMouseOver?: React.MouseEventHandler; - onMouseUp?: React.MouseEventHandler; + onContextMenu?: React.MouseEventHandler; + onDoubleClick?: React.MouseEventHandler; + onDrag?: React.DragEventHandler; + onDragEnd?: React.DragEventHandler; + onDragEnter?: React.DragEventHandler; + onDragExit?: React.DragEventHandler; + onDragLeave?: React.DragEventHandler; + onDragOver?: React.DragEventHandler; + onDragStart?: React.DragEventHandler; + onDrop?: React.DragEventHandler; + onMouseDown?: React.MouseEventHandler; + onMouseEnter?: React.MouseEventHandler; + onMouseLeave?: React.MouseEventHandler; + onMouseMove?: React.MouseEventHandler; + onMouseOut?: React.MouseEventHandler; + onMouseOver?: React.MouseEventHandler; + onMouseUp?: React.MouseEventHandler; // Selection Events - onSelect?: React.ReactEventHandler; + onSelect?: React.ReactEventHandler; // Touch Events - onTouchCancel?: React.TouchEventHandler; - onTouchEnd?: React.TouchEventHandler; - onTouchMove?: React.TouchEventHandler; - onTouchStart?: React.TouchEventHandler; + onTouchCancel?: React.TouchEventHandler; + onTouchEnd?: React.TouchEventHandler; + onTouchMove?: React.TouchEventHandler; + onTouchStart?: React.TouchEventHandler; // UI Events - onScroll?: React.UIEventHandler; + onScroll?: React.UIEventHandler; // Wheel Events - onWheel?: React.WheelEventHandler; + onWheel?: React.WheelEventHandler; } - - - + + + interface BadgeProps extends __MDLClassProps { text: string | number; className ?: string; @@ -275,8 +275,8 @@ declare namespace __ReactMDL { overlap ?: boolean; } class Badge extends __MDLComponent {} - - + + interface ButtonProps extends __MDLOtherProps, RippleComponent, CustomRenderedComponent { accent ?: boolean; colored ?: boolean; @@ -295,8 +295,8 @@ declare namespace __ReactMDL { class Button extends __MDLComponent {} class FABButton extends __MDLComponent {} class IconButton extends __MDLComponent {} - - + + interface CardProps extends __MDLOtherProps, ShadowedComponent {} interface CardActionProps extends __MDLOtherProps { border ?: boolean; @@ -310,19 +310,19 @@ declare namespace __ReactMDL { class CardText extends __MDLBasicComponent {} class CardMenu extends __MDLBasicComponent {} class CardMedia extends __MDLBasicComponent {} - - + + interface CheckboxProps extends __MDLOtherProps, RippleComponent { checked ?: boolean; disabled ?: boolean; label ?: string; } class Checkbox extends __MDLComponent {} - - interface UndecoratedTableProps extends __MDLClassProps, MDLHTMLAttributes, React.DOMAttributes, ShadowedComponent { + + interface UndecoratedTableProps extends __MDLClassProps, MDLHTMLAttributes, React.DOMAttributes, ShadowedComponent { rows: Array; rowKeyColumn ?: string; - + name ?: string; title ?: string; } @@ -331,13 +331,13 @@ declare namespace __ReactMDL { selectable ?: boolean; onSelectionChanged ?: (row : any) => any; } - interface TableHeaderProps extends __MDLClassProps, MDLHTMLAttributes, MDLDOMAttributes { + interface TableHeaderProps extends __MDLClassProps, MDLHTMLAttributes, MDLDOMAttributes { name : string; title ?: string; cellFormatter ?: (value : any, row : any, index : number) => React.ReactNode; numeric ?: boolean; nosort ?: boolean; - onClick ?: (e : React.MouseEvent, name : string) => any; + onClick ?: (e : React.MouseEvent, name : string) => any; sortFn ?: (a : any, b : any, isAsc : boolean) => number; tooltip ?: React.ReactNode; } @@ -345,8 +345,8 @@ declare namespace __ReactMDL { class TableHeader extends __MDLComponent {} class UndecoratedTable extends __MDLComponent {} class DataTable extends Table {} - - + + interface DialogProps extends __MDLOtherProps { open ?: boolean; } @@ -358,8 +358,8 @@ declare namespace __ReactMDL { class DialogActions extends __MDLComponent {} class DialogTitle extends __MDLComponent {} class DialogContent extends __MDLBasicComponent {} - - + + interface GridProps extends __MDLOtherProps, CustomRenderedComponent, ShadowedComponent { noSpacing ?: boolean; } @@ -374,22 +374,22 @@ declare namespace __ReactMDL { } class Grid extends __MDLComponent {} class Cell extends __MDLComponent {} - - + + interface IconProps extends __MDLOtherProps { name : string; } class Icon extends __MDLComponent {} - - + + interface IconToggleProps extends __MDLOtherProps, RippleComponent { name : string; checked ?: boolean; disabled ?: boolean; } class IconToggle extends __MDLComponent {} - - + + interface ContentProps extends __MDLOtherProps, CustomRenderedComponent {} interface DrawerProps extends __MDLOtherProps { title ?: string; @@ -407,7 +407,7 @@ declare namespace __ReactMDL { } interface HeaderTabsProps extends __MDLOtherProps, RippleComponent { activeTab ?: number; - onChange ?: React.FormEventHandler; + onChange ?: React.FormEventHandler

; } interface LayoutProps extends __MDLOtherProps { fixedDrawer ?: boolean; @@ -423,33 +423,33 @@ declare namespace __ReactMDL { class Layout extends __MDLComponent {} class Navigation extends __MDLComponent {} class Spacer extends __MDLBasicComponent {} - - interface FooterProps extends MDLHTMLAttributes, React.DOMAttributes { + + interface FooterProps extends MDLHTMLAttributes, React.DOMAttributes
{ size ?: string; - + title ?: string; } - interface FooterDropDownSectionProps extends MDLHTMLAttributes, React.DOMAttributes { + interface FooterDropDownSectionProps extends MDLHTMLAttributes, React.DOMAttributes { size ?: string; title : React.ReactNode; } - interface FooterLinkListProps extends MDLHTMLAttributes, React.DOMAttributes { + interface FooterLinkListProps extends MDLHTMLAttributes, React.DOMAttributes { size ?: string; - + title ?: string; } - interface FooterSectionProps extends MDLHTMLAttributes, React.DOMAttributes { + interface FooterSectionProps extends MDLHTMLAttributes, React.DOMAttributes { size ?: string; type ?: string; logo ?: React.ReactNode; - + title ?: string; } class Footer extends __MDLComponent {} class FooterDropDownSection extends __MDLComponent {} class FooterLinkList extends __MDLComponent {} class FooterSection extends __MDLComponent {} - + interface ListItemProps extends __MDLOtherProps { twoLine ?: boolean; threeLine ?: boolean; @@ -457,7 +457,7 @@ declare namespace __ReactMDL { interface ListItemActionProps extends __MDLOtherProps { info ?: string; } - interface ListItemContentProps extends MDLHTMLAttributes, React.DOMAttributes { + interface ListItemContentProps extends MDLHTMLAttributes, React.DOMAttributes { avatar ?: string | JSX.Element; icon ?: string | JSX.Element; subtitle ?: React.ReactNode; @@ -467,8 +467,8 @@ declare namespace __ReactMDL { class ListItem extends __MDLComponent {} class ListItemAction extends __MDLComponent {} class ListItemContent extends __MDLComponent {} - - + + interface MenuProps extends __MDLOtherProps, RippleComponent { target : string; align ?: string; @@ -476,99 +476,99 @@ declare namespace __ReactMDL { } class Menu extends __MDLComponent {} class MenuItem extends __MDLBasicComponent {} - - + + interface ProgressBarProps extends __MDLOtherProps { buffer ?: number; indeterminate ?: boolean; progress ?: number; } class ProgressBar extends __MDLComponent {} - - - interface RadioProps extends MDLHTMLAttributes, React.DOMAttributes, RippleComponent { + + + interface RadioProps extends MDLHTMLAttributes, React.DOMAttributes, RippleComponent { value : string | number; checked ?: boolean; disabled ?: boolean; name ?: string; - onChange ?: React.FormEventHandler; + onChange ?: React.FormEventHandler; label ?: string; } - interface RadioGroupProps extends MDLHTMLAttributes, React.DOMAttributes { + interface RadioGroupProps extends MDLHTMLAttributes, React.DOMAttributes { name : string; value : string | number; childContainer ?: string; container ?: string; - onChange ?: React.FormEventHandler; + onChange ?: React.FormEventHandler; label ?: string; } class Radio extends __MDLComponent {} class RadioGroup extends __MDLComponent {} - - - interface SliderProps extends MDLHTMLAttributes, React.DOMAttributes { + + + interface SliderProps extends MDLHTMLAttributes, React.DOMAttributes { max : number; min : number; - onChange ?: React.FormEventHandler; + onChange ?: React.FormEventHandler; value ?: number; } class Slider extends __MDLComponent {} - - + + interface SnackbarProps extends __MDLOtherProps { active : boolean; onTimeout : () => any; action ?: string; - onActionClick ?: React.MouseEventHandler; + onActionClick ?: React.MouseEventHandler; timeout ?: number; } class Snackbar extends __MDLComponent {} - - + + interface SpinnerProps extends __MDLOtherProps { singleColor ?: boolean; } class Spinner extends __MDLComponent {} - - + + interface SwitchProps extends __MDLOtherProps, RippleComponent { checked ?: boolean; disabled ?: boolean; - onChange ?: React.FormEventHandler; + onChange ?: React.FormEventHandler; } class Switch extends __MDLComponent {} - - + + interface TabProps extends __MDLOtherProps, CustomRenderedComponent { active ?: boolean; cssPrefix ?: string; onTabClick ?: (tabId : number) => any; tabId ?: number; } - interface TabBarProps extends MDLHTMLAttributes, MDLDOMAttributes { + interface TabBarProps extends MDLHTMLAttributes, MDLDOMAttributes { cssPrefix : string; activeTab ?: number; onChange ?: (tabId : number) => any; - + name ?: string; - title ?: string; - onClick ?: React.MouseEventHandler; + title ?: string; + onClick ?: React.MouseEventHandler; } - interface TabsProps extends MDLHTMLAttributes, MDLDOMAttributes { + interface TabsProps extends MDLHTMLAttributes, MDLDOMAttributes { activeTab ?: number; onChange ?: (tabId : number) => any; tabBarProps ?: TabBarProps; - + name ?: string; - title ?: string; - onClick ?: React.MouseEventHandler; + title ?: string; + onClick ?: React.MouseEventHandler; } class Tab extends __MDLComponent {} class TabBar extends __MDLComponent {} class Tabs extends __MDLComponent {} - - - interface TextfieldProps extends MDLHTMLAttributes, React.DOMAttributes { + + + interface TextfieldProps extends MDLHTMLAttributes, React.DOMAttributes { label : string; disabled ?: boolean; error ?: React.ReactNode; @@ -578,23 +578,23 @@ declare namespace __ReactMDL { id ?: string; inputClassName ?: string; maxRows ?: number; - onChange ?: React.FormEventHandler; + onChange ?: React.FormEventHandler; pattern ?: string; required ?: boolean; rows ?: number; value ?: string | number; - + name ?: string; title ?: string; } class Textfield extends __MDLComponent {} - - - interface TooltipProps extends MDLHTMLAttributes, React.DOMAttributes { + + + interface TooltipProps extends MDLHTMLAttributes, React.DOMAttributes { label : React.ReactNode; large ?: boolean; position ?: string; - + name ?: string; title ?: string; } From c60e17576eadb99141aa9577e912fdd8e92376a5 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 13 Jul 2016 22:30:45 -0700 Subject: [PATCH 09/14] Fix use of generic React attributes and event handlers --- react-router/lib/Link.d.ts | 2 +- react-select/index.d.ts | 4 ++-- react-select/react-select-tests.tsx | 2 +- redux-form/index.d.ts | 16 ++++++++-------- redux-form/redux-form-tests.tsx | 10 +++++----- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/react-router/lib/Link.d.ts b/react-router/lib/Link.d.ts index 2375724ebc..58e9f85bcf 100644 --- a/react-router/lib/Link.d.ts +++ b/react-router/lib/Link.d.ts @@ -8,7 +8,7 @@ type Link = Link.Link; export default Link; declare namespace Link { - interface LinkProps extends React.HTMLAttributes, React.Props { + interface LinkProps extends React.HTMLAttributes, React.Props { activeStyle?: React.CSSProperties; activeClassName?: string; onlyActiveOnIndex?: boolean; diff --git a/react-select/index.d.ts b/react-select/index.d.ts index 3a91090076..2f47bde6f5 100644 --- a/react-select/index.d.ts +++ b/react-select/index.d.ts @@ -150,7 +150,7 @@ export interface ReactSelectProps extends React.Props { * @default "No results found" */ noResultsText?: string; - onBlur?: React.FocusEventHandler; + onBlur?: React.FocusEventHandler; /** * whether to clear input on blur or not * @default true @@ -158,7 +158,7 @@ export interface ReactSelectProps extends React.Props { onBlurResetsInput?: boolean; onChange?: (newValue: Option | Option[]) => void; onClose?: () => void; - onFocus?: React.FocusEventHandler; + onFocus?: React.FocusEventHandler; onInputChange?: (inputValue: string) => void; onOpen?: () => void; onOptionLabelClick?: (value: string, event: Event) => void; diff --git a/react-select/react-select-tests.tsx b/react-select/react-select-tests.tsx index acd21186e1..7b5eed53ad 100644 --- a/react-select/react-select-tests.tsx +++ b/react-select/react-select-tests.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import * as ReactDOM from "react-dom"; -import Select from "react-select"; +import Select, * as ReactSelect from "react-select"; class SelectTest extends React.Component, {}> { diff --git a/redux-form/index.d.ts b/redux-form/index.d.ts index c9b11228ed..f68dc936b4 100644 --- a/redux-form/index.d.ts +++ b/redux-form/index.d.ts @@ -15,7 +15,7 @@ export type FieldValue = any; export type FormData = { [fieldName: string]: FieldValue }; -export interface FieldProp { +export interface FieldProp { /** * true if this field currently has focus. It will only work if you are * passing onFocus to your input element. @@ -64,14 +64,14 @@ export interface FieldProp { * either receive the React SyntheticEvent or the current value of the * field. */ - onBlur(eventOrValue: SyntheticEvent | FieldValue): void; + onBlur(eventOrValue: SyntheticEvent | FieldValue): void; /** * A function to call when the form field is changed. It expects to either * receive the React SyntheticEvent or the new value of the field. * @param eventOrValue */ - onChange(eventOrValue: SyntheticEvent | FieldValue): void; + onChange(eventOrValue: SyntheticEvent | FieldValue): void; /** * A function to call when the form field receives a 'dragStart' event. @@ -128,7 +128,7 @@ export interface FieldProp { visited: boolean; } -export interface ReduxFormProps { +export interface ReduxFormProps { /** * The name of the currently active (with focus) field. */ @@ -171,7 +171,7 @@ export interface ReduxFormProps { * props, e.g. . Each field Object has * the following properties: */ - fields?: { [field: string]: FieldProp }; + fields?: { [field: string]: FieldProp }; /** * A function meant to be passed to or to @@ -190,10 +190,10 @@ export interface ReduxFormProps { * that as if it were the error for a field called _error, and it will be * given as the error prop. */ - handleSubmit?(event: SyntheticEvent): void; + handleSubmit?(event: SyntheticEvent): void; handleSubmit?(submit: (data: FormData, dispatch?: Dispatch) - => Promise | void): FormEventHandler; + => Promise | void): FormEventHandler; /** * Initializes the form data to the given values. All dirty and pristine @@ -418,7 +418,7 @@ export interface ReduxFormConfig { * { field1: , field2: }. * Defaults to (values, props) => ({}). */ - validate?(values: FormData, props: { [fieldName: string]: FieldProp }): Object; + validate?(values: FormData, props: { [fieldName: string]: FieldProp }): Object; } /** diff --git a/redux-form/redux-form-tests.tsx b/redux-form/redux-form-tests.tsx index 1e66391d75..d6620940d2 100644 --- a/redux-form/redux-form-tests.tsx +++ b/redux-form/redux-form-tests.tsx @@ -8,7 +8,7 @@ import {reduxForm, reducer as reduxFormReducer, ReduxFormProps} from 'redux-form namespace SimpleForm { export const fields = ['firstName', 'lastName', 'email', 'sex', 'favoriteColor', 'employed', 'notes']; - class SimpleForm extends Component { + class SimpleForm extends Component, void> { static propTypes = { fields: PropTypes.object.isRequired, handleSubmit: PropTypes.func.isRequired, @@ -123,7 +123,7 @@ namespace SynchronousValidation { return errors; }; - class SynchronousValidationForm extends Component { + class SynchronousValidationForm extends Component, any> { static propTypes = { fields: PropTypes.object.isRequired, handleSubmit: PropTypes.func.isRequired, @@ -193,7 +193,7 @@ namespace SumbitValidation { }); }; - class SubmitValidationForm extends Component { + class SubmitValidationForm extends Component, any> { static propTypes = { fields: PropTypes.object.isRequired, handleSubmit: PropTypes.func.isRequired, @@ -251,11 +251,11 @@ namespace InitializingFromState { bio: 'Born to write amazing Redux code.' }; - interface Props extends ReduxFormProps { + interface Props extends ReduxFormProps { load: Function; } - class InitializingFromStateForm extends Component { + class InitializingFromStateForm extends Component, any> { static propTypes = { fields: PropTypes.object.isRequired, handleSubmit: PropTypes.func.isRequired, From 317e5ee1bcad4c19eee26993b3fd975a0a940053 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 13 Jul 2016 22:45:21 -0700 Subject: [PATCH 10/14] Fix ng-cordova --- filewriter/index.d.ts | 34 +++++++++++++++++----------------- ng-cordova/camera.d.ts | 2 +- ng-cordova/file.d.ts | 2 +- ng-cordova/fileTransfer.d.ts | 2 +- ng-cordova/tsconfig.json | 19 +++++++++++++++++++ 5 files changed, 39 insertions(+), 20 deletions(-) create mode 100644 ng-cordova/tsconfig.json diff --git a/filewriter/index.d.ts b/filewriter/index.d.ts index e16dc97792..376d94b481 100644 --- a/filewriter/index.d.ts +++ b/filewriter/index.d.ts @@ -1,7 +1,7 @@ // Type definitions for File API: Writer // Project: http://www.w3.org/TR/file-writer-api/ -// Definitions by: Kon -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Definitions by: Kon +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** * This interface provides methods to monitor the asynchronous writing of blobs to disk using progress events [PROGRESS-EVENTS] and event handler attributes. @@ -21,25 +21,25 @@ interface FileSaver extends EventTarget { *
  • Terminate this algorithm.
  • * */ - abort():void; + abort(): void; /** * The blob is being written. * @readonly */ - INIT:number; + INIT: number; /** * The object has been constructed, but there is no pending write. * @readonly */ - WRITING:number; + WRITING: number; /** * The entire Blob has been written to the file, an error occurred during the write, or the write was aborted using abort(). The FileSaver is no longer writing the blob. * @readonly */ - DONE:number; + DONE: number; /** * The FileSaver object can be in one of 3 states. The readyState attribute, on getting, must return the current state, which must be one of the following values: @@ -50,43 +50,43 @@ interface FileSaver extends EventTarget { *
      * @readonly */ - readyState:number; + readyState: number; /** * The last error that occurred on the FileSaver. - * @readonly + * @readonly */ - error:DOMError; + error: Error; /** * Handler for writestart events */ - onwritestart:Function; + onwritestart: (event: ProgressEvent) => void; /** * Handler for progress events. */ - onprogress:Function; + onprogress: (event: ProgressEvent) => void; /** * Handler for write events. */ - onwrite:Function; + onwrite: (event: ProgressEvent) => void; /** * Handler for abort events. */ - onabort:Function; + onabort: (event: ProgressEvent) => void; /** * Handler for error events. */ - onerror:Function; + onerror: (event: ProgressEvent) => void; /** * Handler for writeend events. */ - onwriteend:Function; + onwriteend: (event: ProgressEvent) => void; } declare var FileSaver: { @@ -113,7 +113,7 @@ interface FileWriter extends FileSaver { length:number; /** - * Write the supplied data to the file at position. + * Write the supplied data to the file at position. * @param data The blob to write. */ write(data:Blob):void; @@ -171,6 +171,6 @@ interface FileWriterSync { * *
    * @param size The size to which the length of the file is to be adjusted, measured in bytes. - */ + */ truncate(size:number):void; } diff --git a/ng-cordova/camera.d.ts b/ng-cordova/camera.d.ts index 8f6f822fab..580483dbd5 100644 --- a/ng-cordova/camera.d.ts +++ b/ng-cordova/camera.d.ts @@ -3,7 +3,7 @@ // Definitions by: Jacques Kang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// /// declare namespace ngCordova { diff --git a/ng-cordova/file.d.ts b/ng-cordova/file.d.ts index a76a6895ae..8ebe777c14 100644 --- a/ng-cordova/file.d.ts +++ b/ng-cordova/file.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// +/// declare namespace ngCordova { export interface IFileService { diff --git a/ng-cordova/fileTransfer.d.ts b/ng-cordova/fileTransfer.d.ts index 075e817e10..d98e4b62d8 100644 --- a/ng-cordova/fileTransfer.d.ts +++ b/ng-cordova/fileTransfer.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// +/// /// declare namespace ngCordova { diff --git a/ng-cordova/tsconfig.json b/ng-cordova/tsconfig.json new file mode 100644 index 0000000000..06dae1ab12 --- /dev/null +++ b/ng-cordova/tsconfig.json @@ -0,0 +1,19 @@ +{ + "files": [ + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": false, + "baseUrl": "../", + "experimentalDecorators": true, + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} \ No newline at end of file From dbf24a4f17bce238630fe48558e6e9da93cad7e0 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 14 Jul 2016 14:06:10 -0700 Subject: [PATCH 11/14] Fix angular tsconfig --- angular/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular/tsconfig.json b/angular/tsconfig.json index 294ae03d1b..ea2099d486 100644 --- a/angular/tsconfig.json +++ b/angular/tsconfig.json @@ -1,7 +1,7 @@ { "files": [ "index.d.ts", - "angular-mocks-tests.ts" + "angular-tests.ts" ], "compilerOptions": { "module": "commonjs", From 9d7d5a209af31672a77f7a59bddcb8088ccc919f Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 14 Jul 2016 18:13:43 -0700 Subject: [PATCH 12/14] Getting types-2.0 passing CI --- .../angular-bootstrap-calendar-tests.ts | 2 +- .../angular-dynamic-locale-tests.ts | 3 +- angular-hotkeys/angular-hotkeys-tests.ts | 3 +- angular-jwt/angular-jwt-tests.ts | 3 +- .../angular-local-storage-tests.ts | 2 +- angular-locker/angular-locker-tests.ts | 2 +- angular-meteor/angular-meteor-tests.ts | 2 +- angular-modal/angular-modal-tests.ts | 2 - angular-strap/angular-strap-tests.ts | 2 - angular-toastr/angular-toastr-tests.ts | 2 - angular-touchspin/angular-touchspin-tests.ts | 1 + angular-ui-router/angular-ui-router-tests.ts | 4 +- .../angular-ui-sortable-tests.ts | 3 - angular-wizard/angular-wizard-tests.ts | 1 - angular/angular-mocks.d.ts | 2 +- angular/index.d.ts | 6 +- .../angularLocalStorage-tests.ts | 4 +- angulartics/angulartics-tests.ts | 3 - atom/atom-tests.ts | 5 +- bardjs/bardjs-tests.ts | 3 +- .../business-rules-engine-tests.ts | 2 +- d3/plugins/index.d.ts | 4 + decorum/decorum-tests.ts | 3 +- ...eonasdan-bootstrap-datetimepicker-tests.ts | 2 - falcor/falcor-tests.ts | 4 +- google-apps-script/index.d.ts | 4 + highcharts-ng/highcharts-ng-tests.ts | 3 +- highcharts/index.d.ts | 5 + js-data-angular/js-data-angular-tests.ts | 2 + jsnox/index.d.ts | 2 +- jsnox/jsnox-tests.ts | 2 +- json-patch/json-patch-tests.ts | 3 +- karma-coverage/index.d.ts | 1 + karma-coverage/karma-coverage-tests.ts | 2 - material-ui/index.d.ts | 198 +++++++++--------- material-ui/material-ui-tests.tsx | 10 +- moment-range/index.d.ts | 1 - msportalfx-test/msportalfx-test-tests.ts | 4 +- ng-command/ng-command-tests.ts | 3 +- ng-cordova/fileTransfer.d.ts | 1 - ng-dialog/ng-dialog-tests.ts | 5 +- ng-file-upload/ng-file-upload-tests.ts | 2 +- ng-grid/ng-grid-tests.ts | 3 +- ng-notify/ng-notify-tests.ts | 3 +- ng-stomp/ng-stomp-tests.ts | 3 +- ngbootbox/ngbootbox-tests.ts | 2 +- ngprogress-lite/ngprogress-lite-tests.ts | 2 +- ngstorage/ngstorage-tests.ts | 2 +- ngtoaster/angularjs-toaster-tests.ts | 3 +- node-form/node-form-tests.ts | 5 +- oclazyload/oclazyload-tests.ts | 2 + promise-pg/promise-pg-tests.ts | 4 +- q-io/Q-io-tests.ts | 3 +- qajax/qajax-tests.ts | 1 + react-addons-linked-state-mixin/index.d.ts | 2 +- react-addons-test-utils/index.d.ts | 2 +- react-bootstrap-daterangepicker/index.d.ts | 2 +- react-bootstrap/index.d.ts | 96 ++++----- react-datagrid/index.d.ts | 6 +- react-day-picker/index.d.ts | 12 +- react-day-picker/react-day-picker-tests.tsx | 3 +- react/react-tests.ts | 6 +- restangular/restangular-tests.ts | 2 +- sharepoint/SharePoint-tests.ts | 12 +- sharepoint/tsconfig.json | 2 +- simple-mock/simple-mock-tests.ts | 4 +- ui-grid/ui-grid-tests.ts | 2 +- ui-router-extras/ui-router-extras-tests.ts | 2 +- ui-select/ui-select-tests.ts | 2 +- webrtc/index.d.ts | 5 + xrm/index.d.ts | 2 +- 71 files changed, 249 insertions(+), 264 deletions(-) diff --git a/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts b/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts index 53d74f0800..4ff5b4cf19 100644 --- a/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts +++ b/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts @@ -1,5 +1,5 @@ /// -/// +/// var myApp = angular.module('testModule'); diff --git a/angular-dynamic-locale/angular-dynamic-locale-tests.ts b/angular-dynamic-locale/angular-dynamic-locale-tests.ts index 968d4995e8..fd88de0d25 100644 --- a/angular-dynamic-locale/angular-dynamic-locale-tests.ts +++ b/angular-dynamic-locale/angular-dynamic-locale-tests.ts @@ -1,4 +1,5 @@ -import * as angular from 'angularjs'; +import * as angular from 'angular'; + var app = angular.module('testModule', ['tmh.dynamicLocale']); app.config((localStorageServiceProvider: angular.dynamicLocale.tmhDynamicLocaleProvider) => { localStorageServiceProvider diff --git a/angular-hotkeys/angular-hotkeys-tests.ts b/angular-hotkeys/angular-hotkeys-tests.ts index 098c84d710..1f87ecefdf 100644 --- a/angular-hotkeys/angular-hotkeys-tests.ts +++ b/angular-hotkeys/angular-hotkeys-tests.ts @@ -1,5 +1,4 @@ -/// - +/// var scope: ng.IScope; var hotkeyProvider: ng.hotkeys.HotkeysProvider; diff --git a/angular-jwt/angular-jwt-tests.ts b/angular-jwt/angular-jwt-tests.ts index a959992dfc..335b6a70f8 100644 --- a/angular-jwt/angular-jwt-tests.ts +++ b/angular-jwt/angular-jwt-tests.ts @@ -1,5 +1,4 @@ -/// - +/// var app = angular.module("angular-jwt-tests", ["angular-jwt"]); diff --git a/angular-local-storage/angular-local-storage-tests.ts b/angular-local-storage/angular-local-storage-tests.ts index 439de2caff..ead14e85fb 100644 --- a/angular-local-storage/angular-local-storage-tests.ts +++ b/angular-local-storage/angular-local-storage-tests.ts @@ -9,7 +9,7 @@ interface TestScope extends ng.IScope { property: string; } -export class TestController { +class TestController { constructor($scope: TestScope, localStorageService: ng.local.storage.ILocalStorageService) { // isSupported if (localStorageService.isSupported) { diff --git a/angular-locker/angular-locker-tests.ts b/angular-locker/angular-locker-tests.ts index e7076d11bd..a82f6a86cb 100644 --- a/angular-locker/angular-locker-tests.ts +++ b/angular-locker/angular-locker-tests.ts @@ -1,4 +1,4 @@ -import * as angular from 'angularjs'; +import * as angular from 'angular'; angular .module('angular-locker-tests', ['angular-locker']) diff --git a/angular-meteor/angular-meteor-tests.ts b/angular-meteor/angular-meteor-tests.ts index 9317676eed..6a379b8bac 100644 --- a/angular-meteor/angular-meteor-tests.ts +++ b/angular-meteor/angular-meteor-tests.ts @@ -1,4 +1,4 @@ -import * as angular from 'angularjs'; +import * as angular from 'angular'; interface ITodo { _id?: string; diff --git a/angular-modal/angular-modal-tests.ts b/angular-modal/angular-modal-tests.ts index 45b64debc8..5be313840b 100644 --- a/angular-modal/angular-modal-tests.ts +++ b/angular-modal/angular-modal-tests.ts @@ -1,6 +1,4 @@ /// -/// - var btfModal: angularModal.AngularModalFactory; diff --git a/angular-strap/angular-strap-tests.ts b/angular-strap/angular-strap-tests.ts index c37d6d103b..c81e0056e9 100644 --- a/angular-strap/angular-strap-tests.ts +++ b/angular-strap/angular-strap-tests.ts @@ -1,5 +1,3 @@ -/// - namespace angularStrapTests { import ngStrap = mgcrea.ngStrap; diff --git a/angular-toastr/angular-toastr-tests.ts b/angular-toastr/angular-toastr-tests.ts index ba11179df0..6cb4290b3c 100644 --- a/angular-toastr/angular-toastr-tests.ts +++ b/angular-toastr/angular-toastr-tests.ts @@ -1,5 +1,3 @@ -import * as angular from 'angularjs'; - angular .module('toastr-tests', ['toastr']) .config(function(toastrConfig: angular.toastr.IToastrConfig) { diff --git a/angular-touchspin/angular-touchspin-tests.ts b/angular-touchspin/angular-touchspin-tests.ts index ed7fd0a2ca..5ee9aca998 100644 --- a/angular-touchspin/angular-touchspin-tests.ts +++ b/angular-touchspin/angular-touchspin-tests.ts @@ -1,4 +1,5 @@ import angularTouchSpin = require("angular-touchspin"); +import * as angular from 'angular'; angular .module('touchspin-tests', ['lm.touchspin']) diff --git a/angular-ui-router/angular-ui-router-tests.ts b/angular-ui-router/angular-ui-router-tests.ts index f1ab855e63..5d6387a3a9 100644 --- a/angular-ui-router/angular-ui-router-tests.ts +++ b/angular-ui-router/angular-ui-router-tests.ts @@ -1,5 +1,5 @@ -import * as ng from 'angularjs'; -import * as angular from 'angularjs'; +import * as ng from 'angular'; +import * as angular from 'angular'; var myApp = angular.module('testModule'); diff --git a/angular-ui-sortable/angular-ui-sortable-tests.ts b/angular-ui-sortable/angular-ui-sortable-tests.ts index 70a2745289..a5db7903bf 100644 --- a/angular-ui-sortable/angular-ui-sortable-tests.ts +++ b/angular-ui-sortable/angular-ui-sortable-tests.ts @@ -1,6 +1,3 @@ -/// - - var myApp = angular.module('testModule'); interface MySortableControllerScope extends ng.IScope { diff --git a/angular-wizard/angular-wizard-tests.ts b/angular-wizard/angular-wizard-tests.ts index 71cd1cbbc2..3f55e27356 100644 --- a/angular-wizard/angular-wizard-tests.ts +++ b/angular-wizard/angular-wizard-tests.ts @@ -1,5 +1,4 @@ /// -/// // test file taken from https://github.com/mgonto/angular-wizard diff --git a/angular/angular-mocks.d.ts b/angular/angular-mocks.d.ts index a5c0db7ac6..ae3d1252f5 100644 --- a/angular/angular-mocks.d.ts +++ b/angular/angular-mocks.d.ts @@ -3,7 +3,7 @@ // Definitions by: Diego Vilar , Tony Curtis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import * as angular from './index'; +import * as angular from 'angular'; declare module "angular-mocks/ngMock" { var _: string; diff --git a/angular/index.d.ts b/angular/index.d.ts index 1d2f37e281..9e2bcc1f5d 100644 --- a/angular/index.d.ts +++ b/angular/index.d.ts @@ -10,8 +10,10 @@ declare var angular: angular.IAngularStatic; // Support for painless dependency injection -interface Function { - $inject?: string[]; +declare global { + interface Function { + $inject?: string[]; + } } export as namespace angular; diff --git a/angularLocalStorage/angularLocalStorage-tests.ts b/angularLocalStorage/angularLocalStorage-tests.ts index 409dcde292..f62b38c897 100644 --- a/angularLocalStorage/angularLocalStorage-tests.ts +++ b/angularLocalStorage/angularLocalStorage-tests.ts @@ -1,10 +1,8 @@ -/// - interface TestScope extends ng.IScope { viewType: string; } -export class TestController { +class TestController { constructor(private $scope: TestScope, private storage: ng.localStorage.ILocalStorageService) { storage.bind($scope, 'varName'); storage.bind($scope,'varName', { defaultValue: 'randomValue123', storeName: 'customStoreKey' }); diff --git a/angulartics/angulartics-tests.ts b/angulartics/angulartics-tests.ts index 36ad8f46cf..a7d8ba5971 100644 --- a/angulartics/angulartics-tests.ts +++ b/angulartics/angulartics-tests.ts @@ -1,6 +1,3 @@ - -/// - namespace Analytics { angular.module("angulartics.app", ["angulartics"]) .config(["$analyticsProvider", ($analyticsProvider:angulartics.IAnalyticsServiceProvider) => { diff --git a/atom/atom-tests.ts b/atom/atom-tests.ts index 7ce49d23bd..8d35578e69 100644 --- a/atom/atom-tests.ts +++ b/atom/atom-tests.ts @@ -1,12 +1,11 @@ /// - /// import path = require("path"); import _atom = require("atom"); -import pathwatcher = require("pathwatcher"); -var File = pathwatcher.File; +import PathWatcher = require("pathwatcher"); +var File = PathWatcher.File; class SampleView extends _atom.ScrollView { diff --git a/bardjs/bardjs-tests.ts b/bardjs/bardjs-tests.ts index 50a9ae3a49..be685826c3 100644 --- a/bardjs/bardjs-tests.ts +++ b/bardjs/bardjs-tests.ts @@ -1,8 +1,7 @@ /// /// -/// -import * as angular from 'angularjs'; +import * as angular from 'angular'; namespace bardTests { var expect = chai.expect, diff --git a/business-rules-engine/business-rules-engine-tests.ts b/business-rules-engine/business-rules-engine-tests.ts index 2a8180ce6b..84f6d243ec 100644 --- a/business-rules-engine/business-rules-engine-tests.ts +++ b/business-rules-engine/business-rules-engine-tests.ts @@ -1,4 +1,4 @@ -/// +/// import * as Validators from './node-validators'; import Validation = require("business-rules-engine"); diff --git a/d3/plugins/index.d.ts b/d3/plugins/index.d.ts index 967d278d99..2f0b6de7f2 100644 --- a/d3/plugins/index.d.ts +++ b/d3/plugins/index.d.ts @@ -1,3 +1,7 @@ +// Type definitions for d3JS plugins +// Project: http://d3js.org/ +// Definitions by: Alex Ford , Boris Yankov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as d3 from 'd3'; diff --git a/decorum/decorum-tests.ts b/decorum/decorum-tests.ts index d5ef1b191f..8cd03e046c 100644 --- a/decorum/decorum-tests.ts +++ b/decorum/decorum-tests.ts @@ -1,5 +1,3 @@ - - import {Required} from 'decorum'; import {Email} from 'decorum'; import {MinLength} from 'decorum'; @@ -14,6 +12,7 @@ import {Validator} from 'decorum'; import {BaseValidator} from 'decorum'; import {IMessageOpts} from 'decorum'; import {MessageHandlers} from 'decorum'; +import * as decorum from 'decorum'; class MyModel { @FieldName('User name') diff --git a/eonasdan-bootstrap-datetimepicker/eonasdan-bootstrap-datetimepicker-tests.ts b/eonasdan-bootstrap-datetimepicker/eonasdan-bootstrap-datetimepicker-tests.ts index d84c6cd5a6..bf66b7b657 100644 --- a/eonasdan-bootstrap-datetimepicker/eonasdan-bootstrap-datetimepicker-tests.ts +++ b/eonasdan-bootstrap-datetimepicker/eonasdan-bootstrap-datetimepicker-tests.ts @@ -1,5 +1,3 @@ -import * as moment from 'moment'; - // Minimum Setup $("#datetimepicker1").datetimepicker(); diff --git a/falcor/falcor-tests.ts b/falcor/falcor-tests.ts index 35cf7810ba..4fdba89022 100644 --- a/falcor/falcor-tests.ts +++ b/falcor/falcor-tests.ts @@ -1,5 +1,3 @@ - - import falcor = require('falcor'); let dataSource: falcor.DataSource; @@ -58,7 +56,7 @@ const model = new falcor.Model({ model.get('items[0].name'); model.get(['items', 0, 'name']); model.get(['items', {from: 0, to: 1}, 'name']); -model.get(['items', {from: 0, length: 2, hoge: 3}, 'name']); +model.get(['items', {from: 0, length: 2 }, 'name']); model.get('items[0].name', 'items[1].name'); model.set({path: 'items[0].name', value: 'ITEM 01'}, {path: ['items', 1, 'name'], value: 'ITEM 27'}); diff --git a/google-apps-script/index.d.ts b/google-apps-script/index.d.ts index 9f60a23b2a..76a3bbec61 100644 --- a/google-apps-script/index.d.ts +++ b/google-apps-script/index.d.ts @@ -1,4 +1,8 @@ // Type definitions for google-apps-script +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + /// /// diff --git a/highcharts-ng/highcharts-ng-tests.ts b/highcharts-ng/highcharts-ng-tests.ts index 925d398fb5..0bf559061b 100644 --- a/highcharts-ng/highcharts-ng-tests.ts +++ b/highcharts-ng/highcharts-ng-tests.ts @@ -1,5 +1,4 @@ - -/// +/// var app = angular.module('app', ['highcharts-ng']); diff --git a/highcharts/index.d.ts b/highcharts/index.d.ts index 16151be327..b3dd4c6f28 100644 --- a/highcharts/index.d.ts +++ b/highcharts/index.d.ts @@ -724,6 +724,9 @@ interface HighchartsAxisOptions { * @since 1.2.0 */ startOnTick?: boolean; + + stops?: [number, string][]; + /** * The amount of ticks to draw on the axis. This opens up for aligning the ticks of multiple charts or panes within * a chart. This option overrides the tickPixelInterval option. @@ -5456,6 +5459,7 @@ interface HighchartsOptions { * lineWidth is specified in plotOptions.series, an individual lineWidth can be specified for each series. */ series?: HighchartsIndividualSeriesOptions[]; + /** * The chart's subtitle */ @@ -5478,6 +5482,7 @@ interface HighchartsOptions { * horizontal axis. In case of multiple axes, the yAxis node is an array of configuration objects. */ yAxis?: HighchartsAxisOptions | HighchartsAxisOptions[]; + } interface HighchartsGlobalOptions extends HighchartsOptions { diff --git a/js-data-angular/js-data-angular-tests.ts b/js-data-angular/js-data-angular-tests.ts index 4e0293f4a1..13aff12d37 100644 --- a/js-data-angular/js-data-angular-tests.ts +++ b/js-data-angular/js-data-angular-tests.ts @@ -1,4 +1,6 @@ import * as JSData from 'js-data'; +import * as ng from 'angular'; +import * as angular from 'angular'; interface IUser { diff --git a/jsnox/index.d.ts b/jsnox/index.d.ts index 118ea364e7..f49cef58c4 100644 --- a/jsnox/index.d.ts +++ b/jsnox/index.d.ts @@ -40,7 +40,7 @@ interface CreateElement { * @param children A single React node (string or ReactElement) or array of nodes. * Note that unlike with React itself, multiple children must be placed into an array. */ -

    (specString: string, props?: React.HTMLAttributes, children?: React.ReactNode): React.DOMElement +

    (specString: string, props?: React.HTMLAttributes<{}>, children?: React.ReactNode): React.DOMElement /** diff --git a/jsnox/jsnox-tests.ts b/jsnox/jsnox-tests.ts index 05c8a81cb4..5d7440e315 100644 --- a/jsnox/jsnox-tests.ts +++ b/jsnox/jsnox-tests.ts @@ -15,7 +15,7 @@ var Person = React.createClass({ var PersonTag = React.createFactory(Person); -var clickHandler: React.MouseEventHandler +var clickHandler: React.MouseEventHandler<{}>; // Tests with spec string function spec_string () { diff --git a/json-patch/json-patch-tests.ts b/json-patch/json-patch-tests.ts index b57f1d6fe0..3c3ff51f22 100644 --- a/json-patch/json-patch-tests.ts +++ b/json-patch/json-patch-tests.ts @@ -1,5 +1,4 @@ - - +import jsonpatch = require("json-patch"); import jp = require("json-patch"); // Add property, result: {foo: 'bar'} diff --git a/karma-coverage/index.d.ts b/karma-coverage/index.d.ts index dd6a382239..20ee56f43c 100644 --- a/karma-coverage/index.d.ts +++ b/karma-coverage/index.d.ts @@ -29,6 +29,7 @@ declare namespace karmaCoverage { includeAllSources?: boolean; sourceStore?: istanbul.Store; instrumenter?: any; + [moreSettings: string]: any; } } diff --git a/karma-coverage/karma-coverage-tests.ts b/karma-coverage/karma-coverage-tests.ts index a59ca7cdea..4f0b187a7a 100644 --- a/karma-coverage/karma-coverage-tests.ts +++ b/karma-coverage/karma-coverage-tests.ts @@ -1,7 +1,5 @@ - import * as karma from 'karma-coverage'; - // See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/README.md#basic module.exports = function(config: karma.Config) { config.set({ diff --git a/material-ui/index.d.ts b/material-ui/index.d.ts index 00080d39a6..84b42a1b9c 100644 --- a/material-ui/index.d.ts +++ b/material-ui/index.d.ts @@ -103,7 +103,7 @@ declare namespace __MaterialUI { } // What's common between React.TouchEvent and React.MouseEvent - interface TouchTapEvent extends React.SyntheticEvent { + interface TouchTapEvent extends React.SyntheticEvent<{}> { altKey: boolean; ctrlKey: boolean; getModifierState(key: string): boolean; @@ -554,11 +554,11 @@ declare namespace __MaterialUI { focusRippleOpacity?: number; keyboardFocused?: boolean; linkButton?: boolean; - onBlur?: React.FocusEventHandler; - onFocus?: React.FocusEventHandler; - onKeyboardFocus?: (e: React.FocusEvent, isKeyboardFocused: boolean) => void; - onKeyDown?: React.KeyboardEventHandler; - onKeyUp?: React.KeyboardEventHandler; + onBlur?: React.FocusEventHandler<{}>; + onFocus?: React.FocusEventHandler<{}>; + onKeyboardFocus?: (e: React.FocusEvent<{}>, isKeyboardFocused: boolean) => void; + onKeyDown?: React.KeyboardEventHandler<{}>; + onKeyUp?: React.KeyboardEventHandler<{}>; onTouchTap?: TouchTapEventHandler; style?: React.CSSProperties; tabIndex?: number; @@ -567,7 +567,7 @@ declare namespace __MaterialUI { type?: string; } - interface EnhancedButtonProps extends React.HTMLAttributes, SharedEnhancedButtonProps { + interface EnhancedButtonProps extends React.HTMLAttributes<{}>, SharedEnhancedButtonProps { // container element,

    // ---------------------------------------- - interface ColProps extends React.HTMLAttributes { + interface ColProps extends React.HTMLAttributes<{}>{ componentClass?: any; // TODO: Add more specific type lg?: number; lgHidden?: boolean; @@ -566,7 +566,7 @@ declare module "react-bootstrap" { // // ---------------------------------------- - interface ThumbnailProps extends React.HTMLAttributes { + interface ThumbnailProps extends React.HTMLAttributes<{}>{ bsSize?: string; bsStyle?: string; } @@ -575,7 +575,7 @@ declare module "react-bootstrap" { // // ---------------------------------------- - interface ListGroupProps extends React.HTMLAttributes { + interface ListGroupProps extends React.HTMLAttributes<{}>{ fill?: boolean; // TODO: Add more specific type } class ListGroup extends React.Component { @@ -583,7 +583,7 @@ declare module "react-bootstrap" { // // ---------------------------------------- - interface ListGroupItemProps extends React.HTMLAttributes { + interface ListGroupItemProps extends React.HTMLAttributes<{}>{ active?: any; bsSize?: string; bsStyle?: string; @@ -597,7 +597,7 @@ declare module "react-bootstrap" { //
    @@ -1528,7 +1528,7 @@ declare namespace __MaterialUI { className?: string; columnNumber?: number; key?: string; - onClick?: (e: React.MouseEvent, column: number) => void; + onClick?: (e: React.MouseEvent<{}>, column: number) => void; style?: React.CSSProperties; tooltip?: string; tooltipStyle?: React.CSSProperties; @@ -1577,7 +1577,7 @@ declare namespace __MaterialUI { contentContainerStyle?: React.CSSProperties; initialSelectedIndex?: number; inkBarStyle?: React.CSSProperties; - onChange?: (value: any, e: React.FormEvent, tab: Tab) => void; + onChange?: (value: any, e: React.FormEvent<{}>, tab: Tab) => void; style?: React.CSSProperties; tabItemContainerStyle?: React.CSSProperties; tabTemplate?: React.ComponentClass; @@ -1615,11 +1615,11 @@ declare namespace __MaterialUI { id?: string; inputStyle?: React.CSSProperties; multiLine?: boolean; - onBlur?: React.FocusEventHandler; - onChange?: React.FormEventHandler; - onEnterKeyDown?: React.KeyboardEventHandler; - onFocus?: React.FocusEventHandler; - onKeyDown?: React.KeyboardEventHandler; + onBlur?: React.FocusEventHandler<{}>; + onChange?: React.FormEventHandler<{}>; + onEnterKeyDown?: React.KeyboardEventHandler<{}>; + onFocus?: React.FocusEventHandler<{}>; + onKeyDown?: React.KeyboardEventHandler<{}>; rows?: number, rowsMax?: number, style?: React.CSSProperties; @@ -1649,7 +1649,7 @@ declare namespace __MaterialUI { format?: string; // 'ampm' or '24hr' onChange?: (e: any, time: Date) => void; onDismiss?: () => void; - onFocus?: React.FocusEventHandler; + onFocus?: React.FocusEventHandler<{}>; onShow?: () => void; onTouchTap?: TouchTapEventHandler; pedantic?: boolean; @@ -1668,8 +1668,8 @@ declare namespace __MaterialUI { hintText?: React.ReactNode; id?: string; inputStyle?: React.CSSProperties; - onBlur?: React.FocusEventHandler; - onKeyDown?: React.KeyboardEventHandler; + onBlur?: React.FocusEventHandler<{}>; + onKeyDown?: React.KeyboardEventHandler<{}>; rows?: number, rowsMax?: number, type?: string; @@ -1710,7 +1710,7 @@ declare namespace __MaterialUI { export class ToolbarSeparator extends React.Component { } - interface ToolbarTitleProps extends React.HTMLAttributes, React.Props { + interface ToolbarTitleProps extends React.HTMLAttributes<{}>, React.Props { className?: string; style?: React.CSSProperties; text?: string; diff --git a/material-ui/material-ui-tests.tsx b/material-ui/material-ui-tests.tsx index e0c13ed474..a5fbe03b3f 100644 --- a/material-ui/material-ui-tests.tsx +++ b/material-ui/material-ui-tests.tsx @@ -174,7 +174,7 @@ class MaterialUiTests extends React.Component<{}, MaterialUiTestsState> implemen private touchTapEventHandler(e: TouchTapEvent) { console.info("Received touch tap", e); } - private formEventHandler(e: React.FormEvent) { + private formEventHandler(e: React.FormEvent<{}>) { } private selectFieldChangeHandler(e: TouchTapEvent, si: number, mi: any) { } @@ -188,9 +188,9 @@ class MaterialUiTests extends React.Component<{}, MaterialUiTestsState> implemen private handleClose() { this.setState(Object.assign({}, this.state, { open: false })); } - private handleChangeSingle(event: React.MouseEvent, value: string){ + private handleChangeSingle(event: React.MouseEvent<{}>, value: string){ } - private handleChangeMultiple(event: React.MouseEvent, value: string[]) { + private handleChangeMultiple(event: React.MouseEvent<{}>, value: string[]) { } private handleChange = (e: TouchTapEvent, index: number, value: number) => this.setState(Object.assign({}, this.state, { value })); @@ -207,7 +207,7 @@ class MaterialUiTests extends React.Component<{}, MaterialUiTestsState> implemen this.setState(Object.assign({}, this.state, {open: false,})); alert('Event removed from your calendar.'); } - private handleChangeDuration = (event: React.FormEvent) => { + private handleChangeDuration = (event: React.FormEvent<{}>) => { const value = event.target["value"]; this.setState(Object.assign({}, this.state, { autoHideDuration: value.length > 0 ? parseInt(value) : 0, @@ -218,7 +218,7 @@ class MaterialUiTests extends React.Component<{}, MaterialUiTestsState> implemen private handleActive(tab: Tab) { alert(`A tab with this route property ${tab.props.value} was activated.`); } - private handleChangeTabs(value: any, e: React.FormEvent, tab: Tab) { + private handleChangeTabs(value: any, e: React.FormEvent<{}>, tab: Tab) { } private handleChangeTimePicker12(err, time) { this.picker12hr.setTime(time); diff --git a/moment-range/index.d.ts b/moment-range/index.d.ts index c8a1d307ab..982fb49913 100644 --- a/moment-range/index.d.ts +++ b/moment-range/index.d.ts @@ -5,7 +5,6 @@ import * as moment from 'moment'; -export as namespace moment; export = moment; declare module 'moment' { diff --git a/msportalfx-test/msportalfx-test-tests.ts b/msportalfx-test/msportalfx-test-tests.ts index e3245c878e..7da9325068 100644 --- a/msportalfx-test/msportalfx-test-tests.ts +++ b/msportalfx-test/msportalfx-test-tests.ts @@ -1,6 +1,4 @@ - - - +import * as Q from 'q'; import testFx = require('msportalfx-test'); var galleryPackageName = "My.Package"; diff --git a/ng-command/ng-command-tests.ts b/ng-command/ng-command-tests.ts index 640022bb2d..c6eb344ed7 100644 --- a/ng-command/ng-command-tests.ts +++ b/ng-command/ng-command-tests.ts @@ -1,5 +1,4 @@ - -/// +/// var app = angular.module('testModule', ['ng-command']); diff --git a/ng-cordova/fileTransfer.d.ts b/ng-cordova/fileTransfer.d.ts index d98e4b62d8..6fad06e14a 100644 --- a/ng-cordova/fileTransfer.d.ts +++ b/ng-cordova/fileTransfer.d.ts @@ -5,7 +5,6 @@ /// /// -/// declare namespace ngCordova { export interface IFileTransferService { diff --git a/ng-dialog/ng-dialog-tests.ts b/ng-dialog/ng-dialog-tests.ts index 4a2a144850..6c867f422d 100644 --- a/ng-dialog/ng-dialog-tests.ts +++ b/ng-dialog/ng-dialog-tests.ts @@ -1,6 +1,5 @@ - -/// -import * as angular from 'angularjs'; +/// +import * as angular from 'angular'; var app = angular.module('testModule', ['ngDialog']); diff --git a/ng-file-upload/ng-file-upload-tests.ts b/ng-file-upload/ng-file-upload-tests.ts index 40fe92b919..d04f4cf423 100644 --- a/ng-file-upload/ng-file-upload-tests.ts +++ b/ng-file-upload/ng-file-upload-tests.ts @@ -1,4 +1,4 @@ -import * as angular from 'angularjs'; +import * as angular from 'angular'; "use strict"; diff --git a/ng-grid/ng-grid-tests.ts b/ng-grid/ng-grid-tests.ts index 5dcd9c34c9..f14e9cb540 100644 --- a/ng-grid/ng-grid-tests.ts +++ b/ng-grid/ng-grid-tests.ts @@ -1,5 +1,4 @@ - -/// +/// var options1: ngGrid.IGridOptions = { data: [{ 'Name': 'Bob' }, { 'Name': 'Jane' }] diff --git a/ng-notify/ng-notify-tests.ts b/ng-notify/ng-notify-tests.ts index cf2af57792..e140cb6130 100644 --- a/ng-notify/ng-notify-tests.ts +++ b/ng-notify/ng-notify-tests.ts @@ -1,5 +1,4 @@ -/// - +/// class NgNotifyTestController { diff --git a/ng-stomp/ng-stomp-tests.ts b/ng-stomp/ng-stomp-tests.ts index 287e1a7be2..b579a3aa06 100644 --- a/ng-stomp/ng-stomp-tests.ts +++ b/ng-stomp/ng-stomp-tests.ts @@ -1,5 +1,4 @@ -/// - +/// namespace ngStompTesting { diff --git a/ngbootbox/ngbootbox-tests.ts b/ngbootbox/ngbootbox-tests.ts index ae8b264249..e38995bcd7 100644 --- a/ngbootbox/ngbootbox-tests.ts +++ b/ngbootbox/ngbootbox-tests.ts @@ -1,4 +1,4 @@ -/// +/// class TestBootboxController { diff --git a/ngprogress-lite/ngprogress-lite-tests.ts b/ngprogress-lite/ngprogress-lite-tests.ts index 5b9d1a4855..d305595e23 100644 --- a/ngprogress-lite/ngprogress-lite-tests.ts +++ b/ngprogress-lite/ngprogress-lite-tests.ts @@ -1,4 +1,4 @@ -/// +/// var app = angular.module('testApp', ['ngProgressLite']); diff --git a/ngstorage/ngstorage-tests.ts b/ngstorage/ngstorage-tests.ts index 38299343ac..fe3d47ab06 100644 --- a/ngstorage/ngstorage-tests.ts +++ b/ngstorage/ngstorage-tests.ts @@ -1,4 +1,4 @@ -/// +/// var app: any; diff --git a/ngtoaster/angularjs-toaster-tests.ts b/ngtoaster/angularjs-toaster-tests.ts index 73b0416e66..eb30c181d4 100644 --- a/ngtoaster/angularjs-toaster-tests.ts +++ b/ngtoaster/angularjs-toaster-tests.ts @@ -1,5 +1,6 @@ import ngtoaster = require("ngtoaster"); -import * as angular from 'angularjs'; +import * as ng from 'angular'; +import * as angular from 'angular'; class NgToasterTestController { constructor(public $scope: ng.IScope, public $window: ng.IWindowService, public toaster: ngtoaster.IToasterService) { diff --git a/node-form/node-form-tests.ts b/node-form/node-form-tests.ts index 3ee0f31d47..75d98f6b13 100644 --- a/node-form/node-form-tests.ts +++ b/node-form/node-form-tests.ts @@ -1,7 +1,4 @@ - -/// - -export interface IPerson{ +interface IPerson{ Checked:boolean; FirstName:string; LastName:string; diff --git a/oclazyload/oclazyload-tests.ts b/oclazyload/oclazyload-tests.ts index 16b38b9315..da6f206600 100644 --- a/oclazyload/oclazyload-tests.ts +++ b/oclazyload/oclazyload-tests.ts @@ -1,3 +1,5 @@ +import * as angular from 'angular'; +import * as ng from 'angular'; import oc = require('oclazyload'); angular.module('app', ['oc.lazyLoad']).config(['$ocLazyLoadProvider', function ($ocLazyLoadProvider: oc.ILazyLoadProvider) { diff --git a/promise-pg/promise-pg-tests.ts b/promise-pg/promise-pg-tests.ts index 999fe571fc..ea734f3018 100644 --- a/promise-pg/promise-pg-tests.ts +++ b/promise-pg/promise-pg-tests.ts @@ -1,6 +1,4 @@ - -/// - +import * as Q from 'q'; import * as pg from 'promise-pg'; var conString = "postgres://username:password@localhost/database"; diff --git a/q-io/Q-io-tests.ts b/q-io/Q-io-tests.ts index f0dfe8e01e..ae6d14d623 100644 --- a/q-io/Q-io-tests.ts +++ b/q-io/Q-io-tests.ts @@ -1,5 +1,4 @@ -/// - +import * as Q from 'q'; var fs:typeof QioFS = require('q-io/fs'); var http:typeof QioHTTP = require('q-io/http'); diff --git a/qajax/qajax-tests.ts b/qajax/qajax-tests.ts index 0307bf4d0c..6770270cf4 100644 --- a/qajax/qajax-tests.ts +++ b/qajax/qajax-tests.ts @@ -1,4 +1,5 @@ import Qajax = require("qajax"); +import * as Q from 'q'; // Based on https://github.com/gre/qajax/blob/master/test/qajax.js diff --git a/react-addons-linked-state-mixin/index.d.ts b/react-addons-linked-state-mixin/index.d.ts index a7ec5ab123..e4df63ead1 100644 --- a/react-addons-linked-state-mixin/index.d.ts +++ b/react-addons-linked-state-mixin/index.d.ts @@ -21,7 +21,7 @@ declare namespace LinkedStateMixin { } declare module 'react' { - interface HTMLAttributes { + interface HTMLAttributes { checkedLink?: LinkedStateMixin.ReactLink; valueLink?: LinkedStateMixin.ReactLink; } diff --git a/react-addons-test-utils/index.d.ts b/react-addons-test-utils/index.d.ts index 091c5d5df7..765b01b374 100644 --- a/react-addons-test-utils/index.d.ts +++ b/react-addons-test-utils/index.d.ts @@ -126,7 +126,7 @@ declare namespace TestUtils { export function isElementOfType( element: ReactElement, type: string): element is ReactHTMLElement; - export function isElementOfType

    ( + export function isElementOfType

    , T extends Element>( element: ReactElement, type: string): element is DOMElement; export function isElementOfType

    ( element: ReactElement, type: SFC

    ): element is SFCElement

    ; diff --git a/react-bootstrap-daterangepicker/index.d.ts b/react-bootstrap-daterangepicker/index.d.ts index e7d58f3747..3ffc8396a1 100644 --- a/react-bootstrap-daterangepicker/index.d.ts +++ b/react-bootstrap-daterangepicker/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for react-bootstrap-daterangepicker // Project: https://github.com/skratchdot/react-bootstrap-daterangepicker -// Definitions by: Ian Ker-Seymer https://github.com/ianks +// Definitions by: Ian Ker-Seymer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// diff --git a/react-bootstrap/index.d.ts b/react-bootstrap/index.d.ts index d98ef3c963..b2a3b5ef6a 100644 --- a/react-bootstrap/index.d.ts +++ b/react-bootstrap/index.d.ts @@ -12,7 +12,7 @@ declare module "react-bootstrap" { //

    // ---------------------------------------- - interface TableProps extends React.HTMLAttributes { + interface TableProps extends React.HTMLAttributes<{}>{ bordered?: boolean; condensed?: boolean; hover?: boolean; @@ -659,7 +659,7 @@ declare module "react-bootstrap" { // // ---------------------------------------- - interface InputProps extends React.HTMLAttributes { + interface InputProps extends React.HTMLAttributes<{}>{ defaultValue?:string; addonAfter?: any; // TODO: Add more specific type addonBefore?: any; // TODO: Add more specific type @@ -680,7 +680,7 @@ declare module "react-bootstrap" { // // ---------------------------------------- - interface ButtonInputProps extends React.HTMLAttributes { + interface ButtonInputProps extends React.HTMLAttributes<{}>{ addonAfter?: any; // TODO: Add more specific type addonBefore?: any; // TODO: Add more specific type bsSize?: string; @@ -702,7 +702,7 @@ declare module "react-bootstrap" { // // ---------------------------------------- - interface StaticProps extends React.HTMLAttributes {} + interface StaticProps extends React.HTMLAttributes<{}>{} interface Static extends React.ReactElement { } interface StaticClass extends React.ComponentClass { } interface FormControlsClass { diff --git a/react-datagrid/index.d.ts b/react-datagrid/index.d.ts index d6e0e1d37a..31462d2619 100644 --- a/react-datagrid/index.d.ts +++ b/react-datagrid/index.d.ts @@ -296,9 +296,9 @@ declare namespace ReactDataGrid { showRefreshIcon: boolean; iconSize: number; iconProps: { - style: React.SVGAttributes, - overStyle: React.SVGAttributes, - disabledStyle: React.SVGAttributes + style: React.SVGAttributes<{}>, + overStyle: React.SVGAttributes<{}>, + disabledStyle: React.SVGAttributes<{}> } } diff --git a/react-day-picker/index.d.ts b/react-day-picker/index.d.ts index cdc0280ba1..1c21d02065 100644 --- a/react-day-picker/index.d.ts +++ b/react-day-picker/index.d.ts @@ -29,7 +29,7 @@ declare namespace ReactDayPicker { date?: Date; localeUtils?: LocaleUtils; locale?: string; - onClick?: React.MouseEventHandler; + onClick?: React.MouseEventHandler<{}>; } interface Props extends React.Props{ @@ -44,12 +44,12 @@ declare namespace ReactDayPicker { localeUtils?: LocaleUtils; locale?: string; captionElement?: React.ReactElement; - onDayClick?: (e: React.SyntheticEvent, day: Date, modifiers: string[]) => any; - onDayTouchTap?: (e: React.SyntheticEvent, day: Date, modifiers: string[]) => any; - onDayMouseEnter?: (e: React.SyntheticEvent, day: Date, modifiers: string[]) => any; - onDayMouseLeave?: (e: React.SyntheticEvent, day: Date, modifiers: string[]) => any; + onDayClick?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: string[]) => any; + onDayTouchTap?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: string[]) => any; + onDayMouseEnter?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: string[]) => any; + onDayMouseLeave?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: string[]) => any; onMonthChange?: (month: Date) => any; - onCaptionClick?: (e: React.SyntheticEvent, month: Date) => any; + onCaptionClick?: (e: React.SyntheticEvent<{}>, month: Date) => any; className?: string; style?: React.CSSProperties; tabIndex?: number; diff --git a/react-day-picker/react-day-picker-tests.tsx b/react-day-picker/react-day-picker-tests.tsx index 6709dd00eb..33fbadf900 100644 --- a/react-day-picker/react-day-picker-tests.tsx +++ b/react-day-picker/react-day-picker-tests.tsx @@ -1,5 +1,4 @@ -/// - +import * as React from 'react'; import * as DayPicker2 from "react-day-picker"; function isSunday(day: Date) { diff --git a/react/react-tests.ts b/react/react-tests.ts index 088f1eb164..a8dcab0095 100644 --- a/react/react-tests.ts +++ b/react/react-tests.ts @@ -167,9 +167,9 @@ var classicFactory: React.ClassicFactory = var classicFactoryElement: React.ClassicElement = classicFactory(props); -var domFactory: React.DOMFactory = +var domFactory: React.DOMFactory, Element> = React.createFactory("foo"); -var domFactoryElement: React.DOMElement = +var domFactoryElement: React.DOMElement, Element> = domFactory(); // React.createElement @@ -304,7 +304,7 @@ var htmlAttr: React.HTMLProps = { children: children, className: "test-attr", style: divStyle, - onClick: (event: React.MouseEvent) => { + onClick: (event: React.MouseEvent<{}>) => { event.preventDefault(); event.stopPropagation(); }, diff --git a/restangular/restangular-tests.ts b/restangular/restangular-tests.ts index 8e8893f4fd..2ede97a893 100644 --- a/restangular/restangular-tests.ts +++ b/restangular/restangular-tests.ts @@ -1,5 +1,5 @@ import restangular = require("restangular"); -import * as angular from 'angularjs'; +import * as angular from 'angular'; var myApp = angular.module('testModule'); diff --git a/sharepoint/SharePoint-tests.ts b/sharepoint/SharePoint-tests.ts index bef4ac4b39..7c000e3d21 100644 --- a/sharepoint/SharePoint-tests.ts +++ b/sharepoint/SharePoint-tests.ts @@ -1,8 +1,8 @@ -/// -/// +/// /// - +import * as angular from 'angular'; +import * as ng from 'angular'; //code from http://sptypescript.codeplex.com/ //BasicTasksJSOM.ts // Website tasks @@ -1977,7 +1977,7 @@ module _ { } //taxonomy -namespace SP { +namespace MySP { // Class export class ClientContextPromise extends SP.ClientContext { @@ -2008,7 +2008,7 @@ namespace SP { SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs("CSOMPromise.ts"); module _ { - var context: SP.ClientContextPromise; + var context: MySP.ClientContextPromise; var web: SP.Web; var site: SP.Site; var session: SP.Taxonomy.TaxonomySession; @@ -2019,7 +2019,7 @@ module _ { // which is needed to use the SharePoint object model. // It also wires up the click handlers for the two HTML buttons in Default.aspx. $(document).ready(function () { - context = SP.ClientContextPromise.get_current(); + context = MySP.ClientContextPromise.get_current(); site = context.get_site(); web = context.get_web(); $('#listExisting').click(function () { listGroups(); }); diff --git a/sharepoint/tsconfig.json b/sharepoint/tsconfig.json index ae34c0036a..b9d27c3224 100644 --- a/sharepoint/tsconfig.json +++ b/sharepoint/tsconfig.json @@ -14,6 +14,6 @@ }, "files": [ "index.d.ts", - "sharepoint-tests.ts" + "SharePoint-tests.ts" ] } \ No newline at end of file diff --git a/simple-mock/simple-mock-tests.ts b/simple-mock/simple-mock-tests.ts index 3dc8b7a915..508399580a 100644 --- a/simple-mock/simple-mock-tests.ts +++ b/simple-mock/simple-mock-tests.ts @@ -637,12 +637,12 @@ describe('Simple', function() { Simple.mock(Simple, 'Promise', { when: function (value: T) { - let promise: MockPromise = Object.create(mockPromise) + let promise: MockPromise = Object.create(mockPromise) promise.resolveValue = value return promise }, reject: function (value: T) { - let promise: MockPromise = Object.create(mockPromise) + let promise: MockPromise = Object.create(mockPromise) promise.rejectValue = value return promise } diff --git a/ui-grid/ui-grid-tests.ts b/ui-grid/ui-grid-tests.ts index 4e4b56064d..3eef02e113 100644 --- a/ui-grid/ui-grid-tests.ts +++ b/ui-grid/ui-grid-tests.ts @@ -1,5 +1,5 @@ +import * as ng from 'angular'; import uiGrid = require("ui-grid"); -/// interface IMyEntity { name: string; diff --git a/ui-router-extras/ui-router-extras-tests.ts b/ui-router-extras/ui-router-extras-tests.ts index db6f69d486..25a257467a 100644 --- a/ui-router-extras/ui-router-extras-tests.ts +++ b/ui-router-extras/ui-router-extras-tests.ts @@ -1,4 +1,4 @@ -import * as angular from 'angularjs'; +import * as angular from 'angular'; var myApp = angular.module('testModule') myApp.config(($stateProvider: angular.ui.IStateProvider, $stickyStateProvider: angular.ui.IStickyStateProvider) => { diff --git a/ui-select/ui-select-tests.ts b/ui-select/ui-select-tests.ts index 6bb9e3de80..12abc31c1e 100644 --- a/ui-select/ui-select-tests.ts +++ b/ui-select/ui-select-tests.ts @@ -1,4 +1,4 @@ -import * as angular from 'angularjs'; +import * as angular from 'angular'; angular .module('main', ['ui-select']) diff --git a/webrtc/index.d.ts b/webrtc/index.d.ts index f950da1943..4ed329463d 100644 --- a/webrtc/index.d.ts +++ b/webrtc/index.d.ts @@ -1,2 +1,7 @@ +// Type definitions for webrtc +// Project: https://webrtc.org/ +// Definitions by: Toshiya Nakakura +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + /// /// diff --git a/xrm/index.d.ts b/xrm/index.d.ts index bcd204ec1b..5138663195 100644 --- a/xrm/index.d.ts +++ b/xrm/index.d.ts @@ -832,7 +832,7 @@ declare namespace Xrm /** * @param {EventContext} context The context. */ - ( context?: EventContext ): void; + ( context: EventContext ): void; } /** From 7fe95f21c9f0758ea9ba1e95b1152a41b9976dec Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 14 Jul 2016 18:25:36 -0700 Subject: [PATCH 13/14] Make bluebird compatible with new promiselike definition --- bluebird/bluebird-tests.ts | 1 - bluebird/index.d.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index 8acdcb44bd..830aa06b4b 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -892,7 +892,6 @@ fooProm = Promise.race(fooArr); //TODO expand tests to overloads fooArrProm = Promise.some(fooThenArrThen, num); -fooArrProm = Promise.some(fooArrThen, num); fooArrProm = Promise.some(fooThenArr, num); fooArrProm = Promise.some(fooArr, num); diff --git a/bluebird/index.d.ts b/bluebird/index.d.ts index 4d70205a03..d4c4fe40bb 100644 --- a/bluebird/index.d.ts +++ b/bluebird/index.d.ts @@ -357,7 +357,7 @@ interface Promise extends PromiseLike, Promise.Inspection { /** * Promises/A+ `.then()` with progress handler. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise. */ - then(onFulfill: (value: T) => U | PromiseLike, onReject?: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): Promise; + then(onFulfill?: (value: T) => U | PromiseLike, onReject?: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): Promise; then(onFulfill: (value: T) => U | PromiseLike, onReject?: (error: any) => void | PromiseLike, onProgress?: (note: any) => any): Promise; /** From 677ebd4e546c82728d5537adf168c74cbff58cfb Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 14 Jul 2016 19:22:25 -0700 Subject: [PATCH 14/14] Update tester version --- npm-shrinkwrap.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 7f51e8741b..652dc6cd80 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -37,8 +37,8 @@ "from": "definition-header@>=0.3.1 <0.4.0" }, "definition-tester": { - "version": "0.5.2", - "from": "definition-tester@0.5.2" + "version": "2.0.0-alpha", + "from": "definition-tester@>= 2.0.0-alpha" }, "findup-sync": { "version": "0.3.0", diff --git a/package.json b/package.json index a38ab0b124..4a131fdb5b 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "help": "dt -h" }, "devDependencies": { - "definition-tester": "0.5.2", + "definition-tester": ">= 2.0.0-alpha", "typescript": "next" } }