diff --git a/README.md b/README.md index 3e149a043f..7b575babbf 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ or just look for any ".d.ts" files in the package and manually include them with These can be used by TypeScript 1.0. * [Typings](https://github.com/typings/typings) -* [NuGet](http://nuget.org/Tpackages?q=DefinitelyTyped) +* ~~[NuGet](http://nuget.org/Tpackages?q=DefinitelyTyped)~~ (use preferred alternatives, nuget DT type publishing has been turned off) * Manually download from the `master` branch of this repository You may need to add manual [references](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html). diff --git a/actioncable/index.d.ts b/actioncable/index.d.ts index 8d42c4d17a..8815bcf88b 100644 --- a/actioncable/index.d.ts +++ b/actioncable/index.d.ts @@ -7,6 +7,7 @@ declare module ActionCable { interface Channel { unsubscribe(): void; perform(action: string, data: {}): void; + send(data: Object): boolean; } interface Subscriptions { diff --git a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts index 84ddd63790..16eaff3b39 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts @@ -38,6 +38,7 @@ testApp.config(( $datepickerConfig.formatMonth = 'M'; $datepickerConfig.formatMonthTitle = 'yy'; $datepickerConfig.formatYear = 'y'; + $datepickerConfig.initDate = '1389586124979'; $datepickerConfig.maxDate = '1389586124979'; $datepickerConfig.maxMode = 'month'; $datepickerConfig.minDate = '1389586124979'; diff --git a/angular-ui-bootstrap/index.d.ts b/angular-ui-bootstrap/index.d.ts index 24f8405125..73043c4e7a 100644 --- a/angular-ui-bootstrap/index.d.ts +++ b/angular-ui-bootstrap/index.d.ts @@ -42,7 +42,6 @@ declare module 'angular' { closeOthers?: boolean; } - interface IButtonConfig { /** * @default: 'active' @@ -55,7 +54,6 @@ declare module 'angular' { toggleEvent?: string; } - interface IDatepickerConfig { /** * Format of day in month. @@ -155,6 +153,13 @@ declare module 'angular' { */ maxDate?: any; + /** + * Defines the initial date, when no model value is specified. + * + * @default null + */ + initDate?: any; + /** * An option to disable or enable shortcut's event propagation * diff --git a/angular-ui-router-default/angular-ui-router-default-tests.ts b/angular-ui-router-default/angular-ui-router-default-tests.ts index 95229f68cd..39e792e3a1 100644 --- a/angular-ui-router-default/angular-ui-router-default-tests.ts +++ b/angular-ui-router-default/angular-ui-router-default-tests.ts @@ -1,11 +1,10 @@ import * as angular from "angular"; -import { ui } from "angular"; angular.module("test", [ "ui.router", "ui.router.default" ]) - .config(function($stateProvider: ui.IStateProvider) { + .config(function($stateProvider: angular.ui.IStateProvider) { $stateProvider .state('concrete', { // no abstract or default diff --git a/arcgis-rest-api/arcgis-rest-api-tests.ts b/arcgis-rest-api/arcgis-rest-api-tests.ts new file mode 100644 index 0000000000..0f4cf3d926 --- /dev/null +++ b/arcgis-rest-api/arcgis-rest-api-tests.ts @@ -0,0 +1,11 @@ +import { Point } from "arcgis-rest-api"; + +let point: Point; + +point = { + x: -122.6764, + y: 45.5165, + spatialReference: { + wkid: 4326 + } +}; \ No newline at end of file diff --git a/arcgis-rest-api/index.d.ts b/arcgis-rest-api/index.d.ts new file mode 100644 index 0000000000..2b28b32fac --- /dev/null +++ b/arcgis-rest-api/index.d.ts @@ -0,0 +1,219 @@ +// Type definitions for arcgis-to-geojson-utils 10.4 +// Project: http://resources.arcgis.com/en/help/arcgis-rest-api/ +// Definitions by: Jeff Jacobson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Feature { + geometry: Geometry; + attributes: any; +} + +export interface Field { + name: string; + type: string; + alias?: string; + length?: number; +} + +export interface FeatureSet extends HasZM { + objectIdFieldName?: string; // optional + globalIdFieldName?: string; // optional + displayFieldName?: string; // optional + geometryType?: esriGeometryType; // for feature layers only + spatialReference?: SpatialReference; // for feature layers only. + fields?: Field[]; + features: Feature[]; +} + +export type Position2D = [number, number]; +export type Position = Position2D | [number, number, number] | [number, number, number, number]; + +export interface CircularArc { + "c": [Position, Position2D]; +} + +export interface Arc { + "a": [ + Position, // End point: x, y, , + Position2D, // Center point: center_x, center_y + number, // minor + number, // clockwise + number, // rotation + number, // axis + number // ratio + ]; +} + +export type ElipticArc = Arc; + +export interface OldCircularArc { + "a": [ + Position, // End point: x, y, , + Position2D, // Center point: center_x, center_y + number, // minor + number // clockwise + ]; +} + +export interface BezierCurve { + "b": [ + Position, + Position2D, + Position2D + ]; +} + +export type JsonCurve = CircularArc | Arc | OldCircularArc | BezierCurve; + + +export interface SpatialReferenceWkid { + wkid?: number; + latestWkid?: number; + vcsWkid?: number; + latestVcsWkid?: number; +} + +export interface SpatialReferenceWkt { + wkt?: string; + latestWkt?: string; +} + +export type SpatialReference = SpatialReferenceWkt | SpatialReferenceWkid; + +export interface Geometry { + spatialReference?: SpatialReference; +} + +export interface HasZM { + hasZ?: boolean; + hasM?: boolean; +} + +export interface Point extends Geometry { + x: number; + y: number; + z?: number; + m?: number; +} + +export interface Polyline extends HasZM, Geometry { + paths: Position[][]; +} + +export interface PolylineWithCurves extends HasZM, Geometry { + curvePaths: Array>; +} + +export interface Polygon extends HasZM, Geometry { + rings: Position[][]; +} + +export interface PolygonWithCurves extends HasZM, Geometry { + curveRings: Array>; +} + +export interface Multipoint extends HasZM, Geometry { + points: Position[]; +} + +export interface Envelope extends Geometry { + xmin: number; + xmax: number; + ymin: number; + ymax: number; + + zmin?: number; + zmax?: number; + + mmin?: number; + mmax?: number; +} + +export type esriGeometryType = "esriGeometryPoint" | "esriGeometryMultipoint" | "esriGeometryPolyline" | "esriGeometryPolygon" | "esriGeometryEnvelope"; + + +export type Color = [number, number, number, number]; +export type SimpleMarkerSymbolStyle = "esriSMSCircle" | "esriSMSCross" | "esriSMSDiamond" | "esriSMSSquare" | "esriSMSX" | "esriSMSTriangle"; +export type SimpleLineSymbolStyle = "esriSLSDash" | "esriSLSDashDot" | "esriSLSDashDotDot" | "esriSLSDot" | "esriSLSNull" | "esriSLSSolid"; +export type SimpleFillSymbolStyle = "esriSFSBackwardDiagonal" | "esriSFSCross" | "esriSFSDiagonalCross" | "esriSFSForwardDiagonal" | "esriSFSHorizontal" | "esriSFSNull" | "esriSFSSolid" | "esriSFSVertical"; +export type SymbolType = "esriSLS" | "esriSMS" | "esriSFS" | "esriPMS" | "esriPFS" | "esriTS"; + +export interface Symbol { + "type": SymbolType; + "style"?: string; +} + +export interface SimpleLineSymbol extends Symbol { + "type": "esriSLS"; + "style"?: SimpleLineSymbolStyle; + "color"?: Color; + "width"?: number; +} + +export interface MarkerSymbol extends Symbol { + "angle"?: number; + "xoffset"?: number; + "yoffset"?: number; +} + +export interface SimpleMarkerSymbol extends MarkerSymbol { + "type": "esriSMS"; + "style"?: SimpleMarkerSymbolStyle; + "color"?: Color; + "size"?: number; + "outline"?: SimpleLineSymbol; +} + +export interface SimpleFillSymbol extends Symbol { + "type": "esriSFS"; + "style"?: SimpleFillSymbolStyle; + "color"?: Color; + "outline"?: SimpleLineSymbol; //if outline has been specified +} + +export interface PictureSourced { + "url"?: string; //Relative URL for static layers and full URL for dynamic layers. Access relative URL using http:////images/ + "imageData"?: string; //""; + "contentType"?: string; + "width"?: number; + "height"?: number; + "angle"?: number; + "xoffset"?: number; + "yoffset"?: number; + +} + +export interface PictureMarkerSymbol extends MarkerSymbol, PictureSourced { + "type": "esriPMS"; +} + +export interface PictureFillSymbol extends Symbol, PictureSourced { + "type": "esriPFS"; + "outline"?: SimpleLineSymbol; //if outline has been specified + "xscale"?: number; + "yscale"?: number; +} + +export interface Font { + "family"?: string; //""; + "size"?: number; //; + "style"?: "italic" | "normal" | "oblique"; + "weight"?: "bold" | "bolder" | "lighter" | "normal"; + "decoration"?: "line-through" | "underline" | "none"; +} + +export interface TextSymbol extends MarkerSymbol { + "type": "esriTS"; + "color"?: Color; + "backgroundColor"?: Color; + "borderLineSize"?: number; // ; + "borderLineColor"?: Color; + "haloSize"?: number; // ; + "haloColor"?: Color; + "verticalAlignment"?: "baseline" | "top" | "middle" | "bottom"; + "horizontalAlignment"?: "left" | "right" | "center" | "justify"; + "rightToLeft"?: boolean; + "kerning"?: boolean; + "font"?: Font; + "text"?: string; //only applicable when specified as a client-side graphic. +} \ No newline at end of file diff --git a/arcgis-rest-api/tsconfig.json b/arcgis-rest-api/tsconfig.json new file mode 100644 index 0000000000..ac74de6345 --- /dev/null +++ b/arcgis-rest-api/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "arcgis-rest-api-tests.ts" + ] +} \ No newline at end of file diff --git a/arcgis-rest-api/tslint.json b/arcgis-rest-api/tslint.json new file mode 100644 index 0000000000..2149d13884 --- /dev/null +++ b/arcgis-rest-api/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} \ No newline at end of file diff --git a/arcgis-to-geojson-utils/arcgis-to-geojson-utils-tests.ts b/arcgis-to-geojson-utils/arcgis-to-geojson-utils-tests.ts new file mode 100644 index 0000000000..48a06fcd02 --- /dev/null +++ b/arcgis-to-geojson-utils/arcgis-to-geojson-utils-tests.ts @@ -0,0 +1,20 @@ +import utils = require("arcgis-to-geojson-utils"); +import arcgisApi = require("arcgis-rest-api"); + +let arcgisPoint: arcgisApi.Point = { + x: -122.6764, + y: 45.5165, + spatialReference: { + wkid: 4326 + } +}; +let geojsonPoint: GeoJSON.Point = { + type: "Point", + coordinates: [45.5165, -122.6764] +}; + +// parse ArcGIS JSON, convert it to GeoJSON +var geojson = utils.arcgisToGeoJSON(arcgisPoint); + +// take GeoJSON and convert it to ArcGIS JSON +var arcgis = utils.geojsonToArcGIS(geojsonPoint); \ No newline at end of file diff --git a/arcgis-to-geojson-utils/index.d.ts b/arcgis-to-geojson-utils/index.d.ts new file mode 100644 index 0000000000..94a86022a3 --- /dev/null +++ b/arcgis-to-geojson-utils/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for arcgis-to-geojson-utils 1.0 +// Project: https://github.com/Esri/arcgis-to-geojson-utils +// Definitions by: Jeff Jacobson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as ArcGis from "arcgis-rest-api"; + +/** + * Converts an ArcGIS geometry into a GeoJSON geometry. + */ +export function arcgisToGeoJSON(arcgis: T): GeoJSON.GeometryObject; + +/** + * Converts a GeoJSON geometry into a ArcGIS geometry. + */ +export function geojsonToArcGIS(geojson: GeoJSON.GeometryObject): ArcGis.Geometry; \ No newline at end of file diff --git a/arcgis-to-geojson-utils/tsconfig.json b/arcgis-to-geojson-utils/tsconfig.json new file mode 100644 index 0000000000..2ef6376fee --- /dev/null +++ b/arcgis-to-geojson-utils/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "arcgis-to-geojson-utils-tests.ts" + ] +} \ No newline at end of file diff --git a/arcgis-to-geojson-utils/tslint.json b/arcgis-to-geojson-utils/tslint.json new file mode 100644 index 0000000000..2149d13884 --- /dev/null +++ b/arcgis-to-geojson-utils/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} \ No newline at end of file diff --git a/chai-json-schema/chai-json-schema-tests.ts b/chai-json-schema/chai-json-schema-tests.ts new file mode 100644 index 0000000000..8559d3caae --- /dev/null +++ b/chai-json-schema/chai-json-schema-tests.ts @@ -0,0 +1,56 @@ +/// + +import { expect } from 'chai'; +import { assert } from 'chai'; + +import chai = require('chai'); +import ChaiJsonSchema = require('chai-json-schema'); + +chai.use(ChaiJsonSchema); +chai.should(); + +let goodApple = { + skin: 'thin', + colors: ['red', 'green', 'yellow'], + taste: 10 +}; + +let badApple = { + colors: ['brown'], + taste: 0, + worms: 2 +}; + +let fruitSchema = { + title: 'fresh fruit schema v1', + type: 'object', + required: ['skin', 'colors', 'taste'], + properties: { + colors: { + type: 'array', + minItems: 1, + uniqueItems: true, + items: { + type: 'string' + } + }, + skin: { + type: 'string' + }, + taste: { + type: 'number', + minimum: 5 + } + } +}; + +//bdd style +expect(goodApple).to.be.jsonSchema(fruitSchema); +expect(badApple).to.not.be.jsonSchema(fruitSchema); + +goodApple.should.be.jsonSchema(fruitSchema); +badApple.should.not.be.jsonSchema(fruitSchema); + +//tdd style +assert.jsonSchema(goodApple, fruitSchema); +assert.notJsonSchema(badApple, fruitSchema); diff --git a/chai-json-schema/index.d.ts b/chai-json-schema/index.d.ts new file mode 100644 index 0000000000..e3e4934c76 --- /dev/null +++ b/chai-json-schema/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for chai-json-schema 1.4 +// Project: https://github.com/chaijs/chai-json-schema/ +// Definitions by: Ulrich Heiniger +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// +// + +declare namespace Chai { + export interface Assert { + jsonSchema(value: any, schema: any, msg?: string): void; + notJsonSchema(value: any, schema: any, msg?: string): void; + } + + export interface LanguageChains { + jsonSchema(schema: any, msg?: string): void; + } +} + +declare module "chai-json-schema" { + function chaiJsonSchema(chai: any, utils: any): void; + namespace chaiJsonSchema {} + export = chaiJsonSchema; +} diff --git a/chai-json-schema/tsconfig.json b/chai-json-schema/tsconfig.json new file mode 100644 index 0000000000..1ac8b87c7a --- /dev/null +++ b/chai-json-schema/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "chai-json-schema-tests.ts" + ] +} diff --git a/chai-json-schema/tslint.json b/chai-json-schema/tslint.json new file mode 100644 index 0000000000..83a03ce890 --- /dev/null +++ b/chai-json-schema/tslint.json @@ -0,0 +1,5 @@ +{ "extends": "../tslint.json", + "rules": { + "no-single-declare-module": false + } +} diff --git a/chart.js/index.d.ts b/chart.js/index.d.ts index e9186035c7..bf23a1cc52 100644 --- a/chart.js/index.d.ts +++ b/chart.js/index.d.ts @@ -172,11 +172,11 @@ interface ChartAnimationOptions { interface ChartElementsOptions { point?: ChartPointOptions; line?: ChartLineOptions; - arg?: ChartArcOtpions; + arc?: ChartArcOptions; rectangle?: ChartRectangleOptions; } -interface ChartArcOtpions { +interface ChartArcOptions { backgroundColor?: ChartColor; borderColor?: ChartColor; borderWidth?: number; @@ -394,6 +394,7 @@ interface RadialLinearScale { declare class Chart { constructor (context: CanvasRenderingContext2D | HTMLCanvasElement, options: ChartConfiguration); config: ChartConfiguration; + data: ChartData; destroy: () => {}; update: (duration?: any, lazy?: any) => {}; render: (duration?: any, lazy?: any) => {}; diff --git a/chrome/chrome-app.d.ts b/chrome/chrome-app.d.ts index a38d0c7724..f80b335125 100644 --- a/chrome/chrome-app.d.ts +++ b/chrome/chrome-app.d.ts @@ -355,6 +355,14 @@ declare namespace chrome.sockets.tcp { var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; } +/** + * Use the chrome.sockets.udp API to send and receive data over the network + * using UDP connections. This API supersedes the UDP functionality previously + * found in the "socket" API. + * + * @since Chrome 33 + * @see https://developer.chrome.com/apps/sockets_udp + */ declare namespace chrome.sockets.udp { interface CreateInfo { socketId: number; @@ -377,43 +385,278 @@ declare namespace chrome.sockets.udp { resultCode: number; } + /** + * @see https://developer.chrome.com/apps/sockets_udp#type-SocketProperties + */ interface SocketProperties { + /** + * Flag indicating if the socket is left open when the event page of the + * application is unloaded. The default value is "false." When the + * application is loaded, any sockets previously opened with + * persistent=true can be fetched with getSockets. + * @see http://developer.chrome.com/apps/app_lifecycle.html + */ persistent?: boolean; + + /** An application-defined string associated with the socket. */ name?: string; + + /** + * The size of the buffer used to receive data. If the buffer is too + * small to receive the UDP packet, data is lost. The default value is + * 4096. + */ bufferSize?: number; } + /** + * @see https://developer.chrome.com/apps/sockets_udp#type-SocketInfo + */ interface SocketInfo { + /** The socket identifier. */ socketId: number; + + /** + * Flag indicating whether the socket is left open when the application + * is suspended (see SocketProperties.persistent). + */ persistent: boolean; + + /** Application-defined string associated with the socket. */ name?: string; + + /** + * The size of the buffer used to receive data. If no buffer size ha + * been specified explictly, the value is not provided. + */ bufferSize?: number; + + /** + * Flag indicating whether the socket is blocked from firing onReceive + * events. + */ paused: boolean; + + /** + * If the underlying socket is bound, contains its local IPv4/6 address. + */ localAddress?: string; + + /** + * If the underlying socket is bound, contains its local port. + */ localPort?: number; } + /** + * Creates a UDP socket with default properties. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-create + * @param createInfo.socketId The ID of the newly created socket. + */ export function create(callback: (createInfo: CreateInfo) => void): void; - export function create(properties: SocketProperties, - callback: (createInfo: CreateInfo) => void): void; + /** + * Creates a UDP socket with the given properties. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-create + * @param properties The socket properties. + * @param createInfo.socketId The ID of the newly created socket. + */ + export function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; + + /** + * Updates the socket properties. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-update + * @param socketId The socket ID. + * @param properties The properties to update. + * @param callback Called when the properties are updated. + */ export function update(socketId: number, properties: SocketProperties, callback?: () => void): void; + + /** + * Pauses or unpauses a socket. A paused socket is blocked from firing + * onReceive events. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-setPaused + * @param socketId The socket ID. + * @param paused Flag to indicate whether to pause or unpause. + * @param callback Called when the socket has been successfully paused or + * unpaused. + */ export function setPaused(socketId: number, paused: boolean, callback?: () => void): void; + + /** + * Binds the local address and port for the socket. For a client socket, it + * is recommended to use port 0 to let the platform pick a free port. + * + * Once the bind operation completes successfully, onReceive events are + * raised when UDP packets arrive on the address/port specified -- unless + * the socket is paused. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-bind + * @param socketId The socket ID. + * @param address The address of the local machine. DNS name, IPv4 and IPv6 + * formats are supported. Use "0.0.0.0" to accept packets + * from all local available network interfaces. + * @param port The port of the local machine. Use "0" to bind to a free + * port. + * @param callback Called when the bind operation completes. + */ export function bind(socketId: number, address: string, port: number, callback: (result: number) => void): void; + + /** + * Sends data on the given socket to the given address and port. The socket + * must be bound to a local port before calling this method. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-send + * @param socketId The socket ID. + * @param data The data to send. + * @param address The address of the remote machine. + * @param port The port of the remote machine. + * @param callback Called when the send operation completes. + */ export function send(socketId: number, data: ArrayBuffer, address: string, port: number, callback: (sendInfo: SendInfo) => void): void; + + /** + * Closes the socket and releases the address/port the socket is bound to. + * Each socket created should be closed after use. The socket id is no + * longer valid as soon at the function is called. However, the socket is + * guaranteed to be closed only when the callback is invoked. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-close + * @param socketId The socket ID. + * @param callback Called when the close operation completes. + */ export function close(socketId: number, callback?: () => void): void; + + /** + * Retrieves the state of the given socket. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-getInfo + * @param socketId The socket ID. + * @param callback Called when the socket state is available. + */ export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; + + /** + * Retrieves the list of currently opened sockets owned by the application. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-getSockets + * @param callback Called when the list of sockets is available. + */ export function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; + + /** + * Joins the multicast group and starts to receive packets from that group. + * The socket must be bound to a local port before calling this method. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-joinGroup + * @param socketId The socket ID. + * @param address The group address to join. Domain names are not supported. + * @param callback Called when the joinGroup operation completes. + */ export function joinGroup(socketId: number, address: string, callback: (result: number) => void): void; + + /** + * Leaves the multicast group previously joined using joinGroup. This is + * only necessary to call if you plan to keep using the socket afterwards, + * since it will be done automatically by the OS when the socket is closed. + * + * Leaving the group will prevent the router from sending multicast + * datagrams to the local host, presuming no other process on the host is + * still joined to the group. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-leaveGroup + * @param socketId The socket ID. + * @param address The group address to leave. Domain names are not + * supported. + * @param callback Called when the leaveGroup operation completes. + */ export function leaveGroup(socketId: number, address: string, callback: (result: number) => void): void; + + /** + * Sets the time-to-live of multicast packets sent to the multicast group. + * + * Calling this method does not require multicast permissions. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-setMulticastTimeToLive + * @param socketId The socket ID. + * @param ttl The time-to-live value. + * @param callback Called when the configuration operation completes. + */ export function setMulticastTimeToLive(socketId: number, ttl: number, callback: (result: number) => void): void; + + /** + * Sets whether multicast packets sent from the host to the multicast group + * will be looped back to the host. + * + * Note: the behavior of setMulticastLoopbackMode is slightly different + * between Windows and Unix-like systems. The inconsistency happens only + * when there is more than one application on the same host joined to the + * same multicast group while having different settings on multicast + * loopback mode. On Windows, the applications with loopback off will not + * RECEIVE the loopback packets; while on Unix-like systems, the + * applications with loopback off will not SEND the loopback packets to + * other applications on the same host. + * @see MSDN: http://goo.gl/6vqbj + * + * Calling this method does not require multicast permissions. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-setMulticastLoopbackMode + * @param socketId The socket ID. + * @param enabled Indicate whether to enable loopback mode. + * @param callback Called when the configuration operation completes. + */ export function setMulticastLoopbackMode(socketId: number, enabled: boolean, callback: (result: number) => void): void; + + /** + * Gets the multicast group addresses the socket is currently joined to. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-getJoinedGroups + * @param socketId The socket ID. + * @param callback Called with an array of strings of the result. + */ export function getJoinedGroups(socketId: number, callback: (groups: string[]) => void): void; + /** + * Enables or disables broadcast packets on this socket. + * + * @since Chrome 44 + * @see https://developer.chrome.com/apps/sockets_udp#method-setBroadcast + * @param socketId The socket ID. + * @param enabled true to enable broadcast packets, false to disable them. + * @param callback Callback from the setBroadcast method. + */ + export function setBroadcast(socketId: number, enabled: boolean, callback?: (result: number) => void): void; + + /** + * Event raised when a UDP packet has been received for the given socket. + * + * @see https://developer.chrome.com/apps/sockets_udp#event-onReceive + */ var onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>; + + /** + * Event raised when a network error occured while the runtime was waiting + * for data on the socket address and port. Once this event is raised, the + * socket is paused and no more onReceive events will be raised for this + * socket until the socket is resumed. + * + * @see https://developer.chrome.com/apps/sockets_udp#event-onReceiveError + */ var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; } +/** + * Use the chrome.sockets.tcpServer API to create server applications using TCP + * connections. This API supersedes the TCP functionality previously found in + * the chrome.socket API. + * + * @since Chrome 33 + * @see https://developer.chrome.com/apps/sockets_tcpServer + */ declare namespace chrome.sockets.tcpServer { interface CreateInfo { socketId: number; @@ -429,36 +672,180 @@ declare namespace chrome.sockets.tcpServer { resultCode: number; } + /** + * @see https://developer.chrome.com/apps/sockets_tcpServer#type-SocketProperties + */ interface SocketProperties { + /** + * Flag indicating if the socket remains open when the event page of the + * application is unloaded. The default value is "false." When the + * application is loaded, any sockets previously opened with + * persistent=true can be fetched with getSockets. + * + * @see http://developer.chrome.com/apps/app_lifecycle.html + */ persistent?: boolean; + + /** An application-defined string associated with the socket. */ name?: string; } + /** + * @see https://developer.chrome.com/apps/sockets_tcpServer#type-SocketInfo + */ interface SocketInfo { + /** The socket identifier. */ socketId: number; + + /** + * Flag indicating if the socket remains open when the event page of the + * application is unloaded (see SocketProperties.persistent). The + * default value is "false". + */ persistent: boolean; + + /** Application-defined string associated with the socket. */ name?: string; + + /** + * Flag indicating whether connection requests on a listening socket are + * dispatched through the onAccept event or queued up in the listen + * queue backlog. See setPaused. The default value is "false" + */ paused: boolean; + + /** If the socket is listening, contains its local IPv4/6 address. */ localAddress?: string; + + /** If the socket is listening, contains its local port. */ localPort?: number; } + /** + * Creates a TCP server socket. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-create + * @param callback Called when the socket has been created. + */ export function create(callback: (createInfo: CreateInfo) => void): void; + + /** + * Creates a TCP server socket. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-create + * @param properties The socket properties. + * @param callback Called when the socket has been created. + */ export function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; + /** + * Updates the socket properties. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-update + * @param socketId The socket identifier. + * @param properties The properties to update. + * @param callback Called when the properties are updated. + */ export function update(socketId: number, properties: SocketProperties, callback?: () => void): void; + + /** + * Enables or disables a listening socket from accepting new connections. + * When paused, a listening socket accepts new connections until its backlog + * (see listen function) is full then refuses additional connection + * requests. onAccept events are raised only when the socket is un-paused. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-setPaused + * @param callback Callback from the setPaused method. + */ export function setPaused(socketId: number, paused: boolean, callback?: () => void): void; - export function listen(socketId: number, address: string, - port: number, backlog: number, callback: (result: number) => void): void; - export function listen(socketId: number, address: string, - port: number, callback: (result: number) => void): void; + /** + * Listens for connections on the specified port and address. If the + * port/address is in use, the callback indicates a failure. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-listen + * @param socketId The socket identifier. + * @param address The address of the local machine. + * @param port The port of the local machine. When set to 0, a free port + * is chosen dynamically. The dynamically allocated port can + * be found by calling getInfo. + * @param backlog Length of the socket's listen queue. The default value + * depends on the Operating System (SOMAXCONN), which + * ensures a reasonable queue length for most applications. + * @param callback Called when listen operation completes. + */ + export function listen(socketId: number, address: string, port: number, backlog: number, callback: (result: number) => void): void; + /** + * Listens for connections on the specified port and address. If the + * port/address is in use, the callback indicates a failure. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-listen + * @param socketId The socket identifier. + * @param address The address of the local machine. + * @param port The port of the local machine. When set to 0, a free port + * is chosen dynamically. The dynamically allocated port can + * be found by calling getInfo. + * @param callback Called when listen operation completes. + */ + export function listen(socketId: number, address: string, port: number, callback: (result: number) => void): void; + + /** + * Disconnects the listening socket, i.e. stops accepting new connections + * and releases the address/port the socket is bound to. The socket + * identifier remains valid, e.g. it can be used with listen to accept + * connections on a new port and address. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-disconnect + * @param socketId The socket identifier. + * @param callback Called when the disconnect attempt is complete. + */ export function disconnect(socketId: number, callback?: () => void): void; - export function close(socketId: number, callback?: () => void): void; - export function getInfo(socketId: number, callback: (socketInfos: SocketInfo[]) => void): void; + /** + * Disconnects and destroys the socket. Each socket created should be closed + * after use. The socket id is no longer valid as soon at the function is + * called. However, the socket is guaranteed to be closed only when the + * callback is invoked. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-close + * @param socketId The socket identifier. + * @param callback Called when the close operation completes. + */ + export function close(socketId: number, callback?: () => void): void; + + /** + * Retrieves the state of the given socket. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-getInfo + * @param socketId The socket identifier. + * @param callback Called when the socket state is available. + */ + export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; + + /** + * Retrieves the list of currently opened sockets owned by the application. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-getSockets + * @param callback Called when the list of sockets is available. + */ + export function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; + + /** + * Event raised when a connection has been made to the server socket. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#event-onAccept + */ var onAccept: chrome.events.Event<(args: AcceptEventArgs) => void>; + + /** + * Event raised when a network error occured while the runtime was waiting + * for new connections on the socket address and port. Once this event is + * raised, the socket is set to paused and no more onAccept events are + * raised for this socket until the socket is resumed. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#event-onAcceptError + */ var onAcceptError: chrome.events.Event<(args: AcceptErrorEventArgs) => void>; } diff --git a/codemirror/index.d.ts b/codemirror/index.d.ts index 83c45e93ab..4af27f5f12 100644 --- a/codemirror/index.d.ts +++ b/codemirror/index.d.ts @@ -178,6 +178,13 @@ declare namespace CodeMirror { class can be left off to remove all classes for the specified node, or be a string to remove only a specific class. */ removeLineClass(line: any, where: string, class_: string): CodeMirror.LineHandle; + /** + * Compute the line at the given pixel height. + * + * `mode` is the relative element to use to compute this line - defaults to 'page' if not specified + */ + lineAtHeight(height: number, mode?: 'window' | 'page' | 'local'): number + /** Returns the line number, text content, and marker status of the given line, which can be either a number or a line handle. */ lineInfo(line: any): { line: any; diff --git a/colors/colors-tests.ts b/colors/colors-tests.ts index e8ad0910ed..fcac0323f6 100644 --- a/colors/colors-tests.ts +++ b/colors/colors-tests.ts @@ -1,16 +1,21 @@ import colors = require("colors"); +import { zalgo } from "colors/safe"; + +let str: string; + +str = zalgo(""); colors.enabled = true; -console.log(colors.black.underline('test')); -console.log(colors.rainbow.black.blue.gray('test')); -console.log(colors.random.reset.bgWhite.dim('test')); -console.log(colors.random.reset.bgWhite.strip('test')); -console.log('test'.black.underline); -console.log('test'.rainbow.black.blue.gray); -console.log('test'.random.reset.bgWhite.dim); -console.log('test'.random.reset.bgWhite.dim.stripColors); +str = colors.black.underline('test'); +str = colors.rainbow.black.blue.gray('test'); +str = colors.random.reset.bgWhite.dim('test'); +str = colors.random.reset.bgWhite.strip('test'); +str = 'test'.black.underline; +str = 'test'.rainbow.black.blue.gray; +str = 'test'.random.reset.bgWhite.dim; +str = 'test'.random.reset.bgWhite.dim.stripColors; colors.enabled = false; -console.log(colors.black.underline('test')); +str = colors.black.underline('test'); diff --git a/colors/index.d.ts b/colors/index.d.ts index 50e960c416..e087bd0714 100644 --- a/colors/index.d.ts +++ b/colors/index.d.ts @@ -1,137 +1,133 @@ -// Type definitions for Colors.js 0.6.0-1 +// Type definitions for Colors.js 1.1 // Project: https://github.com/Marak/colors.js -// Definitions by: Bart van der Schoor +// Definitions by: Bart van der Schoor , Staffan Eketorp // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module "colors" { - interface Color { - (text: string): string; +interface Color { + (text: string): string; - strip: Color; - stripColors: Color; + strip: Color; + stripColors: Color; - black: Color; - red: Color; - green: Color; - yellow: Color; - blue: Color; - magenta: Color; - cyan: Color; - white: Color; - gray: Color; - grey: Color; + black: Color; + red: Color; + green: Color; + yellow: Color; + blue: Color; + magenta: Color; + cyan: Color; + white: Color; + gray: Color; + grey: Color; - bgBlack: Color; - bgRed: Color; - bgGreen: Color; - bgYellow: Color; - bgBlue: Color; - bgMagenta: Color; - bgCyan: Color; - bgWhite: Color; + bgBlack: Color; + bgRed: Color; + bgGreen: Color; + bgYellow: Color; + bgBlue: Color; + bgMagenta: Color; + bgCyan: Color; + bgWhite: Color; - reset: Color; - bold: Color; - dim: Color; - italic: Color; - underline: Color; - inverse: Color; - hidden: Color; - strikethrough: Color; + reset: Color; + bold: Color; + dim: Color; + italic: Color; + underline: Color; + inverse: Color; + hidden: Color; + strikethrough: Color; - rainbow: Color; - zebra: Color; - america: Color; - trap: Color; - random: Color; - zalgo: Color; - } - - namespace e { - export function setTheme(theme:any): void; - - export var enabled: boolean; - - export var strip: Color; - export var stripColors: Color; - - export var black: Color; - export var red: Color; - export var green: Color; - export var yellow: Color; - export var blue: Color; - export var magenta: Color; - export var cyan: Color; - export var white: Color; - export var gray: Color; - export var grey: Color; - - export var bgBlack: Color; - export var bgRed: Color; - export var bgGreen: Color; - export var bgYellow: Color; - export var bgBlue: Color; - export var bgMagenta: Color; - export var bgCyan: Color; - export var bgWhite: Color; - - export var reset: Color; - export var bold: Color; - export var dim: Color; - export var italic: Color; - export var underline: Color; - export var inverse: Color; - export var hidden: Color; - export var strikethrough: Color; - - export var rainbow: Color; - export var zebra: Color; - export var america: Color; - export var trap: Color; - export var random: Color; - export var zalgo: Color; - } - - export = e; + rainbow: Color; + zebra: Color; + america: Color; + trap: Color; + random: Color; + zalgo: Color; } -interface String { - strip: string; - stripColors: string; +export function setTheme(theme: any): void; - black: string; - red: string; - green: string; - yellow: string; - blue: string; - magenta: string; - cyan: string; - white: string; - gray: string; - grey: string; +export var enabled: boolean; - bgBlack: string; - bgRed: string; - bgGreen: string; - bgYellow: string; - bgBlue: string; - bgMagenta: string; - bgCyan: string; - bgWhite: string; +export var strip: Color; +export var stripColors: Color; - reset: string; - bold: string; - dim: string; - italic: string; - underline: string; - inverse: string; - hidden: string; - strikethrough: string; +export var black: Color; +export var red: Color; +export var green: Color; +export var yellow: Color; +export var blue: Color; +export var magenta: Color; +export var cyan: Color; +export var white: Color; +export var gray: Color; +export var grey: Color; - rainbow: string; - zebra: string; - america: string; - trap: string; - random: string; - zalgo: string; -} +export var bgBlack: Color; +export var bgRed: Color; +export var bgGreen: Color; +export var bgYellow: Color; +export var bgBlue: Color; +export var bgMagenta: Color; +export var bgCyan: Color; +export var bgWhite: Color; + +export var reset: Color; +export var bold: Color; +export var dim: Color; +export var italic: Color; +export var underline: Color; +export var inverse: Color; +export var hidden: Color; +export var strikethrough: Color; + +export var rainbow: Color; +export var zebra: Color; +export var america: Color; +export var trap: Color; +export var random: Color; +export var zalgo: Color; + +declare global { + interface String { + strip: string; + stripColors: string; + + black: string; + red: string; + green: string; + yellow: string; + blue: string; + magenta: string; + cyan: string; + white: string; + gray: string; + grey: string; + + bgBlack: string; + bgRed: string; + bgGreen: string; + bgYellow: string; + bgBlue: string; + bgMagenta: string; + bgCyan: string; + bgWhite: string; + + reset: string; + bold: string; + dim: string; + italic: string; + underline: string; + inverse: string; + hidden: string; + strikethrough: string; + + rainbow: string; + zebra: string; + america: string; + trap: string; + random: string; + zalgo: string; + } +} \ No newline at end of file diff --git a/colors/safe.d.ts b/colors/safe.d.ts new file mode 100644 index 0000000000..c2145b7bc1 --- /dev/null +++ b/colors/safe.d.ts @@ -0,0 +1,40 @@ +export var enabled: boolean; + +export function strip(str: string): string; +export function stripColors(str: string): string; + +export function black(str: string): string; +export function red(str: string): string; +export function green(str: string): string; +export function yellow(str: string): string; +export function blue(str: string): string; +export function magenta(str: string): string; +export function cyan(str: string): string; +export function white(str: string): string; +export function gray(str: string): string; +export function grey(str: string): string; + +export function bgBlack(str: string): string; +export function bgRed(str: string): string; +export function bgGreen(str: string): string; +export function bgYellow(str: string): string; +export function bgBlue(str: string): string; +export function bgMagenta(str: string): string; +export function bgCyan(str: string): string; +export function bgWhite(str: string): string; + +export function reset(str: string): string; +export function bold(str: string): string; +export function dim(str: string): string; +export function italic(str: string): string; +export function underline(str: string): string; +export function inverse(str: string): string; +export function hidden(str: string): string; +export function strikethrough(str: string): string; + +export function rainbow(str: string): string; +export function zebra(str: string): string; +export function america(str: string): string; +export function trap(str: string): string; +export function random(str: string): string; +export function zalgo(str: string): string; diff --git a/colors/tsconfig.json b/colors/tsconfig.json index 5630227201..203d97e2fa 100644 --- a/colors/tsconfig.json +++ b/colors/tsconfig.json @@ -4,7 +4,7 @@ "target": "es6", "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/colors/tslint.json b/colors/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/colors/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file diff --git a/cordova-sqlite-storage/tslint.json b/cordova-sqlite-storage/tslint.json index 3c28fbed42..2221e40e4a 100644 --- a/cordova-sqlite-storage/tslint.json +++ b/cordova-sqlite-storage/tslint.json @@ -1,7 +1 @@ -{ - "extends": "../tslint.json", - "rules": { - // https://github.com/Microsoft/types-publisher/issues/241 - "void-return": false - } -} +{ "extends": "../tslint.json" } \ No newline at end of file diff --git a/csv-stringify/csv-stringify-tests.ts b/csv-stringify/csv-stringify-tests.ts index 5dd14d459c..7ffd1f6e3e 100644 --- a/csv-stringify/csv-stringify-tests.ts +++ b/csv-stringify/csv-stringify-tests.ts @@ -1,6 +1,8 @@ +/// import stringify = require("csv-stringify"); +let stream: stringify.Stringifier; stringify([["1", "2", "3"], ["4", "5", "6"]], (error: Error, output: string): void => { // nothing @@ -13,9 +15,10 @@ stringify([["1", "2", "3"], ["4", "5", "6"]], { }); -var s = stringify({ delimiter: "," }); -s.write(["1", "2", "3"]); - +stream = stringify({ delimiter: "," }); +stream.write(["1", "2", "3"]); +let transform: NodeJS.ReadWriteStream = stream; +stream = stringify(); diff --git a/csv-stringify/index.d.ts b/csv-stringify/index.d.ts index 6525bd9e15..fcf3321319 100644 --- a/csv-stringify/index.d.ts +++ b/csv-stringify/index.d.ts @@ -1,12 +1,10 @@ -// Type definitions for csv-stringify 0.0.6 +// Type definitions for csv-stringify 1.0 // Project: https://github.com/wdavidw/node-csv-stringify // Definitions by: Rogier Schouten // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// - - declare namespace stringify { interface StringifyOpts { /** @@ -57,26 +55,24 @@ declare namespace stringify { } interface Stringifier extends NodeJS.ReadWriteStream { - - // Stringifier stream takes array of strings or Object - write(line: string[] | Object): boolean; + // Stringifier stream takes array of strings or Object + write(line: string[] | any): boolean; // repeat declarations from NodeJS.WritableStream to avoid compile error - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; + write(buffer: string | Buffer, cb?: () => void): boolean; + write(str: string, encoding?: string, cb?: () => void): boolean; } } -/** - * Callback version: string in --> callback with string out - */ -declare function stringify(input: any[][], opts: stringify.StringifyOpts, callback: (error: Error, output: string) => void): void; -declare function stringify(input: any[][], callback: (error: Error, output: string) => void): void; - /** * Streaming stringifier */ -declare function stringify(opts: stringify.StringifyOpts): stringify.Stringifier; +declare function stringify(opts?: stringify.StringifyOpts): stringify.Stringifier; + +/** + * Callback version: string in --> callback with string out + */ +declare function stringify(input: any[][], opts: stringify.StringifyOpts, callback: (error: Error | undefined, output: string) => void): void; +declare function stringify(input: any[][], callback: (error: Error | undefined, output: string) => void): void; export = stringify; diff --git a/csv-stringify/tslint.json b/csv-stringify/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/csv-stringify/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/d3kit/d3kit-tests.ts b/d3kit/d3kit-tests.ts index 8e524a1f69..c8a447ecda 100644 --- a/d3kit/d3kit-tests.ts +++ b/d3kit/d3kit-tests.ts @@ -5,7 +5,7 @@ function test_abstract_chart() { chart: d3kit.AbstractChart, options: d3kit.ChartOptions, margins: d3kit.ChartMargin, - offsets: d3kit.ChartOffset, + offsets: [number, number], defopts: d3kit.ChartOptions, fitopts: d3kit.FitOptions, watchop: d3kit.WatchOptions, @@ -17,7 +17,7 @@ function test_abstract_chart() { // create examples of margins, offsets, options, fit options, watch options margins = { top: 20, right: 20, bottom: 20, left: 20}; - offsets = { x: 0.5, y: 0.5 }; + offsets = [0.5, 0.5]; options = { initialWidth: 400, initialHeight: 300, margin: margins, offset: offsets }; fitopts = { mode: 'basic', width: '90%', ratio: 4/3 }; watchop = { mode: 'window', target: null, interval: 500 }; @@ -85,7 +85,7 @@ function test_svgchart() { chart: d3kit.SvgChart, options: d3kit.ChartOptions, margins: d3kit.ChartMargin, - offsets: d3kit.ChartOffset, + offsets: [number, number], svg: d3.Selection, rootg: d3.Selection, layers: d3kit.LayerOrganizer; @@ -95,7 +95,7 @@ function test_svgchart() { // create examples of margins, offsets, options, fit options, watch options margins = { top: 20, right: 20, bottom: 20, left: 20}; - offsets = { x: 0.5, y: 0.5 }; + offsets = [0.5, 0.5]; options = { initialWidth: 400, initialHeight: 300, margin: margins, offset: offsets }; /** @@ -119,7 +119,7 @@ function test_canvaschart() { chart: d3kit.CanvasChart, options: d3kit.ChartOptions, margins: d3kit.ChartMargin, - offsets: d3kit.ChartOffset, + offsets: [number, number], context: CanvasRenderingContext2D; // create a div, append to body, return Node as type Element @@ -127,7 +127,7 @@ function test_canvaschart() { // create examples of margins, offsets, options, fit options, watch options margins = { top: 20, right: 20, bottom: 20, left: 20}; - offsets = { x: 0.5, y: 0.5 }; + offsets = [0.5, 0.5]; options = { initialWidth: 400, initialHeight: 300, margin: margins, offset: offsets, pixelRatio: 1 }; /** diff --git a/d3kit/index.d.ts b/d3kit/index.d.ts index 18adf3c6c0..8d0d468a3c 100644 --- a/d3kit/index.d.ts +++ b/d3kit/index.d.ts @@ -26,8 +26,8 @@ export class AbstractChart { data(): any; margin(margins: ChartMargin): this; margin(): ChartMargin; - offset(offset: ChartOffset): this; - offset(): ChartOffset; + offset(offset: [number, number]): this; + offset(): [number, number]; options(options: ChartOptions): this; options(): ChartOptions; updateDimensionNow(): this; @@ -47,16 +47,11 @@ export interface ChartMargin { left?: number; } -export interface ChartOffset { - x: number; - y: number; -} - export interface ChartOptions { initialWidth?: number; initialHeight?: number; margin?: ChartMargin; - offset?: ChartOffset; + offset?: [number, number]; pixelRatio?: number; } @@ -93,23 +88,23 @@ export class CanvasChart extends AbstractChart { export class LayerOrganizer { constructor(container: d3.Selection, defaultTag?: string); - create(layerNames: string|Array|LayerConfig|Array): d3.Selection|Array>; + create(layerNames: string|string[]|LayerConfig|LayerConfig[]): d3.Selection|Array>; get(name: string): d3.Selection; has(name: string): boolean; } export interface LayerConfig { - [layerName: string]: string|string[]|LayerConfig|Array; + [layerName: string]: string|string[]|LayerConfig|LayerConfig[]; } export namespace helper { - function debounce(fn: (...args: Array) => void, delay: number): (...args: Array) => void; - function deepExtend(dest: Object, ...args: Object[]): Object; - function extend(dest: Object, ...args: Object[]): Object; - function functor(value: any): (...args: Array) => any; - function rebind(target: Object, source: Object): Object; + function debounce(fn: (...args: any[]) => void, delay: number): (...args: any[]) => void; + function deepExtend(dest: any, ...args: any[]): any; + function extend(dest: any, ...args: any[]): any; + function functor(value: any): (...args: any[]) => any; + function rebind(target: any, source: any): any; function isFunction(value: any): boolean; function isObject(value: any): boolean; function kebabCase(str: string): string; - function throttle(fn: (...args: Array) => void, delay: number): (...args: Array) => void; + function throttle(fn: (...args: any[]) => void, delay: number): (...args: any[]) => void; } diff --git a/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts b/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts new file mode 100644 index 0000000000..8b3b2ab70f --- /dev/null +++ b/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts @@ -0,0 +1,15 @@ +/// +/// + +$(document).ready(function() { + + var config: DataTables.Settings = { + // FixedHeader extension options + fixedHeader: { + footer: true, + footerOffset: 4, + header: true, + headerOffset: 3 + } + }; +}); diff --git a/datatables.net-fixedheader/index.d.ts b/datatables.net-fixedheader/index.d.ts new file mode 100644 index 0000000000..e72360f933 --- /dev/null +++ b/datatables.net-fixedheader/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for datatables.net-fixedheader 3.1 +// Project: https://datatables.net/extensions/fixedheader/ +// Definitions by: Jared Szechy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// +/// + +declare namespace DataTables { + export interface Settings { + /* + * FixedHeader extension options + */ + fixedHeader?: boolean | FixedHeaderSettings; + } + + /* + * FixedHeader extension options + */ + interface FixedHeaderSettings { + /* + * Enable / disable fixed footer + */ + footer?: boolean; + + /* + * Offset the table's fixed footer + */ + footerOffset?: number; + + /* + * Enable / disable fixed header + */ + header?: boolean; + + /* + * Offset the table's fixed header + */ + headerOffset?: number; + } +} diff --git a/datatables.net-fixedheader/tsconfig.json b/datatables.net-fixedheader/tsconfig.json new file mode 100644 index 0000000000..0cbc559ca2 --- /dev/null +++ b/datatables.net-fixedheader/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "datatables.net-fixedheader-tests.ts" + ] +} diff --git a/datatables.net-fixedheader/tslint.json b/datatables.net-fixedheader/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/datatables.net-fixedheader/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/datatables.net-select/datatables.net-select-tests.ts b/datatables.net-select/datatables.net-select-tests.ts new file mode 100644 index 0000000000..02c3249cf7 --- /dev/null +++ b/datatables.net-select/datatables.net-select-tests.ts @@ -0,0 +1,17 @@ +/// +/// + +$(document).ready(function() { + + var config: DataTables.Settings = { + // Select extension options + select: { + blurable: true, + className: "selectClass", + info: true, + items: "row", + selector: "td:first-child", + style: "os" + } + }; +}); diff --git a/datatables.net-select/index.d.ts b/datatables.net-select/index.d.ts new file mode 100644 index 0000000000..1365ab991e --- /dev/null +++ b/datatables.net-select/index.d.ts @@ -0,0 +1,47 @@ +// Type definitions for datatables.net-select 1.2 +// Project: https://datatables.net/extensions/select/ +// Definitions by: Jared Szechy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// +/// + +declare namespace DataTables { + export interface Settings { + /* + * Select extension options + */ + select?: boolean | string | SelectSettings; + } + + interface SelectSettings { + /* + * Indicate if the selected items will be removed when clicking outside of the table + */ + blurable?: boolean; + + /* + * Set the class name that will be applied to selected items + */ + className?: string; + + /* + * Enable / disable the display for item selection information in the table summary + */ + info?: boolean; + + /* + * Set which table items to select (rows, columns or cells) + */ + items?: string; + + /* + * Set the element selector used for mouse event capture to select items + */ + selector?: string; + + /* + * Set the selection style for end user interaction with the table + */ + style?: string; + } +} diff --git a/datatables.net-select/tsconfig.json b/datatables.net-select/tsconfig.json new file mode 100644 index 0000000000..e31ad091c8 --- /dev/null +++ b/datatables.net-select/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "datatables.net-select-tests.ts" + ] +} diff --git a/datatables.net-select/tslint.json b/datatables.net-select/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/datatables.net-select/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/fs-extra-promise/fs-extra-promise-tests.ts b/fs-extra-promise/fs-extra-promise-tests.ts index 51ae5b1140..112a27109c 100644 --- a/fs-extra-promise/fs-extra-promise-tests.ts +++ b/fs-extra-promise/fs-extra-promise-tests.ts @@ -62,6 +62,8 @@ fs.mkdirsSync(dir); fs.mkdirp(dir, errorCallback); fs.mkdirpSync(dir); +fs.move(src, dest, errorCallback); + fs.outputFile(file, data, errorCallback); fs.outputFileSync(file, data); fs.outputJson(file, data, errorCallback); diff --git a/fs-extra-promise/index.d.ts b/fs-extra-promise/index.d.ts index 871105f769..e04f0f0688 100644 --- a/fs-extra-promise/index.d.ts +++ b/fs-extra-promise/index.d.ts @@ -10,7 +10,7 @@ import * as stream from 'stream'; import { Stats } from 'fs'; import * as Promise from 'bluebird'; -import { CopyFilter, CopyOptions, OpenOptions, MkdirOptions } from 'fs-extra'; +import { CopyFilter, CopyOptions, OpenOptions, MkdirOptions, MoveOptions } from 'fs-extra'; export * from 'fs-extra'; @@ -24,6 +24,8 @@ export declare function createFileAsync(file: string): Promise; export declare function mkdirsAsync(dir: string, options?: MkdirOptions): Promise; export declare function mkdirpAsync(dir: string, options?: MkdirOptions): Promise; +export declare function moveAsync(src: string, dest: string, options?: MoveOptions): Promise; + export declare function outputFileAsync(file: string, data: any): Promise; export declare function outputJsonAsync(file: string, data: any): Promise; diff --git a/googlemaps/index.d.ts b/googlemaps/index.d.ts index c80098fd0d..010714b831 100644 --- a/googlemaps/index.d.ts +++ b/googlemaps/index.d.ts @@ -31,7 +31,7 @@ declare namespace google.maps { /***** Map *****/ export class Map extends MVCObject { constructor(mapDiv: Element, opts?: MapOptions); - fitBounds(bounds: LatLngBounds): void; + fitBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void; getBounds(): LatLngBounds; getCenter(): LatLng; getDiv(): Element; @@ -43,7 +43,7 @@ declare namespace google.maps { getZoom(): number; panBy(x: number, y: number): void; panTo(latLng: LatLng|LatLngLiteral): void; - panToBounds(latLngBounds: LatLngBounds): void; + panToBounds(latLngBounds: LatLngBounds|LatLngBoundsLiteral): void; setCenter(latlng: LatLng|LatLngLiteral): void; setHeading(heading: number): void; setMapTypeId(mapTypeId: MapTypeId|string): void; @@ -394,7 +394,7 @@ declare namespace google.maps { */ icon?: string|Icon|Symbol; /** - * Adds a label to the marker. The label can either be a string, or a MarkerLabel object. + * Adds a label to the marker. The label can either be a string, or a MarkerLabel object. * Only the first character of the string will be displayed. * @type {(string|MarkerLabel)} */ @@ -489,7 +489,7 @@ declare namespace google.maps { /** The text to be displayed in the label. Only the first character of this string will be shown. */ text?: string; } - + export interface MarkerShape { coords?: number[]; type?: string; @@ -769,7 +769,7 @@ declare namespace google.maps { getEditable(): boolean; getMap(): Map; getVisible(): boolean; - setBounds(bounds: LatLngBounds): void; + setBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void; setDraggable(draggable: boolean): void; setEditable(editable: boolean): void; setMap(map: Map): void; @@ -844,7 +844,7 @@ declare namespace google.maps { } export class GroundOverlay extends MVCObject { - constructor(url: string, bounds: LatLngBounds, opts?: GroundOverlayOptions); + constructor(url: string, bounds: LatLngBounds|LatLngBoundsLiteral, opts?: GroundOverlayOptions); getBounds(): LatLngBounds; getMap(): Map; getOpacity(): number; @@ -895,7 +895,7 @@ declare namespace google.maps { export interface GeocoderRequest { address?: string; - bounds?: LatLngBounds; + bounds?: LatLngBounds|LatLngBoundsLiteral; componentRestrictions?: GeocoderComponentRestrictions; location?: LatLng|LatLngLiteral; placeId?: string; @@ -1801,7 +1801,7 @@ declare namespace google.maps { /** Returns a string of the form "lat,lng". We round the lat/lng values to 6 decimal places by default. */ toUrlValue(precision?: number): string; /** Converts to JSON representation. This function is intended to be used via JSON.stringify. */ - toJSON(): LatLngLiteral; + toJSON(): LatLngLiteral; } export type LatLngLiteral = { lat: number; lng: number } @@ -1817,6 +1817,7 @@ declare namespace google.maps { getSouthWest(): LatLng; intersects(other: LatLngBounds|LatLngBoundsLiteral): boolean; isEmpty(): boolean; + toJSON(): LatLngBoundsLiteral; toSpan(): LatLng; toString(): string; toUrlValue(precision?: number): string; @@ -2004,13 +2005,13 @@ declare namespace google.maps { constructor(inputField: HTMLInputElement, opts?: AutocompleteOptions); getBounds(): LatLngBounds; getPlace(): PlaceResult; - setBounds(bounds: LatLngBounds): void; + setBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void; setComponentRestrictions(restrictions: ComponentRestrictions): void; setTypes(types: string[]): void; } export interface AutocompleteOptions { - bounds?: LatLngBounds; + bounds?: LatLngBounds|LatLngBoundsLiteral; componentRestrictions?: ComponentRestrictions; types?: string[]; } @@ -2040,7 +2041,7 @@ declare namespace google.maps { } export interface AutocompletionRequest { - bounds?: LatLngBounds; + bounds?: LatLngBounds|LatLngBoundsLiteral; componentRestrictions?: ComponentRestrictions; input: string; location?: LatLng; @@ -2115,7 +2116,7 @@ declare namespace google.maps { } export interface PlaceSearchRequest { - bounds?: LatLngBounds; + bounds?: LatLngBounds|LatLngBoundsLiteral; keyword?: string; location?: LatLng|LatLngLiteral; maxPriceLevel?: number; @@ -2153,7 +2154,7 @@ declare namespace google.maps { } export interface QueryAutocompletionRequest { - bounds?: LatLngBounds; + bounds?: LatLngBounds|LatLngBoundsLiteral; input?: string; location?: LatLng; offset?: number; @@ -2161,7 +2162,7 @@ declare namespace google.maps { } export interface RadarSearchRequest { - bounds?: LatLngBounds; + bounds?: LatLngBounds|LatLngBoundsLiteral; keyword?: string; location?: LatLng|LatLngLiteral; name?: string; @@ -2179,15 +2180,15 @@ declare namespace google.maps { constructor(inputField: HTMLInputElement, opts?: SearchBoxOptions); getBounds(): LatLngBounds; getPlaces(): PlaceResult[]; - setBounds(bounds: LatLngBounds): void; + setBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void; } export interface SearchBoxOptions { - bounds: LatLngBounds; + bounds: LatLngBounds|LatLngBoundsLiteral; } export interface TextSearchRequest { - bounds?: LatLngBounds; + bounds?: LatLngBounds|LatLngBoundsLiteral; location?: LatLng|LatLngLiteral; query: string; radius?: number; diff --git a/graphql/index.d.ts b/graphql/index.d.ts index 6b32b787e1..e9f3a7ba1a 100644 --- a/graphql/index.d.ts +++ b/graphql/index.d.ts @@ -319,6 +319,7 @@ declare module "graphql/language/ast" { | FloatValueNode | StringValueNode | BooleanValueNode + | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode @@ -450,6 +451,7 @@ declare module "graphql/language/ast" { | FloatValueNode | StringValueNode | BooleanValueNode + | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode @@ -478,6 +480,11 @@ declare module "graphql/language/ast" { value: boolean; } + export type NullValueNode = { + kind: 'NullValue'; + loc?: Location; + } + export type EnumValueNode = { kind: 'EnumValue'; loc?: Location; diff --git a/highcharts/highstock.d.ts b/highcharts/highstock.d.ts index 6784e83eb1..bd7f0bffd4 100644 --- a/highcharts/highstock.d.ts +++ b/highcharts/highstock.d.ts @@ -5,7 +5,7 @@ import * as Highcharts from "highcharts"; -declare namespace __Highstock { +declare namespace Highstock { interface ChartObject extends Highcharts.ChartObject { options: Options; } @@ -100,14 +100,14 @@ declare namespace __Highstock { declare global { interface JQuery { - highcharts(type: "StockChart"): __Highstock.ChartObject; + highcharts(type: "StockChart"): Highstock.ChartObject; /** * Creates a new Highcharts.Chart for the current JQuery selector; usually * a div selected by $('#container') * @param {Highcharts.Options} options Options for this chart * @return current {JQuery} selector the current JQuery selector **/ - highcharts(type: "StockChart", options: __Highstock.Options): JQuery; + highcharts(type: "StockChart", options: Highstock.Options): JQuery; /** * Creates a new Highcharts.Chart for the current JQuery selector; usually * a div selected by $('#container') @@ -115,7 +115,7 @@ declare global { * @param callback Callback function used to manipulate the constructed chart instance * @return current {JQuery} selector the current JQuery selector **/ - highcharts(type: "StockChart", options: __Highstock.Options, callback: (chart: __Highstock.ChartObject) => void): JQuery; + highcharts(type: "StockChart", options: Highstock.Options, callback: (chart: Highstock.ChartObject) => void): JQuery; highcharts(type: string): Highcharts.ChartObject; @@ -124,3 +124,6 @@ declare global { } } +declare var Highstock: Highstock.Static; +export = Highstock; +export as namespace Highstock; \ No newline at end of file diff --git a/ioredis/index.d.ts b/ioredis/index.d.ts index 9fa66ad2b6..16b33400c3 100644 --- a/ioredis/index.d.ts +++ b/ioredis/index.d.ts @@ -338,6 +338,7 @@ declare module IORedis { scanStream(options?: IORedis.ScanStreamOption): NodeJS.EventEmitter; hscanStream(key: string, options?: IORedis.ScanStreamOption): NodeJS.EventEmitter; + zscanStream(key: string, options?: IORedis.ScanStreamOption): NodeJS.EventEmitter; } interface Pipeline { @@ -719,4 +720,4 @@ declare module IORedis { retryDelayOnTryAgain?: number; redisOptions?: RedisOptions; } -} \ No newline at end of file +} diff --git a/is-windows/index.d.ts b/is-windows/index.d.ts new file mode 100644 index 0000000000..cd0b8d83b3 --- /dev/null +++ b/is-windows/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-windows 0.2 +// Project: https://github.com/jonschlinkert/is-windows +// Definitions by: Mizunashi Mana +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function isWindows(): boolean; +declare namespace isWindows {} +export = isWindows; diff --git a/is-windows/is-windows-tests.ts b/is-windows/is-windows-tests.ts new file mode 100644 index 0000000000..79ada21511 --- /dev/null +++ b/is-windows/is-windows-tests.ts @@ -0,0 +1,3 @@ +import * as isWindows from 'is-windows'; + +var bool: boolean = isWindows(); diff --git a/is-windows/tsconfig.json b/is-windows/tsconfig.json new file mode 100644 index 0000000000..de9fd876dd --- /dev/null +++ b/is-windows/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-windows-tests.ts" + ] +} diff --git a/is-windows/tslint.json b/is-windows/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/is-windows/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/jade/index.d.ts b/jade/index.d.ts index bc97c52839..9d34b07350 100644 --- a/jade/index.d.ts +++ b/jade/index.d.ts @@ -3,13 +3,39 @@ // Definitions by: Panu Horsmalahti // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export type JadeCustomFilterFunction = (text: string, options: { + [key: string]: boolean; +}) => string; -export declare function compile(template: string, options?: any): (locals?: any) => string; -export declare function compileFile(path: string, options?: any): (locals?: any) => string; -export declare function compileClient(template: string, options?: any): (locals?: any) => string; -export declare function compileClientWithDependenciesTracked(template: string, options?: any): { - body: (locals?: any) => string; +export interface JadeOptions { + filename?: string; + basedir?: string; + doctype?: string; + pretty?: boolean | string; + filters?: { + [key: string]: JadeCustomFilterFunction + }; + self?: boolean; + debug?: boolean; + compileDebug?: boolean; + globals?: string[]; + cache?: boolean; + inlineRuntimeFunctions?: boolean; + name?: string; +} + +export interface TemplateLocals { + [key: string]: any; +} + +export type JadeGenerationFunction = (locals?: TemplateLocals) => string; + +export declare function compile(template: string, options?: JadeOptions): JadeGenerationFunction; +export declare function compileFile(path: string, options?: JadeOptions): JadeGenerationFunction; +export declare function compileClient(template: string, options?: JadeOptions): JadeGenerationFunction; +export declare function compileClientWithDependenciesTracked(template: string, options?: JadeOptions): { + body: JadeGenerationFunction; dependencies: string[]; }; -export declare function render(template: string, options?: any): string; -export declare function renderFile(path: string, options?: any): string; +export declare function render(template: string, options?: JadeOptions): string; +export declare function renderFile(path: string, options?: JadeOptions): string; diff --git a/jade/jade-tests.ts b/jade/jade-tests.ts index 2f8fd9d70e..2a17cc0c92 100644 --- a/jade/jade-tests.ts +++ b/jade/jade-tests.ts @@ -4,5 +4,5 @@ jade.compile("b")(); jade.compileFile("foo.jade", {})(); jade.compileClient("a")({ a: 1 }); jade.compileClientWithDependenciesTracked("test").body(); -jade.render("h1",{}); +jade.render("h1", {}); jade.renderFile("foo.jade"); diff --git a/leaflet-draw/index.d.ts b/leaflet-draw/index.d.ts index 269215eef1..3cced930c2 100644 --- a/leaflet-draw/index.d.ts +++ b/leaflet-draw/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for leaflet-draw 0.2.4 +// Type definitions for leaflet-draw 0.4.6 // Project: https://github.com/Leaflet/Leaflet.draw -// Definitions by: Matt Guest +// Definitions by: Matt Guest , Ryan Blace // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -10,17 +10,9 @@ declare namespace L { drawControl?: boolean; } - export interface ControlStatic { - Draw: Control.DrawStatic; - } - namespace Control { - export interface DrawStatic { - new (options?: IDrawConstructorOptions): Draw; - } - - export interface IDrawConstructorOptions { + export interface DrawConstructorOptions { /** * The initial position of the control (one of the map corners). @@ -91,7 +83,7 @@ declare namespace L { * * Default value: null */ - featureGroup: FeatureGroup; + featureGroup: FeatureGroup; /** * Edit handler options. Set to false to disable handler. @@ -108,9 +100,14 @@ declare namespace L { remove?: DrawOptions.DeleteHandlerOptions; } - export interface Draw extends IControl { - + export interface Draw extends Control { + setDrawingOptions(options: DrawOptions): void; } + + export class Draw { + constructor(options?: DrawConstructorOptions); + } + } @@ -252,6 +249,28 @@ declare namespace L { } + namespace Draw { + + namespace Event { + + export const CREATED: string; + export const EDITED: string; + export const DELETED: string; + export const DRAWSTART: string; + export const DRAWSTOP: string; + export const DRAWVERTEX: string; + export const EDITSTART: string; + export const EDITMOVE: string; + export const EDITRESIZE: string; + export const EDITVERTEX: string; + export const EDITSTOP: string; + export const DELETESTART: string; + export const DELETESTOP: string; + + } + + } + namespace DrawEvents { export interface Created { @@ -259,7 +278,7 @@ declare namespace L { /** * Layer that was just created. */ - layer: ILayer; + layer: Layer; /** * The type of layer this is. One of: polyline, polygon, rectangle, circle, marker. @@ -272,7 +291,7 @@ declare namespace L { /** * List of all layers just edited on the map. */ - layers: LayerGroup; + layers: LayerGroup; } /** @@ -283,7 +302,7 @@ declare namespace L { /** * List of all layers just removed from the map. */ - layers: LayerGroup; + layers: LayerGroup; } export interface DrawStart { @@ -302,7 +321,7 @@ declare namespace L { layerType: string; } - export interface EditStart { + export interface EditStart { /** * The type of edit this is. One of: edit */ diff --git a/leaflet-draw/leaflet-draw-tests.ts b/leaflet-draw/leaflet-draw-tests.ts index 885f576d1b..98d3681789 100644 --- a/leaflet-draw/leaflet-draw-tests.ts +++ b/leaflet-draw/leaflet-draw-tests.ts @@ -3,9 +3,9 @@ var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmAttrib = '© OpenStreetMap contributors', osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}), - map = new L.Map('map', {layers: [osm], center: new L.LatLng(-37.7772, 175.2756), zoom: 15 }); + map = L.map('map', {layers: [osm], center: L.latLng(-37.7772, 175.2756), zoom: 15 }); -var drawnItems = new L.FeatureGroup(); +var drawnItems = L.featureGroup(); map.addLayer(drawnItems); var drawControl = new L.Control.Draw({ @@ -37,9 +37,10 @@ var drawControl = new L.Control.Draw({ }); map.addControl(drawControl); -map.on('draw:created', function (e: L.DrawEvents.Created) { - var type = e.layerType, - layer = e.layer; +map.on('draw:created', function (e: any) { + var drawEvent = (e as L.DrawEvents.Created); + var type = drawEvent.layerType, + layer = drawEvent.layer; drawnItems.addLayer(layer); -}); \ No newline at end of file +}); diff --git a/leaflet-draw/package.json b/leaflet-draw/package.json index 711ba15e43..fa93c2516c 100644 --- a/leaflet-draw/package.json +++ b/leaflet-draw/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "@types/leaflet": "^0.7" + "@types/leaflet": "^1.0" } -} \ No newline at end of file +} diff --git a/lodash-es/package.json b/lodash-es/package.json deleted file mode 100644 index 27f0917342..0000000000 --- a/lodash-es/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "lodash": ">=4.14.0" - } -} diff --git a/lodash/fb/index.d.ts b/lodash/fb/index.d.ts index 5f90e9e920..df9796d7d7 100644 --- a/lodash/fb/index.d.ts +++ b/lodash/fb/index.d.ts @@ -1,7 +1,2 @@ -// Type definitions for Lo-Dash 4.14 -// Project: http://lodash.com/ -// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import * as _ from "../index" +import * as _ from "../index"; export = _; diff --git a/lodash/generate-modules.ts b/lodash/generate-modules.ts index 716f3bb23f..127f1f44c6 100644 --- a/lodash/generate-modules.ts +++ b/lodash/generate-modules.ts @@ -66,6 +66,7 @@ function allModuleNames() { "every", "extend", "extendWith", + "fb", "fill", "filter", "find", @@ -168,6 +169,7 @@ function allModuleNames() { "max", "maxBy", "mean", + "meanBy", "memoize", "merge", "mergeWith", diff --git a/lodash/index.d.ts b/lodash/index.d.ts index 54bafe0388..d16b07219c 100644 --- a/lodash/index.d.ts +++ b/lodash/index.d.ts @@ -241,7 +241,9 @@ export as namespace _; declare var _: _.LoDashStatic; -declare module _ { +declare namespace _ { + type Many = T | T[]; + interface LoDashStatic { /** * Creates a lodash object which wraps the given value to enable intuitive method chaining. @@ -277,8 +279,8 @@ declare module _ { (value: number): LoDashImplicitWrapper; (value: string): LoDashImplicitStringWrapper; (value: boolean): LoDashImplicitWrapper; - (value: Array): LoDashImplicitNumberArrayWrapper; - (value: Array): LoDashImplicitArrayWrapper; + (value: number[]): LoDashImplicitNumberArrayWrapper; + (value: T[]): LoDashImplicitArrayWrapper; (value: T): LoDashImplicitObjectWrapper; (value: any): LoDashImplicitWrapper; @@ -515,7 +517,7 @@ declare module _ { * console.log(array); * // => [1] */ - concat(array: T[]|List, ...values: (T|T[]|List)[]) : T[]; + concat(array: List, ...values: Array>): T[]; } //_.difference @@ -529,8 +531,8 @@ declare module _ { * @return Returns the new array of filtered values. */ difference( - array: T[]|List, - ...values: Array> + array: List, + ...values: Array> ): T[]; } @@ -538,28 +540,28 @@ declare module _ { /** * @see _.difference */ - difference(...values: (T[]|List)[]): LoDashImplicitArrayWrapper; + difference(...values: Array>): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.difference */ - difference(...values: (TValue[]|List)[]): LoDashImplicitArrayWrapper; + difference(...values: Array>): LoDashImplicitArrayWrapper; } interface LoDashExplicitArrayWrapper { /** * @see _.difference */ - difference(...values: (T[]|List)[]): LoDashExplicitArrayWrapper; + difference(...values: Array>): LoDashExplicitArrayWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.difference */ - difference(...values: (TValue[]|List)[]): LoDashExplicitArrayWrapper; + difference(...values: Array>): LoDashExplicitArrayWrapper; } //_.differenceBy @@ -575,8 +577,8 @@ declare module _ { * @returns Returns the new array of filtered values. */ differenceBy( - array: T[]|List, - values?: T[]|List, + array: List, + values?: List, iteratee?: ((value: T) => any)|string ): T[]; @@ -584,8 +586,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values?: T[]|List, + array: List, + values?: List, iteratee?: W ): T[]; @@ -593,9 +595,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, + array: List, + values1?: List, + values2?: List, iteratee?: ((value: T) => any)|string ): T[]; @@ -603,9 +605,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, + array: List, + values1?: List, + values2?: List, iteratee?: W ): T[]; @@ -613,10 +615,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + array: List, + values1?: List, + values2?: List, + values3?: List, iteratee?: ((value: T) => any)|string ): T[]; @@ -624,10 +626,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + array: List, + values1?: List, + values2?: List, + values3?: List, iteratee?: W ): T[]; @@ -635,11 +637,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + array: List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: W ): T[]; @@ -647,11 +649,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + array: List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: ((value: T) => any)|string ): T[]; @@ -659,12 +661,12 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + array: List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: ((value: T) => any)|string ): T[]; @@ -672,12 +674,12 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + array: List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: W ): T[]; @@ -685,7 +687,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, + array: List, ...values: any[] ): T[]; } @@ -695,7 +697,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values?: T[]|List, + values?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -703,7 +705,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values?: T[]|List, + values?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -711,8 +713,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, + values1?: List, + values2?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -720,8 +722,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, + values1?: List, + values2?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -729,9 +731,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + values1?: List, + values2?: List, + values3?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -739,9 +741,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + values1?: List, + values2?: List, + values3?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -749,10 +751,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -760,10 +762,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -771,11 +773,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -783,11 +785,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -804,7 +806,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values?: T[]|List, + values?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -812,7 +814,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values?: T[]|List, + values?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -820,8 +822,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, + values1?: List, + values2?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -829,8 +831,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, + values1?: List, + values2?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -838,9 +840,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + values1?: List, + values2?: List, + values3?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -848,9 +850,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + values1?: List, + values2?: List, + values3?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -858,10 +860,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -869,10 +871,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -880,11 +882,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -892,11 +894,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -913,7 +915,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values?: T[]|List, + values?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -921,7 +923,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values?: T[]|List, + values?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -929,8 +931,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, + values1?: List, + values2?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -938,8 +940,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, + values1?: List, + values2?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -947,9 +949,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + values1?: List, + values2?: List, + values3?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -957,9 +959,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + values1?: List, + values2?: List, + values3?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -967,10 +969,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -978,10 +980,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -989,11 +991,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -1001,11 +1003,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -1022,7 +1024,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values?: T[]|List, + values?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -1030,7 +1032,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values?: T[]|List, + values?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -1038,8 +1040,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, + values1?: List, + values2?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -1047,8 +1049,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, + values1?: List, + values2?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -1056,9 +1058,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + values1?: List, + values2?: List, + values3?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -1066,9 +1068,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + values1?: List, + values2?: List, + values3?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -1076,10 +1078,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -1087,10 +1089,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -1098,11 +1100,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -1110,11 +1112,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -1145,7 +1147,7 @@ declare module _ { * // => [3, 1] */ differenceWith( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -1159,7 +1161,7 @@ declare module _ { * @param n The number of elements to drop. * @return Returns the slice of array. */ - drop(array: T[]|List, n?: number): T[]; + drop(array: List, n?: number): T[]; } interface LoDashImplicitArrayWrapper { @@ -1941,7 +1943,7 @@ declare module _ { /** * @see _.flatten */ - flatten(array: List): T[]; + flatten(array: List>): T[]; /** * @see _.flatten @@ -2250,7 +2252,7 @@ declare module _ { * // => [{ 'x': 1 }] */ intersectionBy( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -2277,7 +2279,7 @@ declare module _ { * // => [{ 'x': 1, 'y': 2 }] */ intersectionWith( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -2361,7 +2363,7 @@ declare module _ { * // => [1, 1] */ pullAll( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -2391,7 +2393,7 @@ declare module _ { * // => [{ 'x': 2 }] */ pullAllBy( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -2419,7 +2421,7 @@ declare module _ { * // => [3, 2, 1] */ reverse( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -2531,35 +2533,35 @@ declare module _ { * @param arrays The arrays to inspect. * @return Returns the new array of shared values. */ - intersection(...arrays: (T[]|List)[]): T[]; + intersection(...arrays: Array>): T[]; } interface LoDashImplicitArrayWrapper { /** * @see _.intersection */ - intersection(...arrays: (TResult[]|List)[]): LoDashImplicitArrayWrapper; + intersection(...arrays: Array>): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.intersection */ - intersection(...arrays: (TResult[]|List)[]): LoDashImplicitArrayWrapper; + intersection(...arrays: Array>): LoDashImplicitArrayWrapper; } interface LoDashExplicitArrayWrapper { /** * @see _.intersection */ - intersection(...arrays: (TResult[]|List)[]): LoDashExplicitArrayWrapper; + intersection(...arrays: Array>): LoDashExplicitArrayWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.intersection */ - intersection(...arrays: (TResult[]|List)[]): LoDashExplicitArrayWrapper; + intersection(...arrays: Array>): LoDashExplicitArrayWrapper; } //_.last @@ -2739,7 +2741,7 @@ declare module _ { */ pullAt( array: List, - ...indexes: (number|number[])[] + ...indexes: Array> ): T[]; } @@ -2747,28 +2749,28 @@ declare module _ { /** * @see _.pullAt */ - pullAt(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper; + pullAt(...indexes: Array>): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.pullAt */ - pullAt(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper; + pullAt(...indexes: Array>): LoDashImplicitArrayWrapper; } interface LoDashExplicitArrayWrapper { /** * @see _.pullAt */ - pullAt(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper; + pullAt(...indexes: Array>): LoDashExplicitArrayWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.pullAt */ - pullAt(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper; + pullAt(...indexes: Array>): LoDashExplicitArrayWrapper; } //_.remove @@ -3768,7 +3770,7 @@ declare module _ { * // => 3 */ sortedLastIndexOf( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -4172,45 +4174,45 @@ declare module _ { * @param arrays The arrays to inspect. * @return Returns the new array of combined values. */ - union(...arrays: List[]): T[]; + union(...arrays: Array>): T[]; } interface LoDashImplicitArrayWrapper { /** * @see _.union */ - union(...arrays: List[]): LoDashImplicitArrayWrapper; + union(...arrays: Array>): LoDashImplicitArrayWrapper; /** * @see _.union */ - union(...arrays: List[]): LoDashImplicitArrayWrapper; + union(...arrays: Array>): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.union */ - union(...arrays: List[]): LoDashImplicitArrayWrapper; + union(...arrays: Array>): LoDashImplicitArrayWrapper; } interface LoDashExplicitArrayWrapper { /** * @see _.union */ - union(...arrays: List[]): LoDashExplicitArrayWrapper; + union(...arrays: Array>): LoDashExplicitArrayWrapper; /** * @see _.union */ - union(...arrays: List[]): LoDashExplicitArrayWrapper; + union(...arrays: Array>): LoDashExplicitArrayWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.union */ - union(...arrays: List[]): LoDashExplicitArrayWrapper; + union(...arrays: Array>): LoDashExplicitArrayWrapper; } //_.unionBy @@ -4225,7 +4227,7 @@ declare module _ { * @return Returns the new array of combined values. */ unionBy( - arrays: T[]|List, + arrays: List, iteratee?: (value: T) => any ): T[]; @@ -4233,7 +4235,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays: T[]|List, + arrays: List, iteratee?: W ): T[]; @@ -4241,8 +4243,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays1: T[]|List, - arrays2: T[]|List, + arrays1: List, + arrays2: List, iteratee?: (value: T) => any ): T[]; @@ -4250,8 +4252,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays1: T[]|List, - arrays2: T[]|List, + arrays1: List, + arrays2: List, iteratee?: W ): T[]; @@ -4259,9 +4261,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, + arrays1: List, + arrays2: List, + arrays3: List, iteratee?: (value: T) => any ): T[]; @@ -4269,9 +4271,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, + arrays1: List, + arrays2: List, + arrays3: List, iteratee?: W ): T[]; @@ -4279,10 +4281,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays1: List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: (value: T) => any ): T[]; @@ -4290,10 +4292,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays1: List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: W ): T[]; @@ -4301,11 +4303,11 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays1: List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: (value: T) => any ): T[]; @@ -4313,11 +4315,11 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays1: List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: W ): T[]; @@ -4325,7 +4327,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays: T[]|List, + arrays: List, ...iteratee: any[] ): T[]; } @@ -4349,7 +4351,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, + arrays2: List, iteratee?: (value: T) => any ): LoDashImplicitArrayWrapper; @@ -4357,7 +4359,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, + arrays2: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -4365,8 +4367,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, + arrays2: List, + arrays3: List, iteratee?: (value: T) => any ): LoDashImplicitArrayWrapper; @@ -4374,8 +4376,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, + arrays2: List, + arrays3: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -4383,9 +4385,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: (value: T) => any ): LoDashImplicitArrayWrapper; @@ -4393,9 +4395,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -4403,10 +4405,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: (value: T) => any ): LoDashImplicitArrayWrapper; @@ -4414,10 +4416,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -4448,7 +4450,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, + arrays2: List, iteratee?: (value: T) => any ): LoDashImplicitArrayWrapper; @@ -4456,7 +4458,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, + arrays2: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -4464,8 +4466,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, + arrays2: List, + arrays3: List, iteratee?: (value: T) => any ): LoDashImplicitArrayWrapper; @@ -4473,8 +4475,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, + arrays2: List, + arrays3: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -4482,9 +4484,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: (value: T) => any ): LoDashImplicitArrayWrapper; @@ -4492,9 +4494,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -4502,10 +4504,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: (value: T) => any ): LoDashImplicitArrayWrapper; @@ -4513,10 +4515,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -4547,7 +4549,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, + arrays2: List, iteratee?: (value: T) => any ): LoDashExplicitArrayWrapper; @@ -4555,7 +4557,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, + arrays2: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -4563,8 +4565,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, + arrays2: List, + arrays3: List, iteratee?: (value: T) => any ): LoDashExplicitArrayWrapper; @@ -4572,8 +4574,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, + arrays2: List, + arrays3: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -4581,9 +4583,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: (value: T) => any ): LoDashExplicitArrayWrapper; @@ -4591,9 +4593,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -4601,10 +4603,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: (value: T) => any ): LoDashExplicitArrayWrapper; @@ -4612,10 +4614,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -4646,7 +4648,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, + arrays2: List, iteratee?: (value: T) => any ): LoDashExplicitArrayWrapper; @@ -4654,7 +4656,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, + arrays2: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -4662,8 +4664,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, + arrays2: List, + arrays3: List, iteratee?: (value: T) => any ): LoDashExplicitArrayWrapper; @@ -4671,8 +4673,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, + arrays2: List, + arrays3: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -4680,9 +4682,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: (value: T) => any ): LoDashExplicitArrayWrapper; @@ -4690,9 +4692,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -4700,10 +4702,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: (value: T) => any ): LoDashExplicitArrayWrapper; @@ -4711,10 +4713,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -5315,7 +5317,7 @@ declare module _ { * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ unionWith( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -5341,7 +5343,7 @@ declare module _ { * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] */ uniqWith( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -5473,35 +5475,35 @@ declare module _ { * @param arrays The arrays to inspect. * @return Returns the new array of values. */ - xor(...arrays: List[]): T[]; + xor(...arrays: Array>): T[]; } interface LoDashImplicitArrayWrapper { /** * @see _.xor */ - xor(...arrays: List[]): LoDashImplicitArrayWrapper; + xor(...arrays: Array>): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.xor */ - xor(...arrays: List[]): LoDashImplicitArrayWrapper; + xor(...arrays: Array>): LoDashImplicitArrayWrapper; } interface LoDashExplicitArrayWrapper { /** * @see _.xor */ - xor(...arrays: List[]): LoDashExplicitArrayWrapper; + xor(...arrays: Array>): LoDashExplicitArrayWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.xor */ - xor(...arrays: List[]): LoDashExplicitArrayWrapper; + xor(...arrays: Array>): LoDashExplicitArrayWrapper; } //_.xorBy DUMMY @@ -5527,7 +5529,7 @@ declare module _ { * // => [{ 'x': 2 }] */ xorBy( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -5554,7 +5556,7 @@ declare module _ { * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ xorWith( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -5568,35 +5570,35 @@ declare module _ { * @param arrays The arrays to process. * @return Returns the new array of grouped elements. */ - zip(...arrays: List[]): T[][]; + zip(...arrays: Array>): T[][]; } interface LoDashImplicitArrayWrapper { /** * @see _.zip */ - zip(...arrays: List[]): _.LoDashImplicitArrayWrapper; + zip(...arrays: Array>): _.LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.zip */ - zip(...arrays: List[]): _.LoDashImplicitArrayWrapper; + zip(...arrays: Array>): _.LoDashImplicitArrayWrapper; } interface LoDashExplicitArrayWrapper { /** * @see _.zip */ - zip(...arrays: List[]): _.LoDashExplicitArrayWrapper; + zip(...arrays: Array>): _.LoDashExplicitArrayWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.zip */ - zip(...arrays: List[]): _.LoDashExplicitArrayWrapper; + zip(...arrays: Array>): _.LoDashExplicitArrayWrapper; } //_.zipObject @@ -5939,24 +5941,24 @@ declare module _ { * @param items * @return Returns the new concatenated array. */ - concat(...items: Array>): LoDashImplicitArrayWrapper; + concat(...items: Array>): LoDashImplicitArrayWrapper; /** * @see _.concat */ - concat(...items: Array>): LoDashImplicitArrayWrapper; + concat(...items: Array>): LoDashImplicitArrayWrapper; } interface LoDashExplicitWrapperBase { /** * @see _.concat */ - concat(...items: Array>): LoDashExplicitArrayWrapper; + concat(...items: Array>): LoDashExplicitArrayWrapper; /** * @see _.concat */ - concat(...items: Array>): LoDashExplicitArrayWrapper; + concat(...items: Array>): LoDashExplicitArrayWrapper; } //_.prototype.plant @@ -6110,7 +6112,7 @@ declare module _ { */ at( collection: List|Dictionary, - ...props: (number|string|(number|string)[])[] + ...props: Array> ): T[]; } @@ -6118,28 +6120,28 @@ declare module _ { /** * @see _.at */ - at(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper; + at(...props: Array>): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.at */ - at(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper; + at(...props: Array>): LoDashImplicitArrayWrapper; } interface LoDashExplicitArrayWrapper { /** * @see _.at */ - at(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper; + at(...props: Array>): LoDashExplicitArrayWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.at */ - at(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper; + at(...props: Array>): LoDashExplicitArrayWrapper; } //_.countBy @@ -6931,7 +6933,7 @@ declare module _ { * @return The found element, else undefined. **/ findLast( - collection: Array, + collection: T[], callback: ListIterator, fromIndex?: number ): T|undefined; @@ -6959,7 +6961,7 @@ declare module _ { * @param _.pluck style callback **/ findLast( - collection: Array, + collection: T[], whereValue: W, fromIndex?: number ): T|undefined; @@ -6989,7 +6991,7 @@ declare module _ { * @param _.where style callback **/ findLast( - collection: Array, + collection: T[], pluckValue: string, fromIndex?: number ): T|undefined; @@ -7055,7 +7057,7 @@ declare module _ { */ flatMap( collection: List, - iteratee?: ListIterator + iteratee?: ListIterator> ): TResult[]; /** @@ -7063,7 +7065,7 @@ declare module _ { */ flatMap( collection: List, - iteratee?: ListIterator + iteratee?: ListIterator> ): TResult[]; /** @@ -7071,7 +7073,7 @@ declare module _ { */ flatMap( collection: Dictionary, - iteratee?: DictionaryIterator + iteratee?: DictionaryIterator> ): TResult[]; /** @@ -7079,7 +7081,7 @@ declare module _ { */ flatMap( collection: Dictionary, - iteratee?: DictionaryIterator + iteratee?: DictionaryIterator> ): TResult[]; /** @@ -7087,7 +7089,7 @@ declare module _ { */ flatMap( collection: NumericDictionary, - iteratee?: NumericDictionaryIterator + iteratee?: NumericDictionaryIterator> ): TResult[]; /** @@ -7095,7 +7097,7 @@ declare module _ { */ flatMap( collection: NumericDictionary, - iteratee?: NumericDictionaryIterator + iteratee?: NumericDictionaryIterator> ): TResult[]; /** @@ -7103,7 +7105,7 @@ declare module _ { */ flatMap( collection: TObject, - iteratee?: ObjectIterator + iteratee?: ObjectIterator> ): TResult[]; /** @@ -7111,7 +7113,7 @@ declare module _ { */ flatMap( collection: Object, - iteratee?: ObjectIterator + iteratee?: ObjectIterator> ): TResult[]; /** @@ -7159,7 +7161,7 @@ declare module _ { * @see _.flatMap */ flatMap( - iteratee: ListIterator + iteratee: ListIterator> ): LoDashImplicitArrayWrapper; /** @@ -7173,7 +7175,7 @@ declare module _ { * @see _.flatMap */ flatMap( - iteratee: ListIterator|string + iteratee: ListIterator>|string ): LoDashImplicitArrayWrapper; /** @@ -7201,14 +7203,14 @@ declare module _ { * @see _.flatMap */ flatMap( - iteratee: ListIterator|DictionaryIterator|NumericDictionaryIterator + iteratee: ListIterator>|DictionaryIterator>|NumericDictionaryIterator> ): LoDashImplicitArrayWrapper; /** * @see _.flatMap */ flatMap( - iteratee: ObjectIterator|string + iteratee: ObjectIterator>|string ): LoDashImplicitArrayWrapper; /** @@ -7236,7 +7238,7 @@ declare module _ { * @see _.flatMap */ flatMap( - iteratee: ListIterator + iteratee: ListIterator> ): LoDashExplicitArrayWrapper; /** @@ -7250,7 +7252,7 @@ declare module _ { * @see _.flatMap */ flatMap( - iteratee: ListIterator|string + iteratee: ListIterator>|string ): LoDashExplicitArrayWrapper; /** @@ -7278,14 +7280,14 @@ declare module _ { * @see _.flatMap */ flatMap( - iteratee: ListIterator|DictionaryIterator|NumericDictionaryIterator + iteratee: ListIterator>|DictionaryIterator>|NumericDictionaryIterator> ): LoDashExplicitArrayWrapper; /** * @see _.flatMap */ flatMap( - iteratee: ObjectIterator|string + iteratee: ObjectIterator>|string ): LoDashExplicitArrayWrapper; /** @@ -8044,7 +8046,7 @@ declare module _ { **/ invoke( object: TObject, - path: StringRepresentable|StringRepresentable[], + path: Many, ...args: any[]): TResult; /** @@ -8052,7 +8054,7 @@ declare module _ { **/ invoke( object: Dictionary|TValue[], - path: StringRepresentable|StringRepresentable[], + path: Many, ...args: any[]): TResult; /** @@ -8060,7 +8062,7 @@ declare module _ { **/ invoke( object: any, - path: StringRepresentable|StringRepresentable[], + path: Many, ...args: any[]): TResult; } @@ -8069,7 +8071,7 @@ declare module _ { * @see _.invoke **/ invoke( - path: StringRepresentable|StringRepresentable[], + path: Many, ...args: any[]): TResult; } @@ -8078,7 +8080,7 @@ declare module _ { * @see _.invoke **/ invoke( - path: StringRepresentable|StringRepresentable[], + path: Many, ...args: any[]): TResult; } @@ -8087,7 +8089,7 @@ declare module _ { * @see _.invoke **/ invoke( - path: StringRepresentable|StringRepresentable[], + path: Many, ...args: any[]): TResult; } @@ -8096,7 +8098,7 @@ declare module _ { * @see _.invoke **/ invoke( - path: StringRepresentable|StringRepresentable[], + path: Many, ...args: any[]): TResult; } @@ -8128,7 +8130,7 @@ declare module _ { * @see _.invokeMap **/ invokeMap( - collection: {}[], + collection: Array<{}>, methodName: string, ...args: any[]): TResult[]; @@ -8160,7 +8162,7 @@ declare module _ { * @see _.invokeMap **/ invokeMap( - collection: {}[], + collection: Array<{}>, method: (...args: any[]) => TResult, ...args: any[]): TResult[]; @@ -8549,7 +8551,7 @@ declare module _ { * @return Returns the accumulated value. **/ reduce( - collection: Array, + collection: T[], callback: MemoIterator, accumulator: TResult): TResult; @@ -8581,7 +8583,7 @@ declare module _ { * @see _.reduce **/ reduce( - collection: Array, + collection: T[], callback: MemoIterator): TResult; /** @@ -8679,7 +8681,7 @@ declare module _ { * @return The accumulated value. **/ reduceRight( - collection: Array, + collection: T[], callback: MemoIterator, accumulator: TResult): TResult; @@ -8703,7 +8705,7 @@ declare module _ { * @see _.reduceRight **/ reduceRight( - collection: Array, + collection: T[], callback: MemoIterator): TResult; /** @@ -9391,15 +9393,15 @@ declare module _ { * @see _.sortBy */ sortBy( - collection: (Array|List), - iteratees: (ListIterator|string|Object)[]): T[]; + collection: List, + iteratees: Array|string|Object>): T[]; /** * @see _.sortBy */ sortBy( - collection: (Array|List), - ...iteratees: (ListIterator|Object|string)[]): T[]; + collection: List, + ...iteratees: Array|Object|string>): T[]; } interface LoDashImplicitArrayWrapper { @@ -9428,12 +9430,12 @@ declare module _ { /** * @see _.sortBy */ - sortBy(...iteratees: (ListIterator|Object|string)[]): LoDashImplicitArrayWrapper; + sortBy(...iteratees: Array|Object|string>): LoDashImplicitArrayWrapper; /** * @see _.sortBy **/ - sortBy(iteratees: (ListIterator|string|Object)[]): LoDashImplicitArrayWrapper; + sortBy(iteratees: Array|string|Object>): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { @@ -9539,8 +9541,8 @@ declare module _ { */ orderBy( collection: List, - iteratees: ListIterator|string|W|(ListIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): T[]; /** @@ -9548,8 +9550,8 @@ declare module _ { */ orderBy( collection: List, - iteratees: ListIterator|string|Object|(ListIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): T[]; /** @@ -9557,8 +9559,8 @@ declare module _ { */ orderBy( collection: NumericDictionary, - iteratees: NumericDictionaryIterator|string|W|(NumericDictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): T[]; /** @@ -9566,8 +9568,8 @@ declare module _ { */ orderBy( collection: NumericDictionary, - iteratees: NumericDictionaryIterator|string|Object|(NumericDictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): T[]; /** @@ -9575,8 +9577,8 @@ declare module _ { */ orderBy( collection: Dictionary, - iteratees: DictionaryIterator|string|W|(DictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): T[]; /** @@ -9584,8 +9586,8 @@ declare module _ { */ orderBy( collection: Dictionary, - iteratees: DictionaryIterator|string|Object|(DictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): T[]; } @@ -9594,8 +9596,8 @@ declare module _ { * @see _.orderBy */ orderBy( - iteratees: ListIterator|string|(ListIterator|string)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string>, + orders?: Many ): LoDashImplicitArrayWrapper; } @@ -9604,8 +9606,8 @@ declare module _ { * @see _.orderBy */ orderBy( - iteratees: ListIterator|string|W|(ListIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): LoDashImplicitArrayWrapper; } @@ -9614,48 +9616,48 @@ declare module _ { * @see _.orderBy */ orderBy( - iteratees: ListIterator|string|W|(ListIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): LoDashImplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: ListIterator|string|Object|(ListIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): LoDashImplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: NumericDictionaryIterator|string|W|(NumericDictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): LoDashImplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: NumericDictionaryIterator|string|Object|(NumericDictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): LoDashImplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: DictionaryIterator|string|W|(DictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): LoDashImplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: DictionaryIterator|string|Object|(DictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): LoDashImplicitArrayWrapper; } @@ -9664,8 +9666,8 @@ declare module _ { * @see _.orderBy */ orderBy( - iteratees: ListIterator|string|(ListIterator|string)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string>, + orders?: Many ): LoDashExplicitArrayWrapper; } @@ -9674,8 +9676,8 @@ declare module _ { * @see _.orderBy */ orderBy( - iteratees: ListIterator|string|W|(ListIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W|(ListIterator|string|W)>, + orders?: Many ): LoDashExplicitArrayWrapper; } @@ -9684,48 +9686,48 @@ declare module _ { * @see _.orderBy */ orderBy( - iteratees: ListIterator|string|W|(ListIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): LoDashExplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: ListIterator|string|Object|(ListIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): LoDashExplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: NumericDictionaryIterator|string|W|(NumericDictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): LoDashExplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: NumericDictionaryIterator|string|Object|(NumericDictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): LoDashExplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: DictionaryIterator|string|W|(DictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): LoDashExplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: DictionaryIterator|string|Object|(DictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): LoDashExplicitArrayWrapper; } @@ -9926,7 +9928,7 @@ declare module _ { */ bindAll( object: T, - ...methodNames: (string|string[])[] + ...methodNames: Array> ): T; } @@ -9934,14 +9936,14 @@ declare module _ { /** * @see _.bindAll */ - bindAll(...methodNames: (string|string[])[]): LoDashImplicitObjectWrapper; + bindAll(...methodNames: Array>): LoDashImplicitObjectWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.bindAll */ - bindAll(...methodNames: (string|string[])[]): LoDashExplicitObjectWrapper; + bindAll(...methodNames: Array>): LoDashExplicitObjectWrapper; } //_.bindKey @@ -10472,7 +10474,7 @@ declare module _ { memoize: { (func: T, resolver?: Function): T & MemoizedFunction; Cache: MapCacheConstructor; - } + }; } interface LoDashImplicitObjectWrapper { @@ -10619,21 +10621,11 @@ declare module _ { type PH = LoDashStatic; - interface Function0 { - (): R; - } - interface Function1 { - (t1: T1): R; - } - interface Function2 { - (t1: T1, t2: T2): R; - } - interface Function3 { - (t1: T1, t2: T2, t3: T3): R; - } - interface Function4 { - (t1: T1, t2: T2, t3: T3, t4: T4): R; - } + type Function0 = () => R; + type Function1 = (t1: T1) => R; + type Function2 = (t1: T1, t2: T2) => R; + type Function3 = (t1: T1, t2: T2, t3: T3) => R; + type Function4 = (t1: T1, t2: T2, t3: T3, t4: T4) => R; interface Partial { // arity 0 @@ -10685,7 +10677,7 @@ declare module _ { * @param args Arguments to be partially applied. * @return The new partially applied function. **/ - partialRight: PartialRight + partialRight: PartialRight; } interface PartialRight { @@ -11039,7 +11031,7 @@ declare module _ { * @param value The value to inspect. * @return Returns the cast array. */ - castArray(value?: T | T[]): T[]; + castArray(value?: Many): T[]; } interface LoDashImplicitWrapper { @@ -11198,9 +11190,7 @@ declare module _ { } //_.cloneDeepWith - interface CloneDeepWithCustomizer { - (value: TValue): TResult; - } + type CloneDeepWithCustomizer = (value: TValue) => TResult; interface LoDashStatic { /** @@ -11321,9 +11311,7 @@ declare module _ { } //_.cloneWith - interface CloneWithCustomizer { - (value: TValue): TResult; - } + type CloneWithCustomizer = (value: TValue) => TResult; interface LoDashStatic { /** @@ -11594,14 +11582,14 @@ declare module _ { isArray(value?: any): value is T[]; } - interface LoDashImplicitWrapperBase { + interface LoDashImplicitWrapperBase { /** * @see _.isArray */ isArray(): boolean; } - interface LoDashExplicitWrapperBase { + interface LoDashExplicitWrapperBase { /** * @see _.isArray */ @@ -11663,14 +11651,14 @@ declare module _ { isArrayLike(value?: any): value is T[]; } - interface LoDashImplicitWrapperBase { + interface LoDashImplicitWrapperBase { /** * @see _.isArrayLike */ isArrayLike(): boolean; } - interface LoDashExplicitWrapperBase { + interface LoDashExplicitWrapperBase { /** * @see _.isArrayLike */ @@ -11706,14 +11694,14 @@ declare module _ { isArrayLikeObject(value?: any): value is T[]; } - interface LoDashImplicitWrapperBase { + interface LoDashImplicitWrapperBase { /** * @see _.isArrayLikeObject */ isArrayLikeObject(): boolean; } - interface LoDashExplicitWrapperBase { + interface LoDashExplicitWrapperBase { /** * @see _.isArrayLikeObject */ @@ -11900,9 +11888,7 @@ declare module _ { } // _.isEqualWith - interface IsEqualCustomizer { - (value: any, other: any, indexOrKey?: number|string): boolean; - } + type IsEqualCustomizer = (value: any, other: any, indexOrKey?: number|string) => boolean; interface LoDashStatic { /** @@ -12153,9 +12139,7 @@ declare module _ { } //_.isMatch - interface isMatchCustomizer { - (value: any, other: any, indexOrKey?: number|string): boolean; - } + type isMatchCustomizer = (value: any, other: any, indexOrKey?: number|string) => boolean; interface LoDashStatic { /** @@ -12191,9 +12175,7 @@ declare module _ { } //_.isMatchWith - interface isMatchWithCustomizer { - (value: any, other: any, indexOrKey?: number|string): boolean; - } + type isMatchWithCustomizer = (value: any, other: any, indexOrKey?: number|string) => boolean; interface LoDashStatic { /** @@ -14060,11 +14042,6 @@ declare module _ { assign(...otherArgs: any[]): LoDashExplicitObjectWrapper; } - //_.assignWith - interface AssignCustomizer { - (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}): any; - } - interface LoDashStatic { /** * This method is like `_.assign` except that it accepts `customizer` which @@ -14418,9 +14395,7 @@ declare module _ { } //_.assignInWith - interface AssignCustomizer { - (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}): any; - } + type AssignCustomizer = (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}) => any; interface LoDashStatic { /** @@ -14805,7 +14780,7 @@ declare module _ { /** * @see _.defaultsDeep **/ - defaultsDeep(...sources: any[]): LoDashImplicitObjectWrapper + defaultsDeep(...sources: any[]): LoDashImplicitObjectWrapper; } // _.extend @@ -15595,7 +15570,7 @@ declare module _ { */ get( object: TObject, - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult ): TResult; @@ -15604,7 +15579,7 @@ declare module _ { */ get( object: any, - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult ): TResult; } @@ -15614,7 +15589,7 @@ declare module _ { * @see _.get */ get( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult ): TResult; } @@ -15624,7 +15599,7 @@ declare module _ { * @see _.get */ get( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult ): TResult; } @@ -15634,7 +15609,7 @@ declare module _ { * @see _.get */ get( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult ): TResult; } @@ -15644,7 +15619,7 @@ declare module _ { * @see _.get */ get( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: any ): TResultWrapper; } @@ -15654,7 +15629,7 @@ declare module _ { * @see _.get */ get( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: any ): TResultWrapper; } @@ -15664,7 +15639,7 @@ declare module _ { * @see _.get */ get( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: any ): TResultWrapper; } @@ -15699,7 +15674,7 @@ declare module _ { */ has( object: T, - path: StringRepresentable|StringRepresentable[] + path: Many ): boolean; } @@ -15707,14 +15682,14 @@ declare module _ { /** * @see _.has */ - has(path: StringRepresentable|StringRepresentable[]): boolean; + has(path: Many): boolean; } interface LoDashExplicitObjectWrapper { /** * @see _.has */ - has(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper; + has(path: Many): LoDashExplicitWrapper; } //_.hasIn @@ -15746,7 +15721,7 @@ declare module _ { */ hasIn( object: T, - path: StringRepresentable|StringRepresentable[] + path: Many ): boolean; } @@ -15754,14 +15729,14 @@ declare module _ { /** * @see _.hasIn */ - hasIn(path: StringRepresentable|StringRepresentable[]): boolean; + hasIn(path: Many): boolean; } interface LoDashExplicitObjectWrapper { /** * @see _.hasIn */ - hasIn(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper; + hasIn(path: Many): LoDashExplicitWrapper; } //_.invert @@ -15803,9 +15778,7 @@ declare module _ { } //_.inverBy - interface InvertByIterator { - (value: T): any; - } + type InvertByIterator = (value: T) => any; interface LoDashStatic { /** @@ -16347,9 +16320,7 @@ declare module _ { } //_.mergeWith - interface MergeWithCustomizer { - (value: any, srcValue: any, key?: string, object?: Object, source?: Object): any; - } + type MergeWithCustomizer = (value: any, srcValue: any, key?: string, object?: Object, source?: Object) => any; interface LoDashStatic { /** @@ -16505,7 +16476,7 @@ declare module _ { omit( object: T, - ...predicate: (StringRepresentable|StringRepresentable[])[] + ...predicate: Array> ): TResult; } @@ -16515,7 +16486,7 @@ declare module _ { * @see _.omit */ omit( - ...predicate: (StringRepresentable|StringRepresentable[])[] + ...predicate: Array> ): LoDashImplicitObjectWrapper; } @@ -16525,7 +16496,7 @@ declare module _ { * @see _.omit */ omit( - ...predicate: (StringRepresentable|StringRepresentable[])[] + ...predicate: Array> ): LoDashExplicitObjectWrapper; } @@ -16594,7 +16565,7 @@ declare module _ { */ pick( object: T, - ...predicate: (StringRepresentable|StringRepresentable[])[] + ...predicate: Array> ): TResult; } @@ -16603,7 +16574,7 @@ declare module _ { * @see _.pick */ pick( - ...predicate: (StringRepresentable|StringRepresentable[])[] + ...predicate: Array> ): LoDashImplicitObjectWrapper; } @@ -16612,7 +16583,7 @@ declare module _ { * @see _.pick */ pick( - ...predicate: (StringRepresentable|StringRepresentable[])[] + ...predicate: Array> ): LoDashExplicitObjectWrapper; } @@ -16672,7 +16643,7 @@ declare module _ { */ result( object: TObject, - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult|((...args: any[]) => TResult) ): TResult; @@ -16681,7 +16652,7 @@ declare module _ { */ result( object: any, - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult|((...args: any[]) => TResult) ): TResult; } @@ -16691,7 +16662,7 @@ declare module _ { * @see _.result */ result( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult|((...args: any[]) => TResult) ): TResult; } @@ -16701,7 +16672,7 @@ declare module _ { * @see _.result */ result( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult|((...args: any[]) => TResult) ): TResult; } @@ -16711,7 +16682,7 @@ declare module _ { * @see _.result */ result( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult|((...args: any[]) => TResult) ): TResult; } @@ -16721,7 +16692,7 @@ declare module _ { * @see _.result */ result( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: any ): TResultWrapper; } @@ -16731,7 +16702,7 @@ declare module _ { * @see _.result */ result( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: any ): TResultWrapper; } @@ -16741,7 +16712,7 @@ declare module _ { * @see _.result */ result( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: any ): TResultWrapper; } @@ -16760,7 +16731,7 @@ declare module _ { */ set( object: Object, - path: StringRepresentable|StringRepresentable[], + path: Many, value: any ): TResult; @@ -16769,7 +16740,7 @@ declare module _ { */ set( object: Object, - path: StringRepresentable|StringRepresentable[], + path: Many, value: V ): TResult; @@ -16778,7 +16749,7 @@ declare module _ { */ set( object: O, - path: StringRepresentable|StringRepresentable[], + path: Many, value: V ): TResult; } @@ -16788,7 +16759,7 @@ declare module _ { * @see _.set */ set( - path: StringRepresentable|StringRepresentable[], + path: Many, value: any ): LoDashImplicitObjectWrapper; @@ -16796,7 +16767,7 @@ declare module _ { * @see _.set */ set( - path: StringRepresentable|StringRepresentable[], + path: Many, value: V ): LoDashImplicitObjectWrapper; } @@ -16806,7 +16777,7 @@ declare module _ { * @see _.set */ set( - path: StringRepresentable|StringRepresentable[], + path: Many, value: any ): LoDashExplicitObjectWrapper; @@ -16814,15 +16785,13 @@ declare module _ { * @see _.set */ set( - path: StringRepresentable|StringRepresentable[], + path: Many, value: V ): LoDashExplicitObjectWrapper; } //_.setWith - interface SetWithCustomizer { - (nsValue: any, key: string, nsObject: T): any; - } + type SetWithCustomizer = (nsValue: any, key: string, nsObject: T) => any; interface LoDashStatic { /** @@ -16838,7 +16807,7 @@ declare module _ { */ setWith( object: Object, - path: StringRepresentable|StringRepresentable[], + path: Many, value: any, customizer?: SetWithCustomizer ): TResult; @@ -16848,7 +16817,7 @@ declare module _ { */ setWith( object: Object, - path: StringRepresentable|StringRepresentable[], + path: Many, value: V, customizer?: SetWithCustomizer ): TResult; @@ -16858,7 +16827,7 @@ declare module _ { */ setWith( object: O, - path: StringRepresentable|StringRepresentable[], + path: Many, value: V, customizer?: SetWithCustomizer ): TResult; @@ -16869,7 +16838,7 @@ declare module _ { * @see _.setWith */ setWith( - path: StringRepresentable|StringRepresentable[], + path: Many, value: any, customizer?: SetWithCustomizer ): LoDashImplicitObjectWrapper; @@ -16878,7 +16847,7 @@ declare module _ { * @see _.setWith */ setWith( - path: StringRepresentable|StringRepresentable[], + path: Many, value: V, customizer?: SetWithCustomizer ): LoDashImplicitObjectWrapper; @@ -16889,7 +16858,7 @@ declare module _ { * @see _.setWith */ setWith( - path: StringRepresentable|StringRepresentable[], + path: Many, value: any, customizer?: SetWithCustomizer ): LoDashExplicitObjectWrapper; @@ -16898,7 +16867,7 @@ declare module _ { * @see _.setWith */ setWith( - path: StringRepresentable|StringRepresentable[], + path: Many, value: V, customizer?: SetWithCustomizer ): LoDashExplicitObjectWrapper; @@ -17055,7 +17024,7 @@ declare module _ { */ unset( object: T, - path: StringRepresentable|StringRepresentable[] + path: Many ): boolean; } @@ -17063,14 +17032,14 @@ declare module _ { /** * @see _.unset */ - unset(path: StringRepresentable|StringRepresentable[]): LoDashImplicitWrapper; + unset(path: Many): LoDashImplicitWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.unset */ - unset(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper; + unset(path: Many): LoDashExplicitWrapper; } //_.update @@ -17086,7 +17055,7 @@ declare module _ { */ update( object: Object, - path: StringRepresentable|StringRepresentable[], + path: Many, updater: Function ): TResult; @@ -17095,7 +17064,7 @@ declare module _ { */ update( object: Object, - path: StringRepresentable|StringRepresentable[], + path: Many, updater: U ): TResult; @@ -17104,7 +17073,7 @@ declare module _ { */ update( object: O, - path: StringRepresentable|StringRepresentable[], + path: Many, updater: Function ): TResult; @@ -17113,7 +17082,7 @@ declare module _ { */ update( object: O, - path: StringRepresentable|StringRepresentable[], + path: Many, updater: U ): TResult; } @@ -17123,7 +17092,7 @@ declare module _ { * @see _.update */ update( - path: StringRepresentable|StringRepresentable[], + path: Many, updater: any ): LoDashImplicitObjectWrapper; @@ -17131,7 +17100,7 @@ declare module _ { * @see _.update */ update( - path: StringRepresentable|StringRepresentable[], + path: Many, updater: U ): LoDashImplicitObjectWrapper; } @@ -17141,7 +17110,7 @@ declare module _ { * @see _.update */ update( - path: StringRepresentable|StringRepresentable[], + path: Many, updater: any ): LoDashExplicitObjectWrapper; @@ -17149,7 +17118,7 @@ declare module _ { * @see _.update */ update( - path: StringRepresentable|StringRepresentable[], + path: Many, updater: U ): LoDashExplicitObjectWrapper; } @@ -18485,7 +18454,7 @@ declare module _ { * @return Returns the new function. */ matchesProperty( - path: StringRepresentable|StringRepresentable[], + path: Many, srcValue: T ): (value: any) => boolean; @@ -18493,7 +18462,7 @@ declare module _ { * @see _.matchesProperty */ matchesProperty( - path: StringRepresentable|StringRepresentable[], + path: Many, srcValue: T ): (value: V) => boolean; } @@ -18615,7 +18584,7 @@ declare module _ { methodOf( object: TObject, ...args: any[] - ): (path: StringRepresentable|StringRepresentable[]) => TResult; + ): (path: Many) => TResult; /** * @see _.methodOf @@ -18623,7 +18592,7 @@ declare module _ { methodOf( object: {}, ...args: any[] - ): (path: StringRepresentable|StringRepresentable[]) => TResult; + ): (path: Many) => TResult; } interface LoDashImplicitObjectWrapper { @@ -18632,7 +18601,7 @@ declare module _ { */ methodOf( ...args: any[] - ): LoDashImplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>; + ): LoDashImplicitObjectWrapper<(path: Many) => TResult>; } interface LoDashExplicitObjectWrapper { @@ -18641,7 +18610,7 @@ declare module _ { */ methodOf( ...args: any[] - ): LoDashExplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>; + ): LoDashExplicitObjectWrapper<(path: Many) => TResult>; } //_.mixin @@ -18794,35 +18763,35 @@ declare module _ { * @param iteratees The iteratees to invoke. * @return Returns the new function. */ - over(...iteratees: (Function|Function[])[]): (...args: any[]) => TResult[]; + over(...iteratees: Array>): (...args: any[]) => TResult[]; } interface LoDashImplicitArrayWrapper { /** * @see _.over */ - over(...iteratees: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => TResult[]>; + over(...iteratees: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => TResult[]>; } interface LoDashImplicitObjectWrapper { /** * @see _.over */ - over(...iteratees: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => TResult[]>; + over(...iteratees: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => TResult[]>; } interface LoDashExplicitArrayWrapper { /** * @see _.over */ - over(...iteratees: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>; + over(...iteratees: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>; } interface LoDashExplicitObjectWrapper { /** * @see _.over */ - over(...iteratees: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>; + over(...iteratees: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>; } //_.overEvery @@ -18834,35 +18803,35 @@ declare module _ { * @param predicates The predicates to check. * @return Returns the new function. */ - overEvery(...predicates: (Function|Function[])[]): (...args: any[]) => boolean; + overEvery(...predicates: Array>): (...args: any[]) => boolean; } interface LoDashImplicitArrayWrapper { /** * @see _.overEvery */ - overEvery(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; + overEvery(...predicates: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; } interface LoDashImplicitObjectWrapper { /** * @see _.overEvery */ - overEvery(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; + overEvery(...predicates: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; } interface LoDashExplicitArrayWrapper { /** * @see _.overEvery */ - overEvery(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; + overEvery(...predicates: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; } interface LoDashExplicitObjectWrapper { /** * @see _.overEvery */ - overEvery(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; + overEvery(...predicates: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; } //_.overSome @@ -18874,35 +18843,35 @@ declare module _ { * @param predicates The predicates to check. * @return Returns the new function. */ - overSome(...predicates: (Function|Function[])[]): (...args: any[]) => boolean; + overSome(...predicates: Array>): (...args: any[]) => boolean; } interface LoDashImplicitArrayWrapper { /** * @see _.overSome */ - overSome(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; + overSome(...predicates: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; } interface LoDashImplicitObjectWrapper { /** * @see _.overSome */ - overSome(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; + overSome(...predicates: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; } interface LoDashExplicitArrayWrapper { /** * @see _.overSome */ - overSome(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; + overSome(...predicates: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; } interface LoDashExplicitObjectWrapper { /** * @see _.overSome */ - overSome(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; + overSome(...predicates: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; } //_.property @@ -18913,7 +18882,7 @@ declare module _ { * @param path The path of the property to get. * @return Returns the new function. */ - property(path: StringRepresentable|StringRepresentable[]): (obj: TObj) => TResult; + property(path: Many): (obj: TObj) => TResult; } interface LoDashImplicitWrapper { @@ -18953,21 +18922,21 @@ declare module _ { * @param object The object to query. * @return Returns the new function. */ - propertyOf(object: T): (path: string|string[]) => any; + propertyOf(object: T): (path: Many) => any; } interface LoDashImplicitObjectWrapper { /** * @see _.propertyOf */ - propertyOf(): LoDashImplicitObjectWrapper<(path: string|string[]) => any>; + propertyOf(): LoDashImplicitObjectWrapper<(path: Many) => any>; } interface LoDashExplicitObjectWrapper { /** * @see _.propertyOf */ - propertyOf(): LoDashExplicitObjectWrapper<(path: string|string[]) => any>; + propertyOf(): LoDashExplicitObjectWrapper<(path: Many) => any>; } //_.range @@ -19224,41 +19193,22 @@ declare module _ { uniqueId(): LoDashExplicitWrapper; } - interface ListIterator { - (value: T, index: number, collection: List): TResult; - } + type ListIterator = (value: T, index: number, collection: List) => TResult; - interface DictionaryIterator { - (value: T, key?: string, collection?: Dictionary): TResult; - } + type DictionaryIterator = (value: T, key?: string, collection?: Dictionary) => TResult; - interface NumericDictionaryIterator { - (value: T, key?: number, collection?: Dictionary): TResult; - } + type NumericDictionaryIterator = (value: T, key?: number, collection?: Dictionary) => TResult; - interface ObjectIterator { - (element: T, key?: string, collection?: any): TResult; - } + type ObjectIterator = (element: T, key?: string, collection?: any) => TResult; - interface StringIterator { - (char: string, index?: number, string?: string): TResult; - } + type StringIterator = (char: string, index?: number, string?: string) => TResult; - interface MemoVoidIterator { - (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): void; - } - interface MemoIterator { - (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): TResult; - } + type MemoVoidIterator = (prev: TResult, curr: T, indexOrKey?: any, list?: T[]) => void; - interface MemoVoidArrayIterator { - (acc: TResult, curr: T, index?: number, arr?: T[]): void; - } - interface MemoVoidDictionaryIterator { - (acc: TResult, curr: T, key?: string, dict?: Dictionary): void; - } + type MemoIterator = (prev: TResult, curr: T, indexOrKey?: any, list?: T[]) => TResult; - //interface Collection {} + type MemoVoidArrayIterator = (acc: TResult, curr: T, index?: number, arr?: T[]) => void; + type MemoVoidDictionaryIterator = (acc: TResult, curr: T, key?: string, dict?: Dictionary) => void; // Common interface between Arrays and jQuery objects interface List { diff --git a/lodash/lodash-3.10-tests.ts b/lodash/legacy/lodash-3.10-tests.ts similarity index 100% rename from lodash/lodash-3.10-tests.ts rename to lodash/legacy/lodash-3.10-tests.ts diff --git a/lodash/lodash-3.10.d.ts b/lodash/legacy/lodash-3.10.d.ts similarity index 100% rename from lodash/lodash-3.10.d.ts rename to lodash/legacy/lodash-3.10.d.ts diff --git a/lodash/meanBy/index.d.ts b/lodash/meanBy/index.d.ts index 0876057523..3004930ef6 100644 --- a/lodash/meanBy/index.d.ts +++ b/lodash/meanBy/index.d.ts @@ -1,8 +1,3 @@ -// Type definitions for Lo-Dash 4.14 -// Project: http://lodash.com/ -// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import * as _ from "../index" +import * as _ from "../index"; declare const meanBy: typeof _.meanBy; export = meanBy; diff --git a/lodash/tslint.json b/lodash/tslint.json new file mode 100644 index 0000000000..8bcd32b3b1 --- /dev/null +++ b/lodash/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "../tslint.json", + "rules": { + "forbidden-types": false, + "no-empty-interface": false, + "unified-signatures": false + } +} \ No newline at end of file diff --git a/markdown-it/index.d.ts b/markdown-it/index.d.ts index 5bbd977d17..6af0b7dc90 100644 --- a/markdown-it/index.d.ts +++ b/markdown-it/index.d.ts @@ -1,14 +1,14 @@ // Type definitions for markdown-it // Project: https://github.com/markdown-it/markdown-it -// Definitions by: York Yao +// Definitions by: York Yao , Robert Coie // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface MarkdownItStatic { new (): MarkdownIt.MarkdownIt; - new (presetName: "commonmark" | "zero" | "default"): MarkdownIt.MarkdownIt; + new (presetName: "commonmark" | "zero" | "default", options?: MarkdownIt.Options): MarkdownIt.MarkdownIt; new (options: MarkdownIt.Options): MarkdownIt.MarkdownIt; (): MarkdownIt.MarkdownIt; - (presetName: "commonmark" | "zero" | "default"): MarkdownIt.MarkdownIt; + (presetName: "commonmark" | "zero" | "default", options ?: MarkdownIt.Options): MarkdownIt.MarkdownIt; (options: MarkdownIt.Options): MarkdownIt.MarkdownIt; } @@ -19,6 +19,8 @@ declare module MarkdownIt { interface MarkdownIt { render(md: string, env?: any): string; renderInline(md: string, env?: any): string; + parse(src: string, env: any): Token[]; + parseInline(src: string, env: any): Token[]; use(plugin: any, ...params: any[]): MarkdownIt; utils: { assign(obj: any): any; @@ -43,10 +45,10 @@ declare module MarkdownIt { normalizeLink(url: string): string; normalizeLinkText(url: string): string; validateLink(url: string): boolean; - block: any; - core: any; + block: ParserBlock; + core: Core; helpers: any; - inline: any; + inline: ParserInline; linkify: LinkifyIt; renderer: Renderer; } @@ -92,4 +94,35 @@ declare module MarkdownIt { } type TokenRender = (tokens: Token[], index: number, options: any, env: any, self: Renderer) => void; + + interface Rule { + (state: any): void; + } + + interface Ruler { + after(afterName: string, ruleName: string, rule: Rule, options?: any): void; + at(name: string, rule: Rule, options?: any): void; + before(beforeName: string, ruleName: string, rule: Rule, options?: any): void; + disable(rules: string | string[], ignoreInvalid?: boolean): string[]; + enable(rules: string | string[], ignoreInvalid?: boolean): string[]; + enableOnly(rule: string, ignoreInvalid?: boolean): void; + getRules(chain: string): Rule[]; + push(ruleName: string, rule: Rule, options?: any): void; + } + + interface ParserBlock { + parse(src: string, md: MarkdownIt, env: any, outTokens: Token[]): void; + ruler: Ruler; + } + + interface Core { + process(state: any): void; + ruler: Ruler; + } + + interface ParserInline { + parse(src: string, md: MarkdownIt, env: any, outTokens: Token[]): void; + ruler: Ruler; + ruler2: Ruler; + } } diff --git a/material-ui/index.d.ts b/material-ui/index.d.ts index 6f219152ac..08e926d043 100644 --- a/material-ui/index.d.ts +++ b/material-ui/index.d.ts @@ -1494,7 +1494,7 @@ declare namespace __MaterialUI { contentStyle?: React.CSSProperties; message: React.ReactNode; onActionTouchTap?: React.TouchEventHandler<{}>; - onRequestClose: (reason: string) => void; + onRequestClose?: (reason: string) => void; open: boolean; style?: React.CSSProperties; } diff --git a/minimist/index.d.ts b/minimist/index.d.ts index 4ab52d76ff..143727ed76 100644 --- a/minimist/index.d.ts +++ b/minimist/index.d.ts @@ -1,33 +1,89 @@ -// Type definitions for minimist 1.1.3 +// Type definitions for minimist 1.2.0 // Project: https://github.com/substack/minimist -// Definitions by: Bart van der Schoor , Necroskillz +// Definitions by: Bart van der Schoor , Necroskillz , kamranayub // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +/** + * Return an argument object populated with the array arguments from args + * + * @param args An optional argument array (typically `process.argv.slice(2)`) + * @param opts An optional options object to customize the parsing + */ declare function minimist(args?: string[], opts?: minimist.Opts): minimist.ParsedArgs; +/** + * Return an argument object populated with the array arguments from args. Strongly-typed + * to be the intersect of type T with minimist.ParsedArgs. + * + * @type T The type that will be intersected with minimist.ParsedArgs to represent the argument object + * @param args An optional argument array (typically `process.argv.slice(2)`) + * @param opts An optional options object to customize the parsing + */ +declare function minimist(args?: string[], opts?: minimist.Opts): T & minimist.ParsedArgs; + +/** + * Return an argument object populated with the array arguments from args. Strongly-typed + * to be the the type T which should extend minimist.ParsedArgs + * + * @type T The type that extends minimist.ParsedArgs and represents the argument object + * @param args An optional argument array (typically `process.argv.slice(2)`) + * @param opts An optional options object to customize the parsing + */ +declare function minimist(args?: string[], opts?: minimist.Opts): T; + declare namespace minimist { export interface Opts { - // a string or array of strings argument names to always treat as strings + /** + * A string or array of strings argument names to always treat as strings + */ string?: string | string[]; - // a string or array of strings to always treat as booleans + + /** + * A boolean, string or array of strings to always treat as booleans. If true will treat + * all double hyphenated arguments without equals signs as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) + */ boolean?: boolean | string | string[]; - // an object mapping string names to strings or arrays of string argument names to use + + /** + * An object mapping string names to strings or arrays of string argument names to use as aliases + */ alias?: { [key: string]: string | string[] }; - // an object mapping string argument names to default values + + /** + * An object mapping string argument names to default values + */ default?: { [key: string]: any }; - // when true, populate argv._ with everything after the first non-option + + /** + * When true, populate argv._ with everything after the first non-option + */ stopEarly?: boolean; - // a function which is invoked with a command line parameter not defined in the opts configuration object. - // If the function returns false, the unknown option is not added to argv + + /** + * A function which is invoked with a command line parameter not defined in the opts + * configuration object. If the function returns false, the unknown option is not added to argv + */ unknown?: (arg: string) => boolean; - // when true, populate argv._ with everything before the -- and argv['--'] with everything after the -- + + /** + * When true, populate argv._ with everything before the -- and argv['--'] with everything after the --. + * Note that with -- set, parsing for arguments still stops after the `--`. + */ '--'?: boolean; } export interface ParsedArgs { [arg: string]: any; - _: string[]; + + /** + * If opts['--'] is true, populated with everything after the -- + */ + '--'?: string[]; + + /** + * Contains all the arguments that didn't have an option associated with them + */ + _: string[]; } } diff --git a/minimist/minimist-tests.ts b/minimist/minimist-tests.ts index 6e63590462..bf8fb34564 100644 --- a/minimist/minimist-tests.ts +++ b/minimist/minimist-tests.ts @@ -2,11 +2,21 @@ import minimist = require('minimist'); import Opts = minimist.Opts; +interface CustomArgs { + foo: boolean; +} + +interface CustomArgs2 extends minimist.ParsedArgs { + foo: boolean; +} + var num: string; var str: string; var strArr: string[]; var args: string[]; var obj: minimist.ParsedArgs; +var iobj: minimist.ParsedArgs & CustomArgs; +var eobj: CustomArgs2; var opts: Opts; var arg: any; @@ -40,6 +50,18 @@ opts['--'] = true; obj = minimist(); obj = minimist(strArr); obj = minimist(strArr, opts); +iobj = minimist(); +iobj = minimist(strArr); +iobj = minimist(strArr, opts); +eobj = minimist(); +eobj = minimist(strArr); +eobj = minimist(strArr, opts); var remainingArgCount = obj._.length; arg = obj['foo']; + +arg = iobj.foo; +remainingArgCount = iobj._.length; + +arg = eobj.foo; +remainingArgCount = eobj._.length; \ No newline at end of file diff --git a/nanomsg/index.d.ts b/nanomsg/index.d.ts index d59dea239e..a722a470ed 100644 --- a/nanomsg/index.d.ts +++ b/nanomsg/index.d.ts @@ -1,7 +1,7 @@ // Type definitions for nanomsg 3.2 // Project: https://github.com/nickdesaulniers/node-nanomsg // Definitions by: Titan -// Definitions: https://github.com/DefinitelyTyped/nanomsg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// diff --git a/ng-file-upload/index.d.ts b/ng-file-upload/index.d.ts index 88210fe206..2455c8daf5 100644 --- a/ng-file-upload/index.d.ts +++ b/ng-file-upload/index.d.ts @@ -106,20 +106,6 @@ declare module 'angular' { width?: number; } - interface ResizeIfFunction { - (width: number, height: number): boolean; - } - - interface FileResizeOptions { - centerCrop?: boolean; - height?: number; - ratio?: number; - resizeIf?: ResizeIfFunction; - restoreExif?: boolean; - quality?: number; - width?: number; - } - interface IUploadService { /** * Convert a single file or array of files to a single or array of diff --git a/node-fetch/index.d.ts b/node-fetch/index.d.ts index 733e25639e..d39b6db22e 100644 --- a/node-fetch/index.d.ts +++ b/node-fetch/index.d.ts @@ -5,6 +5,8 @@ /// +import { Agent } from "http"; + export class Request extends Body { constructor(input: string | Request, init?: RequestInit); method: string; @@ -12,20 +14,35 @@ export class Request extends Body { headers: Headers; context: RequestContext; referrer: string; - mode: RequestMode; redirect: RequestRedirect; - credentials: RequestCredentials; - cache: RequestCache; + + //node-fetch extensions to the whatwg/fetch spec + compress: boolean; + agent?: Agent; + counter: number; + follow: number; + hostname: string; + protocol: string; + port?: number; + timeout: number; + size: number; } interface RequestInit { + //whatwg/fetch standard options method?: string; headers?: HeaderInit | { [index: string]: string }; body?: BodyInit; - mode?: RequestMode; redirect?: RequestRedirect; - credentials?: RequestCredentials; - cache?: RequestCache; + + //node-fetch extensions + timeout?: number; //=0 req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies) + compress?: boolean; //=true support gzip/deflate content encoding. false to disable + size?: number; //=0 maximum response body size in bytes. 0 to disable + agent?: Agent; //=null http.Agent instance, allows custom proxy, certificate etc. + follow?: number; //=20 maximum redirect count. 0 to not follow redirect + + //node-fetch does not support mode, cache or credentials options } type RequestContext = @@ -56,7 +73,6 @@ export class Headers { export class Body { bodyUsed: boolean; body: NodeJS.ReadableStream; - arrayBuffer(): Promise; json(): Promise; json(): Promise; text(): Promise; @@ -71,7 +87,9 @@ export class Response extends Body { url: string; status: number; ok: boolean; + size: number; statusText: string; + timeout: number; headers: Headers; clone(): Response; } diff --git a/node-fetch/node-fetch-tests.ts b/node-fetch/node-fetch-tests.ts index e72b3db8e2..dbf140225f 100644 --- a/node-fetch/node-fetch-tests.ts +++ b/node-fetch/node-fetch-tests.ts @@ -1,4 +1,5 @@ import fetch, { Headers, Request, RequestInit, Response } from 'node-fetch'; +import { Agent } from "http"; function test_fetchUrlWithOptions() { var headers = new Headers(); @@ -6,10 +7,11 @@ function test_fetchUrlWithOptions() { var requestOptions: RequestInit = { method: "POST", headers: headers, - mode: 'same-origin', - credentials: 'omit', - cache: 'default', - redirect: 'manual' + compress: true, + follow: 10, + redirect: 'manual', + size: 100, + timeout: 5000 }; handlePromise(fetch("http://www.andlabs.net/html5/uCOR.php", requestOptions)); } @@ -36,6 +38,11 @@ function test_fetchUrlWithRequestObject() { } }; var request: Request = new Request("http://www.andlabs.net/html5/uCOR.php", requestOptions); + var timeout: number = request.timeout; + var size: number = request.size; + var agent: Agent = request.agent; + var protocol: string = request.protocol + handlePromise(fetch(request)); } diff --git a/node/index.d.ts b/node/index.d.ts index abe711e47b..1e18038d3c 100644 --- a/node/index.d.ts +++ b/node/index.d.ts @@ -2073,8 +2073,8 @@ declare module "dgram" { setMulticastLoopback(flag: boolean): void; addMembership(multicastAddress: string, multicastInterface?: string): void; dropMembership(multicastAddress: string, multicastInterface?: string): void; - ref(): void; - unref(): void; + ref(): this; + unref(): this; /** * events.EventEmitter diff --git a/notNeededPackages.json b/notNeededPackages.json index 92e1a708ed..8d5795ee50 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -96,6 +96,7 @@ "asOfVersion": "2.0.18" }, { +<<<<<<< HEAD "libraryName": "camel-case", "typingsPackageName": "camel-case", "sourceRepoURL": "https://github.com/blakeembrey/camel-case", diff --git a/passport/index.d.ts b/passport/index.d.ts index d2e260b118..26ae940a2f 100644 --- a/passport/index.d.ts +++ b/passport/index.d.ts @@ -26,64 +26,63 @@ declare module 'passport' { import express = require('express'); namespace passport { + interface AuthenticateOptions { + authInfo?: boolean; + assignProperty?: string; + failureFlash?: string|boolean|any; + failureMessage?: boolean|string; + failureRedirect?: string; + failWithError?: boolean; + session?: boolean; + scope?: string|string[]; + successFlash?: string|boolean|any; + successMessage?: boolean|string; + successRedirect?: string; + successReturnToOrRedirect?: string; + pauseStream?: boolean; + userProperty?: string; + } - interface AuthenticateOptions { - authInfo?: boolean; - assignProperty?: string; - failureFlash?: string|boolean|any; - failureMessage?: boolean|string; - failureRedirect?: string; - failWithError?: boolean; - session?: boolean; - scope?: string|string[]; - successFlash?: string|boolean|any; - successMessage?: boolean|string; - successRedirect?: string; - successReturnToOrRedirect?: string; - pauseStream?: boolean; - userProperty?: string; - } + interface Passport { + use(strategy: passport.Strategy): this; + use(name: string, strategy: passport.Strategy): this; + unuse(name: string): this; + framework(fw: passport.Framework): this; + initialize(options?: { userProperty: string; }): express.Handler; + session(options?: { pauseStream: boolean; }): express.Handler; - interface Passport { - use(strategy: passport.Strategy): Passport; - use(name: string, strategy: passport.Strategy): Passport; - unuse(name: string): Passport; - framework(fw: passport.Framework): Passport; - initialize(options?: { userProperty: string; }): express.Handler; - session(options?: { pauseStream: boolean; }): express.Handler; + authenticate(strategy: string|string[], callback?: Function): express.Handler; + authenticate(strategy: string|string[], options: AuthenticateOptions, callback?: Function): express.Handler; + authorize(strategy: string|string[], callback?: Function): express.Handler; + authorize(strategy: string|string[], options: any, callback?: Function): express.Handler; + serializeUser(fn: (user: TUser, done: (err: any, id: TID) => void) => void): void; + deserializeUser(fn: (id: TID, done: (err: any, user: TUser) => void) => void): void; + transformAuthInfo(fn: (info: any, done: (err: any, info: any) => void) => void): void; + } - authenticate(strategy: string|string[], callback?: Function): express.Handler; - authenticate(strategy: string|string[], options: AuthenticateOptions, callback?: Function): express.Handler; - authorize(strategy: string|string[], callback?: Function): express.Handler; - authorize(strategy: string|string[], options: any, callback?: Function): express.Handler; - serializeUser(fn: (user: TUser, done: (err: any, id: TID) => void) => void): void; - deserializeUser(fn: (id: TID, done: (err: any, user: TUser) => void) => void): void; - transformAuthInfo(fn: (info: any, done: (err: any, info: any) => void) => void): void; - } + interface Strategy { + name?: string; + authenticate(req: express.Request, options?: any): void; + } - interface Strategy { - name?: string; - authenticate(req: express.Request, options?: any): void; - } - - interface Profile { - provider: string; - id: string; - displayName: string; + interface Profile { + provider: string; + id: string; + displayName: string; username?: string; name?: { - familyName: string; - givenName: string; - middleName?: string; - }; - emails?: Array<{ - value: string; - type?: string; - }>; - photos?: Array<{ - value: string; - }>; - } + familyName: string; + givenName: string; + middleName?: string; + }; + emails?: Array<{ + value: string; + type?: string; + }>; + photos?: Array<{ + value: string; + }>; + } interface Framework { initialize(passport: Passport, options?: any): Function; @@ -95,3 +94,4 @@ declare module 'passport' { const passport: passport.Passport; export = passport; } + diff --git a/pdfkit/index.d.ts b/pdfkit/index.d.ts index 68e787c2fd..6d5272875b 100644 --- a/pdfkit/index.d.ts +++ b/pdfkit/index.d.ts @@ -160,7 +160,7 @@ declare namespace PDFKit.Mixins { bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): TDocument; quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): TDocument; rect(x: number, y: number, w: number, h: number): TDocument; - roundRect(x: number, y: number, w: number, h: number, r?: number): TDocument; + roundedRect(x: number, y: number, w: number, h: number, r?: number): TDocument; ellipse(x: number, y: number, r1: number, r2?: number): TDocument; circle(x: number, y: number, raduis: number): TDocument; polygon(...points: number[][]): TDocument; diff --git a/pdfkit/pdfkit-tests.ts b/pdfkit/pdfkit-tests.ts index a652e167a4..57aff702da 100644 --- a/pdfkit/pdfkit-tests.ts +++ b/pdfkit/pdfkit-tests.ts @@ -52,6 +52,8 @@ doc.path("M 0,20 L 100,160 Q 130,200 150,120 C 190,-40 200,200 300,150 L 400,90" //Rectangle shape helper sample doc.rect(100,200,100,100); +// Rounded rectangle +doc.roundedRect(150,250,150,150,10); //polygon doc.polygon([100,0],[50,100],[50,100]); diff --git a/raygun4js/index.d.ts b/raygun4js/index.d.ts index 9c97b17ce6..6acae0a8dd 100644 --- a/raygun4js/index.d.ts +++ b/raygun4js/index.d.ts @@ -1,96 +1,311 @@ -// Type definitions for raygun4js 1.18.3 +// Type definitions for raygun4js 2.4.2 // Project: https://github.com/MindscapeHQ/raygun4js -// Definitions by: Brian Surowiec +// Definitions by: Brian Surowiec , Benjamin Harding // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace raygun { - - // https://github.com/MindscapeHQ/raygun4js/blob/c7d8880045214ab6d403d5cc613c207f696a3cdd/src/raygun.js#L533-539 - interface IStackTrace { - LineNumber: number; - ColumnNumber: number; - ClassName: string; - FileName: string; - MethodName: string; - } - - // https://github.com/MindscapeHQ/raygun4js/blob/c7d8880045214ab6d403d5cc613c207f696a3cdd/src/raygun.js#L598-637 - interface IPayload { - OccurredOn: Date; - Details: { - Error: { - ClassName: string; - Message: string; - StackTrace: IStackTrace[]; - }; - Environment: { - UtcOffset: number; - 'User-Language': string; - 'Document-Mode': number; - 'Browser-Width': number; - 'Browser-Height': number; - 'Screen-Width': number; - 'Screen-Height': number; - 'Color-Depth': number; - Browser: string; - 'Browser-Name': string; - 'Browser-Version': string; - Platform: string; - }; - Client: { - Name: string; - Version: string; - }; - UserCustomData: any; - Tags: string[]; - Request: { - Url: string; - QueryString: string; - Headers: { - 'User-Agent': string; - Referer: string; - Host: string; - }; - }; - Version: string; - }; - } - - // https://github.com/MindscapeHQ/raygun4js/blob/c7d8880045214ab6d403d5cc613c207f696a3cdd/src/raygun.js#L61-82 - interface IRaygunOptions { - allowInsecureSubmissions?: boolean; - ignoreAjaxAbort?: boolean; - ignoreAjaxError?: boolean; - disableAnonymousUserTracking?: boolean; - excludedHostnames?: (string|RegExp)[]; - excludedUserAgents?: (string|RegExp)[]; - wrapAsynchronousCallbacks?: boolean; - debugMode?: boolean; - ignore3rdPartyErrors?: boolean; - } - - interface RaygunStatic { - noConflict(): RaygunStatic; - constructNewRaygun(): RaygunStatic; - init(apiKey: string, options?: IRaygunOptions, customdata?: any): RaygunStatic; - withCustomData(customdata: any): RaygunStatic; - withTags(tags: string[]): RaygunStatic; - attach(): RaygunStatic; - detach(): RaygunStatic; - send(e: Error, customData?: any, tags?: string[]): RaygunStatic; - setUser(user: string, isAnonymous?: boolean, email?: string, fullName?: string, firstName?: string, uuid?: string): RaygunStatic; - resetAnonymousUser(): void; - setVersion(version: string): RaygunStatic; - saveIfOffline(enableOffline: boolean): RaygunStatic; - filterSensitiveData(filteredKeys: string[]): RaygunStatic; - setFilterScope(scope: string): RaygunStatic; - whitelistCrossOriginDomains(whitelist: string[]): RaygunStatic; - onBeforeSend(callback: (payload: IPayload) => IPayload): RaygunStatic; - } - +interface TracekitStackTrace { + message: string; + mode: string; + name: string; + stack: TracekitStack[]; + url: string; + useragent: string; } -declare var Raygun: raygun.RaygunStatic; +interface TracekitStack { + column: number; + context: any; + func: string; + line: number; + url: string; +} + + +interface RaygunStackTrace { + LineNumber: number; + ColumnNumber: number; + ClassName: string; + FileName: string; + MethodName: string; +} + +interface RaygunOptions { + /** + * Posts error payloads over HTTP. This allows IE8 to send JS errors. + */ + allowInsecureSubmissions?: boolean; + + /** + * User-aborted Ajax calls result in errors. If this option is true, these errors will not be sent. + */ + ignoreAjaxAbort?: boolean; + + /** + * Ajax requests that return error codes will not be sent as errors to Raygun if this options is true. + */ + ignoreAjaxError?: boolean; + + /** + * Disabling anonymous user tracking. + */ + disableAnonymousUserTracking?: boolean; + + /** + * Prevent uncaught errors from being sent. + */ + disableErrorTracking?: boolean; + + /** + * Prevent Pulse real user monitoring events from being sent. + */ + disablePulse?: boolean; + + /** + * Prevents errors from being sent from certain hostnames (domains) by providing an array of strings or RegExp objects (for partial matches). Each should match the hostname or TLD that you want to exclude. Note that protocols are not tested. + */ + excludedHostnames?: (string|RegExp)[]; + + /** + * Prevents errors from being sent from certain user agents by providing an array of strings. This is very helpful to exclude errors reported by certain browsers or test automation with CasperJS, PhantomJS or any other testing utility that sends a custom user agent. If a part of the client's navigator.userAgent matches one of the given strings in the array, then the client will be excluded from error reporting. + */ + excludedUserAgents?: (string|RegExp)[]; + + /** + * The maximum time a virtual page can be considered viewed, in milliseconds (defaults to 30 minutes). + */ + pulseMaxVirtualPageDuration?: number; + + /** + * Ignore URL casing when sending data to Pulse. + */ + pulseIgnoreUrlCasing?: boolean; + + /** + * A string URI containing the protocol, domain and port (optional) where all payloads will be sent to. This can be used to proxy payloads to the Raygun API through your own server. When not set this defaults internally to the Raygun API, and for most usages you won't need to set this. + */ + apiUrl?: string; + + /** + * If false, async callback functions triggered by setTimeout/setInterval will not be wrapped when attach() is called. Defaults to true + */ + wrapAsynchronousCallbacks?: boolean; + + /** + * Raygun4JS will log to the console when sending errors. + */ + debugMode?: boolean; + + /** + * Ignores any errors that have no stack trace information. This will discard any errors that occur completely within 3rd party scripts - if code loaded from the current domain called the 3rd party function, it will have at least one stack line and will still be sent. + */ + ignore3rdPartyErrors?: boolean; + + /** + * A string URI containing the protocol, domain and port (optional) where all payloads will be sent to. This can be used to proxy payloads to the Raygun API through your own server. When not set this defaults internally to the Raygun API, and for most usages you won't need to set this. + */ + apiEndpoint?: string; +} + +interface RaygunPayload { + OccurredOn: Date; + Details: { + Error: { + ClassName: string; + Message: string; + StackTrace: RaygunStackTrace[]; + }; + Environment: { + UtcOffset: number; + 'User-Language': string; + 'Document-Mode': number; + 'Browser-Width': number; + 'Browser-Height': number; + 'Screen-Width': number; + 'Screen-Height': number; + 'Color-Depth': number; + Browser: string; + 'Browser-Name': string; + 'Browser-Version': string; + Platform: string; + }; + Client: { + Name: string; + Version: string; + }; + UserCustomData: any; + Tags: string[]; + Request: { + Url: string; + QueryString: string; + Headers: { + 'User-Agent': string; + Referer: string; + Host: string; + }; + }; + Version: string; + User: { + Identifier?: string; + IsAnonymous?: boolean; + Email?: string; + FullName?: string; + FirstName?: string; + UUID?: any; + }; + GroupingKey?: string; + }; +} + +interface RaygunStatic { + + /** + * Prevents Raygun from overwriting anything bound to `window.Raygun`. + */ + noConflict(): RaygunStatic; + + /** + * Creates a new Raygun object. Allows the sending of errors to different applications. + */ + constructNewRaygun(): RaygunStatic; + + /** + * Configures the Raygun provider. + */ + init(apiKey: string, options?: RaygunOptions, customdata?: any): RaygunStatic; + + /** + * Attaches custom data to any errors sent to Raygun. + */ + withCustomData(customdata: any): RaygunStatic; + + /** + * Allows errors to be filtered by tag in the Raygun Dashboard. + */ + withTags(tags: string[]): RaygunStatic; + + /** + * Attaches to the `window.onerror` handler. Enables unhandled errors to be automatically tracked. + */ + attach(): RaygunStatic; + + /** + * Detaches the handler from the window.onerror method. Unhandled errors will no longer be tracked. + */ + detach(): RaygunStatic; + + /** + * Sends an error/exception to the Raygun Api. + */ + send(ex: Error, customData?: any, tags?: string[]): RaygunStatic; + + /** + * Provides additional information about the current user. + */ + setUser(user: string, isAnonymous?: boolean, email?: string, fullName?: string, firstName?: string, uuid?: string): RaygunStatic; + + /** + * Resets the information about the current user. + */ + resetAnonymousUser(): void; + + /** + * Allows errors to be filtered by version in the Raygun Dashboard. Versions should be in the format `x.x.x` + */ + setVersion(version: string): RaygunStatic; + + /** + * Whether caught errors should be saved in Local Storage when there is no network activity. Saved errors will be send when another error occurs, and activity is regained. Disabled by default. + */ + saveIfOffline(enableOffline: boolean): RaygunStatic; + + /** + * Blacklist keys to prevent their values from being sent to Raygun. + */ + filterSensitiveData(filteredKeys: (string|RegExp)[]): RaygunStatic; + + /** + * Change the scope at which filters are applied. Defaults to `customData` by default. + */ + setFilterScope(scope: "all"|"customData"): RaygunStatic; + + /** + * Whitelist damains which should transmit errors to Raygun. + */ + whitelistCrossOriginDomains(whitelist: string[]): RaygunStatic; + + /** + * Executed before the payload is sent. If a truthy object is returned, Raygun will attempt to use that as the payload. Raygun will abort the send if `false` is returned. + */ + onBeforeSend(callback: (payload: RaygunPayload) => RaygunPayload|boolean): RaygunStatic; + + /** + * Overrides the default automatic grouping and instead group errors together by the string returned by the callback. + */ + groupingKey(callback: (payload: RaygunPayload, stackTrace: TracekitStackTrace, options: any) => string|void): RaygunStatic; + onBeforeXHR(callback: (xhr: XMLHttpRequest) => void): RaygunStatic; + onAfterSend(callback: (response: XMLHttpRequest) => void): RaygunStatic; + endSession(): void; + + /** + * Track Single Page Application route events. + */ + trackEvent(type: "pageView", options: { path: string }): void; +} + +interface RaygunV2UserDetails { + /** + * Uniquely identifies the user within Raygun. + */ + identifier: string; + + /** + * Indicates whether the user is anonymous or has a user account. Even if this is set to true, you should still give the user a unique identifier of some kind. + */ + isAnonymous?: string; + + /** + * The user's email address. + */ + email?: string; + + /** + * The user's full name. + */ + fullName?: string; + + /** + * The user's first or preferred name. + */ + firstName?: string; + + /** + * Identifier of the device the app is running on. This could be used to correlate user accounts over multiple machines. + */ + uuid?: string; +} + + +interface RaygunV2 { + (key: "options", value:RaygunOptions):void; + (key: "setUser", value: RaygunV2UserDetails):void; + (key: "onBeforeSend", callback: (payload: RaygunPayload) => RaygunPayload|boolean):void; + (key: "onBeforeXHR"|"onAfterSend", callback: (xhr: XMLHttpRequest) => void): void; + (key: "groupingKey", value:(payload: RaygunPayload, stackTrace: TracekitStackTrace, options: any) => string|void):void; + (key: "trackEvent", value: { type: string, path: string }): void; + (key: "apiKey"|"setVersion"|"setFilterScope", value:string):void; + (key: "attach"|"enableCrashReporting"|"enablePulse"|"noConflict"|"saveIfOffline", value: boolean):void; + (key: "filterSensitiveData"|"whitelistCrossOriginDomains"|"withTags", values: string[]): void; + (key: "send"|"withCustomData", value: any): void; + (key: "getRaygunInstance"):RaygunStatic; + (key: "detach"): void; + (key: string):void; +} + +interface Window { + Raygun: RaygunStatic; +} + +declare var Raygun: RaygunStatic; declare module 'raygun4js' { export = Raygun; diff --git a/raygun4js/raygun4js-tests.ts b/raygun4js/raygun4js-tests.ts index f3c3c9c1ed..34ffeafbfb 100644 --- a/raygun4js/raygun4js-tests.ts +++ b/raygun4js/raygun4js-tests.ts @@ -1,19 +1,38 @@ -var client: raygun.RaygunStatic = Raygun.noConflict(); +// V2 Api -var newClient: raygun.RaygunStatic = client.constructNewRaygun(); +// To use the V2 api you will need to declare a `rg4js` variable +// This is because `rg4js` name is configurable by users +declare var rg4js: RaygunV2; + +rg4js("apiKey", "api-key"); +rg4js("enableCrashReporting", true); +rg4js("enablePulse", true); +rg4js('setUser', { + identifier: "username", + firstName: "Robert", + fullName: "Robert Raygun" +}); + +// V1 Api +var client: RaygunStatic = Raygun.noConflict(); +var newClient: RaygunStatic = client.constructNewRaygun(); client.init('api-key'); -client.init('api-key', { allowInsecureSubmissions: true }); -client.init('api-key', { allowInsecureSubmissions: true }, { some: 'data' }); +client.init('api-key', { allowInsecureSubmissions: true, disablePulse: false }); +client.init('api-key', { allowInsecureSubmissions: true, disablePulse: false }, { some: 'data' }); client.withCustomData({ some: 'data' }); +client.withCustomData(function() { + return { some: 'data' }; +}); client.withTags(['tag1', 'tag2']); client.attach().detach(); client.send(new Error('a error')); -client.send(new Error('a error'), ['tag1', 'tag2']); +client.send(new Error('a error'), { some: 'data' }); +client.send(new Error('a error'), { some: 'data' }, ['tag1', 'tag2']); try { throw new Error('oops'); @@ -24,14 +43,12 @@ catch (e) { client.setUser('username'); client.setUser('username', true); -client.setUser('username', false, 'user@email.com', 'Robbie Robot'); -client.setUser('username', false, 'user@email.com', 'Robbie Robot', 'Robbie'); -client.setUser('username', false, 'user@email.com', 'Robbie Robot', 'Robbie', '8ae89fc9-1144-42d6-9629-bf085dab18d2'); +client.setUser('username', false, 'user@email.com', 'Robert Raygun'); +client.setUser('username', false, 'user@email.com', 'Robert Raygun', 'Robert'); +client.setUser('username', false, 'user@email.com', 'Robert Raygun', 'Robert', '8ae89fc9-1144-42d6-9629-bf085dab18d2'); client.resetAnonymousUser(); - client.setVersion('1.2.3.4'); - client.saveIfOffline(true); client.filterSensitiveData(['field1', 'field2']); @@ -43,4 +60,22 @@ client.whitelistCrossOriginDomains(['domain1', 'domain2']); client.onBeforeSend(payload=> { payload.OccurredOn = new Date(); return payload; -}); \ No newline at end of file +}); + +client.groupingKey(payload => { + return payload.Details.Error.Message; +}); + +client.onBeforeXHR(xhr => { + console.log(xhr.response); +}); + +client.onAfterSend(xhr => { + console.log(xhr.response); +}); + +client.endSession(); + +client.trackEvent('pageView', { + path: '/url' +}); diff --git a/raygun4js/tsconfig.json b/raygun4js/tsconfig.json index cf1ec52823..1a37c183e6 100644 --- a/raygun4js/tsconfig.json +++ b/raygun4js/tsconfig.json @@ -4,7 +4,7 @@ "target": "es6", "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -17,4 +17,4 @@ "index.d.ts", "raygun4js-tests.ts" ] -} \ No newline at end of file +} diff --git a/react-bootstrap-table/index.d.ts b/react-bootstrap-table/index.d.ts index b0b250f8c3..72db1aaf40 100644 --- a/react-bootstrap-table/index.d.ts +++ b/react-bootstrap-table/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for react-bootstrap-table v2.3.0 +// Type definitions for react-bootstrap-table v2.6.0 // Project: https://github.com/AllenFang/react-bootstrap-table -// Definitions by: Frank Laub +// Definitions by: Frank Laub , Aleksander Lode // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -115,12 +115,18 @@ export interface BootstrapTableProps extends Props { */ options?: Options; fetchInfo?: FetchInfo; - + printable?: boolean; tableStyle?: any; containerStyle?: any; headerStyle?: any; bodyStyle?: any; ignoreSinglePage?: boolean; + containerClass?: string; + tableContainerClass?: string + headerContainerClass?: string; + bodyContainerClass?: string; + expandableRow?: (row: any) => boolean; + expandComponent?: (row: any) => any; } export type SelectRowMode = 'none' | 'radio' | 'checkbox'; @@ -166,7 +172,7 @@ export interface SelectRow { `row`: is the row data which you wanted to select or unselect. `isSelected`: it's a boolean value means "whether or not that row will be selected?". `event`: The event target object. - If return value of this function is false, the select or deselect action will not be applied. + If return value of this (function) is false, the select or deselect action will not be applied. */ onSelect?: (row: any, isSelected: Boolean, event: any) => boolean; /** @@ -178,6 +184,10 @@ export interface SelectRow { */ onSelectAll?: (isSelected: boolean, currentSelectedAndDisplayData: any) => boolean; + /** + * Provide a list of unselectable row keys. + */ + unselectable?: number[]; } export type CellEditClickMode = 'none' | 'click' | 'dbclick'; @@ -293,6 +303,10 @@ export interface Options { /** To define the pagination bar length, default is 5. */ + /** + To define where to start counting the pages. + */ + pageStartIndex?: string; paginationSize?: number; /** Assign a callback function which will be called after page changed. @@ -333,6 +347,15 @@ export interface Options { This function taking one argument: row which is the row data which you click on. */ onRowClick?: (row: any) => void; + /** + Assign a callback function which will be called after a row double click. + This function taking one argument: row which is the row data which you double click on. + */ + onRowDoubleClick?: (row:any)=>void; + /** + Background color on expanded rows. + */ + expandRowBgColor?: string; /** Assign a callback function which will be called when mouse enter into the table. */ @@ -362,7 +385,7 @@ export interface Options { `rowKeys` is the row keys which been deleted, you can call next function to apply this deletion. */ handleConfirmDeleteRow?: (next: Function, rowKeys: any[]) => void; - paginationShowsTotal?: boolean; + paginationShowsTotal?: boolean | ReactElement; onSearchChange?: Function; onAddRow?: Function; onExportToCSV?: Function; @@ -442,6 +465,10 @@ export interface TableHeaderColumnProps extends Props { True to enable table sorting. Default is disabled. */ dataSort?: boolean; + /** + Default search string. + */ + defaultSearch?: string; /** Allow user to render a custom sort caret. You should give a function and should return a JSX. This function taking one arguments: order which present the sort order currently. @@ -460,6 +487,10 @@ export interface TableHeaderColumnProps extends Props { True to hide column. */ hidden?: boolean; + /** + True to hide the dropdown for sizePerPage. + */ + hideSizePerPage?: boolean /** False to disable search functionality on column, default is true. */ @@ -557,7 +588,7 @@ export interface Filter { /** * Only work on NumberFilter. Accept an array which conatin the filter condition, like: ['<','>','='] */ - numberComparators: string[]; + numberComparators?: string[]; } export interface TableHeaderColumn extends ComponentClass { } diff --git a/react-dropzone/index.d.ts b/react-dropzone/index.d.ts index 16d92a0d68..b4ed4ded43 100644 --- a/react-dropzone/index.d.ts +++ b/react-dropzone/index.d.ts @@ -36,5 +36,5 @@ declare module "react-dropzone" { } let Dropzone: React.ClassicComponentClass; - export default Dropzone; + export = Dropzone; } diff --git a/react-dropzone/react-dropzone-tests.tsx b/react-dropzone/react-dropzone-tests.tsx index c258072ec1..322fd82e8c 100644 --- a/react-dropzone/react-dropzone-tests.tsx +++ b/react-dropzone/react-dropzone-tests.tsx @@ -1,7 +1,7 @@ /// /// import * as React from 'react'; -import Dropzone from 'react-dropzone'; +import * as Dropzone from 'react-dropzone'; class Test extends React.Component { constructor(props: any) { diff --git a/react-modal/index.d.ts b/react-modal/index.d.ts index 2c49d7ab1d..59842fe99a 100644 --- a/react-modal/index.d.ts +++ b/react-modal/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-modal v1.3.0 +// Type definitions for react-modal v1.6.1 // Project: https://github.com/reactjs/react-modal // Definitions by: Rajab Shakirov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -24,6 +24,7 @@ declare module "react-modal" { shouldCloseOnOverlayClick?: boolean, overlayClassName?: string, className?: string + contentLabel?: string } let ReactModal: React.ClassicComponentClass; export = ReactModal; diff --git a/react-native/index.d.ts b/react-native/index.d.ts index 122d1e36ce..9e89306872 100644 --- a/react-native/index.d.ts +++ b/react-native/index.d.ts @@ -741,10 +741,57 @@ declare module "react" { timestamp: number } + interface PerpectiveTransform { + perspective: number; + } + + interface RotateTransform { + rotate: string; + } + + interface RotateXTransform { + rotateX: string; + } + + interface RotateYTransform { + rotateY: string; + } + + interface RotateZTransform { + rotateZ: string; + } + + interface ScaleTransform { + scale: number; + } + + interface ScaleXTransform { + scaleX: number; + } + + interface ScaleYTransform { + scaleY: number; + } + + interface TranslateXTransform { + translateX: number; + } + + interface TranslateYTransform { + translateY: number; + } + + interface SkewXTransform { + skewX: string; + } + + interface SkewYTransform { + skewY: string; + } export interface TransformsStyle { - transform?: [{ perspective: number }, { rotate: string }, { rotateX: string }, { rotateY: string }, { rotateZ: string }, { scale: number }, { scaleX: number }, { scaleY: number }, { translateX: number }, { translateY: number }, { skewX: string }, { skewY: string }] + transform?: (PerpectiveTransform|RotateTransform|RotateXTransform|RotateYTransform|RotateZTransform|ScaleTransform|ScaleXTransform|ScaleYTransform|TranslateXTransform|TranslateYTransform|SkewXTransform|SkewYTransform)[] transformMatrix?: Array rotation?: number scaleX?: number @@ -3772,13 +3819,13 @@ declare module "react" { * On iOS, the modal is still restricted by what's specified in your app's Info.plist's UISupportedInterfaceOrientations field. * @platform ios */ - supportedOrientations: ('portrait' | 'portrait-upside-down' | 'landscape' | 'landscape-left' | 'landscape-right')[] + supportedOrientations?: ('portrait' | 'portrait-upside-down' | 'landscape' | 'landscape-left' | 'landscape-right')[] /** * The `onOrientationChange` callback is called when the orientation changes while the modal is being displayed. * The orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render, regardless of the current orientation. * @platform ios */ - onOrientationChange: () => void, + onOrientationChange?: () => void } export interface ModalStatic extends React.ComponentClass { @@ -5576,7 +5623,17 @@ declare module "react" { * Fires at most once per frame during scrolling. * The frequency of the events can be contolled using the scrollEventThrottle prop. */ - onScroll?: (event?: { nativeEvent: NativeScrollEvent }) => void + onScroll?: (event?: NativeSyntheticEvent) => void + + /** + * Fires if a user initiates a scroll gesture. + */ + onScrollBeginDrag?: (event?: NativeSyntheticEvent) => void + + /** + * Fires when a user has finished scrolling. + */ + onScrollEndDrag?: (event?: NativeSyntheticEvent) => void /** * When true the scroll view stops on multiples of the scroll view's size diff --git a/redux-form/index.d.ts b/redux-form/index.d.ts index 77a3004710..4c73f3e489 100644 --- a/redux-form/index.d.ts +++ b/redux-form/index.d.ts @@ -1,476 +1,38 @@ -// Type definitions for redux-form v4.0.3 +// Type definitions for redux-form v6.3.1 // Project: https://github.com/erikras/redux-form -// Definitions by: Daniel Lytkin +// Definitions by: Carson Full , Daniel Lytkin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import * as React from 'react'; -import { Component, SyntheticEvent, FormEventHandler } from 'react'; -import { Dispatch, ActionCreator, Reducer } from 'redux'; +/// -export const actionTypes: {[actionName:string]: string}; +import { + ComponentClass, + StatelessComponent, +} from 'react'; export type FieldValue = any; -export type FormData = { [fieldName: string]: FieldValue }; +export type FieldType = 'Field' | 'FieldArray'; -export interface FieldProp { - /** - * true if this field currently has focus. It will only work if you are - * passing onFocus to your input element. - */ - active: boolean; +export type DataShape = {[fieldName:string]: FieldValue}; - /** - * An alias for value only when value is a boolean. Provided for - * convenience of destructuring the whole field object into the props of a - * form element. - */ - checked?: boolean; +export type FormErrors = FormData & { _error?: string }; - /** - * true if the field value has changed from its initialized value. - * Opposite of pristine. - */ - dirty: boolean; - - /** - * The error for this field if its value is not passing validation. Both - * synchronous and asynchronous validation errors will be reported here. - */ - error?: any; - - /** - * The value for this field as supplied in initialValues to the form. - */ - initialValue: FieldValue; - - /** - * true if the field value fails validation (has a validation error). - * Opposite of valid. - */ - invalid: boolean; - - /** - * The name of the field. It will be the same as the key in the fields - * Object, but useful if bundling up a field to send down to a specialized - * input component. - */ - name: string; - - /** - * A function to call when the form field loses focus. It expects to - * either receive the React SyntheticEvent or the current value of the - * field. - */ - onBlur(eventOrValue: SyntheticEvent | FieldValue): void; - - /** - * A function to call when the form field is changed. It expects to either - * receive the React SyntheticEvent or the new value of the field. - * @param eventOrValue - */ - onChange(eventOrValue: SyntheticEvent | FieldValue): void; - - /** - * A function to call when the form field receives a 'dragStart' event. - * Saves the field value in the event for giving the field it is dropped - * into. - */ - onDragStart(): void; - - /** - * A function to call when the form field receives a drop event. - */ - onDrop(): void; - - /** - * A function to call when the form field receives focus. - */ - onFocus(): void; - - /** - * An alias for onChange. Provided for convenience of destructuring the - * whole field object into the props of a form element. Added to provide - * out-of-the-box support for Belle components' onUpdate API. - */ - onUpdate(): void; - - /** - * true if the field value is the same as its initialized value. Opposite - * of dirty. - */ - pristine: boolean; - - /** - * true if the field has been touched. By default this will be set when - * the field is blurred. - */ - touched: boolean; - - /** - * true if the field value passes validation (has no validation errors). - * Opposite of invalid. - */ - valid: boolean; - - /** - * The value of this form field. It will be a boolean for checkboxes, and - * a string for all other input types. - */ - value: FieldValue; - - /** - * true if this field has ever had focus. It will only work if you are - * passing onFocus to your input element. - */ - visited: boolean; -} - -export interface ReduxFormProps { - /** - * The name of the currently active (with focus) field. - */ - active?: string; - - /** - * A function that may be called to initiate asynchronous validation if - * asynchronous validation is enabled. - */ - asyncValidate?: Function; - - /** - * true if the asynchronous validation function has been called but has not - * yet returned. - */ - asyncValidating?: boolean; - - /** - * Destroys the form state in the Redux store. By default, this will be - * called for you in componentWillUnmount(). - */ - destroyForm?(): void; - - /** - * true if the form data has changed from its initialized values. Opposite - * of pristine. - */ - dirty?: boolean; - - /** - * A generic error for the entire form given by the _error key in the - * result from the synchronous validation function, the asynchronous - * validation, or the rejected promise from onSubmit. - */ - error?: any; - - /** - * The form data, in the form { field1: , field2: }. The - * field objects are meant to be destructured into your input component as - * props, e.g. . Each field Object has - * the following properties: - */ - fields?: { [field: string]: FieldProp }; - - /** - * A function meant to be passed to
or to - *