diff --git a/aws-sdk/aws-sdk.d.ts b/aws-sdk/aws-sdk.d.ts
index 94e13c93d2..7e6fdf282e 100644
--- a/aws-sdk/aws-sdk.d.ts
+++ b/aws-sdk/aws-sdk.d.ts
@@ -90,8 +90,8 @@ declare module "aws-sdk" {
export interface ClientConfigPartial extends Services {
credentials?: Credentials;
region?: string;
- accessKeyId: string;
- secretAccessKey: string;
+ accessKeyId?: string;
+ secretAccessKey?: string;
computeChecksums?: boolean;
convertResponseTypes?: boolean;
logger?: Logger;
diff --git a/chai-enzyme/chai-enzyme-tests.tsx b/chai-enzyme/chai-enzyme-tests.tsx
new file mode 100644
index 0000000000..f85320cee0
--- /dev/null
+++ b/chai-enzyme/chai-enzyme-tests.tsx
@@ -0,0 +1,45 @@
+///
+///
+///
+///
+
+import * as React from "react";
+import * as chaiEnzyme from "chai-enzyme";
+import { expect } from "chai";
+import { shallow } from "enzyme";
+
+const Test = () =>
;
+
+class Test2 extends React.Component<{}, {}> {
+ render() {
+ return ;
+ }
+}
+
+chai.use(chaiEnzyme());
+
+const wrapper = shallow();
+
+expect(wrapper).to.be.checked();
+expect(wrapper).to.have.className("test");
+expect(wrapper).to.have.descendants({ a: "b" });
+expect(wrapper).to.have.descendants(Test);
+expect(wrapper).to.have.exactly(1).descendants(Test2);
+expect(wrapper).to.have.descendants("div");
+expect(wrapper).to.be.disabled();
+expect(wrapper).to.be.blank();
+expect(wrapper).to.be.present();
+expect(wrapper).to.have.html("");
+expect(wrapper).to.have.id("test");
+expect(wrapper).to.have.ref("test");
+expect(wrapper).to.be.selected();
+expect(wrapper).to.have.tagName("div");
+expect(wrapper).to.have.text("");
+expect(wrapper).to.have.value("test");
+expect(wrapper).to.have.attr("test", "test");
+expect(wrapper).to.have.data("test", "Test");
+expect(wrapper).to.have.style("background", "green");
+expect(wrapper).to.have.state("test", "test");
+expect(wrapper).to.have.prop("test", 5);
+expect(wrapper).to.contain();
+expect(wrapper).to.match();
diff --git a/chai-enzyme/chai-enzyme.d.ts b/chai-enzyme/chai-enzyme.d.ts
new file mode 100644
index 0000000000..21e463dac5
--- /dev/null
+++ b/chai-enzyme/chai-enzyme.d.ts
@@ -0,0 +1,153 @@
+// Type definitions for chai-enzyme 0.5.0
+// Project: https://github.com/producthunt/chai-enzyme
+// Definitions by: Alexey Svetliakov
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+
+///
+///
+///
+
+declare namespace Chai {
+ type EnzymeSelector = string | __React.StatelessComponent | __React.ComponentClass | { [key: string]: any };
+
+ interface Match {
+ /**
+ * Assert that the wrapper matches given selector:
+ * @param selector
+ */
+ (selector: EnzymeSelector): Assertion;
+ }
+ interface Include {
+ /**
+ * Assert that the wrapper contains a given node:
+ * @param code
+ */
+ (selector: EnzymeSelector): Assertion;
+ }
+ interface Assertion {
+ /**
+ * Assert that the given wrapper is checked:
+ */
+ checked(): Assertion;
+
+ /**
+ * Assert that the wrapper has a given class:
+ * @param name
+ */
+ className(name: string): Assertion;
+
+ /**
+ * Assert that the wrapper contains a descendant matching the given selector:
+ * @param selector
+ */
+ descendants(selector?: EnzymeSelector): Assertion;
+
+ /**
+ * Assert that the wrapper contains an exact amount of descendants matching the given selector:
+ */
+ exactly(count?: number): Assertion;
+
+ /**
+ * Assert that the given wrapper is disabled:
+ */
+ disabled(): Assertion;
+
+ /**
+ * Assert that the given wrapper is empty:
+ */
+ blank(): Assertion;
+
+ /**
+ * Assert that the given wrapper exists:
+ */
+ present(): Assertion;
+
+ /**
+ * Assert that the wrapper has given html:
+ * @param str
+ */
+ html(str?: string): Assertion;
+
+ /**
+ * Assert that the wrapper has given ID attribute:
+ * @param str
+ */
+ id(str: string): Assertion;
+
+ /**
+ * Assert that the wrapper has a given ref
+ * @param key
+ */
+ ref(key: string): Assertion;
+
+ /**
+ * Assert that the given wrapper is selected:
+ */
+ selected(): Assertion;
+
+ /**
+ * Assert that the given wrapper has the tag name:
+ * @param str
+ */
+ tagName(str: string): Assertion;
+
+ /**
+ * Assert that the given wrapper has the supplied text:
+ * @param str
+ */
+ text(str?: string): Assertion;
+
+ /**
+ * Assert that the given wrapper has given value:
+ * @param str
+ */
+ value(str: string): Assertion;
+
+ /**
+ * Assert that the wrapper has given attribute [with value]:
+ * @param key
+ * @param val
+ */
+ attr(key: string, val?: string): Assertion;
+
+ /**
+ * Assert that the wrapper has a given data attribute [with value]:
+ * @param key
+ * @param val
+ */
+ data(key: string, val?: string): Assertion;
+
+ /**
+ * Assert that the wrapper has given style:
+ * @param key
+ * @param val
+ */
+ style(key: string, val?: string): Assertion;
+
+ /**
+ * Assert that the wrapper has given state [with value]:
+ * @param key
+ * @param val
+ */
+ state(key: string, val?: any): Assertion;
+
+ /**
+ * Assert that the wrapper has given prop [with value]:
+ * @param key
+ * @param val
+ */
+ prop(key: string, val?: any): Assertion;
+ }
+}
+
+declare module "chai-enzyme" {
+ import { ShallowWrapper, ReactWrapper, CheerioWrapper } from "enzyme";
+
+ type DebugWrapper = ShallowWrapper | CheerioWrapper | ReactWrapper;
+ function chaiEnzyMe(wrapper?: (debugWrapper: DebugWrapper) => string): (chai: any) => void;
+
+ module chaiEnzyMe {
+ }
+ export = chaiEnzyMe;
+}
diff --git a/crypto-js/crypto-js.d.ts b/crypto-js/crypto-js.d.ts
index 0ab6681dce..e58b9c9339 100644
--- a/crypto-js/crypto-js.d.ts
+++ b/crypto-js/crypto-js.d.ts
@@ -93,6 +93,7 @@ declare namespace CryptoJS {
Base64: Encoder;
};
mode: {
+ CBC: Mode;
CFB: Mode;
CTR: Mode;
CTRGladman: Mode;
diff --git a/elasticsearch/elasticsearch.d.ts b/elasticsearch/elasticsearch.d.ts
index 5b7ba8055c..d32b2a8845 100644
--- a/elasticsearch/elasticsearch.d.ts
+++ b/elasticsearch/elasticsearch.d.ts
@@ -38,6 +38,8 @@ declare module Elasticsearch {
create(params: IndicesCreateParams): PromiseLike;
exists(params: IndicesIndexExitsParams, callback: (error: any, response: any, status: any) => void): void;
exists(params: IndicesIndexExitsParams): PromiseLike;
+ existsType(params: IndicesIndexExitsParams & {type: string}, callback: (error: any, response: any, status: any) => void): void;
+ existsType(params: IndicesIndexExitsParams & {type: string}): PromiseLike;
get(params: IndicesGetParams, callback: (error: any, response: any, status: any) => void): void;
get(params: IndicesGetParams): PromiseLike;
getAlias(params: IndicesGetAliasParams, callback: (error: any, response: any, status: any) => void): void;
@@ -46,6 +48,8 @@ declare module Elasticsearch {
putAlias(params: IndicesPutAliasParams): PromiseLike;
putTemplate(params: IndicesPutTemplateParams, callback: (error: any, response: any) => void): void;
putTemplate(params: IndicesPutTemplateParams): PromiseLike;
+ putMapping(params: IndicesPutMappingParams, callback: (error: any, response: any) => void): void;
+ putMapping(params: IndicesPutMappingParams): PromiseLike;
refresh(params: IndicesRefreshParams, callback: (error: any, response: any) => void): void;
refresh(params: IndicesRefreshParams): PromiseLike;
}
@@ -125,10 +129,21 @@ declare module Elasticsearch {
body: string | any;
}
+ export interface IndicesPutMappingParams extends GenericParams {
+ timeout?: Date | number;
+ masterTimeout?: Date | number;
+ ignoreUnavailable?: boolean;
+ allowNoIndices?: boolean;
+ expandWildcards?: "open" | "closed" | "none" | "all";
+ updateAllTypes?: boolean;
+ index: string | string[] | boolean;
+ type: string;
+ }
+
export interface IndicesGetAliasParams extends GenericParams {
ignoreUnavailable?: boolean;
allowNoIndices?: boolean;
- expandWildcards?: string;
+ expandWildcards?: "open" | "closed" | "none" | "all";
local?: boolean;
index?: string | string[] | boolean;
name: string | string[] | boolean;
@@ -260,7 +275,7 @@ declare module Elasticsearch {
export interface SuggestParams extends GenericParams {
ignoreUnavailable?: boolean;
allowNoIndices?: boolean;
- expandWildcards?: string;
+ expandWildcards?: "open" | "closed" | "none" | "all";
preference?: string;
routing?: string;
source?: string;
diff --git a/match-media-mock/match-media-mock-tests.ts b/match-media-mock/match-media-mock-tests.ts
new file mode 100644
index 0000000000..613996f361
--- /dev/null
+++ b/match-media-mock/match-media-mock-tests.ts
@@ -0,0 +1,15 @@
+///
+
+import { create } from "match-media-mock";
+
+const matchMediaMock = create();
+matchMediaMock.setConfig({type: 'screen', width: 1200})
+
+matchMediaMock('(max-width: 991px)').matches // false
+matchMediaMock('(max-width: 1240px)').matches // true
+
+const mediaQueryList = matchMediaMock('(max-width: 991px)');
+const listener = (mql: MediaQueryList) => { };
+
+mediaQueryList.addListener(listener)
+mediaQueryList.removeListener(listener)
diff --git a/match-media-mock/match-media-mock.d.ts b/match-media-mock/match-media-mock.d.ts
new file mode 100644
index 0000000000..7e7161c8cb
--- /dev/null
+++ b/match-media-mock/match-media-mock.d.ts
@@ -0,0 +1,35 @@
+// Type definitions for match-media-mock 0.1.0
+// Project: https://github.com/azazdeaz/match-media-mock
+// Definitions by: Alexey Svetliakov
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare module "match-media-mock" {
+ /**
+ * Mock configuration options
+ */
+ interface ConfigOptions {
+ /**
+ * Screen type
+ */
+ type?: string;
+ /**
+ * Screen height
+ */
+ height?: number;
+ /**
+ * Screen width
+ */
+ width?: number;
+ }
+ interface MatchMediaMock {
+ /**
+ * Set configuration
+ */
+ setConfig(config: ConfigOptions): void;
+ /**
+ * Execute query based on provided configuration
+ */
+ (query: string): MediaQueryList;
+ }
+ export function create(): MatchMediaMock;
+}
diff --git a/microsoft-ajax/microsoft.ajax.d.ts b/microsoft-ajax/microsoft.ajax.d.ts
index 4853092a5c..6c6d34dc9d 100644
--- a/microsoft-ajax/microsoft.ajax.d.ts
+++ b/microsoft-ajax/microsoft.ajax.d.ts
@@ -257,14 +257,6 @@ interface ErrorConstructor {
//#endregion
}
-interface Error {
- /**
- * Updates the fileName and lineNumber properties of an Error instance to indicate where the error was thrown instead of where the error was created. Use this function if you are creating custom error types.
- */
- popStackFrame(): void;
-}
-
-
interface String {
diff --git a/qs/qs-tests.ts b/qs/qs-tests.ts
index 04be4f266b..10b5c90b17 100644
--- a/qs/qs-tests.ts
+++ b/qs/qs-tests.ts
@@ -1,9 +1,254 @@
///
+///
import qs = require('qs');
+import assert = require('assert');
qs.stringify({ a: 'b' });
qs.stringify({ a: 'b', c: 'd' }, { delimiter: '&' });
qs.parse('a=b');
qs.parse('a=b&c=d', { delimiter: '&' });
+
+() => {
+ var obj = qs.parse('a=c');
+ assert.deepEqual(obj, { a: 'c' });
+
+ var str = qs.stringify(obj);
+ assert.equal(str, 'a=c');
+}
+
+() => {
+ var plainObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true });
+ assert.deepEqual(plainObject, { a: { hasOwnProperty: 'b' } });
+}
+
+() => {
+ var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true });
+ assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } });
+}
+
+() => {
+ assert.deepEqual(qs.parse('a%5Bb%5D=c'), {
+ a: { b: 'c' }
+ });
+}
+
+() => {
+ assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), {
+ foo: {
+ bar: {
+ baz: 'foobarbaz'
+ }
+ }
+ });
+}
+
+() => {
+ var expected = {
+ a: {
+ b: {
+ c: {
+ d: {
+ e: {
+ f: {
+ '[g][h][i]': 'j'
+ }
+ }
+ }
+ }
+ }
+ }
+ };
+ var string = 'a[b][c][d][e][f][g][h][i]=j';
+ assert.deepEqual(qs.parse(string), expected);
+}
+
+() => {
+ var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });
+ assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } });
+}
+
+() => {
+ var limited = qs.parse('a=b&c=d', { parameterLimit: 1 });
+ assert.deepEqual(limited, { a: 'b' });
+}
+
+() => {
+ var delimited = qs.parse('a=b;c=d', { delimiter: ';' });
+ assert.deepEqual(delimited, { a: 'b', c: 'd' });
+}
+
+() => {
+ var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });
+ assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' });
+}
+
+() => {
+ var withDots = qs.parse('a.b=c', { allowDots: true });
+ assert.deepEqual(withDots, { a: { b: 'c' } });
+}
+
+() => {
+ var withArray = qs.parse('a[]=b&a[]=c');
+ assert.deepEqual(withArray, { a: ['b', 'c'] });
+}
+
+() => {
+ var withIndexes = qs.parse('a[1]=c&a[0]=b');
+ assert.deepEqual(withIndexes, { a: ['b', 'c'] });
+}
+
+() => {
+ var noSparse = qs.parse('a[1]=b&a[15]=c');
+ assert.deepEqual(noSparse, { a: ['b', 'c'] });
+}
+
+() => {
+ var withEmptyString = qs.parse('a[]=&a[]=b');
+ assert.deepEqual(withEmptyString, { a: ['', 'b'] });
+
+ var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c');
+ assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] });
+}
+
+() => {
+ var withMaxIndex = qs.parse('a[100]=b');
+ assert.deepEqual(withMaxIndex, { a: { '100': 'b' } });
+}
+
+() => {
+ var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 });
+ assert.deepEqual(withArrayLimit, { a: { '1': 'b' } });
+}
+
+() => {
+ var noParsingArrays = qs.parse('a[]=b', { parseArrays: false });
+ assert.deepEqual(noParsingArrays, { a: { '0': 'b' } });
+}
+
+() => {
+ var mixedNotation = qs.parse('a[0]=b&a[b]=c');
+ assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } });
+}
+
+() => {
+ var arraysOfObjects = qs.parse('a[][b]=c');
+ assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] });
+}
+
+() => {
+ assert.equal(qs.stringify({ a: 'b' }), 'a=b');
+ assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');
+}
+
+() => {
+ var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false });
+ assert.equal(unencoded, 'a[b]=c');
+}
+
+() => {
+ var encoded = qs.stringify({ a: { b: 'c' } }, {
+ encoder: function (str) {
+ // Passed in values `a`, `b`, `c`
+ return // Return encoded string
+ }
+ })
+}
+
+() => {
+ var decoded = qs.parse('x=z', {
+ decoder: function (str) {
+ // Passed in values `x`, `z`
+ return // Return decoded string
+ }
+ })
+}
+
+() => {
+ qs.stringify({ a: ['b', 'c', 'd'] });
+ // 'a[0]=b&a[1]=c&a[2]=d'
+}
+
+() => {
+ qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });
+ // 'a=b&a=c&a=d'
+}
+
+() => {
+ qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })
+ // 'a[0]=b&a[1]=c'
+ qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })
+ // 'a[]=b&a[]=c'
+ qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })
+ // 'a=b&a=c'
+}
+
+() => {
+ assert.equal(qs.stringify({ a: '' }), 'a=');
+}
+
+() => {
+ assert.equal(qs.stringify({ a: null, b: undefined }), 'a=');
+}
+
+() => {
+ assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d');
+}
+
+() => {
+ qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: function (prefix, value) {
+ if (prefix == 'b') {
+ // Return an `undefined` value to omit a property.
+ return;
+ }
+ if (prefix == 'e[f]') {
+ return value.getTime();
+ }
+ if (prefix == 'e[g][0]') {
+ return value * 2;
+ }
+ return value;
+ } });
+ // 'a=b&c=d&e[f]=123&e[g][0]=4'
+ qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] });
+ // 'a=b&e=f'
+ qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] });
+}
+
+() => {
+ var withNull = qs.stringify({ a: null, b: '' });
+ assert.equal(withNull, 'a=&b=');
+}
+
+() => {
+ var equalsInsensitive = qs.parse('a&b=');
+ assert.deepEqual(equalsInsensitive, { a: '', b: '' });
+}
+
+() => {
+ var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true });
+ assert.equal(strictNull, 'a&b=');
+}
+
+() => {
+ var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true });
+ assert.deepEqual(parsedStrictNull, { a: null, b: '' });
+}
+
+() => {
+ var nullsSkipped = qs.stringify({ a: 'b', c: null }, { skipNulls: true });
+ assert.equal(nullsSkipped, 'a=b');
+}
+
+() => {
+ var encoder = () => {};
+ var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder });
+ assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I');
+}
+
+() => {
+ var decoder = () => {};
+ var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder });
+ assert.deepEqual(obj, { a: 'こんにちは!' });
+}
diff --git a/qs/qs.d.ts b/qs/qs.d.ts
index af18fcdb4d..53519ef534 100644
--- a/qs/qs.d.ts
+++ b/qs/qs.d.ts
@@ -1,6 +1,6 @@
-// Type definitions for qs
+// Type definitions for qs 6.2.0
// Project: https://github.com/hapijs/qs
-// Definitions by: Roman Korneev
+// Definitions by: Roman Korneev , Leon Yu
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace QueryString {
@@ -9,14 +9,16 @@ declare namespace QueryString {
strictNullHandling?: boolean;
skipNulls?: boolean;
encode?: boolean;
- filter?: any;
- arrayFormat?: any;
- indices?: string;
+ encoder?: (str: string) => any;
+ filter?: Array | ((prefix: string, value: any) => any);
+ arrayFormat?: 'indices' | 'brackets' | 'repeat';
+ indices?: boolean;
}
interface IParseOptions {
- delimiter?: string;
+ delimiter?: string | RegExp;
depth?: number;
+ decoder?: (str: string) => any;
arrayLimit?: number;
parseArrays?: boolean;
allowDots?: boolean;
diff --git a/rc-tooltip/rc-tooltip-tests.tsx b/rc-tooltip/rc-tooltip-tests.tsx
index 33816d7949..d1f4db339a 100644
--- a/rc-tooltip/rc-tooltip-tests.tsx
+++ b/rc-tooltip/rc-tooltip-tests.tsx
@@ -35,3 +35,14 @@ ReactDOM.render(
,
document.querySelector('.another-app')
);
+
+ReactDOM.render(
+ tooltip}
+ >
+ hover
+ ,
+ document.querySelector('.another-app')
+);
diff --git a/rc-tooltip/rc-tooltip.d.ts b/rc-tooltip/rc-tooltip.d.ts
index 317b8d1fc4..a2a5c67314 100644
--- a/rc-tooltip/rc-tooltip.d.ts
+++ b/rc-tooltip/rc-tooltip.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for rc-tooltip v3.3.2
+// Type definitions for rc-tooltip v3.4.2
// Project: https://github.com/react-component/tooltip
// Definitions by: rhysd
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -27,7 +27,7 @@ declare namespace Tooltip {
placement?: Placement | Object;
align?: Object;
onPopupAlign?: (popupDomNode: Element, align: Object) => void;
- overlay: React.ReactElement;
+ overlay: React.ReactElement | (() => React.ReactElement);
arrowContent?: React.ReactNode;
getTooltipContainer?: () => Element;
destroyTooltipOnHide?: boolean;
diff --git a/react-measure/react-measure-tests.tsx b/react-measure/react-measure-tests.tsx
new file mode 100644
index 0000000000..9b1a8e2f91
--- /dev/null
+++ b/react-measure/react-measure-tests.tsx
@@ -0,0 +1,39 @@
+///
+///
+
+import * as React from "react";
+import * as Measure from "react-measure";
+
+class Test extends React.Component<{}, {}> {
+ render() {
+ return (
+
+ test
+
+ );
+ }
+
+ onMeasure(dimensions: Measure.Dimensions): void {
+ dimensions.width;
+ dimensions.height;
+ }
+}
+
+class Test2 extends React.Component<{}, {}> {
+ render() {
+ return (
+
+ {(dimensions: Measure.Dimensions) =>
+
+
Height: {dimensions.height}
+
+ }
+
+ );
+ }
+}
diff --git a/react-measure/react-measure.d.ts b/react-measure/react-measure.d.ts
new file mode 100644
index 0000000000..7e4a30c39b
--- /dev/null
+++ b/react-measure/react-measure.d.ts
@@ -0,0 +1,56 @@
+// Type definitions for react-measure 0.4.0
+// Project: https://github.com/souporserious/react-measure
+// Definitions by: Alexey Svetliakov
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+declare module "react-measure" {
+ import * as React from "react";
+
+ class Measure extends React.Component { }
+ namespace Measure {
+ type MeasurementType = "width" | "height" | "top" | "right" | "bottom" | "left";
+ interface Dimensions {
+ width?: number;
+ height?: number;
+ top?: number;
+ right?: number;
+ bottom?: number;
+ left?: number;
+ }
+
+ type MeasureChildren = React.ReactElement | { (dimension: Dimensions): React.ReactElement };
+
+ interface MeasureProps {
+ /**
+ * Tries to give the most accurate measure. Currently only works with height.
+ * Measures the content rather than the actual box of the element.
+ */
+ accurate?: boolean;
+ /**
+ * Provide a list of properties to fire a callback for.
+ */
+ whitelist?: MeasurementType[];
+ /**
+ * Like whitelist, but will not fire a callback for the specified properties.
+ */
+ blacklist?: MeasurementType[];
+ /**
+ * Determines whether or not a measurement should occur.
+ * @default true
+ */
+ shouldMeasure?: boolean;
+ /**
+ * Callback when the component has been mutated. Receives dimensions, mutations, and anything passed to shouldMeasure.
+ */
+ onMeasure?: (dimensions: Dimensions) => void;
+ /**
+ * Children, ordinary JSX element or function. Leaving it for reference here
+ */
+ children?: MeasureChildren;
+ }
+ }
+ export = Measure;
+
+}
diff --git a/react-motion-slider/react-motion-slider-tests.tsx b/react-motion-slider/react-motion-slider-tests.tsx
new file mode 100644
index 0000000000..b51f57fc3b
--- /dev/null
+++ b/react-motion-slider/react-motion-slider-tests.tsx
@@ -0,0 +1,28 @@
+///
+///
+
+import * as React from "react";
+import Slider from "react-motion-slider";
+
+class Test extends React.Component<{}, {}> {
+ protected slider: Slider;
+
+ public render() {
+ return (
+
+
this.slider = ref}
+ >
+
+
+
+
+ );
+ }
+
+ protected onMouseEnter(): void {
+ this.slider.next();
+ }
+}
diff --git a/react-motion-slider/react-motion-slider.d.ts b/react-motion-slider/react-motion-slider.d.ts
new file mode 100644
index 0000000000..939500150d
--- /dev/null
+++ b/react-motion-slider/react-motion-slider.d.ts
@@ -0,0 +1,85 @@
+// Type definitions for react-motion-slider 0.4.1
+// Project: https://github.com/souporserious/react-motion-slider
+// Definitions by: Alexey Svetliakov
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+///
+
+
+declare module "react-motion-slider" {
+ import * as React from "react";
+ import { OpaqueConfig } from "react-motion";
+
+ export interface SliderProps {
+ /**
+ * Move to a slide by its key.
+ */
+ currentKey?: string | number;
+ /**
+ * Move to a slide by its index.
+ */
+ currentIndex?: number;
+ /**
+ * The amount of slides shown in view
+ * @default 1
+ */
+ slidesToShow?: number;
+ /**
+ * The amount of slides to move upon using prev and next methods.
+ * @default 1
+ */
+ slidesToMove?: number;
+ /**
+ * Animates the wrapper height to fit the current slide.
+ * @default false
+ */
+ autoHeight?: boolean;
+ /**
+ * Offsets the slide to align either left, center, or right.
+ * @default "left"
+ */
+ align?: "left" | "center" | "right";
+ /**
+ * Enable touch and/or mouse dragging
+ * @default true
+ */
+ swipe?: boolean | "touch" | "mouse";
+ /**
+ * The amount the user must swipe to advance slides. (sliderWidth * swipeThreshold)
+ * @default 0.5
+ */
+ swipeThreshold?: number;
+ /**
+ * The amount of time in milliseconds that determines if a swipe was a flick or not.
+ */
+ flickTimeout?: number;
+ /**
+ * Accepts a React Motion spring config.
+ */
+ springConfig?: OpaqueConfig;
+ /**
+ * Prop callback fired before slide change.
+ * @param currentIndex
+ * @param nextIndex
+ */
+ beforeSlide?: (currentIndex: number, nextIndex: number) => void;
+ /**
+ * Prop callback fired after slide change.
+ * @param currentIndex
+ */
+ afterSlide?: (currentIndex: number) => void;
+ }
+
+ export default class Slider extends React.Component {
+ /**
+ * Moves to next slide
+ */
+ public next(): void;
+
+ /**
+ * Move to previous slide
+ */
+ public prev(): void;
+ }
+}
diff --git a/react-redux/react-redux-2.1.2-tests.tsx b/react-redux/react-redux-2.1.2-tests.tsx
index ab32609c01..7ead497767 100644
--- a/react-redux/react-redux-2.1.2-tests.tsx
+++ b/react-redux/react-redux-2.1.2-tests.tsx
@@ -277,4 +277,3 @@ class SomeClass extends Component {
public bar: number;
}
let bar: number = new (connect()(SomeClass))("foo").bar;
-
diff --git a/react-responsive/react-responsive-tests.tsx b/react-responsive/react-responsive-tests.tsx
new file mode 100644
index 0000000000..3c1d25c62c
--- /dev/null
+++ b/react-responsive/react-responsive-tests.tsx
@@ -0,0 +1,45 @@
+///
+///
+
+import * as React from "react";
+import * as MediaQuery from "react-responsive";
+
+class Test extends React.Component<{}, {}> {
+ render() {
+ return (
+
+
Device Test!
+
+ You are a desktop or laptop
+
+ You also have a huge screen
+
+
+ You are sized like a tablet or mobile phone though
+
+
+
+ You are a tablet or mobile phone
+
+
+ You are portrait
+
+
+ You are landscape
+
+
+ You are retina
+
+
+ You are a desktop or laptop
+
+ You also have a huge screen
+
+
+ You are sized like a tablet or mobile phone though
+
+
+
+ )
+ }
+}
diff --git a/react-responsive/react-responsive.d.ts b/react-responsive/react-responsive.d.ts
new file mode 100644
index 0000000000..2c92b38413
--- /dev/null
+++ b/react-responsive/react-responsive.d.ts
@@ -0,0 +1,66 @@
+// Type definitions for react-responsive 1.1.3
+// Project: https://github.com/contra/react-responsive
+// Definitions by: Alexey Svetliakov
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+declare module "react-responsive" {
+ import * as React from "react";
+
+ namespace MediaQuery {
+ export interface MediaQueryProps {
+ query?: string;
+ // matchers
+ orientation?: "portrait" | "landscape";
+ scan?: "progressive" | "interlace";
+ aspectRatio?: string;
+ deviceAspectRatio?: string;
+ height?: number | string;
+ deviceHeight?: number | string;
+ width?: number | string;
+ deviceWidth?: number | string;
+ color?: boolean;
+ colorIndex?: boolean;
+ monochrome?: boolean;
+ resolution?: number | string;
+ // types
+ minAspectRatio?: string;
+ maxAspectRatio?: string;
+ minDeviceAspectRatio?: string;
+ maxDeviceAspectRatio?: string;
+ minHeight?: number | string;
+ maxHeight?: number | string;
+ minDeviceHeight?: number | string;
+ maxDeviceHeight?: number | string;
+ minDeviceWidth?: number | string;
+ maxDeviceWidth?: number | string;
+ minWidth?: number | string;
+ maxWidth?: number | string;
+ minColor?: number;
+ maxColor?: number;
+ minColorIndex?: number;
+ maxColorIndex?: number;
+ minMonochrome?: number;
+ maxMonochrome?: number;
+ minResolution?: number | string;
+ maxResolution?: number | string;
+ // types
+ all?: boolean;
+ grid?: boolean;
+ aural?: boolean;
+ braille?: boolean;
+ handheld?: boolean;
+ print?: boolean;
+ projection?: boolean;
+ screen?: boolean;
+ tty?: boolean;
+ tv?: boolean;
+ embossed?: boolean;
+ }
+ }
+
+ class MediaQuery extends React.Component { }
+ export = MediaQuery;
+
+}
diff --git a/react-textarea-autosize/react-textarea-autosize-tests.tsx b/react-textarea-autosize/react-textarea-autosize-tests.tsx
new file mode 100644
index 0000000000..d87117fa44
--- /dev/null
+++ b/react-textarea-autosize/react-textarea-autosize-tests.tsx
@@ -0,0 +1,17 @@
+///
+///
+
+import * as React from "react";
+import Textarea from "react-textarea-autosize";
+
+class Test extends React.Component<{}, {}> {
+ public render() {
+ return (
+
+ );
+ }
+}
diff --git a/react-textarea-autosize/react-textarea-autosize.d.ts b/react-textarea-autosize/react-textarea-autosize.d.ts
new file mode 100644
index 0000000000..6a4d290937
--- /dev/null
+++ b/react-textarea-autosize/react-textarea-autosize.d.ts
@@ -0,0 +1,58 @@
+// Type definitions for react-textarea-autosize 4.0.3
+// Project: https://github.com/andreypopp/react-textarea-autosize
+// Definitions by: Alexey Svetliakov
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+
+declare module "react-textarea-autosize" {
+ import * as React from "react";
+
+ /**
+ * properties
+ */
+ export interface TextareaAutosizeProps extends React.HTMLProps {
+ /**
+ * Current textarea value
+ */
+ value?: string;
+ /**
+ * Callback on value change
+ * @param event
+ */
+ onChange?: (event: React.FormEvent) => void;
+ /**
+ * Callback on height change
+ * @param height
+ */
+ onHeightChange?: (height: number) => void;
+ /**
+ * Try to cache DOM measurements performed by component so that we don't
+ * touch DOM when it's not needed.
+ *
+ * This optimization doesn't work if we dynamically style
+ * component.
+ * @default false
+ */
+ useCacheForDOMMeasurements?: boolean;
+ /**
+ * Minimal number of rows to show.
+ */
+ rows?: number;
+ /**
+ * Alias for `rows`.
+ */
+ minRows?: number;
+ /**
+ * Maximum number of rows to show.
+ */
+ maxRows?: number;
+ }
+
+ /**
+ *
+ */
+ export default class TextareaAutosize extends React.Component { }
+
+}
diff --git a/react-user-tour/react-user-tour-tests.tsx b/react-user-tour/react-user-tour-tests.tsx
new file mode 100644
index 0000000000..5cfe3f3dab
--- /dev/null
+++ b/react-user-tour/react-user-tour-tests.tsx
@@ -0,0 +1,55 @@
+// Tests for type definitions for react-user-tour
+// Project: https://github.com/socialtables/react-user-tour
+// Definitions by: Carlo Cancellieri
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+///
+///
+
+import React = require('react');
+import ReactDOM = require('react-dom');
+
+import ReactUserTour from 'react-user-tour';
+
+interface State {
+ tourStep:number;
+ isTourActive:boolean;
+}
+
+class TestApp extends React.Component<{}, State> {
+
+ constructor(p:any){
+ super(p);
+
+ this.setState({
+ isTourActive:true,
+ tourStep:1
+ });
+ }
+
+ render() {
+
+ const Tour = this.setState({tourStep: step, isTourActive: true})}
+ onBack={(step:number) => this.setState({tourStep: step, isTourActive: true})}
+ onCancel={() => this.setState({tourStep: this.state.tourStep, isTourActive: false})}
+ steps={[
+ {
+ step: 1,
+ selector: '.MyClass',
+ title: React User Tour
,
+ body: Provide a simple guided tour around a website utilizing css selectors.
,
+ position: 'bottom'
+ }
+ ]}
+ />;
+
+ return
+ {Tour}
+
;
+ }
+}
+
+ReactDOM.render(React.createElement(TestApp, {}), document.getElementById('test-app'));
diff --git a/react-user-tour/react-user-tour-tests.tsx.tscparams b/react-user-tour/react-user-tour-tests.tsx.tscparams
new file mode 100644
index 0000000000..b238f4f2a8
--- /dev/null
+++ b/react-user-tour/react-user-tour-tests.tsx.tscparams
@@ -0,0 +1 @@
+--noImplicitAny --jsx react
diff --git a/react-user-tour/react-user-tour.d.ts b/react-user-tour/react-user-tour.d.ts
new file mode 100644
index 0000000000..1237977dd1
--- /dev/null
+++ b/react-user-tour/react-user-tour.d.ts
@@ -0,0 +1,133 @@
+// Type definitions for react-user-tour
+// Project: https://github.com/socialtables/react-user-tour
+// Definitions by: Carlo Cancellieri
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+declare module 'react-user-tour' {
+
+ // Import React
+ import { HTMLAttributes, ComponentClass } from 'react';
+
+ interface TourStep {
+ /**
+ Index number of the step in the tour
+ */
+ step: number;
+ /**
+ CSS selector to be passed to document.querySelector()
+ */
+ selector: string;
+ /**
+ a react element representing the header of the current step
+ */
+ title: string;
+ /**
+ a react element representing the main body message of the tour step
+ */
+ body: string;
+ /**
+ Optional properties horizontalOffset and verticalOffset values allow to move tooltip around pointed element.
+ */
+ horizontalOffset?: number;
+ /**
+ Optional properties horizontalOffset and verticalOffset values allow to move tooltip around pointed element.
+ */
+ verticalOffset?: number;
+ /**
+ Each step can also take an optional argument, position which will override the position of the tour component in relation to the selector that is determined by the application.
+ */
+ position?: 'left' | 'right' | 'top' | 'topLeft' | 'bottom' | 'bottomLeft';
+ }
+
+ interface TourProps extends HTMLAttributes {
+ /**
+ A boolean value representing whether or not the tour should currently be displayed
+ */
+ active: boolean;
+ /**
+ An integer representing the current active step of the tour
+ */
+ step: number;
+ /**
+ function that fires when user clicks the Next button.
+ Receives the next step integer as a callback.
+ For example, if current step is 1 and user clicks the Next button, onNext(2) will be called.
+ */
+ onNext: Function;
+ /**
+ function that fires when user clicks the Back button.
+ Receives the previous step integer as a callback.
+ For example, if current step is 2 and user clicks the Back button, onBack(1) will be called.
+ */
+ onBack: Function;
+ /**
+ function that fires when user clicks the X button or the Done Button.
+ */
+ onCancel: Function;
+ /**
+ An array of TourStep.
+ */
+ steps: TourStep[];
+ /**
+ Optional style object.
+ */
+ style?: any;
+ /**
+ Optional style object for buttons displayed on component.
+ */
+ buttonStyle?: any;
+ /**
+ Optional style object for the container div around the buttons.
+ */
+ buttonContainerStyle?: any;
+ /**
+ We provide an arrow that points to the selector, but you may optionally pass in your own React element in the place of the arrow provided.
+ */
+ arrow?: any;
+ /**
+ If you choose to use the provided arrow, you can set the pixel size here with an integer value.
+ */
+ arrowSize?: number;
+ /**
+ If you choose to use the provided arrow, you can set the color here by passing in a hex value.
+ */
+ arrowColor?: string;
+ /**
+ Text that will appear on the button that moves the tour forward.
+ Defaults to Next
+ */
+ nextButtonText?: string;
+ /**
+ Text that will appear on the button that moves the tour backwards.
+ Defaults to Back
+ */
+ backButtonText?: string;
+ /**
+ Text that will appear on the button that finishes the tour.
+ Defaults to Done
+ */
+ doneButtonText?: string;
+ /**
+ Text that will appear on the button that closes the tour.
+ Defaults to Close
+ */
+ closeButtonText?: string;
+ /**
+ Boolean to disable the showing of next/back/done buttons.
+ Set this to true if you want to insert your own buttons in the body.
+ */
+ hideButtons?: boolean;
+ /**
+ Boolean to disable the showing of the close text in the upper left of
+ the component. Set this to true if you want to insert your own close
+ functionality or if you would like to disable the ability for the user
+ to prematurely exit the tour.
+ */
+ hideClose?: boolean;
+ }
+
+ var ReactUserTour: ComponentClass;
+ export default ReactUserTour;
+}
diff --git a/redux-storage/redux-storage-tests.ts b/redux-storage/redux-storage-tests.ts
new file mode 100644
index 0000000000..bb38066d0a
--- /dev/null
+++ b/redux-storage/redux-storage-tests.ts
@@ -0,0 +1,31 @@
+///
+///
+
+import { Action, createStore, applyMiddleware } from "redux";
+import { reducer, createMiddleware, createLoader } from "redux-storage";
+import reduxStorageImmutableMerger from "redux-storage-merger-immutablejs";
+import filter from "redux-storage-decorator-filter";
+import createEngine from "redux-storage-engine-localstorage";
+
+interface TestState {
+ a: number;
+ b: string;
+}
+
+function rootReducer(state: TestState, action: Action): TestState {
+ return state;
+}
+
+const enhancedReducer = reducer(rootReducer, reduxStorageImmutableMerger);
+
+const storageEngine = createEngine("test");
+
+const initialStateLoader = createLoader(storageEngine);
+
+const storageMiddleware = createMiddleware(storageEngine, [], []);
+
+const store = applyMiddleware(storageMiddleware)(createStore)(enhancedReducer);
+
+initialStateLoader(store).then(() => {
+ // render app
+})
diff --git a/redux-storage/redux-storage.d.ts b/redux-storage/redux-storage.d.ts
new file mode 100644
index 0000000000..8debaf59d4
--- /dev/null
+++ b/redux-storage/redux-storage.d.ts
@@ -0,0 +1,104 @@
+// Type definitions for redux-storage 4.0.1
+// Project: https://github.com/michaelcontento/redux-storage
+// Definitions by: Alexey Svetliakov
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+declare module "redux-storage" {
+ import { Reducer, Store, Middleware } from "redux";
+
+ /**
+ * Action constants
+ */
+ export const LOAD: string;
+ export const SAVE: string;
+
+ /**
+ * Storage engine interface
+ */
+ export interface StorageEngine {
+ /**
+ * Load
+ */
+ load(): PromiseLike;
+ /**
+ * Save
+ * @param state
+ */
+ save(state: any): PromiseLike
+ }
+
+ export interface StateMerger {
+ (oldState: any, newState: any): any;
+ }
+
+ /**
+ * Storage reducer
+ * @param reducer
+ * @param merger
+ */
+ export function reducer(reducer: Reducer, merger?: StateMerger): Reducer;
+
+ /**
+ * Create storage middleware
+ * @param engine
+ * @param actionBlacklist
+ * @param actionWhitelist
+ */
+ export function createMiddleware(engine: StorageEngine, actionBlacklist?: string[], actionWhitelist?: string[]): Middleware;
+
+ /**
+ * Loader interface
+ */
+ interface Loader {
+ (store: Store): PromiseLike;
+ }
+
+ /**
+ * Create state loader
+ * @param engine
+ */
+ export function createLoader(engine: StorageEngine): Loader;
+
+}
+
+declare module "redux-storage-decorator-filter" {
+ import { StorageEngine } from "redux-storage";
+
+ interface WhitelistArg {
+ [key: number]: string | string[];
+ }
+
+ /**
+ * Filter decorator for redux-storage to only store a subset of the whole state tree.
+ * @param engine
+ * @param whitelist
+ * @example
+ * engine = filter(engine, [
+ * 'simple-key',
+ * ['nested', 'key'],
+ * ['another', 'very', 'nested', 'key']
+ * ]);
+ */
+ export default function(engine: StorageEngine, whitelist?: WhitelistArg): StorageEngine;
+}
+
+declare module "redux-storage-engine-localstorage" {
+ import { StorageEngine } from "redux-storage";
+
+ export interface LocalStorageEngine extends StorageEngine {}
+
+ /**
+ * Create local storage
+ * @param key localstorage key
+ */
+ export default function createEngine(key: string): LocalStorageEngine;
+}
+
+declare module "redux-storage-merger-immutablejs" {
+ import { StateMerger } from "redux-storage";
+
+ const immutableStateMerger: StateMerger;
+ export default immutableStateMerger;
+}
diff --git a/redux-ui/redux-ui-tests.ts b/redux-ui/redux-ui-tests.ts
new file mode 100644
index 0000000000..5576a19b9d
--- /dev/null
+++ b/redux-ui/redux-ui-tests.ts
@@ -0,0 +1,35 @@
+///
+///
+
+import * as React from 'react'
+import ui, { ReduxUIProps, reducer } from 'redux-ui'
+
+type UIShape = {
+ s: string;
+};
+
+@ui({
+ key: 'Root',
+ persist: true,
+ state: {
+ s: '',
+ },
+ mergeProps: () => ({}),
+ options: {}
+})
+class Root extends React.Component, {}> {
+ componentWillMount() {
+ console.info(
+ this.props.ui.s,
+ this.props.uiKey
+ );
+ this.props.updateUI('s', 'a');
+ this.props.updateUI({s: 'a'});
+ this.props.resetUI();
+ }
+}
+
+Redux.combineReducers({
+ ui: reducer,
+});
+
diff --git a/redux-ui/redux-ui.d.ts b/redux-ui/redux-ui.d.ts
new file mode 100644
index 0000000000..7ba61a3f8a
--- /dev/null
+++ b/redux-ui/redux-ui.d.ts
@@ -0,0 +1,55 @@
+// Type definitions for redux-ui 0.0.15
+// Project: https://github.com/tonyhb/redux-ui
+// Definitions by: Andy Shu Xin
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+declare module "redux-ui" {
+
+ import * as Redux from 'redux';
+
+ export interface uiParams {
+ // optional key which is used to determine the UI path in which state will
+ // be stored. if omitted this is randomly generated.
+ key?: string;
+
+ // optional persist, defaults to false. if set to true persist will keep UI
+ // state for this component after it unmounts. if set to false the UI state
+ // will be deleted and recreated when the component remounts
+ persist?: boolean;
+
+ // **required**: UI state for the component
+ state: UIStateShape;
+
+ // optional mergeProps passed to react-redux' @connect
+ mergeProps?: (stateProps: any, dispatchProps: any, ownProps: any) => any;
+
+ // optional `options` passed to react-redux @connect
+ options?: {
+ pure?: boolean;
+ withRef?: boolean;
+ };
+ }
+
+ export interface ReduxUIProps {
+ // The key passed to the decorator from the decorator
+ // (eg. 'some-decorator' with `@ui('some-decorator')`
+ uiKey: string;
+
+ // The UI state for the component's `uiKey`
+ ui: UIStateShape;
+
+ // A function accepting either a name/value pair or object which updates
+ // state within `uiKey`
+ updateUI(obj: UIStateShape): void;
+ updateUI(key: string, value: any): void;
+
+ // A function which resets the state within `uiKey` to its default
+ resetUI(): void;
+ }
+
+ export const reducer: Redux.Reducer;
+
+ export default function ui(params: uiParams): (component: T) => T;
+}