Merge branch 'types-2.0' into jquery-ts2-this

This commit is contained in:
Ciuca, Alexandru
2016-07-15 12:14:57 +03:00
94 changed files with 503 additions and 495 deletions

View File

@@ -1,5 +1,5 @@
///<reference path='index.d.ts'/>
///<reference types="angularjs"/>
///<reference types="angular"/>
var myApp = angular.module('testModule');

View File

@@ -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

View File

@@ -1,5 +1,4 @@
/// <reference types="angularjs" />
/// <reference types="angular" />
var scope: ng.IScope;
var hotkeyProvider: ng.hotkeys.HotkeysProvider;

View File

@@ -1,5 +1,4 @@
/// <reference types="angularjs" />
/// <reference types="angular" />
var app = angular.module("angular-jwt-tests", ["angular-jwt"]);

View File

@@ -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) {

View File

@@ -1,4 +1,4 @@
import * as angular from 'angularjs';
import * as angular from 'angular';
angular
.module('angular-locker-tests', ['angular-locker'])

View File

@@ -1,4 +1,4 @@
import * as angular from 'angularjs';
import * as angular from 'angular';
interface ITodo {
_id?: string;

View File

@@ -1,6 +1,4 @@
/// <reference types="jquery" />
/// <reference types="angularjs" />
var btfModal: angularModal.AngularModalFactory;

View File

@@ -1,5 +1,3 @@
/// <reference types="angularjs"/>
namespace angularStrapTests {
import ngStrap = mgcrea.ngStrap;

View File

@@ -1,5 +1,3 @@
import * as angular from 'angularjs';
angular
.module('toastr-tests', ['toastr'])
.config(function(toastrConfig: angular.toastr.IToastrConfig) {

View File

@@ -1,4 +1,5 @@
import angularTouchSpin = require("angular-touchspin");
import * as angular from 'angular';
angular
.module('touchspin-tests', ['lm.touchspin'])

View File

@@ -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');

View File

@@ -1,6 +1,3 @@
/// <reference types="angularjs" />
var myApp = angular.module('testModule');
interface MySortableControllerScope extends ng.IScope {

View File

@@ -1,5 +1,4 @@
/// <reference types="jasmine" />
/// <reference types="angularjs" />
// test file taken from https://github.com/mgonto/angular-wizard

6
angular/index.d.ts vendored
View File

@@ -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;

View File

@@ -1,7 +1,7 @@
{
"files": [
"index.d.ts",
"angular-mocks-tests.ts"
"angular-tests.ts"
],
"compilerOptions": {
"module": "commonjs",
@@ -14,6 +14,6 @@
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": false
}
}

View File

@@ -1,10 +1,8 @@
/// <reference types="angularjs" />
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' });

View File

@@ -1,6 +1,3 @@
/// <reference types="angularjs" />
namespace Analytics {
angular.module("angulartics.app", ["angulartics"])
.config(["$analyticsProvider", ($analyticsProvider:angulartics.IAnalyticsServiceProvider) => {

View File

@@ -1,4 +1,5 @@
/// <reference types="react" />
/*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'

40
antd/index.d.ts vendored
View File

@@ -536,7 +536,7 @@ declare namespace Antd {
/** 经 `Form.create()` 包装过的组件会自带 `this.props.form` 属性,直接传给 Form 即可*/
form?: Object,
/** 数据验证成功后回调事件*/
onSubmit?: (e: React.FormEvent) => void,
onSubmit?: (e: React.FormEvent<Form>) => 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<TagProps, {}> {
@@ -1633,10 +1633,10 @@ declare namespace Antd {
/**
* #TimePicker
输入或选择时间的控件。
何时使用
--------
当用户需要输入一个时间,可以点击标准输入框,弹出时间面板进行选择。
*/
export class TimePicker extends React.Component<TimePickerProps, {}> {
@@ -1662,9 +1662,9 @@ declare namespace Antd {
/**
* #Timeline
垂直展示的时间流信息。
## 何时使用
- 当有一系列信息需要从上至下按时间排列时;
- 需要有一条时间轴进行视觉上的串联时;*/
export class Timeline extends React.Component<TimelineProps, {}> {
@@ -1685,11 +1685,11 @@ declare namespace Antd {
/**
* #Tooltip
简单的文字提示气泡框。
## 何时使用
鼠标移入则显示提示,移出消失,气泡浮层不承载复杂文本和操作。
可用来代替系统默认的 `title` 提示,提供一个`按钮/文字/操作`的文案解释。*/
export class Tooltip extends React.Component<TooltipProps, {}> {
render(): JSX.Element
@@ -1729,9 +1729,9 @@ declare namespace Antd {
/**
* #Transfer
双栏穿梭选择框。
## 何时使用
用直观的方式在两栏中移动元素,完成选择行为。
*/
export class Transfer extends React.Component<TransferProps, {}> {
@@ -1882,9 +1882,9 @@ declare namespace Antd {
/**
* #TreeSelect
树型选择控件。
## 何时使用
类似 Select 的选择控件,可选择的数据结构是一个树形结构时,可以使用 TreeSelect例如公司层级、学科系统、分类目录等等。
*/
export class TreeSelect extends React.Component<TreeSelectProps, {}> {
@@ -1926,11 +1926,11 @@ declare namespace Antd {
/**
* #Upload
文件选择上传和拖拽上传控件。
## 何时使用
上传是将信息(网页、文字、图片、视频等)通过网页或者上传工具发布到远程服务器上的过程。
- 当需要上传一个或一些文件时。
- 当需要展现上传的进度时。
- 当需要使用拖拽交互时。*/

View File

@@ -1,12 +1,11 @@
/// <reference types="node" />
/// <reference types="pathwatcher" />
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 {

View File

@@ -1,8 +1,7 @@
/// <reference types="mocha" />
/// <reference types="chai" />
/// <reference types="angularjs" />
import * as angular from 'angularjs';
import * as angular from 'angular';
namespace bardTests {
var expect = chai.expect,

View File

@@ -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);

2
bluebird/index.d.ts vendored
View File

@@ -357,7 +357,7 @@ interface Promise<T> extends PromiseLike<T>, Promise.Inspection<T> {
/**
* 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<U>(onFulfill: (value: T) => U | PromiseLike<U>, onReject?: (error: any) => U | PromiseLike<U>, onProgress?: (note: any) => any): Promise<U>;
then<U>(onFulfill?: (value: T) => U | PromiseLike<U>, onReject?: (error: any) => U | PromiseLike<U>, onProgress?: (note: any) => any): Promise<U>;
then<U>(onFulfill: (value: T) => U | PromiseLike<U>, onReject?: (error: any) => void | PromiseLike<void>, onProgress?: (note: any) => any): Promise<U>;
/**

View File

@@ -1,4 +1,4 @@
/// <reference types="Q" />
/// <reference types="q" />
import * as Validators from './node-validators';
import Validation = require("business-rules-engine");

View File

@@ -1,3 +1,7 @@
// Type definitions for d3JS plugins
// Project: http://d3js.org/
// Definitions by: Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as d3 from 'd3';

View File

@@ -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')

View File

@@ -42,7 +42,7 @@ namespace ShallowWrapperTest {
objectVal: Object,
boolVal: Boolean,
stringVal: String,
elementWrapper: ShallowWrapper<HTMLAttributes, {}>
elementWrapper: ShallowWrapper<HTMLAttributes<any>, {}>
function test_find() {
elementWrapper = shallowWrapper.find('.selector');
@@ -236,7 +236,7 @@ namespace ReactWrapperTest {
objectVal: Object,
boolVal: Boolean,
stringVal: String,
elementWrapper: ReactWrapper<HTMLAttributes, {}>
elementWrapper: ReactWrapper<HTMLAttributes<any>, {}>
function test_find() {
elementWrapper = reactWrapper.find('.selector');
@@ -418,7 +418,7 @@ namespace CheerioWrapperTest {
objectVal: Object,
boolVal: Boolean,
stringVal: String,
elementWrapper: ReactWrapper<HTMLAttributes, {}>
elementWrapper: ReactWrapper<HTMLAttributes<any>, {}>
function test_find() {
elementWrapper = cheerioWrapper.find('.selector');

20
enzyme/index.d.ts vendored
View File

@@ -29,7 +29,7 @@ interface CommonWrapper<P, S> {
*/
find<P2>(component: ComponentClass<P2>): CommonWrapper<P2, any>;
find<P2>(statelessComponent: StatelessComponent<P2>): CommonWrapper<P2, {}>;
find(selector: string): CommonWrapper<HTMLAttributes, any>;
find(selector: string): CommonWrapper<HTMLAttributes<any>, any>;
/**
* Finds every node in the render tree that returns true for the provided predicate function.
@@ -43,7 +43,7 @@ interface CommonWrapper<P, S> {
*/
filter<P2>(component: ComponentClass<P2>): CommonWrapper<P2, any>;
filter<P2>(statelessComponent: StatelessComponent<P2>): CommonWrapper<P2, {}>;
filter(selector: string): CommonWrapper<HTMLAttributes, any>;
filter(selector: string): CommonWrapper<HTMLAttributes<any>, 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<P, S> {
*/
children<P2>(component: ComponentClass<P2>): CommonWrapper<P2, any>;
children<P2>(statelessComponent: StatelessComponent<P2>): CommonWrapper<P2, {}>;
children(selector: string): CommonWrapper<HTMLAttributes, any>;
children(selector: string): CommonWrapper<HTMLAttributes<any>, any>;
children(): CommonWrapper<any, any>;
/**
@@ -95,7 +95,7 @@ interface CommonWrapper<P, S> {
*/
parents<P2>(component: ComponentClass<P2>): CommonWrapper<P2, any>;
parents<P2>(statelessComponent: StatelessComponent<P2>): CommonWrapper<P2, {}>;
parents(selector: string): CommonWrapper<HTMLAttributes, any>;
parents(selector: string): CommonWrapper<HTMLAttributes<any>, any>;
parents(): CommonWrapper<any, any>;
/**
@@ -112,7 +112,7 @@ interface CommonWrapper<P, S> {
*/
closest<P2>(component: ComponentClass<P2>): CommonWrapper<P2, any>;
closest<P2>(statelessComponent: StatelessComponent<P2>): CommonWrapper<P2, {}>;
closest(selector: string): CommonWrapper<HTMLAttributes, any>;
closest(selector: string): CommonWrapper<HTMLAttributes<any>, 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<P, S> extends CommonWrapper<P, S> {
*/
find<P2>(component: ComponentClass<P2>): ShallowWrapper<P2, any>;
find<P2>(statelessComponent: (props: P2) => JSX.Element): ShallowWrapper<P2, {}>;
find(selector: string): ShallowWrapper<HTMLAttributes, any>;
find(selector: string): ShallowWrapper<HTMLAttributes<any>, any>;
/**
* Removes nodes in the current wrapper that do not match the provided selector.
@@ -328,7 +328,7 @@ export interface ShallowWrapper<P, S> extends CommonWrapper<P, S> {
*/
filter<P2>(component: ComponentClass<P2>): ShallowWrapper<P2, any>;
filter<P2>(statelessComponent: StatelessComponent<P2>): ShallowWrapper<P2, {}>;
filter(selector: string): ShallowWrapper<HTMLAttributes, any>;
filter(selector: string): ShallowWrapper<HTMLAttributes<any>, any>;
/**
* Finds every node in the render tree that returns true for the provided predicate function.
@@ -343,7 +343,7 @@ export interface ShallowWrapper<P, S> extends CommonWrapper<P, S> {
*/
children<P2>(component: ComponentClass<P2>): ShallowWrapper<P2, any>;
children<P2>(statelessComponent: StatelessComponent<P2>): ShallowWrapper<P2, {}>;
children(selector: string): ShallowWrapper<HTMLAttributes, any>;
children(selector: string): ShallowWrapper<HTMLAttributes<any>, any>;
children(): ShallowWrapper<any, any>;
/**
@@ -355,7 +355,7 @@ export interface ShallowWrapper<P, S> extends CommonWrapper<P, S> {
*/
parents<P2>(component: ComponentClass<P2>): ShallowWrapper<P2, any>;
parents<P2>(statelessComponent: StatelessComponent<P2>): ShallowWrapper<P2, {}>;
parents(selector: string): ShallowWrapper<HTMLAttributes, any>;
parents(selector: string): ShallowWrapper<HTMLAttributes<any>, any>;
parents(): ShallowWrapper<any, any>;
/**
@@ -367,7 +367,7 @@ export interface ShallowWrapper<P, S> extends CommonWrapper<P, S> {
*/
closest<P2>(component: ComponentClass<P2>): ShallowWrapper<P2, any>;
closest<P2>(statelessComponent: StatelessComponent<P2>): ShallowWrapper<P2, {}>;
closest(selector: string): ShallowWrapper<HTMLAttributes, any>;
closest(selector: string): ShallowWrapper<HTMLAttributes<any>, any>;
/**
* Returns a wrapper with the direct parent of the node in the current wrapper.

View File

@@ -1,5 +1,3 @@
import * as moment from 'moment';
// Minimum Setup
$("#datetimepicker1").datetimepicker();

View File

@@ -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'});

34
filewriter/index.d.ts vendored
View File

@@ -1,7 +1,7 @@
// Type definitions for File API: Writer
// Project: http://www.w3.org/TR/file-writer-api/
// Definitions by: Kon <http://phyzkit.net/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Definitions by: Kon <http://phyzkit.net/>
// 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 {
* <li> Terminate this algorithm. </li>
* </ol>
*/
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 {
* <ul>
* @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 {
* </li>
* </ul>
* @param size The size to which the length of the file is to be adjusted, measured in bytes.
*/
*/
truncate(size:number):void;
}

View File

@@ -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<Table>, rowIndex: number) => {}}
onRowDoubleClick={(event: React.SyntheticEvent<Table>, rowIndex: number) => {}}
onRowMouseDown={(event: React.SyntheticEvent<Table>, rowIndex: number) => {}}
onRowMouseEnter={(event: React.SyntheticEvent<Table>, rowIndex: number) => {}}
onRowMouseLeave={(event: React.SyntheticEvent<Table>, rowIndex: number) => {}}
onColumnResizeEndCallback={(newColumnWidth: number, columnKey: string) => {}}>
// add columns
</Table>

View File

@@ -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<Table>, rowIndex: number) => void;
/**
* Callback that is called when a row is double clicked.
*/
onRowDoubleClick?: (event: React.SyntheticEvent, rowIndex: number) => void;
onRowDoubleClick?: (event: React.SyntheticEvent<Table>, 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<Table>, 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<Table>, 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<Table>, 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<Cell> {
/**
* The row index of the cell.
*/

View File

@@ -1,4 +1,8 @@
// Type definitions for google-apps-script
// Project: https://developers.google.com/apps-script/
// Definitions by: motemen <https://github.com/motemen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="google-apps-script.base.d.ts"/>
/// <reference path="google-apps-script.cache.d.ts"/>

View File

@@ -1,5 +1,4 @@
/// <reference types="angularjs" />
/// <reference types="angular" />
var app = angular.module('app', ['highcharts-ng']);

View File

@@ -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 {

View File

@@ -1,4 +1,6 @@
import * as JSData from 'js-data';
import * as ng from 'angular';
import * as angular from 'angular';
interface IUser {

2
jsnox/index.d.ts vendored
View File

@@ -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.
*/
<P>(specString: string, props?: React.HTMLAttributes, children?: React.ReactNode): React.DOMElement<P, Element>
<P>(specString: string, props?: React.HTMLAttributes<{}>, children?: React.ReactNode): React.DOMElement<P, Element>
/**

View File

@@ -15,7 +15,7 @@ var Person = React.createClass<PersonProps, {}>({
var PersonTag = React.createFactory(Person);
var clickHandler: React.MouseEventHandler
var clickHandler: React.MouseEventHandler<{}>;
// Tests with spec string
function spec_string () {

View File

@@ -1,5 +1,4 @@
import jsonpatch = require("json-patch");
import jp = require("json-patch");
// Add property, result: {foo: 'bar'}

View File

@@ -29,6 +29,7 @@ declare namespace karmaCoverage {
includeAllSources?: boolean;
sourceStore?: istanbul.Store;
instrumenter?: any;
[moreSettings: string]: any;
}
}

View File

@@ -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({

198
material-ui/index.d.ts vendored
View File

@@ -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<EnhancedButton> {
interface EnhancedButtonProps extends React.HTMLAttributes<{}>, SharedEnhancedButtonProps<EnhancedButton> {
// container element, <button/>, or <span/>(if disabled link) is the element that get the 'other' properties
containerElement?: React.ReactNode | string;
disabled?: boolean;
@@ -575,7 +575,7 @@ declare namespace __MaterialUI {
export class EnhancedButton extends React.Component<EnhancedButtonProps, {}> {
}
interface FlatButtonProps extends React.DOMAttributes, SharedEnhancedButtonProps<FlatButton> {
interface FlatButtonProps extends React.DOMAttributes<{}>, SharedEnhancedButtonProps<FlatButton> {
// <EnhancedButton/> is the element that get the 'other' properties
backgroundColor?: string;
disabled?: boolean;
@@ -586,10 +586,10 @@ declare namespace __MaterialUI {
labelPosition?: string; // oneOf(['left', 'right'])
labelStyle?: React.CSSProperties;
linkButton?: boolean;
onKeyboardFocus?: (e: React.FocusEvent, isKeyboardFocused: boolean) => void;
onMouseEnter?: React.MouseEventHandler;
onMouseLeave?: React.MouseEventHandler;
onTouchStart?: React.TouchEventHandler;
onKeyboardFocus?: (e: React.FocusEvent<{}>, isKeyboardFocused: boolean) => void;
onMouseEnter?: React.MouseEventHandler<{}>;
onMouseLeave?: React.MouseEventHandler<{}>;
onTouchStart?: React.TouchEventHandler<{}>;
primary?: boolean;
rippleColor?: string;
secondary?: boolean;
@@ -613,12 +613,12 @@ declare namespace __MaterialUI {
labelPosition?: string; // oneOf(['left', 'right'])
labelStyle?: React.CSSProperties;
linkButton?: boolean;
onMouseDown?: React.MouseEventHandler;
onMouseEnter?: React.MouseEventHandler;
onMouseLeave?: React.MouseEventHandler;
onMouseUp?: React.MouseEventHandler;
onTouchEnd?: React.TouchEventHandler;
onTouchStart?: React.TouchEventHandler;
onMouseDown?: React.MouseEventHandler<{}>;
onMouseEnter?: React.MouseEventHandler<{}>;
onMouseLeave?: React.MouseEventHandler<{}>;
onMouseUp?: React.MouseEventHandler<{}>;
onTouchEnd?: React.TouchEventHandler<{}>;
onTouchStart?: React.TouchEventHandler<{}>;
primary?: boolean;
rippleStyle?: React.CSSProperties;
secondary?: boolean;
@@ -627,7 +627,7 @@ declare namespace __MaterialUI {
export class RaisedButton extends React.Component<RaisedButtonProps, {}> {
}
interface FloatingActionButtonProps extends React.HTMLAttributes, SharedEnhancedButtonProps<FloatingActionButton> {
interface FloatingActionButtonProps extends React.HTMLAttributes<{}>, SharedEnhancedButtonProps<FloatingActionButton> {
// <EnhancedButton/> is the element that get the 'other' properties
backgroundColor?: string;
className?: string;
@@ -638,12 +638,12 @@ declare namespace __MaterialUI {
iconStyle?: React.CSSProperties;
linkButton?: boolean;
mini?: boolean;
onMouseDown?: React.MouseEventHandler;
onMouseEnter?: React.MouseEventHandler;
onMouseLeave?: React.MouseEventHandler;
onMouseUp?: React.MouseEventHandler;
onTouchEnd?: React.TouchEventHandler;
onTouchStart?: React.TouchEventHandler;
onMouseDown?: React.MouseEventHandler<{}>;
onMouseEnter?: React.MouseEventHandler<{}>;
onMouseLeave?: React.MouseEventHandler<{}>;
onMouseUp?: React.MouseEventHandler<{}>;
onTouchEnd?: React.TouchEventHandler<{}>;
onTouchStart?: React.TouchEventHandler<{}>;
secondary?: boolean;
style?: React.CSSProperties;
zDepth?: number;
@@ -651,17 +651,17 @@ declare namespace __MaterialUI {
export class FloatingActionButton extends React.Component<FloatingActionButtonProps, {}> {
}
interface IconButtonProps extends React.HTMLAttributes, SharedEnhancedButtonProps<IconButton> {
interface IconButtonProps extends React.HTMLAttributes<{}>, SharedEnhancedButtonProps<IconButton> {
// <EnhancedButton/> is the element that get the 'other' properties
className?: string;
disabled?: boolean;
iconClassName?: string;
iconStyle?: React.CSSProperties;
onBlur?: React.FocusEventHandler;
onFocus?: React.FocusEventHandler;
onKeyboardFocus?: (e: React.FocusEvent, isKeyboardFocused: boolean) => void;
onMouseEnter?: React.MouseEventHandler;
onMouseLeave?: React.MouseEventHandler;
onBlur?: React.FocusEventHandler<{}>;
onFocus?: React.FocusEventHandler<{}>;
onKeyboardFocus?: (e: React.FocusEvent<{}>, isKeyboardFocused: boolean) => void;
onMouseEnter?: React.MouseEventHandler<{}>;
onMouseLeave?: React.MouseEventHandler<{}>;
style?: React.CSSProperties;
tooltip?: string;
tooltipPosition?: string;
@@ -773,9 +773,9 @@ declare namespace __MaterialUI {
mode?: string;
onChange?: (e: any, date: Date) => void; // e is always null
onDismiss?: () => void;
onFocus?: React.FocusEventHandler;
onFocus?: React.FocusEventHandler<{}>;
onShow?: () => void;
onTouchTap?: React.TouchEventHandler;
onTouchTap?: React.TouchEventHandler<{}>;
shouldDisableDate?: (day: Date) => boolean;
/** @deprecated use noFilter instead */
showYearSelector?: boolean;
@@ -797,8 +797,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;
@@ -837,12 +837,12 @@ declare namespace __MaterialUI {
/** @deprecated use array of components instead */
export interface DialogAction {
id?: string;
onClick?: React.MouseEventHandler;
onClick?: React.MouseEventHandler<{}>;
onTouchTap?: TouchTapEventHandler;
ref?: string;
text: string;
}
interface DialogProps extends React.DOMAttributes, React.Props<Dialog> {
interface DialogProps extends React.DOMAttributes<{}>, React.Props<Dialog> {
/** @deprecated use a custom `actions` property instead */
actionFocus?: string;
actions?: Array<DialogAction | React.ReactElement<any>>;
@@ -907,23 +907,23 @@ declare namespace __MaterialUI {
}
}
interface FontIconProps extends React.HTMLAttributes, React.Props<FontIcon> {
interface FontIconProps extends React.HTMLAttributes<{}>, React.Props<FontIcon> {
// <span/> is the element that get the 'other' properties
color?: string;
hoverColor?: string;
onMouseEnter?: React.MouseEventHandler;
onMouseLeave?: React.MouseEventHandler;
onMouseEnter?: React.MouseEventHandler<{}>;
onMouseLeave?: React.MouseEventHandler<{}>;
style?: React.CSSProperties;
}
export class FontIcon extends React.Component<FontIconProps, {}> {
}
interface SvgIconProps extends React.SVGAttributes, React.Props<SvgIcon> {
interface SvgIconProps extends React.SVGAttributes<{}>, React.Props<SvgIcon> {
// <svg/> is the element that get the 'other' properties
color?: string;
hoverColor?: string;
onMouseEnter?: React.MouseEventHandler;
onMouseLeave?: React.MouseEventHandler;
onMouseEnter?: React.MouseEventHandler<{}>;
onMouseLeave?: React.MouseEventHandler<{}>;
style?: React.CSSProperties;
viewBox?: string;
}
@@ -993,7 +993,7 @@ declare namespace __MaterialUI {
export class ListDivider extends React.Component<ListDividerProps, {}> {
}
interface ListItemProps extends React.HTMLAttributes, React.Props<ListItem> {
interface ListItemProps extends React.HTMLAttributes<{}>, React.Props<ListItem> {
// <EnhancedButton/> is the element that get the 'other' properties
autoGenerateNestedIndicator?: boolean;
disableKeyboardFocus?: boolean;
@@ -1007,11 +1007,11 @@ declare namespace __MaterialUI {
nestedItems?: React.ReactElement<ListItemProps>[];
nestedLevel?: number;
nestedListStyle?: React.CSSProperties;
onKeyboardFocus?: React.FocusEventHandler;
onMouseEnter?: React.MouseEventHandler;
onMouseLeave?: React.MouseEventHandler;
onKeyboardFocus?: React.FocusEventHandler<{}>;
onMouseEnter?: React.MouseEventHandler<{}>;
onMouseLeave?: React.MouseEventHandler<{}>;
onNestedListToggle?: (item: ListItem) => void;
onTouchStart?: React.TouchEventHandler;
onTouchStart?: React.TouchEventHandler<{}>;
onTouchTap?: TouchTapEventHandler;
primaryText?: React.ReactNode;
primaryTogglesNestedList?: boolean;
@@ -1038,9 +1038,9 @@ declare namespace __MaterialUI {
maxHeight?: number;
multiple?: boolean;
onChange?: (e: TouchTapEvent, itemValue: any | any[]) => void;
onEscKeyDown?: React.KeyboardEventHandler;
onEscKeyDown?: React.KeyboardEventHandler<{}>;
onItemTouchTap?: (e: TouchTapEvent, item: MenuItem) => void;
onKeyDown?: React.KeyboardEventHandler;
onKeyDown?: React.KeyboardEventHandler<{}>;
openDirection?: string;
selectedMenuItemStyle?: React.CSSProperties;
style?: React.CSSProperties;
@@ -1052,7 +1052,7 @@ declare namespace __MaterialUI {
export class Menu extends React.Component<MenuProps, {}>{
}
interface MenuItemProps extends React.HTMLAttributes, React.Props<MenuItem> {
interface MenuItemProps extends React.HTMLAttributes<{}>, React.Props<MenuItem> {
// <ListItem/> is the element that get the 'other' properties
checked?: boolean;
desktop?: boolean;
@@ -1084,11 +1084,11 @@ declare namespace __MaterialUI {
iconStyle?: React.CSSProperties;
menuStyle?: React.CSSProperties;
onItemTouchTap?: (e: TouchTapEvent, item: MenuItem) => void;
onKeyboardFocus?: React.FocusEventHandler;
onMouseDown?: React.MouseEventHandler;
onMouseEnter?: React.MouseEventHandler;
onMouseLeave?: React.MouseEventHandler;
onMouseUp?: React.MouseEventHandler;
onKeyboardFocus?: React.FocusEventHandler<{}>;
onMouseDown?: React.MouseEventHandler<{}>;
onMouseEnter?: React.MouseEventHandler<{}>;
onMouseLeave?: React.MouseEventHandler<{}>;
onMouseUp?: React.MouseEventHandler<{}>;
onRequestChange?: (opening: boolean, reason: string) => void;
onTouchTap?: TouchTapEventHandler;
open?: boolean;
@@ -1103,7 +1103,7 @@ declare namespace __MaterialUI {
maxHeight?: number;
multiple?: boolean;
onChange?: (e: TouchTapEvent, itemValue: any | any[]) => void;
onKeyDown?: React.KeyboardEventHandler;
onKeyDown?: React.KeyboardEventHandler<{}>;
openDirection?: string;
selectedMenuItemStyle?: React.CSSProperties;
value?: any | any[];
@@ -1152,7 +1152,7 @@ declare namespace __MaterialUI {
export class Overlay extends React.Component<OverlayProps, {}> {
}
interface PaperProps extends React.HTMLAttributes, React.Props<Paper> {
interface PaperProps extends React.HTMLAttributes<{}>, React.Props<Paper> {
circle?: boolean;
rounded?: boolean;
style?: React.CSSProperties;
@@ -1259,9 +1259,9 @@ declare namespace __MaterialUI {
labelStyle?: React.CSSProperties;
/** @deprecated use composability instead */
menuItems?: any[];
onBlur?: React.FocusEventHandler;
onBlur?: React.FocusEventHandler<{}>;
onChange?: (e: TouchTapEvent, index: number, menuItemValue: any) => void;
onFocus?: React.FocusEventHandler;
onFocus?: React.FocusEventHandler<{}>;
selectFieldRoot?: React.CSSProperties;
/** @deprecated use value instead */
selectedIndex?: number;
@@ -1293,11 +1293,11 @@ declare namespace __MaterialUI {
max?: number;
min?: number;
name?: string;
onBlur?: React.FocusEventHandler;
onChange?: (e: React.MouseEvent, value: number) => void;
onDragStart?: React.MouseEventHandler;
onDragStop?: React.MouseEventHandler;
onFocus?: React.FocusEventHandler;
onBlur?: React.FocusEventHandler<{}>;
onChange?: (e: React.MouseEvent<{}>, value: number) => void;
onDragStart?: React.MouseEventHandler<{}>;
onDragStop?: React.MouseEventHandler<{}>;
onFocus?: React.FocusEventHandler<{}>;
required?: boolean;
step?: number;
style?: React.CSSProperties;
@@ -1307,7 +1307,7 @@ declare namespace __MaterialUI {
}
// what's not commonly overridden by Checkbox, RadioButton, or Toggle
interface CommonEnhancedSwitchProps<T> extends React.HTMLAttributes, React.Props<T> {
interface CommonEnhancedSwitchProps<T> extends React.HTMLAttributes<{}>, React.Props<T> {
}
interface EnhancedSwitchProps extends CommonEnhancedSwitchProps<EnhancedSwitch> {
@@ -1325,15 +1325,15 @@ declare namespace __MaterialUI {
labelPosition?: string; // oneOf(['left', 'right'])
labelStyle?: React.CSSProperties;
name?: string;
onBlur?: React.FocusEventHandler;
onFocus?: React.FocusEventHandler;
onMouseDown?: React.MouseEventHandler;
onMouseLeave?: React.MouseEventHandler;
onMouseUp?: React.MouseEventHandler;
onBlur?: React.FocusEventHandler<{}>;
onFocus?: React.FocusEventHandler<{}>;
onMouseDown?: React.MouseEventHandler<{}>;
onMouseLeave?: React.MouseEventHandler<{}>;
onMouseUp?: React.MouseEventHandler<{}>;
onParentShouldUpdate: (isInputChecked: boolean) => void;
onSwitch?: (e: React.MouseEvent, isInputChecked: boolean) => void;
onTouchEnd?: React.TouchEventHandler;
onTouchStart?: React.TouchEventHandler;
onSwitch?: (e: React.MouseEvent<{}>, isInputChecked: boolean) => void;
onTouchEnd?: React.TouchEventHandler<{}>;
onTouchStart?: React.TouchEventHandler<{}>;
required?: boolean;
rippleColor?: string;
rippleStyle?: React.CSSProperties;
@@ -1360,7 +1360,7 @@ declare namespace __MaterialUI {
iconStyle?: React.CSSProperties;
labelPosition?: string; // oneOf(['left', 'right'])
labelStyle?: React.CSSProperties;
onCheck?: (event: React.MouseEvent, checked: boolean) => void;
onCheck?: (event: React.MouseEvent<{}>, checked: boolean) => void;
style?: React.CSSProperties;
/** @deprecated Use uncheckedIcon instead */
unCheckedIcon?: React.ReactElement<{ style?: React.CSSProperties }>; // Normally an SvgIcon
@@ -1381,7 +1381,7 @@ declare namespace __MaterialUI {
inputStyle?: React.CSSProperties;
labelPosition?: string; // oneOf(['left', 'right'])
labelStyle?: React.CSSProperties;
onCheck?: (e: React.FormEvent, selected: string) => void;
onCheck?: (e: React.FormEvent<{}>, selected: string) => void;
style?: React.CSSProperties;
uncheckedIcon?: React.ReactElement<{ style?: React.CSSProperties }>; // Normally an SvgIcon
value?: string;
@@ -1396,7 +1396,7 @@ declare namespace __MaterialUI {
defaultSelected?: string;
labelPosition?: string; // oneOf(['left', 'right'])
name: string;
onChange?: (e: React.FormEvent, selected: string) => void;
onChange?: (e: React.FormEvent<{}>, selected: string) => void;
style?: React.CSSProperties;
valueSelected?: string;
}
@@ -1415,7 +1415,7 @@ declare namespace __MaterialUI {
inputStyle?: React.CSSProperties;
labelPosition?: string; // oneOf(['left', 'right'])
labelStyle?: React.CSSProperties;
onToggle?: (e: React.MouseEvent, isInputChecked: boolean) => void;
onToggle?: (e: React.MouseEvent<{}>, isInputChecked: boolean) => void;
rippleStyle?: React.CSSProperties;
style?: React.CSSProperties;
thumbStyle?: React.CSSProperties;
@@ -1434,7 +1434,7 @@ declare namespace __MaterialUI {
bodyStyle?: React.CSSProperties;
className?: string;
message: string;
onActionTouchTap?: React.TouchEventHandler;
onActionTouchTap?: React.TouchEventHandler<{}>;
/** @deprecated Use the open property to control the component instead */
onDismiss?: () => void; // DEPRECATED
onRequestClose: (reason: string) => void;
@@ -1479,12 +1479,12 @@ declare namespace __MaterialUI {
displayBorder?: boolean;
hoverable?: boolean;
hovered?: boolean;
onCellClick?: (e: React.MouseEvent, row: number, column: number) => void;
onCellHover?: (e: React.MouseEvent, row: number, column: number) => void;
onCellHoverExit?: (e: React.MouseEvent, row: number, column: number) => void;
onRowClick?: (e: React.MouseEvent, row: number) => void;
onRowHover?: (e: React.MouseEvent, row: number) => void;
onRowHoverExit?: (e: React.MouseEvent, row: number) => void;
onCellClick?: (e: React.MouseEvent<{}>, row: number, column: number) => void;
onCellHover?: (e: React.MouseEvent<{}>, row: number, column: number) => void;
onCellHoverExit?: (e: React.MouseEvent<{}>, row: number, column: number) => void;
onRowClick?: (e: React.MouseEvent<{}>, row: number) => void;
onRowHover?: (e: React.MouseEvent<{}>, row: number) => void;
onRowHoverExit?: (e: React.MouseEvent<{}>, row: number) => void;
rowNumber?: number;
selectable?: boolean;
selected?: boolean;
@@ -1500,9 +1500,9 @@ declare namespace __MaterialUI {
columnNumber?: number;
hoverable?: boolean;
key?: string;
onClick?: (e: React.MouseEvent, column: number) => void;
onHover?: (e: React.MouseEvent, column: number) => void;
onHoverExit?: (e: React.MouseEvent, column: number) => void;
onClick?: (e: React.MouseEvent<{}>, column: number) => void;
onHover?: (e: React.MouseEvent<{}>, column: number) => void;
onHoverExit?: (e: React.MouseEvent<{}>, column: number) => void;
style?: React.CSSProperties;
// useful attributes passed to <td/>
@@ -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<any>;
@@ -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<ToolbarSeparatorProps, {}> {
}
interface ToolbarTitleProps extends React.HTMLAttributes, React.Props<ToolbarTitle> {
interface ToolbarTitleProps extends React.HTMLAttributes<{}>, React.Props<ToolbarTitle> {
className?: string;
style?: React.CSSProperties;
text?: string;

View File

@@ -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);

View File

@@ -5,7 +5,6 @@
import * as moment from 'moment';
export as namespace moment;
export = moment;
declare module 'moment' {

View File

@@ -1,6 +1,4 @@
import * as Q from 'q';
import testFx = require('msportalfx-test');
var galleryPackageName = "My.Package";

View File

@@ -1,5 +1,4 @@
/// <reference types="angularjs" />
/// <reference types="angular" />
var app = angular.module('testModule', ['ng-command']);

View File

@@ -3,7 +3,7 @@
// Definitions by: Jacques Kang <https://www.linkedin.com/in/jacqueskang>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="Camera" />
/// <reference types="cordova" />
/// <reference types="angular" />
declare namespace ngCordova {

View File

@@ -4,7 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="angular" />
/// <reference types="FileSystem" />
/// <reference types="cordova" />
declare namespace ngCordova {
export interface IFileService {

View File

@@ -4,8 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="angular" />
/// <reference types="FileTransfer" />
/// <reference types="FileSystem" />
/// <reference types="cordova" />
declare namespace ngCordova {
export interface IFileTransferService {

19
ng-cordova/tsconfig.json Normal file
View File

@@ -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
}
}

View File

@@ -1,6 +1,5 @@
/// <reference types="angularjs" />
import * as angular from 'angularjs';
/// <reference types="angular" />
import * as angular from 'angular';
var app = angular.module('testModule', ['ngDialog']);

View File

@@ -1,4 +1,4 @@
import * as angular from 'angularjs';
import * as angular from 'angular';
"use strict";

View File

@@ -1,5 +1,4 @@
/// <reference types="angularjs" />
/// <reference types="angular" />
var options1: ngGrid.IGridOptions = {
data: [{ 'Name': 'Bob' }, { 'Name': 'Jane' }]

View File

@@ -1,5 +1,4 @@
/// <reference types="angularjs"/>
/// <reference types="angular"/>
class NgNotifyTestController {

View File

@@ -1,5 +1,4 @@
/// <reference types="angularjs" />
/// <reference types="angular" />
namespace ngStompTesting {

View File

@@ -1,4 +1,4 @@
/// <reference types="angularjs" />
/// <reference types="angular" />
class TestBootboxController {

View File

@@ -1,4 +1,4 @@
///<reference types="angularjs" />
///<reference types="angular" />
var app = angular.module('testApp', ['ngProgressLite']);

View File

@@ -1,4 +1,4 @@
/// <reference types="angularjs" />
/// <reference types="angular" />
var app: any;

View File

@@ -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) {

View File

@@ -1,7 +1,4 @@
/// <reference types="Q" />
export interface IPerson{
interface IPerson{
Checked:boolean;
FirstName:string;
LastName:string;

7
npm-shrinkwrap.json generated
View File

@@ -34,8 +34,11 @@
},
"definition-header": {
"version": "0.3.1",
"from": "definition-header@0.3.1",
"resolved": "https://registry.npmjs.org/definition-header/-/definition-header-0.3.1.tgz"
"from": "definition-header@>=0.3.1 <0.4.0"
},
"definition-tester": {
"version": "2.0.0-alpha",
"from": "definition-tester@>= 2.0.0-alpha"
},
"findup-sync": {
"version": "0.3.0",

View File

@@ -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;
}
}

View File

@@ -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) {

View File

@@ -28,7 +28,7 @@
"help": "dt -h"
},
"devDependencies": {
"definition-tester": "0.5.2",
"definition-tester": ">= 2.0.0-alpha",
"typescript": "next"
}
}

View File

@@ -1,6 +1,4 @@
/// <reference types="Q" />
import * as Q from 'q';
import * as pg from 'promise-pg';
var conString = "postgres://username:password@localhost/database";

View File

@@ -1,5 +1,4 @@
/// <reference types="Q" />
import * as Q from 'q';
var fs:typeof QioFS = require('q-io/fs');
var http:typeof QioHTTP = require('q-io/http');

View File

@@ -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

View File

@@ -21,7 +21,7 @@ declare namespace LinkedStateMixin {
}
declare module 'react' {
interface HTMLAttributes {
interface HTMLAttributes<T> {
checkedLink?: LinkedStateMixin.ReactLink<boolean>;
valueLink?: LinkedStateMixin.ReactLink<boolean | string | number>;
}

View File

@@ -126,7 +126,7 @@ declare namespace TestUtils {
export function isElementOfType<T extends HTMLElement>(
element: ReactElement<any>, type: string): element is ReactHTMLElement<T>;
export function isElementOfType<P extends DOMAttributes, T extends Element>(
export function isElementOfType<P extends DOMAttributes<{}>, T extends Element>(
element: ReactElement<any>, type: string): element is DOMElement<P, T>;
export function isElementOfType<P>(
element: ReactElement<any>, type: SFC<P>): element is SFCElement<P>;

View File

@@ -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 <https://github.com/ianks>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="react" />

View File

@@ -12,7 +12,7 @@ declare module "react-bootstrap" {
// <Button />
// ----------------------------------------
interface ButtonProps extends React.HTMLAttributes {
interface ButtonProps extends React.HTMLAttributes<{}> {
// Optional
active?: boolean;
@@ -28,7 +28,7 @@ declare module "react-bootstrap" {
// <ButtonToolbar />
// ----------------------------------------
interface ButtonToolbarProps extends React.HTMLAttributes {
interface ButtonToolbarProps extends React.HTMLAttributes<{}> {
// Optional
block?: boolean;
@@ -42,7 +42,7 @@ declare module "react-bootstrap" {
// <ButtonGroup />
// ----------------------------------------
interface ButtonGroupProps extends React.HTMLAttributes {
interface ButtonGroupProps extends React.HTMLAttributes<{}> {
// Optional
block?: boolean;
bsSize?: string;
@@ -55,7 +55,7 @@ declare module "react-bootstrap" {
// <DropdownButton />
// ----------------------------------------
interface DropdownButtonProps extends React.HTMLAttributes {
interface DropdownButtonProps extends React.HTMLAttributes<{}> {
bsStyle?: string;
bsSize?: string;
buttonClassName?: string;
@@ -69,7 +69,7 @@ declare module "react-bootstrap" {
// <SplitButton />
// ----------------------------------------
interface SplitButtonProps extends React.HTMLAttributes {
interface SplitButtonProps extends React.HTMLAttributes<{}> {
bsStyle?: string;
bsSize?: string;
dropdownTitle?: any; // TODO: Add more specific type
@@ -81,7 +81,7 @@ declare module "react-bootstrap" {
// <MenuItem />
// ----------------------------------------
interface MenuItemProps extends React.HTMLAttributes {
interface MenuItemProps extends React.HTMLAttributes<{}> {
active?: boolean;
divider?: boolean;
eventKey?: any;
@@ -92,7 +92,7 @@ declare module "react-bootstrap" {
// <Panel />
// ----------------------------------------
interface PanelProps extends React.HTMLAttributes {
interface PanelProps extends React.HTMLAttributes<{}> {
bsSize?: string;
bsStyle?: string;
collapsible?: boolean;
@@ -107,7 +107,7 @@ declare module "react-bootstrap" {
// <Accordion />
// ----------------------------------------
interface AccordionProps extends React.HTMLAttributes {
interface AccordionProps extends React.HTMLAttributes<{}> {
bsSize?: string;
bsStyle?: string;
collapsible?: boolean;
@@ -122,7 +122,7 @@ declare module "react-bootstrap" {
// <PanelGroup />
// ----------------------------------------
interface PanelGroupProps extends React.HTMLAttributes {
interface PanelGroupProps extends React.HTMLAttributes<{}>{
accordion?: boolean;
activeKey?: any;
bsSize?: string;
@@ -134,7 +134,7 @@ declare module "react-bootstrap" {
// <Modal.Dialog />
// ----------------------------------------
interface ModalDialogProps extends React.HTMLAttributes {
interface ModalDialogProps extends React.HTMLAttributes<{}>{
// TODO: Add more specific type
}
type ModalDialog = React.ClassicComponent<ModalDialogProps, {}>;
@@ -142,7 +142,7 @@ declare module "react-bootstrap" {
// <Modal.Header />
// ----------------------------------------
interface ModalHeaderProps extends React.HTMLAttributes {
interface ModalHeaderProps extends React.HTMLAttributes<{}>{
closeButton?: boolean;
modalClassName?: string;
onHide?: Function;
@@ -153,7 +153,7 @@ declare module "react-bootstrap" {
// <Modal.Title/>
// ----------------------------------------
interface ModalTitleProps extends React.HTMLAttributes {
interface ModalTitleProps extends React.HTMLAttributes<{}>{
modalClassName?: string;
}
class ModalTitle extends React.Component<ModalTitleProps, {}> {
@@ -161,7 +161,7 @@ declare module "react-bootstrap" {
// <Modal.Body />
// ----------------------------------------
interface ModalBodyProps extends React.HTMLAttributes {
interface ModalBodyProps extends React.HTMLAttributes<{}>{
modalClassName?: string;
}
class ModalBody extends React.Component<ModalBodyProps, {}> {
@@ -169,7 +169,7 @@ declare module "react-bootstrap" {
// <Modal.Footer />
// ----------------------------------------
interface ModalFooterProps extends React.HTMLAttributes {
interface ModalFooterProps extends React.HTMLAttributes<{}>{
modalClassName?: string;
}
class ModalFooter extends React.Component<ModalFooterProps, {}> {
@@ -177,7 +177,7 @@ declare module "react-bootstrap" {
// <Modal />
// ----------------------------------------
interface ModalProps extends React.HTMLAttributes {
interface ModalProps extends React.HTMLAttributes<{}>{
// Required
onHide: Function;
@@ -238,7 +238,7 @@ declare module "react-bootstrap" {
// <Tooltip />
// ----------------------------------------
interface TooltipProps extends React.HTMLAttributes {
interface TooltipProps extends React.HTMLAttributes<{}>{
// Optional
arrowOffsetLeft?: number | string;
arrowOffsetTop?: number | string;
@@ -253,7 +253,7 @@ declare module "react-bootstrap" {
// <Popover/>
// ----------------------------------------
interface PopoverProps extends React.HTMLAttributes {
interface PopoverProps extends React.HTMLAttributes<{}>{
// Optional
arrowOffsetLeft?: number | string;
arrowOffsetTop?: number | string;
@@ -290,7 +290,7 @@ declare module "react-bootstrap" {
// <ProgressBar />
// ----------------------------------------
interface ProgressBarProps extends React.HTMLAttributes {
interface ProgressBarProps extends React.HTMLAttributes<{}>{
// Optional
active?: boolean;
bsSize?: string;
@@ -308,7 +308,7 @@ declare module "react-bootstrap" {
// <Nav />
// ----------------------------------------
// TODO: This one turned into a union of two different types
interface NavProps extends React.HTMLAttributes {
interface NavProps extends React.HTMLAttributes<{}>{
// Optional
activeHref?: string;
activeKey?: any;
@@ -330,7 +330,7 @@ declare module "react-bootstrap" {
// <NavItem />
// ----------------------------------------
interface NavItemProps extends React.HTMLAttributes {
interface NavItemProps extends React.HTMLAttributes<{}>{
active?: boolean;
brand?: any; // TODO: Add more specific type
bsSize?: string;
@@ -354,7 +354,7 @@ declare module "react-bootstrap" {
// <Navbar.Brand />
// ----------------------------------------
interface NavbarBrandProps extends React.HTMLAttributes {
interface NavbarBrandProps extends React.HTMLAttributes<{}>{
}
class NavbarBrand extends React.Component<NavbarBrandProps, {}> {
}
@@ -368,7 +368,7 @@ declare module "react-bootstrap" {
// <Navbar.Header />
// ----------------------------------------
interface NavbarHeaderProps extends React.HTMLAttributes {
interface NavbarHeaderProps extends React.HTMLAttributes<{}>{
}
type NavbarHeader = React.ClassicComponent<NavbarHeaderProps, {}>;
var NavbarHeader: React.ClassicComponentClass<NavbarHeaderProps>;
@@ -382,7 +382,7 @@ declare module "react-bootstrap" {
// <Navbar />
// ----------------------------------------
interface NavbarProps extends React.HTMLAttributes {
interface NavbarProps extends React.HTMLAttributes<{}>{
brand?: any; // TODO: Add more specific type
bsSize?: string;
bsStyle?: string;
@@ -409,7 +409,7 @@ declare module "react-bootstrap" {
// <NavDropdown />
// ----------------------------------------
interface NavDropdownProps extends React.HTMLAttributes {
interface NavDropdownProps extends React.HTMLAttributes<{}>{
eventKey?: any;
}
class NavDropdown extends React.Component<NavDropdownProps, {}> {
@@ -417,7 +417,7 @@ declare module "react-bootstrap" {
// <Tabs />
// ----------------------------------------
interface TabsProps extends React.HTMLAttributes {
interface TabsProps extends React.HTMLAttributes<{}>{
activeKey?: any;
animation?: boolean;
bsStyle?: string;
@@ -431,7 +431,7 @@ declare module "react-bootstrap" {
// <Tab />
// ----------------------------------------
interface TabProps extends React.HTMLAttributes {
interface TabProps extends React.HTMLAttributes<{}>{
animation?: boolean;
eventKey?: any; // TODO: Add more specific type
}
@@ -440,14 +440,14 @@ declare module "react-bootstrap" {
// <Pager />
// ----------------------------------------
interface PagerProps extends React.HTMLAttributes {
interface PagerProps extends React.HTMLAttributes<{}>{
}
type Pager = React.ClassicComponent<PagerProps, {}>;
var Pager: React.ClassicComponentClass<PagerProps>;
// <PageItem />
// ----------------------------------------
interface PageItemProps extends React.HTMLAttributes {
interface PageItemProps extends React.HTMLAttributes<{}>{
eventKey?: any;
next?: boolean;
previous?: boolean;
@@ -457,7 +457,7 @@ declare module "react-bootstrap" {
// <Pagination />
// ----------------------------------------
interface PaginationProps extends React.HTMLAttributes {
interface PaginationProps extends React.HTMLAttributes<{}>{
activePage?: number;
bsSize?: string;
bsStyle?: string;
@@ -475,7 +475,7 @@ declare module "react-bootstrap" {
// <Alert />
// ----------------------------------------
interface AlertProps extends React.HTMLAttributes {
interface AlertProps extends React.HTMLAttributes<{}>{
bsSize?: string;
bsStyle?: string;
closeLabel?: string;
@@ -487,7 +487,7 @@ declare module "react-bootstrap" {
// <Carousel />
// ----------------------------------------
interface CarouselProps extends React.HTMLAttributes {
interface CarouselProps extends React.HTMLAttributes<{}>{
activeIndex?: number;
bsSize?: string;
bsStyle?: string;
@@ -507,7 +507,7 @@ declare module "react-bootstrap" {
// <CarouselItem />
// ----------------------------------------
interface CarouselItemProps extends React.HTMLAttributes {
interface CarouselItemProps extends React.HTMLAttributes<{}>{
active?: boolean;
animtateIn?: boolean;
animateOut?: boolean;
@@ -521,7 +521,7 @@ declare module "react-bootstrap" {
// <Grid />
// ----------------------------------------
interface GridProps extends React.HTMLAttributes {
interface GridProps extends React.HTMLAttributes<{}>{
componentClass?: any; // TODO: Add more specific type
fluid?: boolean;
}
@@ -530,7 +530,7 @@ declare module "react-bootstrap" {
// <Row />
// ----------------------------------------
interface RowProps extends React.HTMLAttributes {
interface RowProps extends React.HTMLAttributes<{}>{
componentClass?: any; // TODO: Add more specific type
}
type Row = React.ClassicComponent<RowProps, {}>;
@@ -538,7 +538,7 @@ declare module "react-bootstrap" {
// <Col />
// ----------------------------------------
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" {
// <Thumbnail />
// ----------------------------------------
interface ThumbnailProps extends React.HTMLAttributes {
interface ThumbnailProps extends React.HTMLAttributes<{}>{
bsSize?: string;
bsStyle?: string;
}
@@ -575,7 +575,7 @@ declare module "react-bootstrap" {
// <ListGroup />
// ----------------------------------------
interface ListGroupProps extends React.HTMLAttributes {
interface ListGroupProps extends React.HTMLAttributes<{}>{
fill?: boolean; // TODO: Add more specific type
}
class ListGroup extends React.Component<ListGroupProps, {}> {
@@ -583,7 +583,7 @@ declare module "react-bootstrap" {
// <ListGroupItem />
// ----------------------------------------
interface ListGroupItemProps extends React.HTMLAttributes {
interface ListGroupItemProps extends React.HTMLAttributes<{}>{
active?: any;
bsSize?: string;
bsStyle?: string;
@@ -597,7 +597,7 @@ declare module "react-bootstrap" {
// <Label />
// ----------------------------------------
interface LabelProps extends React.HTMLAttributes {
interface LabelProps extends React.HTMLAttributes<{}>{
bsSize?: string;
bsStyle?: string;
}
@@ -606,7 +606,7 @@ declare module "react-bootstrap" {
// <Badge />
// ----------------------------------------
interface BadgeProps extends React.HTMLAttributes {
interface BadgeProps extends React.HTMLAttributes<{}>{
pullRight?: boolean;
}
type Badge = React.ClassicComponent<BadgeProps, {}>;
@@ -614,7 +614,7 @@ declare module "react-bootstrap" {
// <Jumbotron />
// ----------------------------------------
interface JumbotronProps extends React.HTMLAttributes {
interface JumbotronProps extends React.HTMLAttributes<{}>{
componentClass?: any; // TODO: Add more specific type
}
type Jumbotron = React.ClassicComponent<JumbotronProps, {}>;
@@ -622,14 +622,14 @@ declare module "react-bootstrap" {
// <PageHeader />
// ----------------------------------------
interface PageHeaderProps extends React.HTMLAttributes {
interface PageHeaderProps extends React.HTMLAttributes<{}>{
}
class PageHeader extends React.Component<PageHeaderProps, {}> {
}
// <Well />
// ----------------------------------------
interface WellProps extends React.HTMLAttributes {
interface WellProps extends React.HTMLAttributes<{}>{
bsSize?: string;
bsStyle?: string;
}
@@ -638,7 +638,7 @@ declare module "react-bootstrap" {
// <Glyphicon />
// ----------------------------------------
interface GlyphiconProps extends React.HTMLAttributes {
interface GlyphiconProps extends React.HTMLAttributes<{}>{
// Required
glyph: string;
}
@@ -647,7 +647,7 @@ declare module "react-bootstrap" {
// <Table />
// ----------------------------------------
interface TableProps extends React.HTMLAttributes {
interface TableProps extends React.HTMLAttributes<{}>{
bordered?: boolean;
condensed?: boolean;
hover?: boolean;
@@ -659,7 +659,7 @@ declare module "react-bootstrap" {
// <Input />
// ----------------------------------------
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" {
// <ButtonInput />
// ----------------------------------------
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" {
// <FormControls.Static />
// ----------------------------------------
interface StaticProps extends React.HTMLAttributes {}
interface StaticProps extends React.HTMLAttributes<{}>{}
interface Static extends React.ReactElement<StaticProps> { }
interface StaticClass extends React.ComponentClass<StaticProps> { }
interface FormControlsClass {

View File

@@ -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<{}>
}
}

View File

@@ -29,7 +29,7 @@ declare namespace ReactDayPicker {
date?: Date;
localeUtils?: LocaleUtils;
locale?: string;
onClick?: React.MouseEventHandler;
onClick?: React.MouseEventHandler<{}>;
}
interface Props extends React.Props<DayPicker>{
@@ -44,12 +44,12 @@ declare namespace ReactDayPicker {
localeUtils?: LocaleUtils;
locale?: string;
captionElement?: React.ReactElement<CaptionElementProps>;
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;

View File

@@ -1,5 +1,4 @@
/// <reference types="react" />
import * as React from 'react';
import * as DayPicker2 from "react-day-picker";
function isSunday(day: Date) {

View File

@@ -7,7 +7,7 @@
import * as React from "react";
interface ReactHolderProp extends React.HTMLAttributes {
interface ReactHolderProp extends React.HTMLAttributes<ReactHolder> {
width: string | number;
height: string | number;
updateOnResize: boolean;

View File

@@ -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<ReactInputCalendar>, computableDate: string) => void;
/**
* Define state when date picker would close once the user has clicked on a date.
*/

282
react-mdl/index.d.ts vendored
View File

@@ -12,7 +12,7 @@ declare namespace __ReactMDL {
type __MDLOtherProps = React.HTMLProps<any>;
class __MDLComponent<P extends __MDLClassProps> extends React.Component<P, {}> {}
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<T> {
// 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<T>;
onCut?: React.ClipboardEventHandler<T>;
onPaste?: React.ClipboardEventHandler<T>;
// Composition Events
onCompositionEnd?: React.CompositionEventHandler;
onCompositionStart?: React.CompositionEventHandler;
onCompositionUpdate?: React.CompositionEventHandler;
onCompositionEnd?: React.CompositionEventHandler<T>;
onCompositionStart?: React.CompositionEventHandler<T>;
onCompositionUpdate?: React.CompositionEventHandler<T>;
// Focus Events
onFocus?: React.FocusEventHandler;
onBlur?: React.FocusEventHandler;
onFocus?: React.FocusEventHandler<T>;
onBlur?: React.FocusEventHandler<T>;
// Form Events
onInput?: React.FormEventHandler;
onSubmit?: React.FormEventHandler;
onInput?: React.FormEventHandler<T>;
onSubmit?: React.FormEventHandler<T>;
// Image Events
onLoad?: React.ReactEventHandler;
onError?: React.ReactEventHandler; // also a Media Event
onLoad?: React.ReactEventHandler<T>;
onError?: React.ReactEventHandler<T>; // also a Media Event
// Keyboard Events
onKeyDown?: React.KeyboardEventHandler;
onKeyPress?: React.KeyboardEventHandler;
onKeyUp?: React.KeyboardEventHandler;
onKeyDown?: React.KeyboardEventHandler<T>;
onKeyPress?: React.KeyboardEventHandler<T>;
onKeyUp?: React.KeyboardEventHandler<T>;
// 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<T>;
onCanPlay?: React.ReactEventHandler<T>;
onCanPlayThrough?: React.ReactEventHandler<T>;
onDurationChange?: React.ReactEventHandler<T>;
onEmptied?: React.ReactEventHandler<T>;
onEncrypted?: React.ReactEventHandler<T>;
onEnded?: React.ReactEventHandler<T>;
onLoadedData?: React.ReactEventHandler<T>;
onLoadedMetadata?: React.ReactEventHandler<T>;
onLoadStart?: React.ReactEventHandler<T>;
onPause?: React.ReactEventHandler<T>;
onPlay?: React.ReactEventHandler<T>;
onPlaying?: React.ReactEventHandler<T>;
onProgress?: React.ReactEventHandler<T>;
onRateChange?: React.ReactEventHandler<T>;
onSeeked?: React.ReactEventHandler<T>;
onSeeking?: React.ReactEventHandler<T>;
onStalled?: React.ReactEventHandler<T>;
onSuspend?: React.ReactEventHandler<T>;
onTimeUpdate?: React.ReactEventHandler<T>;
onVolumeChange?: React.ReactEventHandler<T>;
onWaiting?: React.ReactEventHandler<T>;
// 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<T>;
onDoubleClick?: React.MouseEventHandler<T>;
onDrag?: React.DragEventHandler<T>;
onDragEnd?: React.DragEventHandler<T>;
onDragEnter?: React.DragEventHandler<T>;
onDragExit?: React.DragEventHandler<T>;
onDragLeave?: React.DragEventHandler<T>;
onDragOver?: React.DragEventHandler<T>;
onDragStart?: React.DragEventHandler<T>;
onDrop?: React.DragEventHandler<T>;
onMouseDown?: React.MouseEventHandler<T>;
onMouseEnter?: React.MouseEventHandler<T>;
onMouseLeave?: React.MouseEventHandler<T>;
onMouseMove?: React.MouseEventHandler<T>;
onMouseOut?: React.MouseEventHandler<T>;
onMouseOver?: React.MouseEventHandler<T>;
onMouseUp?: React.MouseEventHandler<T>;
// Selection Events
onSelect?: React.ReactEventHandler;
onSelect?: React.ReactEventHandler<T>;
// Touch Events
onTouchCancel?: React.TouchEventHandler;
onTouchEnd?: React.TouchEventHandler;
onTouchMove?: React.TouchEventHandler;
onTouchStart?: React.TouchEventHandler;
onTouchCancel?: React.TouchEventHandler<T>;
onTouchEnd?: React.TouchEventHandler<T>;
onTouchMove?: React.TouchEventHandler<T>;
onTouchStart?: React.TouchEventHandler<T>;
// UI Events
onScroll?: React.UIEventHandler;
onScroll?: React.UIEventHandler<T>;
// Wheel Events
onWheel?: React.WheelEventHandler;
onWheel?: React.WheelEventHandler<T>;
}
interface BadgeProps extends __MDLClassProps {
text: string | number;
className ?: string;
@@ -275,8 +275,8 @@ declare namespace __ReactMDL {
overlap ?: boolean;
}
class Badge extends __MDLComponent<BadgeProps> {}
interface ButtonProps extends __MDLOtherProps, RippleComponent, CustomRenderedComponent {
accent ?: boolean;
colored ?: boolean;
@@ -295,8 +295,8 @@ declare namespace __ReactMDL {
class Button extends __MDLComponent<StandardButtonProps> {}
class FABButton extends __MDLComponent<FABButtonProps> {}
class IconButton extends __MDLComponent<IconButtonProps> {}
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<CheckboxProps> {}
interface UndecoratedTableProps extends __MDLClassProps, MDLHTMLAttributes, React.DOMAttributes, ShadowedComponent {
interface UndecoratedTableProps extends __MDLClassProps, MDLHTMLAttributes, React.DOMAttributes<UndecoratedTable>, ShadowedComponent {
rows: Array<any>;
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<TableHeader> {
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<TableHeader>, 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<TableHeaderProps> {}
class UndecoratedTable extends __MDLComponent<UndecoratedTableProps> {}
class DataTable extends Table {}
interface DialogProps extends __MDLOtherProps {
open ?: boolean;
}
@@ -358,8 +358,8 @@ declare namespace __ReactMDL {
class DialogActions extends __MDLComponent<DialogActionsProps> {}
class DialogTitle extends __MDLComponent<DialogTitleProps> {}
class DialogContent extends __MDLBasicComponent {}
interface GridProps extends __MDLOtherProps, CustomRenderedComponent, ShadowedComponent {
noSpacing ?: boolean;
}
@@ -374,22 +374,22 @@ declare namespace __ReactMDL {
}
class Grid extends __MDLComponent<GridProps> {}
class Cell extends __MDLComponent<CellProps> {}
interface IconProps extends __MDLOtherProps {
name : string;
}
class Icon extends __MDLComponent<IconProps> {}
interface IconToggleProps extends __MDLOtherProps, RippleComponent {
name : string;
checked ?: boolean;
disabled ?: boolean;
}
class IconToggle extends __MDLComponent<IconToggleProps> {}
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<Header>;
}
interface LayoutProps extends __MDLOtherProps {
fixedDrawer ?: boolean;
@@ -423,33 +423,33 @@ declare namespace __ReactMDL {
class Layout extends __MDLComponent<LayoutProps> {}
class Navigation extends __MDLComponent<NavigationProps> {}
class Spacer extends __MDLBasicComponent {}
interface FooterProps extends MDLHTMLAttributes, React.DOMAttributes {
interface FooterProps extends MDLHTMLAttributes, React.DOMAttributes<Footer> {
size ?: string;
title ?: string;
}
interface FooterDropDownSectionProps extends MDLHTMLAttributes, React.DOMAttributes {
interface FooterDropDownSectionProps extends MDLHTMLAttributes, React.DOMAttributes<FooterDropDownSection> {
size ?: string;
title : React.ReactNode;
}
interface FooterLinkListProps extends MDLHTMLAttributes, React.DOMAttributes {
interface FooterLinkListProps extends MDLHTMLAttributes, React.DOMAttributes<FooterLinkList> {
size ?: string;
title ?: string;
}
interface FooterSectionProps extends MDLHTMLAttributes, React.DOMAttributes {
interface FooterSectionProps extends MDLHTMLAttributes, React.DOMAttributes<FooterSection> {
size ?: string;
type ?: string;
logo ?: React.ReactNode;
title ?: string;
}
class Footer extends __MDLComponent<FooterProps> {}
class FooterDropDownSection extends __MDLComponent<FooterDropDownSectionProps> {}
class FooterLinkList extends __MDLComponent<FooterLinkListProps> {}
class FooterSection extends __MDLComponent<FooterSectionProps> {}
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<ListItemContent> {
avatar ?: string | JSX.Element;
icon ?: string | JSX.Element;
subtitle ?: React.ReactNode;
@@ -467,8 +467,8 @@ declare namespace __ReactMDL {
class ListItem extends __MDLComponent<ListItemProps> {}
class ListItemAction extends __MDLComponent<ListItemActionProps> {}
class ListItemContent extends __MDLComponent<ListItemContentProps> {}
interface MenuProps extends __MDLOtherProps, RippleComponent {
target : string;
align ?: string;
@@ -476,99 +476,99 @@ declare namespace __ReactMDL {
}
class Menu extends __MDLComponent<MenuProps> {}
class MenuItem extends __MDLBasicComponent {}
interface ProgressBarProps extends __MDLOtherProps {
buffer ?: number;
indeterminate ?: boolean;
progress ?: number;
}
class ProgressBar extends __MDLComponent<ProgressBarProps> {}
interface RadioProps extends MDLHTMLAttributes, React.DOMAttributes, RippleComponent {
interface RadioProps extends MDLHTMLAttributes, React.DOMAttributes<Radio>, RippleComponent {
value : string | number;
checked ?: boolean;
disabled ?: boolean;
name ?: string;
onChange ?: React.FormEventHandler;
onChange ?: React.FormEventHandler<Radio>;
label ?: string;
}
interface RadioGroupProps extends MDLHTMLAttributes, React.DOMAttributes {
interface RadioGroupProps extends MDLHTMLAttributes, React.DOMAttributes<RadioGroup> {
name : string;
value : string | number;
childContainer ?: string;
container ?: string;
onChange ?: React.FormEventHandler;
onChange ?: React.FormEventHandler<RadioGroup>;
label ?: string;
}
class Radio extends __MDLComponent<RadioProps> {}
class RadioGroup extends __MDLComponent<RadioGroupProps> {}
interface SliderProps extends MDLHTMLAttributes, React.DOMAttributes {
interface SliderProps extends MDLHTMLAttributes, React.DOMAttributes<Slider> {
max : number;
min : number;
onChange ?: React.FormEventHandler;
onChange ?: React.FormEventHandler<Slider>;
value ?: number;
}
class Slider extends __MDLComponent<SliderProps> {}
interface SnackbarProps extends __MDLOtherProps {
active : boolean;
onTimeout : () => any;
action ?: string;
onActionClick ?: React.MouseEventHandler;
onActionClick ?: React.MouseEventHandler<Snackbar>;
timeout ?: number;
}
class Snackbar extends __MDLComponent<SnackbarProps> {}
interface SpinnerProps extends __MDLOtherProps {
singleColor ?: boolean;
}
class Spinner extends __MDLComponent<SpinnerProps> {}
interface SwitchProps extends __MDLOtherProps, RippleComponent {
checked ?: boolean;
disabled ?: boolean;
onChange ?: React.FormEventHandler;
onChange ?: React.FormEventHandler<Switch>;
}
class Switch extends __MDLComponent<SwitchProps> {}
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<TabBar> {
cssPrefix : string;
activeTab ?: number;
onChange ?: (tabId : number) => any;
name ?: string;
title ?: string;
onClick ?: React.MouseEventHandler;
title ?: string;
onClick ?: React.MouseEventHandler<TabBar>;
}
interface TabsProps extends MDLHTMLAttributes, MDLDOMAttributes {
interface TabsProps extends MDLHTMLAttributes, MDLDOMAttributes<Tabs> {
activeTab ?: number;
onChange ?: (tabId : number) => any;
tabBarProps ?: TabBarProps;
name ?: string;
title ?: string;
onClick ?: React.MouseEventHandler;
title ?: string;
onClick ?: React.MouseEventHandler<Tabs>;
}
class Tab extends __MDLComponent<TabProps> {}
class TabBar extends __MDLComponent<TabBarProps> {}
class Tabs extends __MDLComponent<TabsProps> {}
interface TextfieldProps extends MDLHTMLAttributes, React.DOMAttributes {
interface TextfieldProps extends MDLHTMLAttributes, React.DOMAttributes<Textfield> {
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<Textfield>;
pattern ?: string;
required ?: boolean;
rows ?: number;
value ?: string | number;
name ?: string;
title ?: string;
}
class Textfield extends __MDLComponent<TextfieldProps> {}
interface TooltipProps extends MDLHTMLAttributes, React.DOMAttributes {
interface TooltipProps extends MDLHTMLAttributes, React.DOMAttributes<Tooltip> {
label : React.ReactNode;
large ?: boolean;
position ?: string;
name ?: string;
title ?: string;
}

View File

@@ -8,7 +8,7 @@ type Link = Link.Link;
export default Link;
declare namespace Link {
interface LinkProps extends React.HTMLAttributes, React.Props<Link> {
interface LinkProps extends React.HTMLAttributes<Link>, React.Props<Link> {
activeStyle?: React.CSSProperties;
activeClassName?: string;
onlyActiveOnIndex?: boolean;

View File

@@ -150,7 +150,7 @@ export interface ReactSelectProps extends React.Props<ReactSelect> {
* @default "No results found"
*/
noResultsText?: string;
onBlur?: React.FocusEventHandler;
onBlur?: React.FocusEventHandler<ReactSelect>;
/**
* whether to clear input on blur or not
* @default true
@@ -158,7 +158,7 @@ export interface ReactSelectProps extends React.Props<ReactSelect> {
onBlurResetsInput?: boolean;
onChange?: (newValue: Option | Option[]) => void;
onClose?: () => void;
onFocus?: React.FocusEventHandler;
onFocus?: React.FocusEventHandler<ReactSelect>;
onInputChange?: (inputValue: string) => void;
onOpen?: () => void;
onOptionLabelClick?: (value: string, event: Event) => void;

View File

@@ -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<React.Props<{}>, {}> {

View File

@@ -167,9 +167,9 @@ var classicFactory: React.ClassicFactory<Props> =
var classicFactoryElement: React.ClassicElement<Props> =
classicFactory(props);
var domFactory: React.DOMFactory<React.DOMAttributes, Element> =
var domFactory: React.DOMFactory<React.DOMAttributes<{}>, Element> =
React.createFactory("foo");
var domFactoryElement: React.DOMElement<React.DOMAttributes, Element> =
var domFactoryElement: React.DOMElement<React.DOMAttributes<{}>, Element> =
domFactory();
// React.createElement
@@ -304,7 +304,7 @@ var htmlAttr: React.HTMLProps<HTMLElement> = {
children: children,
className: "test-attr",
style: divStyle,
onClick: (event: React.MouseEvent) => {
onClick: (event: React.MouseEvent<{}>) => {
event.preventDefault();
event.stopPropagation();
},

16
redux-form/index.d.ts vendored
View File

@@ -15,7 +15,7 @@ export type FieldValue = any;
export type FormData = { [fieldName: string]: FieldValue };
export interface FieldProp {
export interface FieldProp<T> {
/**
* 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<T> | 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<T> | 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<T> {
/**
* The name of the currently active (with focus) field.
*/
@@ -171,7 +171,7 @@ export interface ReduxFormProps {
* props, e.g. <input type="text" {...field.name}/>. Each field Object has
* the following properties:
*/
fields?: { [field: string]: FieldProp };
fields?: { [field: string]: FieldProp<T> };
/**
* A function meant to be passed to <form onSubmit={handleSubmit}> 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<T>): void;
handleSubmit?(submit: (data: FormData, dispatch?: Dispatch)
=> Promise<any> | void): FormEventHandler;
=> Promise<any> | void): FormEventHandler<T>;
/**
* Initializes the form data to the given values. All dirty and pristine
@@ -418,7 +418,7 @@ export interface ReduxFormConfig {
* { field1: <String>, field2: <String> }.
* Defaults to (values, props) => ({}).
*/
validate?(values: FormData, props: { [fieldName: string]: FieldProp }): Object;
validate?(values: FormData, props: { [fieldName: string]: FieldProp<any> }): Object;
}
/**

View File

@@ -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<ReduxFormProps, void> {
class SimpleForm extends Component<ReduxFormProps<SimpleForm>, void> {
static propTypes = {
fields: PropTypes.object.isRequired,
handleSubmit: PropTypes.func.isRequired,
@@ -123,7 +123,7 @@ namespace SynchronousValidation {
return errors;
};
class SynchronousValidationForm extends Component<ReduxFormProps, any> {
class SynchronousValidationForm extends Component<ReduxFormProps<SynchronousValidationForm>, any> {
static propTypes = {
fields: PropTypes.object.isRequired,
handleSubmit: PropTypes.func.isRequired,
@@ -193,7 +193,7 @@ namespace SumbitValidation {
});
};
class SubmitValidationForm extends Component<ReduxFormProps, any> {
class SubmitValidationForm extends Component<ReduxFormProps<SubmitValidationForm>, 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<T> extends ReduxFormProps<T> {
load: Function;
}
class InitializingFromStateForm extends Component<Props, any> {
class InitializingFromStateForm extends Component<Props<InitializingFromStateForm>, any> {
static propTypes = {
fields: PropTypes.object.isRequired,
handleSubmit: PropTypes.func.isRequired,

View File

@@ -1,5 +1,5 @@
import restangular = require("restangular");
import * as angular from 'angularjs';
import * as angular from 'angular';
var myApp = angular.module('testModule');

View File

@@ -1,8 +1,8 @@
///<reference types="angularjs" />
///<reference types="knockout" />
///<reference types="knockout" />
///<reference types="jquery" />
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(); });

View File

@@ -14,6 +14,6 @@
},
"files": [
"index.d.ts",
"sharepoint-tests.ts"
"SharePoint-tests.ts"
]
}

View File

@@ -637,12 +637,12 @@ describe('Simple', function() {
Simple.mock(Simple, 'Promise', {
when: function <T>(value: T) {
let promise: MockPromise<T> = Object.create(mockPromise)
let promise: MockPromise<T> = <any>Object.create(mockPromise)
promise.resolveValue = value
return promise
},
reject: function <T>(value: T) {
let promise: MockPromise<T> = Object.create(mockPromise)
let promise: MockPromise<T> = <any>Object.create(mockPromise)
promise.rejectValue = value
return promise
}

View File

@@ -1,5 +1,5 @@
import * as ng from 'angular';
import uiGrid = require("ui-grid");
/// <reference types="angularjs" />
interface IMyEntity {
name: string;

View File

@@ -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) => {

View File

@@ -1,4 +1,4 @@
import * as angular from 'angularjs';
import * as angular from 'angular';
angular
.module('main', ['ui-select'])

5
webrtc/index.d.ts vendored
View File

@@ -1,2 +1,7 @@
// Type definitions for webrtc
// Project: https://webrtc.org/
// Definitions by: Toshiya Nakakura <https://github.com/nakakura>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="RTCPeerConnection.d.ts" />
/// <reference path="MediaStream.d.ts" />

2
xrm/index.d.ts vendored
View File

@@ -832,7 +832,7 @@ declare namespace Xrm
/**
* @param {EventContext} context The context.
*/
( context?: EventContext ): void;
( context: EventContext ): void;
}
/**