From 19b33b90d72394225f9f1d1dcbef2a68a550fa31 Mon Sep 17 00:00:00 2001 From: huhuanming Date: Fri, 30 Jun 2017 01:23:43 +0800 Subject: [PATCH 01/34] add react-native-touch-id --- types/react-native-touch-id/index.d.ts | 18 +++++++++++++++ .../react-native-touch-id-tests.ts | 5 +++++ types/react-native-touch-id/tsconfig.json | 22 +++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 types/react-native-touch-id/index.d.ts create mode 100644 types/react-native-touch-id/react-native-touch-id-tests.ts create mode 100644 types/react-native-touch-id/tsconfig.json diff --git a/types/react-native-touch-id/index.d.ts b/types/react-native-touch-id/index.d.ts new file mode 100644 index 0000000000..04f7fbbfde --- /dev/null +++ b/types/react-native-touch-id/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for react-native-touch-id 3.0.0 +// Project: https://github.com/naoufal/react-native-touch-id +// Definitions by: huhuanming +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'react-native-touch-id' { + + class TouchIDError { + name: 'LAErrorAuthenticationFailed' | 'LAErrorUserCancel' | 'LAErrorUserFallback' | 'LAErrorSystemCancel' + | 'LAErrorPasscodeNotSet' | 'LAErrorTouchIDNotAvailable' | 'LAErrorTouchIDNotEnrolled' + | 'LAErrorTouchIDNotEnrolled' | 'RCTTouchIDUnknownError' | 'RCTTouchIDNotSupported'; + message: string; + details: any; + } + + export const isSupported: () => Promise; + export const authenticate: (reason: string) => Promise; +} diff --git a/types/react-native-touch-id/react-native-touch-id-tests.ts b/types/react-native-touch-id/react-native-touch-id-tests.ts new file mode 100644 index 0000000000..009f1c347f --- /dev/null +++ b/types/react-native-touch-id/react-native-touch-id-tests.ts @@ -0,0 +1,5 @@ +import { isSupported, authenticate } from 'react-native-touch-id'; + +isSupported().then(() => {}).catch(() => {}); + +authenticate('reason').then(() => {}).catch(() => {}); diff --git a/types/react-native-touch-id/tsconfig.json b/types/react-native-touch-id/tsconfig.json new file mode 100644 index 0000000000..0a1cd74c96 --- /dev/null +++ b/types/react-native-touch-id/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-native-touch-id-tests.ts" + ] +} From aef3396e6946edd5f1cde28e25f098edcc636cf8 Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Fri, 30 Jun 2017 00:40:56 -0400 Subject: [PATCH 02/34] [react-navigation] Added TabRouter --- types/react-navigation/index.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 1d07494104..4e321e771c 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -5,6 +5,7 @@ // fangpenlin // abrahambotros // petejkim +// Kyle Roach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -633,6 +634,19 @@ export class Transitioner extends React.Component< TransitionerState > { } + +/** + * Tab Router + * + * @desc from react-navigation/src/routers/TabRouter.js + * @param routeConfigs + * @param config + */ +export function TabRouter( + routeConfigs: NavigationRouteConfigMap, + config: NavigationTabRouterConfig +): NavigationRouter + /** * END MANUAL DEFINITIONS OUTSIDE OF TYPEDEFINITION.JS */ From 8d56bf9bd9211f7869b98f77f91c0738db397bb5 Mon Sep 17 00:00:00 2001 From: e020873 Date: Fri, 30 Jun 2017 14:42:48 +0200 Subject: [PATCH 03/34] [send] fix for typescript 2.4.1 --- types/send/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/send/index.d.ts b/types/send/index.d.ts index 4b738fa011..6c38861c4f 100644 --- a/types/send/index.d.ts +++ b/types/send/index.d.ts @@ -197,7 +197,7 @@ declare namespace send { /** * Pipe to `res`. */ - pipe(res: stream.Writable): stream.Writable; + pipe(res: T): T; /** * Transfer `path`. From 0de24ae1b49f9e9d7ccc3143de2abc69e3b04065 Mon Sep 17 00:00:00 2001 From: Arturs Vonda Date: Fri, 30 Jun 2017 20:32:01 +0300 Subject: [PATCH 04/34] Add new options introduced in qs 2.5 --- types/qs/index.d.ts | 5 ++++- types/qs/qs-tests.ts | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/types/qs/index.d.ts b/types/qs/index.d.ts index d3574383a5..2ecbed14be 100644 --- a/types/qs/index.d.ts +++ b/types/qs/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for qs 6.4.0 +// Type definitions for qs 6.5.0 // Project: https://github.com/ljharb/qs // Definitions by: Roman Korneev // Leon Yu // Belinda Teh // Melvin Lee +// Arturs Vonda // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export = QueryString; @@ -23,6 +24,7 @@ declare namespace QueryString { serializeDate?: (d: Date) => string; format?: 'RFC1738' | 'RFC3986'; encodeValuesOnly?: boolean; + addQueryPrefix?: boolean; } interface IParseOptions { @@ -36,6 +38,7 @@ declare namespace QueryString { allowPrototypes?: boolean; parameterLimit?: number; strictNullHandling?: boolean; + ignoreQueryPrefix?: boolean; } function stringify(obj: any, options?: IStringifyOptions): string; diff --git a/types/qs/qs-tests.ts b/types/qs/qs-tests.ts index d71aa55957..49fe89a4aa 100644 --- a/types/qs/qs-tests.ts +++ b/types/qs/qs-tests.ts @@ -233,6 +233,11 @@ qs.parse('a=b&c=d', { delimiter: '&' }); assert.deepEqual(parsedStrictNull, { a: null, b: '' }); } +() => { + var parsedQueryPrefix = qs.parse('?a&b=', { ignoreQueryPrefix: true }); + assert.deepEqual(parsedQueryPrefix, { a: '', b: '' }); +} + () => { var nullsSkipped = qs.stringify({ a: 'b', c: null }, { skipNulls: true }); assert.equal(nullsSkipped, 'a=b'); @@ -278,3 +283,7 @@ qs.parse('a=b&c=d', { delimiter: '&' }); ); assert.equal(encodedValues,'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h'); } + +() => { + assert.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b'); +} From 7ba15010a5994563d21b884a8e0078348de5255d Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Fri, 30 Jun 2017 15:15:41 -0400 Subject: [PATCH 05/34] Support Leaflet-draw explicit false options This matches the documentation better where most of the Leaflet Draw documentation encourages to use explicit false options (rather than null), as seen in the type comments already in the typing file. --- types/leaflet-draw/index.d.ts | 14 +++++++------- types/leaflet-draw/leaflet-draw-tests.ts | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/types/leaflet-draw/index.d.ts b/types/leaflet-draw/index.d.ts index 22d0d45169..cf535930a6 100644 --- a/types/leaflet-draw/index.d.ts +++ b/types/leaflet-draw/index.d.ts @@ -40,35 +40,35 @@ declare namespace L { * * Default value: {} */ - polyline?: DrawOptions.PolylineOptions; + polyline?: DrawOptions.PolylineOptions | false; /** * Polygon draw handler options. Set to false to disable handler. * * Default value: {} */ - polygon?: DrawOptions.PolygonOptions; + polygon?: DrawOptions.PolygonOptions | false; /** * Rectangle draw handler options. Set to false to disable handler. * * Default value: {} */ - rectangle?: DrawOptions.RectangleOptions; + rectangle?: DrawOptions.RectangleOptions | false; /** * Circle draw handler options. Set to false to disable handler. * * Default value: {} */ - circle?: DrawOptions.CircleOptions; + circle?: DrawOptions.CircleOptions | false; /** * Marker draw handler options. Set to false to disable handler. * * Default value: {} */ - marker?: DrawOptions.MarkerOptions; + marker?: DrawOptions.MarkerOptions | false; } interface EditOptions { @@ -85,14 +85,14 @@ declare namespace L { * * Default value: null */ - edit?: DrawOptions.EditHandlerOptions; + edit?: DrawOptions.EditHandlerOptions | false; /** * Delete handler options. Set to false to disable handler. * * Default value: null */ - remove?: DrawOptions.DeleteHandlerOptions; + remove?: DrawOptions.DeleteHandlerOptions | false; } interface Draw extends Control { diff --git a/types/leaflet-draw/leaflet-draw-tests.ts b/types/leaflet-draw/leaflet-draw-tests.ts index 21c08e21e9..db6548d844 100644 --- a/types/leaflet-draw/leaflet-draw-tests.ts +++ b/types/leaflet-draw/leaflet-draw-tests.ts @@ -45,3 +45,27 @@ map.on(L.Draw.Event.CREATED, (e: L.DrawEvents.Created) => { let examplePolygon: L.LatLngLiteral[] = [{lng: 0, lat: 0}, {lng: 10, lat: 0}, {lng: 10, lat: 10}, {lng: 0, lat: 10}, {lng: 0, lat: 0}]; let examplePolygonArea: number = L.GeometryUtil.geodesicArea(examplePolygon); L.GeometryUtil.readableArea(examplePolygonArea, true); + +function testBooleanControlOptions() { + const drawControl = new L.Control.Draw({ + position: 'topleft' , + draw: { + polygon: { + allowIntersection: false, + drawError: { + color: '#b00b00', + timeout: 1000 + }, + shapeOptions: { + color: '#bada55' + }, + showArea: true + }, + polyline: {}, + circle: false + }, + edit: { + featureGroup: drawnItems + } + }); +} From 8114855a0c77a29a3882639962ab3b4892a66e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=BAlio=20Braga?= Date: Fri, 30 Jun 2017 18:13:07 -0300 Subject: [PATCH 06/34] Adding (new) optional parameters to the serializeUser and deserializeUser callback signature following the changes on passportjs lib --- types/passport-local-mongoose/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/passport-local-mongoose/index.d.ts b/types/passport-local-mongoose/index.d.ts index 8a2d036c9f..2e3377a9b8 100644 --- a/types/passport-local-mongoose/index.d.ts +++ b/types/passport-local-mongoose/index.d.ts @@ -19,8 +19,8 @@ declare module 'mongoose' { // statics interface PassportLocalModel extends Model { authenticate(): (username: string, password: string, cb: (err: any, res: T, error: any) => void) => void; - serializeUser(): (user: PassportLocalModel, cb: (err: any) => void) => void; - deserializeUser(): (username: string, cb: (err: any) => void) => void; + serializeUser(): (user: PassportLocalModel, cb: (err: any, id?: any) => void) => void; + deserializeUser(): (username: string, cb: (err: any, user?: any) => void) => void; register(user: T, password: string, cb: (err: any, account: any) => void): void; findByUsername(username: string, selectHashSaltFields: boolean, cb: (err: any, account: any) => void): any; createStrategy(): passportLocal.Strategy; From 97623535569c9c5c957a9ff2c1b99179499e601f Mon Sep 17 00:00:00 2001 From: StickerFiend Date: Fri, 30 Jun 2017 14:20:56 -0700 Subject: [PATCH 07/34] Added hex string option to Color constructor Passing a string into Color worked prior to Typescript 2.4 Requires @clark-stevenson approval. --- types/paper/index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/paper/index.d.ts b/types/paper/index.d.ts index 197707058b..918603be84 100644 --- a/types/paper/index.d.ts +++ b/types/paper/index.d.ts @@ -3514,6 +3514,12 @@ declare module 'paper' { * @param highlight [optional] - */ constructor(color: Gradient, origin: Point, destination: Point, highlight?: Point); + + /** + * Creates a RGB Color object. + * @param hex - the RGB color in hex, i.e. #000000 + */ + constructor(hex: string); /** * The type of the color as a string. From 8b1f037c8ff2a3d2fb41af29b1a6df96030322d6 Mon Sep 17 00:00:00 2001 From: Mattoni Date: Fri, 30 Jun 2017 14:46:31 -0700 Subject: [PATCH 08/34] Update rc-slider definitions to 8.1 --- types/rc-slider/index.d.ts | 51 ++++++++++++++++++----------- types/rc-slider/rc-slider-tests.tsx | 3 +- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/types/rc-slider/index.d.ts b/types/rc-slider/index.d.ts index 34cfc22056..cc25d67b40 100644 --- a/types/rc-slider/index.d.ts +++ b/types/rc-slider/index.d.ts @@ -1,17 +1,20 @@ -// Type definitions for rc-slider 6.1 +// Type definitions for rc-slider 8.1 // Project: https://github.com/react-component/slider -// Definitions by: Marcinkus Mantas +// Definitions by: Marcinkus Mantas , Alexander Mattoni // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import * as React from 'react'; +declare module "rc-slider" { + import * as React from "react"; -declare namespace RcSliderClass { - interface Marks { - [number: number]: JSX.Element | string | { style: any, label: string | JSX.Element }; + export interface Marks { + [number: number]: + | JSX.Element + | string + | { style: any; label: string | JSX.Element }; } - interface CommonApiProps { + export interface CommonApiProps { /** * Additional CSS class for the root DOM node * @default '' @@ -86,9 +89,24 @@ declare namespace RcSliderClass { * Tooltip formatter */ tipFormatter?: ((value: any) => any | undefined) | null; + + /** + * The style used for handle. (both for slider(Object) and range(Array of Object), the array will be used for mutli handle follow element order) + */ + handleStyle?: Array | React.CSSProperties; + + /** + * The style used for track. (both for slider(Object) and range(Array of Object), the array will be used for mutli track follow element order) + */ + trackStyle?: Array | React.CSSProperties; + + /** + * The style used for the track base color. + */ + railStyle?: React.CSSProperties; } - interface SliderProps extends CommonApiProps { + export interface SliderProps extends CommonApiProps { /** * Set initial value of slider. * @default 0 @@ -100,7 +118,7 @@ declare namespace RcSliderClass { value?: number; } - interface RangeProps extends CommonApiProps { + export interface RangeProps extends CommonApiProps { /** * Set initial positions of handles. * @default [0,0] @@ -127,7 +145,7 @@ declare namespace RcSliderClass { pushable?: boolean; } - interface HandleProps extends CommonApiProps { + export interface HandleProps extends CommonApiProps { /** * Class name */ @@ -142,13 +160,8 @@ declare namespace RcSliderClass { */ offset: number; } + + export default class Slider extends React.Component {} + export class Range extends React.Component {} + export class Handle extends React.Component {} } - -declare class RcSliderClass extends React.Component { } - -declare namespace RcSliderClass { - class Range extends React.Component { } - class Handle extends React.Component { } -} - -export = RcSliderClass; diff --git a/types/rc-slider/rc-slider-tests.tsx b/types/rc-slider/rc-slider-tests.tsx index 55c0674741..7e2e14e317 100644 --- a/types/rc-slider/rc-slider-tests.tsx +++ b/types/rc-slider/rc-slider-tests.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; -import * as Slider from 'rc-slider'; -import { Range, Handle } from 'rc-slider'; +import Slider, { Range, Handle } from 'rc-slider'; ReactDOM.render( , From ee24cde3466d3c68f90d501e62ba4cae91c79099 Mon Sep 17 00:00:00 2001 From: Mattoni Date: Fri, 30 Jun 2017 14:52:22 -0700 Subject: [PATCH 09/34] Update rc-slider definitions to 8.1 --- types/rc-slider/index.d.ts | 316 ++++++++++++++++++------------------- 1 file changed, 157 insertions(+), 159 deletions(-) diff --git a/types/rc-slider/index.d.ts b/types/rc-slider/index.d.ts index cc25d67b40..e17504fecf 100644 --- a/types/rc-slider/index.d.ts +++ b/types/rc-slider/index.d.ts @@ -4,164 +4,162 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -declare module "rc-slider" { - import * as React from "react"; +import * as React from "react"; - export interface Marks { - [number: number]: - | JSX.Element - | string - | { style: any; label: string | JSX.Element }; - } - - export interface CommonApiProps { - /** - * Additional CSS class for the root DOM node - * @default '' - */ - className?: string; - /** - * The minimum value of the slider - * @default 0 - */ - min?: number; - /** - * The maximum value of the slider - * @default 100 - */ - max?: number; - /** - * Marks on the slider. The key determines the position, and the value determines what will show. - * If you want to set the style of a specific mark point, the value should be an object which contains style and label properties. - * @default '{}' | {number: { style, label }} - */ - marks?: Marks; - /** - * Value to be added or subtracted on each step the slider makes. Must be greater than zero, and max - min should be evenly divisible by the step value. - * @default 1 - */ - step?: number; - /** - * If vertical is true, the slider will be vertical. - * @default false - */ - vertical?: boolean; - /** - * A handle generator which could be used to customized handle. - */ - handle?(props: any): React.ReactNode; - /** - * If the value is true, it means a continuous value interval, otherwise, it is a independent value. - * @default true - */ - included?: boolean; - /** - * If true, handles can't be moved. - * @default false - */ - disabled?: boolean; - /** - * When the step value is greater than 1, you can set the dots to true if you want to render the slider with dots. - * @default false - */ - dots?: boolean; - /** - * onBeforeChange will be triggered when ontouchstart or onmousedown is triggered. - */ - onBeforeChange?(value: any): any | undefined; - /** - * onChange will be triggered while the value of Slider changing. - */ - onChange?(value: any): any | undefined; - /** - * onAfterChange will be triggered when ontouchend or onmouseup is triggered. - */ - onAfterChange?(value: any): any | undefined; - - /** - * @deprecated in version ^6.0.0. Use rc-tooltip - * Tooltip transition class name - */ - tipTransitionName?: string; - - /** - * @deprecated in version ^6.0.0. Use rc-tooltip - * Tooltip formatter - */ - tipFormatter?: ((value: any) => any | undefined) | null; - - /** - * The style used for handle. (both for slider(Object) and range(Array of Object), the array will be used for mutli handle follow element order) - */ - handleStyle?: Array | React.CSSProperties; - - /** - * The style used for track. (both for slider(Object) and range(Array of Object), the array will be used for mutli track follow element order) - */ - trackStyle?: Array | React.CSSProperties; - - /** - * The style used for the track base color. - */ - railStyle?: React.CSSProperties; - } - - export interface SliderProps extends CommonApiProps { - /** - * Set initial value of slider. - * @default 0 - */ - defaultValue?: number; - /** - * Set current value of slider. - */ - value?: number; - } - - export interface RangeProps extends CommonApiProps { - /** - * Set initial positions of handles. - * @default [0,0] - */ - defaultValue?: number[]; - /** - * Set current positions of handles. - */ - value?: number[]; - /** - * Determine how many ranges to render, and multiple handles will be rendered (number + 1). - * @default 1 - */ - count?: number; - /** - * allowCross could be set as true to allow those handles to cross. - * @default true - */ - allowCross?: boolean; - /** - * pushable could be set as true to allow pushing of surrounding handles when moving an handle. When set to a number, the number will be the minimum ensured distance between handles. - * @default true - */ - pushable?: boolean; - } - - export interface HandleProps extends CommonApiProps { - /** - * Class name - */ - className: string; - /** - * Styling if true, then bottom: {offset} else left: {offset} - * @default False - */ - vertical: boolean; - /** - * Styling option offset - */ - offset: number; - } - - export default class Slider extends React.Component {} - export class Range extends React.Component {} - export class Handle extends React.Component {} +export interface Marks { + [number: number]: + | JSX.Element + | string + | { style: any; label: string | JSX.Element }; } + +export interface CommonApiProps { + /** + * Additional CSS class for the root DOM node + * @default '' + */ + className?: string; + /** + * The minimum value of the slider + * @default 0 + */ + min?: number; + /** + * The maximum value of the slider + * @default 100 + */ + max?: number; + /** + * Marks on the slider. The key determines the position, and the value determines what will show. + * If you want to set the style of a specific mark point, the value should be an object which contains style and label properties. + * @default '{}' | {number: { style, label }} + */ + marks?: Marks; + /** + * Value to be added or subtracted on each step the slider makes. Must be greater than zero, and max - min should be evenly divisible by the step value. + * @default 1 + */ + step?: number; + /** + * If vertical is true, the slider will be vertical. + * @default false + */ + vertical?: boolean; + /** + * A handle generator which could be used to customized handle. + */ + handle?(props: any): React.ReactNode; + /** + * If the value is true, it means a continuous value interval, otherwise, it is a independent value. + * @default true + */ + included?: boolean; + /** + * If true, handles can't be moved. + * @default false + */ + disabled?: boolean; + /** + * When the step value is greater than 1, you can set the dots to true if you want to render the slider with dots. + * @default false + */ + dots?: boolean; + /** + * onBeforeChange will be triggered when ontouchstart or onmousedown is triggered. + */ + onBeforeChange?(value: any): any | undefined; + /** + * onChange will be triggered while the value of Slider changing. + */ + onChange?(value: any): any | undefined; + /** + * onAfterChange will be triggered when ontouchend or onmouseup is triggered. + */ + onAfterChange?(value: any): any | undefined; + + /** + * @deprecated in version ^6.0.0. Use rc-tooltip + * Tooltip transition class name + */ + tipTransitionName?: string; + + /** + * @deprecated in version ^6.0.0. Use rc-tooltip + * Tooltip formatter + */ + tipFormatter?: ((value: any) => any | undefined) | null; + + /** + * The style used for handle. (both for slider(Object) and range(Array of Object), the array will be used for mutli handle follow element order) + */ + handleStyle?: Array | React.CSSProperties; + + /** + * The style used for track. (both for slider(Object) and range(Array of Object), the array will be used for mutli track follow element order) + */ + trackStyle?: Array | React.CSSProperties; + + /** + * The style used for the track base color. + */ + railStyle?: React.CSSProperties; +} + +export interface SliderProps extends CommonApiProps { + /** + * Set initial value of slider. + * @default 0 + */ + defaultValue?: number; + /** + * Set current value of slider. + */ + value?: number; +} + +export interface RangeProps extends CommonApiProps { + /** + * Set initial positions of handles. + * @default [0,0] + */ + defaultValue?: number[]; + /** + * Set current positions of handles. + */ + value?: number[]; + /** + * Determine how many ranges to render, and multiple handles will be rendered (number + 1). + * @default 1 + */ + count?: number; + /** + * allowCross could be set as true to allow those handles to cross. + * @default true + */ + allowCross?: boolean; + /** + * pushable could be set as true to allow pushing of surrounding handles when moving an handle. When set to a number, the number will be the minimum ensured distance between handles. + * @default true + */ + pushable?: boolean; +} + +export interface HandleProps extends CommonApiProps { + /** + * Class name + */ + className: string; + /** + * Styling if true, then bottom: {offset} else left: {offset} + * @default False + */ + vertical: boolean; + /** + * Styling option offset + */ + offset: number; +} + +export default class Slider extends React.Component { } +export class Range extends React.Component { } +export class Handle extends React.Component { } From 7d8db5784b340bbf7c0ac97aa1f76b99a9ca2359 Mon Sep 17 00:00:00 2001 From: Mattoni Date: Fri, 30 Jun 2017 14:58:30 -0700 Subject: [PATCH 10/34] lint file --- types/rc-slider/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/rc-slider/index.d.ts b/types/rc-slider/index.d.ts index e17504fecf..c30f6a649c 100644 --- a/types/rc-slider/index.d.ts +++ b/types/rc-slider/index.d.ts @@ -92,16 +92,16 @@ export interface CommonApiProps { /** * The style used for handle. (both for slider(Object) and range(Array of Object), the array will be used for mutli handle follow element order) */ - handleStyle?: Array | React.CSSProperties; + handleStyle?: React.CSSProperties[] | React.CSSProperties; /** * The style used for track. (both for slider(Object) and range(Array of Object), the array will be used for mutli track follow element order) */ - trackStyle?: Array | React.CSSProperties; + trackStyle?: React.CSSProperties[] | React.CSSProperties; /** - * The style used for the track base color. - */ + * The style used for the track base color. + */ railStyle?: React.CSSProperties; } From 93acafe448df680873c6123e54b43c4685c2f631 Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Sat, 1 Jul 2017 07:37:45 -0400 Subject: [PATCH 11/34] [react-navigation] Added StackRouter --- types/react-navigation/index.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 4e321e771c..6b821586dd 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -647,6 +647,17 @@ export function TabRouter( config: NavigationTabRouterConfig ): NavigationRouter +/** + * Stack Router + * + * @desc from react-navigation/src/routers/StackRouter.js + * @param routeConfigs + * @param config + */ +export function StackRouter( + routeConfigs: NavigationRouteConfigMap, + config: NavigationTabRouterConfig +): NavigationRouter /** * END MANUAL DEFINITIONS OUTSIDE OF TYPEDEFINITION.JS */ From 07257c41a0be1d277cce868f58698ef548cc102f Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 2 Jul 2017 16:09:31 +0100 Subject: [PATCH 12/34] Fix Leaflet bug #17685 --- types/leaflet/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/leaflet/index.d.ts b/types/leaflet/index.d.ts index 80adf4bc3f..951bc4b22d 100644 --- a/types/leaflet/index.d.ts +++ b/types/leaflet/index.d.ts @@ -399,7 +399,7 @@ declare namespace L { class Layer extends Evented { constructor(options?: LayerOptions); - addTo(map: Map): this; + addTo(map: Map|LayerGroup): this; remove(): this; removeFrom(map: Map): this; getPane(name?: string): HTMLElement | undefined; From e97075f1ea2c1177feda67660d291b0251434847 Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Mon, 3 Jul 2017 11:53:14 -0400 Subject: [PATCH 13/34] [react-native] Correct signatures for Flatlist ListEmptyComponent, ListFooterComponent, ListHeaderComponent --- types/react-native/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index e1cc0daa3c..ed662e1c46 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -3444,17 +3444,17 @@ export interface FlatListProperties extends ScrollViewProperties { /** * Rendered when the list is empty. */ - ListEmptyComponent?: React.ComponentClass | null + ListEmptyComponent?: React.ComponentClass | React.ReactElement | null /** * Rendered at the very end of the list. */ - ListFooterComponent?: React.ComponentClass | (() => React.ReactElement) | null + ListFooterComponent?: React.ComponentClass | React.ReactElement | null /** * Rendered at the very beginning of the list. */ - ListHeaderComponent?: React.ComponentClass | (() => React.ReactElement) | null + ListHeaderComponent?: React.ComponentClass | React.ReactElement | null /** * Optional custom style for multi-item rows generated when numColumns > 1 From 9ab3afa064b69ff1021acd80d47d9622976615cf Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Mon, 3 Jul 2017 12:02:07 -0400 Subject: [PATCH 14/34] [react-native] Add state type to React.Component generic --- types/react-native/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index e1cc0daa3c..5a3df6dcb7 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -336,7 +336,7 @@ export interface NativeMethodsMixinStatic { blur(): void; refs: { - [key: string]: React.Component + [key: string]: React.Component }; } @@ -8858,7 +8858,7 @@ export function requireNativeComponent

