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); 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; } 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; diff --git a/types/gapi.auth2/index.d.ts b/types/gapi.auth2/index.d.ts index 04dfe32c2d..6e9e5c4199 100644 --- a/types/gapi.auth2/index.d.ts +++ b/types/gapi.auth2/index.d.ts @@ -47,7 +47,7 @@ declare namespace gapi.auth2 { /** * Get permission from the user to access the specified scopes offline. */ - grantOfflineAccess(options: { + grantOfflineAccess(options?: { scope?: string; prompt?: "select_account" | "consent"; app_package_name?: string; 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 + } + }); +} 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; 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 = ""; 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. 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; diff --git a/types/pg/index.d.ts b/types/pg/index.d.ts index 2b442b1227..6718fb3f12 100644 --- a/types/pg/index.d.ts +++ b/types/pg/index.d.ts @@ -71,7 +71,7 @@ export declare class Pool extends events.EventEmitter { connect(): Promise; connect(callback: (err: Error, client: Client, done: () => void) => void): void; - end(): Promise; + end(callback?: () => void): Promise; query(queryStream: QueryConfig & stream.Readable): stream.Readable; query(queryTextOrConfig: string | QueryConfig): Promise; diff --git a/types/pg/pg-tests.ts b/types/pg/pg-tests.ts index 73c18ac1b7..4b4cfba7ec 100644 --- a/types/pg/pg-tests.ts +++ b/types/pg/pg-tests.ts @@ -74,3 +74,8 @@ pool.connect((err, client, done) => { pool.on('error', (err, client) => { console.error('idle client error', err.message, err.stack) }) + +pool.end(); +pool.end(() => { + console.log("pool is closed"); +}); 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'); +} diff --git a/types/rc-slider/index.d.ts b/types/rc-slider/index.d.ts index 34cfc22056..c30f6a649c 100644 --- a/types/rc-slider/index.d.ts +++ b/types/rc-slider/index.d.ts @@ -1,154 +1,165 @@ -// 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'; +import * as React from "react"; -declare namespace RcSliderClass { - interface Marks { - [number: number]: JSX.Element | string | { style: any, label: string | JSX.Element }; - } - - 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; - } - - interface SliderProps extends CommonApiProps { - /** - * Set initial value of slider. - * @default 0 - */ - defaultValue?: number; - /** - * Set current value of slider. - */ - value?: number; - } - - 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; - } - - 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 interface Marks { + [number: number]: + | JSX.Element + | string + | { style: any; label: string | JSX.Element }; } -declare class RcSliderClass extends React.Component { } +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; -declare namespace RcSliderClass { - class Range extends React.Component { } - class Handle extends React.Component { } + /** + * @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?: 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?: React.CSSProperties[] | React.CSSProperties; + + /** + * The style used for the track base color. + */ + railStyle?: React.CSSProperties; } -export = RcSliderClass; +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 { } 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( , 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 ( + + + + + + ; + } +} 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" } diff --git a/types/react-tooltip/index.d.ts b/types/react-tooltip/index.d.ts new file mode 100644 index 0000000000..c4c380f533 --- /dev/null +++ b/types/react-tooltip/index.d.ts @@ -0,0 +1,55 @@ +// Type definitions for react-tooltip 3.3 +// 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"; + +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; 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 + +
+
; + } +} 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" } 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`. diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 86ecb00809..246984286e 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -1353,6 +1353,11 @@ declare namespace sequelize { */ otherKey?: string | AssociationForeignKeyOptions; + /** + * Should the join model have timestamps + */ + timestamps?: boolean; + } /** diff --git a/types/swiper/index.d.ts b/types/swiper/index.d.ts index e16c7d5cc5..57edc39a61 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; @@ -237,6 +241,8 @@ declare class Swiper { height: number; params: any; positions: any; + wrapper: any; + virtualSize: number; // Feature detection support: {