( extraConfig?: {nativeOnly?: any} ): React.ComponentClass

; -export function findNodeHandle(componentOrHandle: null | number | React.Component | React.ComponentClass): null | number; +export function findNodeHandle(componentOrHandle: null | number | React.Component | React.ComponentClass): null | number; export function processColor(color: any): number; From 366a37cd317f211a2d706461170e4082a45252f1 Mon Sep 17 00:00:00 2001 From: Deividas Bakanas Date: Mon, 3 Jul 2017 20:17:34 +0300 Subject: [PATCH 15/34] ReactSwipe types added. --- types/react-swipe/index.d.ts | 34 +++++++++++++++++++++++++++++++++ types/react-swipe/tsconfig.json | 25 ++++++++++++++++++++++++ types/react-swipe/tslint.json | 1 + 3 files changed, 60 insertions(+) create mode 100644 types/react-swipe/index.d.ts create mode 100644 types/react-swipe/tsconfig.json create mode 100644 types/react-swipe/tslint.json diff --git a/types/react-swipe/index.d.ts b/types/react-swipe/index.d.ts new file mode 100644 index 0000000000..304db816d2 --- /dev/null +++ b/types/react-swipe/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for react-swipe 5.0 +// Project: https://github.com/voronianski/react-swipe +// Definitions by: Deividas Bakanas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import * as React from "react"; + +declare class ReactSwipe extends React.Component { + prev(): void; + next(): void; + getPos(): number; + getNumSlides(): number; + slide(index: number, duration: number): void; +} + +declare namespace ReactSwipe { + interface Style { + container: React.CSSProperties; + wrapper: React.CSSProperties; + child: React.CSSProperties; + } + + interface Props { + id?: string; + swipeOptions?: SwipeOptions; + style?: Style; + className?: string; + } +} + +export = ReactSwipe; diff --git a/types/react-swipe/tsconfig.json b/types/react-swipe/tsconfig.json new file mode 100644 index 0000000000..304ae7e451 --- /dev/null +++ b/types/react-swipe/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-swipe-tests.tsx" + ] +} diff --git a/types/react-swipe/tslint.json b/types/react-swipe/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-swipe/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 031688dbfce4491fb744240c52609636c7649140 Mon Sep 17 00:00:00 2001 From: Deividas Bakanas Date: Mon, 3 Jul 2017 20:17:49 +0300 Subject: [PATCH 16/34] ReactSwipe tests added. --- types/react-swipe/react-swipe-tests.tsx | 75 +++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 types/react-swipe/react-swipe-tests.tsx diff --git a/types/react-swipe/react-swipe-tests.tsx b/types/react-swipe/react-swipe-tests.tsx new file mode 100644 index 0000000000..fed2c2d3b5 --- /dev/null +++ b/types/react-swipe/react-swipe-tests.tsx @@ -0,0 +1,75 @@ +import * as React from "react"; +import * as ReactSwipe from "react-swipe"; + +class ReactSwipeTest extends React.PureComponent { + private swipeComponent: ReactSwipe | null = null; + + private onPrev: React.MouseEventHandler = () => { + if (this.swipeComponent != null) { + this.swipeComponent.prev(); + } + } + + private onNext: React.MouseEventHandler = () => { + if (this.swipeComponent != null) { + this.swipeComponent.next(); + } + } + + private onSlideToStart: React.MouseEventHandler = () => { + if (this.swipeComponent != null) { + const lastSlide = this.swipeComponent.getNumSlides() - 1; + this.swipeComponent.slide(lastSlide, 1000); + } + } + + private onGetCurrentPosition: React.MouseEventHandler = () => { + let currentPosition: number; + + if (this.swipeComponent != null) { + currentPosition = this.swipeComponent.getPos(); + } else { + currentPosition = 0; + } + + alert(currentPosition); + } + + render() { + const swipeOptions: SwipeOptions = { + auto: 12, + disableScroll: true, + stopPropagation: true + }; + + const style: ReactSwipe.Style = { + child: { + backgroundColor: "yellow" + }, + container: { + backgroundColor: "green" + }, + wrapper: { + backgroundColor: "red" + } + }; + + return

+ { this.swipeComponent = swipeComponent; }} + > +
PANE 1
+
PANE 2
+
PANE 3
+
+ + + + +
; + } +} From 2b525047034b8af3f4b3d9a8bc19bd57a172d0b5 Mon Sep 17 00:00:00 2001 From: Andreas Krohn Date: Mon, 3 Jul 2017 20:42:05 +0200 Subject: [PATCH 17/34] Added missing callbacks --- types/swiper/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/swiper/index.d.ts b/types/swiper/index.d.ts index e16c7d5cc5..efd2c591d8 100644 --- a/types/swiper/index.d.ts +++ b/types/swiper/index.d.ts @@ -193,6 +193,10 @@ interface SwiperOptions { onLazyImageLoad?(swiper: Swiper, slide: any, image: any): void; onLazyImageReady?(swiper: Swiper, slide: any, image: any): void; onPaginationRendered?(swiper: Swiper, paginationContainer: any): void; + onScroll?(swiper: Swiper, event: Event): void; + onBeforeResize?(swiper: Swiper): void; + onAfterResize?(swiper: Swiper): void; + onKeyPress?(swiper: Swiper, kc: any): void; // Namespace slideClass?: string; From a99764c7698d264a1212f734e319d35e024a779e Mon Sep 17 00:00:00 2001 From: Andreas Krohn Date: Mon, 3 Jul 2017 20:42:26 +0200 Subject: [PATCH 18/34] Added `virtualSize` as property --- types/swiper/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/swiper/index.d.ts b/types/swiper/index.d.ts index efd2c591d8..f79c4ce7ca 100644 --- a/types/swiper/index.d.ts +++ b/types/swiper/index.d.ts @@ -241,6 +241,7 @@ declare class Swiper { height: number; params: any; positions: any; + virtualSize: number; // Feature detection support: { From 87b1ae55d98ee50098507a77076273dd1e5bec22 Mon Sep 17 00:00:00 2001 From: Andreas Krohn Date: Mon, 3 Jul 2017 20:55:57 +0200 Subject: [PATCH 19/34] Added wrapper property --- types/swiper/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/swiper/index.d.ts b/types/swiper/index.d.ts index f79c4ce7ca..57edc39a61 100644 --- a/types/swiper/index.d.ts +++ b/types/swiper/index.d.ts @@ -241,6 +241,7 @@ declare class Swiper { height: number; params: any; positions: any; + wrapper: any; virtualSize: number; // Feature detection From e5f1296ee484544c0096b9f0b7d0466b9477566e Mon Sep 17 00:00:00 2001 From: Nate Silva Date: Mon, 3 Jul 2017 13:15:50 -0700 Subject: [PATCH 20/34] support `timestamps` option on `AssociationOptionsBelongsToMany` as documented at http://docs.sequelizejs.com/class/lib/model.js~Model.html#static-method-belongsToMany --- types/sequelize/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index c227e13d55..88296b8215 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -1355,6 +1355,11 @@ declare namespace sequelize { */ otherKey?: string | AssociationForeignKeyOptions; + /** + * Should the join model have timestamps + */ + timestamps?: boolean; + } /** From 5f081bc7b48cce8d6947b96c0c9c1d88e456c5b4 Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Mon, 3 Jul 2017 17:42:47 -0400 Subject: [PATCH 21/34] Add `onerror` and `runInDebug` to Ember typings. --- types/ember/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 07a8a0d54f..41f8fe6d45 100644 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -2449,6 +2449,7 @@ declare namespace Ember { function observersFor(obj: any, path: string): any[]; function onLoad(name: string, callback: Function): void; const onError: Error; + function onerror(error: any): void; function overrideChains(obj: any, keyName: string, m: any): boolean; // ReSharper disable once DuplicatingLocalDeclaration const platform: { @@ -2480,6 +2481,7 @@ declare namespace Ember { throttle(target: any, method: Function | string, ...args: any[]): void; queues: any[]; }; + function runInDebug(fn: Function): void; function runLoadHooks(name: string, object: any): void; function sendEvent(obj: any, eventName: string, params?: any[], actions?: any[]): boolean; function set(obj: any, keyName: string, value: any): any; From 3a78509fb0f1508f8523466810694d4f788fbb99 Mon Sep 17 00:00:00 2001 From: huhuanming Date: Tue, 4 Jul 2017 15:57:10 +0800 Subject: [PATCH 22/34] Detailed Types In Block --- types/react-native-touch-id/index.d.ts | 2 +- types/react-native-touch-id/react-native-touch-id-tests.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-native-touch-id/index.d.ts b/types/react-native-touch-id/index.d.ts index 04f7fbbfde..f1fc4f7a71 100644 --- a/types/react-native-touch-id/index.d.ts +++ b/types/react-native-touch-id/index.d.ts @@ -13,6 +13,6 @@ declare module 'react-native-touch-id' { details: any; } - export const isSupported: () => Promise; + export const isSupported: () => Promise; export const authenticate: (reason: string) => Promise; } diff --git a/types/react-native-touch-id/react-native-touch-id-tests.ts b/types/react-native-touch-id/react-native-touch-id-tests.ts index 009f1c347f..0b431ecc85 100644 --- a/types/react-native-touch-id/react-native-touch-id-tests.ts +++ b/types/react-native-touch-id/react-native-touch-id-tests.ts @@ -1,5 +1,5 @@ -import { isSupported, authenticate } from 'react-native-touch-id'; +import { isSupported, authenticate, TouchIDError } from 'react-native-touch-id'; -isSupported().then(() => {}).catch(() => {}); +isSupported().then((isOk: boolean) => {}).catch((error: TouchIDError) => {}); -authenticate('reason').then(() => {}).catch(() => {}); +authenticate('reason').then((isOk: boolean) => {}).catch((error: TouchIDError) => {}); From 328d2c268faf567bb1a38964042d690eb40f6906 Mon Sep 17 00:00:00 2001 From: Jeremi Stadler Date: Tue, 4 Jul 2017 11:24:25 +0200 Subject: [PATCH 23/34] [React-Native] Remove me from maintainer list --- types/react-native/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 5a3df6dcb7..bef9e7afea 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -3,7 +3,6 @@ // Definitions by: Eloy Durán // Fedor Nezhivoi // HuHuanming -// Jeremi Stadler // Kyle Roach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From e23ee8a8dd5c5909ceae48eb23a48d58e443a795 Mon Sep 17 00:00:00 2001 From: Ika Date: Tue, 4 Jul 2017 23:55:07 +0800 Subject: [PATCH 24/34] fix(cheerio): CheerioAPI should extend CheerioStatic --- types/cheerio/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/cheerio/index.d.ts b/types/cheerio/index.d.ts index 4096a0f9c2..f525a46ee6 100644 --- a/types/cheerio/index.d.ts +++ b/types/cheerio/index.d.ts @@ -263,7 +263,7 @@ interface CheerioElement { nodeValue: string; } -interface CheerioAPI extends CheerioSelector { +interface CheerioAPI extends CheerioSelector, CheerioStatic { load(html: string, options?: CheerioOptionsInterface): CheerioStatic; load(element: CheerioElement, options?: CheerioOptionsInterface): CheerioStatic; } From 98fdc33a5308775c27a83b8d1469ba9ee4739126 Mon Sep 17 00:00:00 2001 From: Ika Date: Tue, 4 Jul 2017 23:57:48 +0800 Subject: [PATCH 25/34] test(cheerio): add tests --- types/cheerio/cheerio-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/cheerio/cheerio-tests.ts b/types/cheerio/cheerio-tests.ts index 1c0848eef7..4a15f029f0 100644 --- a/types/cheerio/cheerio-tests.ts +++ b/types/cheerio/cheerio-tests.ts @@ -306,3 +306,5 @@ $.parseHTML(html, null, true); * Not in doc */ $el.toArray(); + +cheerio.html($el); From 642aa347d7340a6c2d1f6ffbc0df657863663104 Mon Sep 17 00:00:00 2001 From: Deividas Bakanas Date: Tue, 4 Jul 2017 19:33:31 +0300 Subject: [PATCH 26/34] `tslint.json` and `tsconfig.json` added. --- types/react-tooltip/tsconfig.json | 25 +++++++++++++++++++++++++ types/react-tooltip/tslint.json | 1 + 2 files changed, 26 insertions(+) create mode 100644 types/react-tooltip/tsconfig.json create mode 100644 types/react-tooltip/tslint.json diff --git a/types/react-tooltip/tsconfig.json b/types/react-tooltip/tsconfig.json new file mode 100644 index 0000000000..d52b7c28ab --- /dev/null +++ b/types/react-tooltip/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom", + "dom.iterable" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-tooltip-tests.tsx" + ] +} diff --git a/types/react-tooltip/tslint.json b/types/react-tooltip/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-tooltip/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From d1f0c60277735137b08e780f2e787b9ecbb3b3cb Mon Sep 17 00:00:00 2001 From: Deividas Bakanas Date: Tue, 4 Jul 2017 19:43:24 +0300 Subject: [PATCH 27/34] `react-tooltip` types added. --- types/react-tooltip/index.d.ts | 54 ++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 types/react-tooltip/index.d.ts diff --git a/types/react-tooltip/index.d.ts b/types/react-tooltip/index.d.ts new file mode 100644 index 0000000000..67c7635752 --- /dev/null +++ b/types/react-tooltip/index.d.ts @@ -0,0 +1,54 @@ +// Type definitions for react-tooltip 3.3 +// Project: https://github.com/wwayne/react-tooltip +// Definitions by: Deividas Bakanas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as React from "react"; + +declare class ReactTooltip extends React.Component { } + +declare namespace ReactTooltip { + interface Offset { + top?: number; + right?: number; + left?: number; + bottom?: number; + } + + type ElementEvents = keyof HTMLElementEventMap; + type WindowEvents = keyof WindowEventMap; + + type GetContentCallback = () => React.ReactNode; + type GetContent = GetContentCallback | [GetContentCallback, number]; + + interface Props { + id?: string; + place?: "top" | "right" | "bottom" | "left"; + type?: "success" | "warning" | "error" | "info" | "light"; + effect?: "float" | "solid"; + event?: ElementEvents; + eventOff?: ElementEvents; + globalEventOff?: WindowEvents; + isCapture?: boolean; + offset?: Offset; + multiline?: boolean; + className?: string; + html?: boolean; + delayHide?: number; + delayShow?: number; + insecure?: boolean; + border?: boolean; + getContent?: GetContent; + afterShow?(): void; + afterHide?(): void; + disable?: boolean; + scrollHide?: boolean; + resizeHide?: boolean; + wrapper?: "div" | "span"; + role?: string; + class?: string; + watchWindow?: boolean; + } +} + +export = ReactTooltip; From 9bbcff9c8c55c972d2067782610e901d44fb1b37 Mon Sep 17 00:00:00 2001 From: Deividas Bakanas Date: Tue, 4 Jul 2017 19:51:15 +0300 Subject: [PATCH 28/34] React tooltip tests added. --- types/react-tooltip/react-tooltip-tests.tsx | 79 +++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 types/react-tooltip/react-tooltip-tests.tsx diff --git a/types/react-tooltip/react-tooltip-tests.tsx b/types/react-tooltip/react-tooltip-tests.tsx new file mode 100644 index 0000000000..7fa5332f27 --- /dev/null +++ b/types/react-tooltip/react-tooltip-tests.tsx @@ -0,0 +1,79 @@ +import * as React from "react"; +import * as ReactTooltip from "react-tooltip"; + +export class ReactTooltipTest extends React.PureComponent { + render() { + const getContent: ReactTooltip.GetContent = [() => Math.floor(Math.random() * 100), 30]; + + return
+ d(`・∀・)b + + Show happy face + + + இдஇ + { console.log("afterHide"); }}> + Show sad face + + + σ`∀´)σ + (〃∀〃) + { console.log("afterShow"); }}> +

This is a global react component tooltip

+

You can put every thing here

+
    +
  • Word
  • +
  • Chart
  • +
  • Else
  • +
+
+ + ( •̀д•́) + + + ( •̀д•́) + + + (・ω´・ )́) + + + =( •̀д•́) + + + =( •̀д•́) + new Date().toISOString(), 1000]} /> + + d(`・∀・)b + + + Show happy face + +
+ + Show happy face + +
+
; + } +} From bea2afe988c283c664ad376b60b1ae858a00f00b Mon Sep 17 00:00:00 2001 From: Deividas Bakanas Date: Tue, 4 Jul 2017 20:10:25 +0300 Subject: [PATCH 29/34] Typescript version defined. --- types/react-tooltip/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-tooltip/index.d.ts b/types/react-tooltip/index.d.ts index 67c7635752..c4c380f533 100644 --- a/types/react-tooltip/index.d.ts +++ b/types/react-tooltip/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/wwayne/react-tooltip // Definitions by: Deividas Bakanas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import * as React from "react"; From 00215dc7a43cb343017000bd87efe8a0c578ce0b Mon Sep 17 00:00:00 2001 From: Daniel Chao Date: Tue, 4 Jul 2017 11:43:10 -0700 Subject: [PATCH 30/34] add subscribe and unsubscribe methods to peripherals --- types/noble/index.d.ts | 3 +++ types/noble/noble-tests.ts | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/types/noble/index.d.ts b/types/noble/index.d.ts index 4f2b5f0b7c..d62b0609a8 100644 --- a/types/noble/index.d.ts +++ b/types/noble/index.d.ts @@ -4,6 +4,7 @@ // Hans Bakker // Shantanu Bhadoria // Luke Libraro +// Dan Chao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -88,6 +89,8 @@ export declare class Characteristic extends events.EventEmitter { notify(notify: boolean, callback?: (error: string) => void): void; discoverDescriptors(callback?: (error: string, descriptors: Descriptor[]) => void): void; toString(): string; + subscribe(callback?: (error: string) => void): void; + unsubscribe(callback?: (error: string) => void): void; on(event: string, listener: Function): this; on(event: string, option: boolean, listener: Function): this; diff --git a/types/noble/noble-tests.ts b/types/noble/noble-tests.ts index baa65c5662..c790f2deb0 100644 --- a/types/noble/noble-tests.ts +++ b/types/noble/noble-tests.ts @@ -87,6 +87,10 @@ characteristic.on("write", true, (error: string): void => {}); characteristic.on("broadcast", (state: string): void => {}); characteristic.on("notify", (state: string): void => {}); characteristic.on("descriptorsDiscover", (descriptors: noble.Descriptor[]): void => {}); +characteristic.subscribe(); +characteristic.subscribe((error: string) => {}); +characteristic.unsubscribe(); +characteristic.unsubscribe((error: string) => {}); var descriptor: noble.Descriptor = new noble.Descriptor(); descriptor.uuid = ""; From 93109f126a2e0079ff823a0fffe74369d3e8a82d Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Tue, 4 Jul 2017 16:10:19 -0400 Subject: [PATCH 31/34] Added definitions for react-native-elements --- types/react-native-elements/index.d.ts | 166 ++++++++++++++++++ .../react-native-elements-tests.tsx | 44 +++++ types/react-native-elements/tsconfig.json | 24 +++ types/react-native-elements/tslint.json | 1 + 4 files changed, 235 insertions(+) create mode 100644 types/react-native-elements/index.d.ts create mode 100644 types/react-native-elements/react-native-elements-tests.tsx create mode 100644 types/react-native-elements/tsconfig.json create mode 100644 types/react-native-elements/tslint.json diff --git a/types/react-native-elements/index.d.ts b/types/react-native-elements/index.d.ts new file mode 100644 index 0000000000..8323ef1c25 --- /dev/null +++ b/types/react-native-elements/index.d.ts @@ -0,0 +1,166 @@ +// Type definitions for react-native-elements 0.13 +// Project: https://github.com/react-native-training/react-native-elements#readme +// Definitions by: Kyle Roach +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as React from 'react'; +import { ViewStyle, TextStyle } from 'react-native'; + +export interface ButtonIcon { + name?: string; + color?: string; + size?: number; + type?: 'material' | 'material-community' | 'simple-line-icon' | 'zocial' | 'font-awesome' | 'octicon' | 'ionicon' | 'foundation' | 'evilicon' | 'entypo'; + buttonStyle?: TextStyle; +} + +export interface ButtonProperties { + /** + * Specify other component such as TouchableOpacity or other + * + * @default TouchableHighlight (iOS), TouchableNativeFeedback (android) + */ + Component?: JSX.Element; + + /** + * Additional styling for button component + * + * @default null + */ + buttonStyle?: ViewStyle; + + /** + * Button title + */ + title: string; + + /** + * Makes button large + * + * @default false + */ + large?: boolean; + + /** + * Specify different font family + * + * @default System font (iOS), Sans Serif (android) + */ + fontFamily?: string; + + /** + * Specify font weight for title + * + * @default null + */ + fontWeight?: string; + + /** + * Moves icon to right of title + * + * @default false + */ + iconRight?: boolean; + + /** + * onPress method + */ + onPress(): void; + + /** + * onLongPress method + */ + onLongPress?(): void; + + /** + * Icon configuration + */ + icon?: ButtonIcon; + + /** + * Specify other icon component instead of default. The component will have all values from the icon prop + * + * @default MaterialIcon + * @see https://github.com/oblador/react-native-vector-icons#icon-component + */ + iconComponent?: JSX.Element; + + /** + * Background color of button + * + * @default #397af8 + */ + backgroundColor?: string; + + /** + * Adds border radius to button + * (Note: if you set this, don't forget to also set borderRadius to containerViewStyle prop, otherwise unexpected behaviour might occur) + * + * @default 0 + */ + borderRadius?: number; + + /** + * Font color + * + * @default #fff + */ + color?: string; + + /** + * Text styling + * + * @default null + */ + textStyle?: TextStyle; + + /** + * Font size + * + * @default 18 + */ + fontSize?: number; + + /** + * Underlay color for button press + * + * @default transparent + */ + underlayColor?: string; + + /** + * Flag to add raised button styling + * + * @default false + */ + raised?: boolean; + + /** + * Indicates button is disabled + * + * @default false + */ + disabled?: boolean; + + /** + * Disabled button styling + * + * @default null + */ + disabledStyle?: ViewStyle; + + /** + * Styling for Component container + * + * @default null + */ + containerViewStyle?: ViewStyle; +} + +/** + * Button component + * + * @desc https://react-native-training.github.io/react-native-elements/API/buttons/ + */ +export class Button extends React.Component {} diff --git a/types/react-native-elements/react-native-elements-tests.tsx b/types/react-native-elements/react-native-elements-tests.tsx new file mode 100644 index 0000000000..197b1ec202 --- /dev/null +++ b/types/react-native-elements/react-native-elements-tests.tsx @@ -0,0 +1,44 @@ +import * as React from 'react'; +import { View, StyleSheet } from 'react-native'; +import { Button } from 'react-native-elements'; + +class ButtonTest extends React.Component { + handleButtonPress() { + console.log('I got pressed'); + } + + render() { + return ( + +