From 199e45bc8cef44b86c6fa0b8ab28258e4e905c97 Mon Sep 17 00:00:00 2001 From: TheVTM Date: Tue, 8 Nov 2016 17:00:56 -0200 Subject: [PATCH 01/51] Added missing nconf.required(keys) and Provider.required(keys) methods. --- nconf/nconf-tests.ts | 2 ++ nconf/nconf.d.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/nconf/nconf-tests.ts b/nconf/nconf-tests.ts index dd33514c23..db105dfefe 100644 --- a/nconf/nconf-tests.ts +++ b/nconf/nconf-tests.ts @@ -57,6 +57,7 @@ nconf.init(opts); p = nconf.overrides(); p = nconf.overrides(opts); nconf.remove(str); +bool = nconf.required(strArr); store = nconf.create(str, opts); str = nconf.key(value, value); @@ -118,6 +119,7 @@ p = p.defaults(opts); p.init(opts); p = p.overrides(opts); p.remove(str); +bool = p.required(strArr); store = p.create(str, opts); // - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nconf/nconf.d.ts b/nconf/nconf.d.ts index 005d129199..6a42dc0100 100644 --- a/nconf/nconf.d.ts +++ b/nconf/nconf.d.ts @@ -32,6 +32,7 @@ declare module "nconf" { export function init(options?: IOptions): void; export function overrides(options?: IOptions): Provider; export function remove(name: string): void; + export function required(keys: string[]): boolean; export function create(name: string, options: IOptions): IStore; export function key(...values: any[]): string; @@ -95,6 +96,7 @@ declare module "nconf" { init(options?: IOptions): void; overrides(options?: IOptions): Provider; remove(name: string): void; + required(keys: string[]): boolean; create(name: string, options: IOptions): IStore; } From f9c3dc99f2a88e94aacae8b7f40761fb324c10c3 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 30 Nov 2016 10:07:06 -0500 Subject: [PATCH 02/51] update to 4.7.0, add querycursor.map() and schema.loadClass() --- mongoose/mongoose-tests.ts | 12 ++++++++++++ mongoose/mongoose.d.ts | 16 ++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/mongoose/mongoose-tests.ts b/mongoose/mongoose-tests.ts index 8e4fa4a1ef..911e152db2 100644 --- a/mongoose/mongoose-tests.ts +++ b/mongoose/mongoose-tests.ts @@ -196,6 +196,18 @@ QCModel.find({}).cursor({}).on('data', function (doc: any) { }).on('error', function (error: any) { throw error; }).close().then(cb).catch(cb); +querycursor.map(function (doc) { + doc.foo = "bar"; + return doc; +}).on('data', function (doc: any) { + console.log(doc.foo); +}); +querycursor.map(function (doc) { + doc.foo = "bar"; + return doc; +}).next(function (error, doc) { + console.log(doc.foo); +}); /* * section virtualtype.js diff --git a/mongoose/mongoose.d.ts b/mongoose/mongoose.d.ts index 1b1cba3e8c..360fa9f69d 100644 --- a/mongoose/mongoose.d.ts +++ b/mongoose/mongoose.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mongoose 4.6.8 +// Type definitions for Mongoose 4.7.0 // Project: http://mongoosejs.com/ // Definitions by: simonxca , horiuchi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -496,11 +496,17 @@ declare module "mongoose" { */ eachAsync(fn: (doc: T) => any, callback?: (err: any) => void): Promise; + /** + * Registers a transform function which subsequently maps documents retrieved + * via the streams interface or .next() + */ + map(fn: (doc: T) => T): this; + /** * Get the next document from this cursor. Will return null when there are * no documents left. */ - next(callback?: (err: any) => void): Promise; + next(callback?: (err: any, doc?: T) => void): Promise; } /* @@ -563,6 +569,12 @@ declare module "mongoose" { /** Compiles indexes from fields and schema-level indexes */ indexes(): any[]; + /** + * Loads an ES6 class into a schema. Maps setters + getters, static methods, and + * instance methods to schema virtuals, statics, and methods. + */ + loadClass(model: Function): this; + /** * Adds an instance method to documents constructed from Models compiled from this schema. * If a hash of name/fn pairs is passed as the only argument, each name/fn pair will be added as methods. From 52f93374af9dbc94722f002889b0efa7c16e2712 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 30 Nov 2016 10:08:35 -0500 Subject: [PATCH 03/51] add error callback for schema.post() --- mongoose/mongoose-tests.ts | 12 +++++++++++- mongoose/mongoose.d.ts | 10 +++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/mongoose/mongoose-tests.ts b/mongoose/mongoose-tests.ts index 911e152db2..1c075b6cc0 100644 --- a/mongoose/mongoose-tests.ts +++ b/mongoose/mongoose-tests.ts @@ -269,8 +269,18 @@ schema.plugin(function (schema, opts) { schema.get('path'); opts.hasOwnProperty(''); }).plugin(cb, {opts: true}); -schema.post('post', function (doc) {}).post('post', function (doc, next) { +schema +.post('save', function (error, doc, next) { + error.stack; + doc.model; + next.apply; +}) +.post('save', function (doc: mongoose.Document, next: Function) { + doc.model; next(new Error()); +}) +.post('save', function (doc: mongoose.Document) { + doc.model; }); schema.queue('m1', [1, 2, 3]).queue('m2', [[]]); schema.remove('path'); diff --git a/mongoose/mongoose.d.ts b/mongoose/mongoose.d.ts index 360fa9f69d..025d543163 100644 --- a/mongoose/mongoose.d.ts +++ b/mongoose/mongoose.d.ts @@ -609,9 +609,13 @@ declare module "mongoose" { * @param method name of the method to hook * @param fn callback */ - post(method: string, fn: (doc: T) => void, ...args: any[]): this; - post(method: string, fn: (doc: T, next: (err?: NativeError) => void, - ...otherArgs: any[]) => void): this; + post(method: string, fn: ( + error: mongodb.MongoError, doc: T, next: (err?: NativeError) => void + ) => void): this; + + post(method: string, fn: ( + doc: T, next: (err?: NativeError) => void + ) => void): this; /** * Defines a pre hook for the document. From 2f6ac1cf943d6cb5f0b1d17548fd83b4de1ffaac Mon Sep 17 00:00:00 2001 From: Max Schaefer Date: Fri, 2 Dec 2016 16:24:01 +0000 Subject: [PATCH 04/51] Improve model of Node.js events module. The module directly exports the `EventEmitter` class, so `typeof require("events") === 'function'`. This is modelled in the same way as for modules `assert` and `stream` using an auxiliary `internal` class. --- node/index.d.ts | 39 ++++++++++++++++++++++----------------- node/node-tests.ts | 5 +++++ 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/node/index.d.ts b/node/index.d.ts index ea81e61147..8a4ac93801 100644 --- a/node/index.d.ts +++ b/node/index.d.ts @@ -569,25 +569,30 @@ declare module "querystring" { } declare module "events" { - export class EventEmitter extends NodeJS.EventEmitter { - static EventEmitter: EventEmitter; - static listenerCount(emitter: EventEmitter, event: string | symbol): number; // deprecated - static defaultMaxListeners: number; + class internal extends NodeJS.EventEmitter { } - addListener(event: string | symbol, listener: Function): this; - on(event: string | symbol, listener: Function): this; - once(event: string | symbol, listener: Function): this; - prependListener(event: string | symbol, listener: Function): this; - prependOnceListener(event: string | symbol, listener: Function): this; - removeListener(event: string | symbol, listener: Function): this; - removeAllListeners(event?: string | symbol): this; - setMaxListeners(n: number): this; - getMaxListeners(): number; - listeners(event: string | symbol): Function[]; - emit(event: string | symbol, ...args: any[]): boolean; - eventNames(): (string | symbol)[]; - listenerCount(type: string | symbol): number; + namespace internal { + export class EventEmitter extends internal { + static listenerCount(emitter: EventEmitter, event: string | symbol): number; // deprecated + static defaultMaxListeners: number; + + addListener(event: string | symbol, listener: Function): this; + on(event: string | symbol, listener: Function): this; + once(event: string | symbol, listener: Function): this; + prependListener(event: string | symbol, listener: Function): this; + prependOnceListener(event: string | symbol, listener: Function): this; + removeListener(event: string | symbol, listener: Function): this; + removeAllListeners(event?: string | symbol): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string | symbol): Function[]; + emit(event: string | symbol, ...args: any[]): boolean; + eventNames(): (string | symbol)[]; + listenerCount(type: string | symbol): number; + } } + + export = internal; } declare module "http" { diff --git a/node/node-tests.ts b/node/node-tests.ts index 9873b19e72..55da84d43d 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -1,6 +1,7 @@ import * as assert from "assert"; import * as fs from "fs"; import * as events from "events"; +import events2 = require("events"); import * as zlib from "zlib"; import * as url from "url"; import * as util from "util"; @@ -142,6 +143,10 @@ namespace events_tests { } } } + + { + new events2(); + } } //////////////////////////////////////////////////// From e8fb543de749f8742c4f3d2bfe494a150b6d15c9 Mon Sep 17 00:00:00 2001 From: Johannes Schickling Date: Sat, 3 Dec 2016 21:15:37 +0100 Subject: [PATCH 05/51] Added playsInline property as introduced in React 15.3.2 --- react/react.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/react/react.d.ts b/react/react.d.ts index 1cf06af218..280ce26859 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -2005,6 +2005,7 @@ declare namespace __React { optimum?: number; pattern?: string; placeholder?: string; + playsInline?: boolean; poster?: string; preload?: string; radioGroup?: string; From bddf14ed27fb8bb3940b54dcf0c57e029206f6a8 Mon Sep 17 00:00:00 2001 From: Karol Janyst Date: Tue, 6 Dec 2016 04:22:48 +0900 Subject: [PATCH 06/51] Add definitions for redux-localstorage and main enhancers (#12580) * Add definitions for redux-localstorage * Add definitions for redux-localstorage-filter enhancer * Add definitions for redux-localstorage-debounce enhancer --- .../redux-localstorage-debounce-tests.ts | 29 ++++++++ .../redux-localstorage-debounce.d.ts | 23 +++++++ .../redux-localstorage-filter-tests.ts | 24 +++++++ .../redux-localstorage-filter.d.ts | 27 ++++++++ .../redux-localstorage-tests.ts | 40 +++++++++++ redux-localstorage/redux-localstorage.d.ts | 67 +++++++++++++++++++ 6 files changed, 210 insertions(+) create mode 100644 redux-localstorage-debounce/redux-localstorage-debounce-tests.ts create mode 100644 redux-localstorage-debounce/redux-localstorage-debounce.d.ts create mode 100644 redux-localstorage-filter/redux-localstorage-filter-tests.ts create mode 100644 redux-localstorage-filter/redux-localstorage-filter.d.ts create mode 100644 redux-localstorage/redux-localstorage-tests.ts create mode 100644 redux-localstorage/redux-localstorage.d.ts diff --git a/redux-localstorage-debounce/redux-localstorage-debounce-tests.ts b/redux-localstorage-debounce/redux-localstorage-debounce-tests.ts new file mode 100644 index 0000000000..2d060cb768 --- /dev/null +++ b/redux-localstorage-debounce/redux-localstorage-debounce-tests.ts @@ -0,0 +1,29 @@ +// Redux Localstorage Filter Test +// ================================================================================ +/// +/// +/// + +// Imports +// -------------------------------------------------------------------------------- +import { compose } from "redux" +import { + default as persistState +} from "redux-localstorage" +import * as adapter from "redux-localstorage/lib/adapters/localStorage" +import { default as debounce } from "redux-localstorage-debounce" + +const storageWait = compose( + debounce(100) +)(adapter(window.localStorage)) +const enhancerWait = persistState(storageWait, "test") + +const storageMax = compose( + debounce(100, 200) +)(adapter(window.localStorage)) +const enhancerMax = persistState(storageMax, "test") + +const storageOpts = compose( + debounce(100, { maxWait : 200, foo : "bar" }) +)(adapter(window.localStorage)) +const enhancerOpts = persistState(storageOpts, "test") diff --git a/redux-localstorage-debounce/redux-localstorage-debounce.d.ts b/redux-localstorage-debounce/redux-localstorage-debounce.d.ts new file mode 100644 index 0000000000..ff3483c4e1 --- /dev/null +++ b/redux-localstorage-debounce/redux-localstorage-debounce.d.ts @@ -0,0 +1,23 @@ +// Type definitions for redux-localstorage-debounce v0.1.0 +// Project: https://github.com/elgerlambert/redux-localstorage-debounce +// Definitions by: Karol Janyst +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare namespace ReduxLocalStorage { + + namespace Debounce { + interface DebounceOptions { + maxWait?: number + [key: string]: any + } + function debounce (wait: number, options?: number | DebounceOptions): (adapter: StorageAdapter) => StorageAdapter + } + +} + +declare module "redux-localstorage-debounce" { + export default ReduxLocalStorage.Debounce.debounce +} diff --git a/redux-localstorage-filter/redux-localstorage-filter-tests.ts b/redux-localstorage-filter/redux-localstorage-filter-tests.ts new file mode 100644 index 0000000000..83172ef0c1 --- /dev/null +++ b/redux-localstorage-filter/redux-localstorage-filter-tests.ts @@ -0,0 +1,24 @@ +// Redux Localstorage Filter Test +// ================================================================================ +/// +/// +/// + +// Imports +// -------------------------------------------------------------------------------- +import { compose } from "redux" +import { + default as persistState +} from "redux-localstorage" +import * as adapter from "redux-localstorage/lib/adapters/localStorage" +import { default as filter } from "redux-localstorage-filter" + +const storageSingle = compose( + filter("foo") +)(adapter(window.localStorage)) +const enhancerSingle = persistState(storageSingle, "test") + +const storageMulti = compose( + filter(["foo", "bar"]) +)(adapter(window.localStorage)) +const enhancerMulti = persistState(storageMulti, "test") diff --git a/redux-localstorage-filter/redux-localstorage-filter.d.ts b/redux-localstorage-filter/redux-localstorage-filter.d.ts new file mode 100644 index 0000000000..3bc1a51a93 --- /dev/null +++ b/redux-localstorage-filter/redux-localstorage-filter.d.ts @@ -0,0 +1,27 @@ +// Type definitions for redux-localstorage-filter v0.1.1 +// Project: https://github.com/elgerlambert/redux-localstorage-filter +// Definitions by: Karol Janyst +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare namespace ReduxLocalStorage { + + namespace Filter { + function getSubset (obj: any, paths: Array): any + function filter (paths?: string | Array): (adapter: StorageAdapter) => StorageAdapter + } + +} + +declare module "redux-localstorage-filter" { + import getSubset = ReduxLocalStorage.Filter.getSubset + + export { + getSubset + } + + export default ReduxLocalStorage.Filter.filter + +} diff --git a/redux-localstorage/redux-localstorage-tests.ts b/redux-localstorage/redux-localstorage-tests.ts new file mode 100644 index 0000000000..f1a4393f7b --- /dev/null +++ b/redux-localstorage/redux-localstorage-tests.ts @@ -0,0 +1,40 @@ +// Redux Localstorage Test +// ================================================================================ +/// +/// + +// Imports +// -------------------------------------------------------------------------------- +import { compose, combineReducers, createStore } from "redux" +import { + default as persistState, + mergePersistedState, + actionTypes +} from "redux-localstorage" +import * as adapterAsyncStorage from "redux-localstorage/lib/adapters/AsyncStorage" +import * as adapterLocalStorage from "redux-localstorage/lib/adapters/localStorage" +import * as adapterSessionStorage from "redux-localstorage/lib/adapters/sessionStorage" + +const AsyncStorage: any = {} + +const rootReducer: Redux.Reducer = (state: any, action: any) => state + +const reducer = compose( + mergePersistedState() +)(rootReducer) + +const storageAsyncStorage = adapterAsyncStorage(AsyncStorage) +const storageLocalStorage = adapterLocalStorage(window.localStorage) +const storageSessionStorage = adapterSessionStorage(window.sessionStorage) + +const createStoreAsyncStorage = compose( + persistState(storageAsyncStorage, "foo") +)(createStore)(reducer) + +const createStoreLocalStorage = compose( + persistState(storageLocalStorage, "foo") +)(createStore)(reducer) + +const createStoreSessionStorage = compose( + persistState(storageSessionStorage, "foo") +)(createStore)(reducer) diff --git a/redux-localstorage/redux-localstorage.d.ts b/redux-localstorage/redux-localstorage.d.ts new file mode 100644 index 0000000000..aeeb940aab --- /dev/null +++ b/redux-localstorage/redux-localstorage.d.ts @@ -0,0 +1,67 @@ +// Type definitions for redux-localstorage v1.0.0-rc4 +// Project: https://github.com/elgerlambert/redux-localstorage +// Definitions by: Karol Janyst +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace ReduxLocalStorage { + + interface ActionTypes { + INIT: string + } + + interface AdapterCallback { + (err?: any, result?: A): void + } + + interface StorageAdapter { + 0: A + put(key: string, value: any, callback: AdapterCallback): void + get(key: string, callback: AdapterCallback): void + del(key: string, callback: AdapterCallback): void + } + + interface StorageAdapterCreator { + (storage: A): StorageAdapter + } + + interface StorageAdapterEnhancer {} + + function mergePersistedState (merge?: (initialState: A1, persistentState: A2) => A1 & A2): (next: Redux.Reducer) => Redux.Reducer + + function persistState (storage?: StorageAdapter, key?: string, callback?: Function): Redux.GenericStoreEnhancer + +} + +declare module "redux-localstorage/lib/adapters/AsyncStorage" { + const adapterCreator: ReduxLocalStorage.StorageAdapterCreator + export = adapterCreator +} + +declare module "redux-localstorage/lib/adapters/localStorage" { + const adapterCreator: ReduxLocalStorage.StorageAdapterCreator + export = adapterCreator +} + +declare module "redux-localstorage/lib/adapters/sessionStorage" { + const adapterCreator: ReduxLocalStorage.StorageAdapterCreator + export = adapterCreator +} + +declare module "redux-localstorage" { + import mergePersistedState = ReduxLocalStorage.mergePersistedState + + const actionTypes: ReduxLocalStorage.ActionTypes + + export type StorageAdapterEnhancer = ReduxLocalStorage.StorageAdapterEnhancer + + export { + mergePersistedState, + actionTypes + } + + export default ReduxLocalStorage.persistState +} + + From c6ad01fb488bc732528057bbd9db6755e1a1c8b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Crist=C3=B3v=C3=A3o?= Date: Tue, 6 Dec 2016 13:37:31 +0000 Subject: [PATCH 07/51] csurf.d.ts relying on CookieOptions from express It seems express no longer exports `CookieOptions`, we need to import `express-serve-static-core` instead. --- csurf/csurf.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csurf/csurf.d.ts b/csurf/csurf.d.ts index 3d213c76cd..7a2f9c055a 100644 --- a/csurf/csurf.d.ts +++ b/csurf/csurf.d.ts @@ -12,7 +12,7 @@ declare namespace Express { } declare module "csurf" { - import express = require('express'); + import express = require('express-serve-static-core'); function csurf(options?: { value?: (req: express.Request) => string; From 3680719dd5845f8580b1b429d13e8812f5f52e93 Mon Sep 17 00:00:00 2001 From: Thomas Hendriksen Date: Tue, 6 Dec 2016 21:56:46 +0100 Subject: [PATCH 08/51] Added height property to IDialogOptions --- ng-dialog/ng-dialog.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ng-dialog/ng-dialog.d.ts b/ng-dialog/ng-dialog.d.ts index 7b70874408..71757165de 100644 --- a/ng-dialog/ng-dialog.d.ts +++ b/ng-dialog/ng-dialog.d.ts @@ -227,6 +227,11 @@ declare namespace angular.dialog { * Specifies the width of the dialog content element. Default value is null (unspecified) */ width?: string|number; + + /** + * Specifies the height of the dialog content element. Default value is null (unspecified) + */ + height?: string|number; } /** From eb935a2994efb32f733a8533c6a6312da2dc569c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=20B=C3=A9rtolo?= Date: Wed, 7 Dec 2016 23:24:33 +0000 Subject: [PATCH 09/51] versionKey type --- mongoose/mongoose.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mongoose/mongoose.d.ts b/mongoose/mongoose.d.ts index 025d543163..7dd37fdc32 100644 --- a/mongoose/mongoose.d.ts +++ b/mongoose/mongoose.d.ts @@ -717,7 +717,7 @@ declare module "mongoose" { /** defaults to true */ validateBeforeSave?: boolean; /** defaults to "__v" */ - versionKey?: string; + versionKey?: string|boolean; /** * skipVersioning allows excluding paths from * versioning (the internal revision will not be From 9256d28b56a414ffd80f24c496089d2cd64f88ec Mon Sep 17 00:00:00 2001 From: Evan Martin Date: Wed, 7 Dec 2016 16:58:26 -0800 Subject: [PATCH 10/51] kendo-ui: mark toString() params as optional (#13164) These function parameters are optional according to the upstream docs, e.g. http://docs.telerik.com/kendo-ui/api/javascript/geometry/matrix#methods-toString --- kendo-ui/kendo-ui.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index bf8a2ec926..edfe747202 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -8505,7 +8505,7 @@ declare namespace kendo.geometry { round(digits: number): kendo.geometry.Matrix; multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; toArray(digits: number): any; - toString(digits: number, separator: string): string; + toString(digits?: number, separator?: string): string; } @@ -8551,7 +8551,7 @@ declare namespace kendo.geometry { setX(value: number): kendo.geometry.Point; setY(value: number): kendo.geometry.Point; toArray(digits: number): any; - toString(digits: number, separator: string): string; + toString(digits?: number, separator?: string): string; transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; translate(dx: number, dy: number): kendo.geometry.Point; @@ -19212,7 +19212,7 @@ declare namespace kendo.dataviz.geometry { round(digits: number): kendo.geometry.Matrix; multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; toArray(digits: number): any; - toString(digits: number, separator: string): string; + toString(digits?: number, separator?: string): string; } From 6ac7434b8b2a8429d4a2f94ef55478b62fc74f5d Mon Sep 17 00:00:00 2001 From: EamonHetherton Date: Thu, 8 Dec 2016 16:07:27 +1000 Subject: [PATCH 11/51] Ensure that zoneAbbr and zoneName are expected type (string). --- moment-timezone/moment-timezone-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moment-timezone/moment-timezone-tests.ts b/moment-timezone/moment-timezone-tests.ts index 410c45fe2e..5ce57818c1 100644 --- a/moment-timezone/moment-timezone-tests.ts +++ b/moment-timezone/moment-timezone-tests.ts @@ -80,7 +80,7 @@ moment.tz.setDefault('America/Los_Angeles'); moment.tz.guess(); -moment.tz('America/Los_Angeles').zoneAbbr(); +var zoneAbbr: string = moment.tz('America/Los_Angeles').zoneAbbr(); -moment.tz('America/Los_Angeles').zoneName(); +var zoneName: string = moment.tz('America/Los_Angeles').zoneName(); From b1b9addfb04b62133d5cfde4edc16595988e780a Mon Sep 17 00:00:00 2001 From: EamonHetherton Date: Thu, 8 Dec 2016 16:08:22 +1000 Subject: [PATCH 12/51] Update moment-timezone.d.ts --- moment-timezone/moment-timezone.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moment-timezone/moment-timezone.d.ts b/moment-timezone/moment-timezone.d.ts index c1d7e2d23f..870f0d6309 100644 --- a/moment-timezone/moment-timezone.d.ts +++ b/moment-timezone/moment-timezone.d.ts @@ -9,8 +9,8 @@ declare namespace moment { interface Moment { tz(): string; tz(timezone: string): Moment; - zoneAbbr() :Moment; - zoneName() :Moment; + zoneAbbr(): string; + zoneName(): string; } interface MomentStatic { From 8621c476047cd21552da5f5570767dd7750235a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Kov=C3=A1cs?= Date: Thu, 8 Dec 2016 14:04:38 +0100 Subject: [PATCH 13/51] Fix syntax error in interact.d.ts A parameter name was missing making TypeScript compiler fail. --- interactjs/interact.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interactjs/interact.d.ts b/interactjs/interact.d.ts index 2a547450d5..c9d15a2a5f 100644 --- a/interactjs/interact.d.ts +++ b/interactjs/interact.d.ts @@ -200,7 +200,7 @@ declare namespace Interact { (element: HTMLElement): Interactable; (element: SVGElement): Interactable; (element: string): Interactable; - (element: string, {context: Element}): Interactable; + (element: string, options: {context: Element}): Interactable; // returns boolean or {[key: string]: any} autoScroll(): any; autoScroll(options: boolean): InteractStatic; From 18765bde850489fc73906cbaf81969b309e9c67f Mon Sep 17 00:00:00 2001 From: Farokhcpu Date: Wed, 17 Aug 2016 10:31:49 +0200 Subject: [PATCH 14/51] adding type for move to fs-extra --- fs-extra/fs-extra-tests.ts | 26 ++++++++++++++++++++++++++ fs-extra/fs-extra.d.ts | 4 ++++ 2 files changed, 30 insertions(+) diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts index a31df8cfd7..d03faf4c3c 100644 --- a/fs-extra/fs-extra-tests.ts +++ b/fs-extra/fs-extra-tests.ts @@ -52,20 +52,46 @@ fs.copySync(src, dest, filter: /.*/ } ); + fs.createFile(file, errorCallback); fs.createFileSync(file); fs.mkdirs(dir, errorCallback); fs.mkdirs(dir, {}, errorCallback); + fs.mkdirsSync(dir); fs.mkdirsSync(dir, {}); + fs.mkdirp(dir, errorCallback); fs.mkdirp(dir, {}, errorCallback); + fs.mkdirpSync(dir); fs.mkdirpSync(dir, {}); +fs.move(src, dest, errorCallback); +fs.move(src, dest, (src: string) => { + return false; +}, errorCallback); +fs.move(src, dest, + { + clobber: true, + preserveTimestamps: true, + filter: (src: string) => {return false} + }, + errorCallback +); +fs.move(src, dest, + { + clobber: true, + preserveTimestamps: true, + filter: /.*/ + }, + errorCallback +); + fs.outputFile(file, data, errorCallback); fs.outputFileSync(file, data); + fs.outputJson(file, data, errorCallback); fs.outputJSON(file, data, errorCallback); diff --git a/fs-extra/fs-extra.d.ts b/fs-extra/fs-extra.d.ts index d052752ba9..976595a84f 100644 --- a/fs-extra/fs-extra.d.ts +++ b/fs-extra/fs-extra.d.ts @@ -31,6 +31,10 @@ declare module "fs-extra" { export function mkdirsSync(dir: string, options?: MkdirOptions): void; export function mkdirpSync(dir: string, options?: MkdirOptions): void; + export function move(src: string, dest: string, callback?: (err: Error) => void): void; + export function move(src: string, dest: string, filter: CopyFilter, callback?: (err: Error) => void): void; + export function move(src: string, dest: string, options: CopyOptions, callback?: (err: Error) => void): void; + export function outputFile(file: string, data: any, callback?: (err: Error) => void): void; export function outputFileSync(file: string, data: any): void; From 8770eab1aac67f4513d2a7f5e0f2b93a7625c4e4 Mon Sep 17 00:00:00 2001 From: Farokhcpu Date: Thu, 8 Dec 2016 17:14:05 +0100 Subject: [PATCH 15/51] fixing signature of sinon/alwaysReturned based on the http://sinonjs.org/docs/#sinonspy --- sinon/sinon.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sinon/sinon.d.ts b/sinon/sinon.d.ts index 69647534de..ba7256ab79 100644 --- a/sinon/sinon.d.ts +++ b/sinon/sinon.d.ts @@ -76,7 +76,7 @@ declare namespace Sinon { alwaysThrew(): boolean; alwaysThrew(type: string): boolean; alwaysThrew(obj: any): boolean; - alwaysReturned(): boolean; + alwaysReturned(obj: any): boolean; invokeCallback(...args: any[]): void; getCall(n: number): SinonSpyCall; reset(): void; From 45efcf3e4d1fba82bcf66ff694c76509bee47c12 Mon Sep 17 00:00:00 2001 From: Farokhcpu Date: Thu, 8 Dec 2016 17:28:34 +0100 Subject: [PATCH 16/51] increasing version number --- sinon/sinon.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sinon/sinon.d.ts b/sinon/sinon.d.ts index ba7256ab79..53590481e7 100644 --- a/sinon/sinon.d.ts +++ b/sinon/sinon.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Sinon 1.16.0 +// Type definitions for Sinon 1.16.1 // Project: http://sinonjs.org/ // Definitions by: William Sears // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 3ee09113bc22bf31f6c5d05510e73724caf1a389 Mon Sep 17 00:00:00 2001 From: Farokhcpu Date: Thu, 8 Dec 2016 17:29:56 +0100 Subject: [PATCH 17/51] returning back the version number to the origin number --- sinon/sinon.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sinon/sinon.d.ts b/sinon/sinon.d.ts index 53590481e7..ba7256ab79 100644 --- a/sinon/sinon.d.ts +++ b/sinon/sinon.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Sinon 1.16.1 +// Type definitions for Sinon 1.16.0 // Project: http://sinonjs.org/ // Definitions by: William Sears // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From d2a5bf5b5a3cff20f76ead860b12be4dec6d9f62 Mon Sep 17 00:00:00 2001 From: Farokhcpu Date: Thu, 8 Dec 2016 17:46:08 +0100 Subject: [PATCH 18/51] reversing changes in fs-extra --- fs-extra/fs-extra-tests.ts | 26 -------------------------- fs-extra/fs-extra.d.ts | 4 ---- 2 files changed, 30 deletions(-) diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts index d03faf4c3c..a31df8cfd7 100644 --- a/fs-extra/fs-extra-tests.ts +++ b/fs-extra/fs-extra-tests.ts @@ -52,46 +52,20 @@ fs.copySync(src, dest, filter: /.*/ } ); - fs.createFile(file, errorCallback); fs.createFileSync(file); fs.mkdirs(dir, errorCallback); fs.mkdirs(dir, {}, errorCallback); - fs.mkdirsSync(dir); fs.mkdirsSync(dir, {}); - fs.mkdirp(dir, errorCallback); fs.mkdirp(dir, {}, errorCallback); - fs.mkdirpSync(dir); fs.mkdirpSync(dir, {}); -fs.move(src, dest, errorCallback); -fs.move(src, dest, (src: string) => { - return false; -}, errorCallback); -fs.move(src, dest, - { - clobber: true, - preserveTimestamps: true, - filter: (src: string) => {return false} - }, - errorCallback -); -fs.move(src, dest, - { - clobber: true, - preserveTimestamps: true, - filter: /.*/ - }, - errorCallback -); - fs.outputFile(file, data, errorCallback); fs.outputFileSync(file, data); - fs.outputJson(file, data, errorCallback); fs.outputJSON(file, data, errorCallback); diff --git a/fs-extra/fs-extra.d.ts b/fs-extra/fs-extra.d.ts index 976595a84f..d052752ba9 100644 --- a/fs-extra/fs-extra.d.ts +++ b/fs-extra/fs-extra.d.ts @@ -31,10 +31,6 @@ declare module "fs-extra" { export function mkdirsSync(dir: string, options?: MkdirOptions): void; export function mkdirpSync(dir: string, options?: MkdirOptions): void; - export function move(src: string, dest: string, callback?: (err: Error) => void): void; - export function move(src: string, dest: string, filter: CopyFilter, callback?: (err: Error) => void): void; - export function move(src: string, dest: string, options: CopyOptions, callback?: (err: Error) => void): void; - export function outputFile(file: string, data: any, callback?: (err: Error) => void): void; export function outputFileSync(file: string, data: any): void; From 30242acb3487b2ac2ed6a57625814a1fe2045104 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Thu, 8 Dec 2016 09:45:36 -0800 Subject: [PATCH 19/51] Request that PRs have meaningful titles --- PULL_REQUEST_TEMPLATE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 95d0041063..78acfdb5c9 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,7 @@ Please fill in this template. - [ ] Prefer to make your PR against the `types-2.0` branch. +- [ ] Use a meaningful title for the pull request. Include the name of the package modified. - [ ] Test the change in your own code. - [ ] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped#make-a-pull-request). - [ ] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped#common-mistakes). From 1eef4bb6671d17570361a55c3132c8ad31de1142 Mon Sep 17 00:00:00 2001 From: Guust Nieuwenhuis Date: Thu, 8 Dec 2016 21:03:04 +0100 Subject: [PATCH 20/51] Improvement to existing nouislider type definition. (#12033) * updated nouislider version and added a lot of tests out of the documentation * corrected intentation * corrected untyped variables, issue raised by Travis * incorporated feedback on pull request --- nouislider/nouislider-8.0.2.d.ts | 180 +++++++++++ nouislider/nouislider-tests-8.0.2.ts | 88 +++++ nouislider/nouislider-tests.ts | 466 +++++++++++++++++++++++++-- nouislider/nouislider.d.ts | 55 ++-- 4 files changed, 747 insertions(+), 42 deletions(-) create mode 100644 nouislider/nouislider-8.0.2.d.ts create mode 100644 nouislider/nouislider-tests-8.0.2.ts diff --git a/nouislider/nouislider-8.0.2.d.ts b/nouislider/nouislider-8.0.2.d.ts new file mode 100644 index 0000000000..b3bd58c727 --- /dev/null +++ b/nouislider/nouislider-8.0.2.d.ts @@ -0,0 +1,180 @@ +// Type definitions for nouislider v8.0.2 +// Project: https://github.com/leongersen/noUiSlider +// Definitions by: Patrick Davies +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +declare namespace noUiSlider { + /** + * To create a slider, call noUiSlider.create() with an element and your options. + */ + function create(target: HTMLElement, options: Options): void; + + interface Options { + /** + * The start option sets the number of handles and their start positions, relative to range. + */ + start: number | number[] | number[][]; + /** + * The connect setting can be used to control the bar between the handles, + * or the edges of the slider. Use "lower" to connect to the lower side, + * or "upper" to connect to the upper side. Setting true sets the bar between the handles. + */ + range: Object; + /** + * noUiSlider offers several ways to handle user interaction. + * The range can be set to drag, and handles can move to taps. + * All these effects are optional, and can be enable by adding their keyword to the behaviour option. + * This option accepts a "-" separated list of "drag", "tap", "fixed", "snap" or "none". + */ + connect?: string | boolean; + /** + * When using two handles, the minimum distance between the handles can be set using the margin option. + * The margin value is relative to the value set in 'range'. + * This option is only available on standard linear sliders. + */ + margin?: number; + /** + * The limit option is the oposite of the margin option, + * limiting the maximum distance between two handles. + * As with the margin option, the limit option can only be used on linear sliders. + */ + limit?: number; + /** + * By default, the slider slides fluently. + * In order to make the handles jump between intervals, you can use this option. + * The step option is relative to the values provided to range. + */ + step?: number; + /** + * The orientation setting can be used to set the slider to "vertical" or "horizontal". + * Set dimensions! Vertical sliders don't assume a default height, so you'll need to set one. + * You can use any unit you want, including % or px. + */ + orientation?: string; + /** + * By default the sliders are top-to-bottom and left-to-right, + * but you can change this using the direction option, + * which decides where the upper side of the slider is. + */ + direction?: string; + /** + * Set the animate option to false to prevent the slider from animating to a new value with when calling .val(). + */ + animate?: boolean; + /** + * All values on the slider are part of a range. The range has a minimum and maximum value. + */ + behaviour?: string; + /** + * To format the slider output, noUiSlider offers a format option. + * Simply specify to and from functions to encode and decode the values. + * See manual formatting to the right for usage information. + * By default, noUiSlider will format output with 2 decimals. + */ + format?: Object | ((...args:any[]) => any); + + /** + * Allows you to generate points along the slider. + */ + pips?: PipsOptions; + } + + interface PipsOptions { + /** + * The 'range' mode uses the slider range to determine where the pips should be. A pip is generated for every percentage specified. + * + * The 'steps', like 'range', uses the slider range. In steps mode, a pip is generated for every step. + * The 'filter' option can be used to filter the generated pips from the 'steps' options' + * The filter function must return 0 (no value), 1 (large value) or 2 (small value). + * + * In 'positions' mode, pips are generated at percentage-based positions on the slider. + * Optionally, the stepped option can be set to true to match the pips to the slider steps. + * + * The 'count' mode can be used to generate a fixed number of pips. As with positions mode, the stepped option can be used. + * + * The 'values' mode is similar to positions, but it accepts values instead of percentages. The stepped option can be used for this mode. + * + */ + mode: string; // "range" | "steps" | "positions" | "count" | "values" + /** + * Range Mode: percentage for range mode + * Step Mode: step number for steps + * Positions Mode: percentage-based positions on the slider + * Count Mode: positions between pips + */ + density?: number; + /** + * Step Mode: The filter option can be used to filter the generated pips. + * The filter function must return 0 (no value), 1 (large value) or 2 (small value). + */ + filter?: (...args: any[]) => PipFilterResult; + /** + * format for step mode + * see noUiSlider format + */ + format?: Object; + /** + * + * values for positions and values mode + * number pips for count mode + */ + values?: number | number[]; + /** + * stepped option for positions, values and count mode + */ + stepped?: boolean; + } + + const enum PipFilterResult { + NoValue, + LargeValue, + SmallValue, + } + + interface Callback { + /** + * Array for both one-handle and two-handle sliders. It contains the current slider values, + * with formatting applied. + */ + (values: any[], handle: number, unencoded: number): void + } + + + interface noUiSlider { + /** + * Bind event to the slider. + */ + on(eventName: string, callback: Callback): void; + /** + * Unbind event to the slider. + */ + off(eventName: string): void; + /** + * Destroy's the slider. + */ + destroy(): void; + + /** + * To get the current slider value. For one-handle sliders, calling .get() will return the value. + * For two-handle sliders, an array[value, value] will be returned. + */ + get(): number | number[]; + /** + * noUiSlider will keep your values within the slider range, which saves you a bunch of validation. + * If you have configured the slider to use one handle, you can change the current value by passing + * a number to the .set() method. If you have two handles, pass an array. One-handled sliders + * will also accept arrays. Within an array, you can set one position to null + * if you want to leave a handle unchanged. + */ + set(value: number | number[]): void; + } + + interface Instance extends HTMLElement { + noUiSlider: noUiSlider + } +} + +declare module "nouislider" { + export = noUiSlider; +} diff --git a/nouislider/nouislider-tests-8.0.2.ts b/nouislider/nouislider-tests-8.0.2.ts new file mode 100644 index 0000000000..2739e609ce --- /dev/null +++ b/nouislider/nouislider-tests-8.0.2.ts @@ -0,0 +1,88 @@ +/// + +var testHtmlElement = document.getElementById('test'); + +/** + * Basic + */ +noUiSlider.create(testHtmlElement, { + start: 80, + range: { + 'min': 0, + 'max': 10000 + } +}); + +/** + * All options + */ +noUiSlider.create(testHtmlElement, { + start: [ 20, 80 ], + step: 10, + margin: 20, + connect: true, + direction: 'rtl', + orientation: 'vertical', + + // Configure tapping, or make the selected range dragable. + behaviour: 'tap-drag', + + // Full number format support. + format: wNumb({ + mark: ',', + decimals: 1 + }), + + // Support for non-linear ranges by adding intervals. + range: { + 'min': 0, + 'max': 100 + } +}); + +/** + * Pips + */ +noUiSlider.create(testHtmlElement, { + start: 0, + range: { + min: 0, + max: 10 + }, + pips: { + mode: 'steps', + density: 3, + filter: function () { return 1 }, + format: wNumb({ + decimals: 2, + prefix: '$' + }), + } +}); + +/** + * Functions + * Need to cast the HTMLElement as noUiSlider.Instance. + */ +// Get value +(testHtmlElement).noUiSlider.get(); + +// Set one value +(testHtmlElement).noUiSlider.set(10); +(testHtmlElement).noUiSlider.set([150]); + +// Set the upper handle, +// don't change the lower one. +(testHtmlElement).noUiSlider.set([null, 14]); + +// Set both slider handles +(testHtmlElement).noUiSlider.set([13.2, 15.7]); + +// Events +var callback: noUiSlider.Callback = (values, handle, unencoded) => {}; +(testHtmlElement).noUiSlider.on('event', callback); + +(testHtmlElement).noUiSlider.off('event'); + +(testHtmlElement).noUiSlider.destroy(); + diff --git a/nouislider/nouislider-tests.ts b/nouislider/nouislider-tests.ts index 2739e609ce..4f7e71306d 100644 --- a/nouislider/nouislider-tests.ts +++ b/nouislider/nouislider-tests.ts @@ -6,42 +6,326 @@ var testHtmlElement = document.getElementById('test'); * Basic */ noUiSlider.create(testHtmlElement, { - start: 80, - range: { - 'min': 0, - 'max': 10000 - } + start: 80, + range: { + 'min': 0, + 'max': 10000 + } }); /** * All options */ noUiSlider.create(testHtmlElement, { - start: [ 20, 80 ], - step: 10, - margin: 20, - connect: true, - direction: 'rtl', - orientation: 'vertical', + start: [ 20, 80 ], + step: 10, + margin: 20, + connect: true, + direction: 'rtl', + orientation: 'vertical', - // Configure tapping, or make the selected range dragable. - behaviour: 'tap-drag', + // Configure tapping, or make the selected range dragable. + behaviour: 'tap-drag', - // Full number format support. - format: wNumb({ - mark: ',', - decimals: 1 - }), + // Full number format support. + format: wNumb({ + mark: ',', + decimals: 1 + }), - // Support for non-linear ranges by adding intervals. - range: { - 'min': 0, - 'max': 100 - } + // Support for non-linear ranges by adding intervals. + range: { + 'min': 0, + 'max': 100 + } }); /** - * Pips + * Start + */ +noUiSlider.create(testHtmlElement, { + start: [20, 80], + range: { + 'min': [ 0 ], + 'max': [ 100 ] + } +}); + +/** + * Handles + */ +noUiSlider.create(testHtmlElement, { + start: [ 4000, 8000 ], + range: { + 'min': [ 2000 ], + 'max': [ 10000 ] + } +}); + +/** + * More than two handles + */ +noUiSlider.create(testHtmlElement, { + start: [ 4000, 8000, 12000, 16000 ], + connect: [false, true, true, false, true], + range: { + 'min': [ 2000 ], + 'max': [ 20000 ] + } +}); + +/** + * Range + */ +noUiSlider.create(testHtmlElement, { + start: [ 4000 ], + range: { + 'min': [ 2000 ], + 'max': [ 10000 ] + } +}); + +/** + * Stepping and snapping to values + */ +noUiSlider.create(testHtmlElement, { + start: [ 4000 ], + step: 1000, + range: { + 'min': [ 2000 ], + 'max': [ 10000 ] + } +}); + +/** + * Non-linear sliders + */ +noUiSlider.create(testHtmlElement, { + start: [ 4000 ], + range: { + 'min': [ 2000 ], + '30%': [ 4000 ], + '70%': [ 8000 ], + 'max': [ 10000 ] + } +}); + +/** + * Stepping in non-linear sliders + */ +noUiSlider.create(testHtmlElement, { + start: [ 500, 4000 ], + range: { + 'min': [ 0 ], + '10%': [ 500, 500 ], + '50%': [ 4000, 1000 ], + 'max': [ 10000 ] + } +}); + +/** + * Snapping between steps + */ +noUiSlider.create(testHtmlElement, { + start: [ 0, 500 ], + snap: true, + connect: true, + range: { + 'min': 0, + '10%': 50, + '20%': 100, + '30%': 150, + '40%': 500, + '50%': 800, + 'max': 1000 + } +}); + +/** + * Connect + */ +noUiSlider.create(testHtmlElement, { + start: 40, + connect: [true, false], + range: { + 'min': 0, + 'max': 100 + } +}); +noUiSlider.create(testHtmlElement, { + start: [20, 40, 60], + connect: [true, false, true, true], + range: { + 'min': 0, + 'max': 80 + } +}); + +/** + * Margin + */ +noUiSlider.create(testHtmlElement, { + start: [ 20, 80 ], + margin: 30, + range: { + 'min': 0, + 'max': 100 + } +}); + +/** + * Limit + */ +noUiSlider.create(testHtmlElement, { + start: [ 10, 120 ], + limit: 40, + behaviour: 'drag', + connect: true, + range: { + 'min': 0, + 'max': 100 + } +}); + +/** + * Steps + */ +noUiSlider.create(testHtmlElement, { + start: [ 20, 80 ], + step: 10, + range: { + 'min': 0, + 'max': 100 + } +}); + +/** + * Orientation + */ +noUiSlider.create(testHtmlElement, { + start: 40, + orientation: 'vertical', + range: { + 'min': 0, + 'max': 100 + } +}); + +/** + * Direction + */ +noUiSlider.create(testHtmlElement, { + start: 20, + direction: 'rtl', + range: { + 'min': 0, + 'max': 100 + } +}); + +/** + * Tooltips + */ +noUiSlider.create(testHtmlElement, { + start: [20, 80, 120], + range: { + 'min': 0, + 'max': 200 + }, + tooltips: [ false, wNumb({ decimals: 1 }), true ] +}); + +/** + * Animate + */ +noUiSlider.create(testHtmlElement, { + animate: true, + animationDuration: 300, + start: 20, + range: { + min: 0, + max: 100 + } +}); +noUiSlider.create(testHtmlElement, { + animate: false, + start: 20, + range: { + min: 0, + max: 100 + } + }); + +/** + * Behaviour + */ +noUiSlider.create(testHtmlElement, { + start: [ 20, 40 ], + step: 10, + behaviour: 'drag', + connect: true, + range: { + 'min': 20, + 'max': 80 + } + }); +noUiSlider.create(testHtmlElement, { + start: 40, + behaviour: 'tap', + connect: [false, true], + range: { + 'min': 20, + 'max': 80 + } +}); +noUiSlider.create(testHtmlElement, { + start: [ 40, 60 ], + behaviour: 'drag', + connect: true, + range: { + 'min': 20, + 'max': 80 + } +}); +noUiSlider.create(testHtmlElement, { + start: [ 40, 60 ], + behaviour: 'drag-fixed', + connect: true, + range: { + 'min': 20, + 'max': 80 + } +}); +noUiSlider.create(testHtmlElement, { + start: 40, + behaviour: 'snap', + connect: [true, false], + range: { + 'min': 20, + 'max': 80 + } +}); +noUiSlider.create(testHtmlElement, { + start: 20, + behaviour: 'hover-snap', + direction: 'rtl', + range: { + 'min': 0, + 'max': 10 + } +}); +noUiSlider.create(testHtmlElement, { + start: [ 40, 60 ], + behaviour: 'drag-tap', + connect: true, + range: { + 'min': 20, + 'max': 80 + } +}); + +/** + * Pips: range */ noUiSlider.create(testHtmlElement, { start: 0, @@ -59,6 +343,137 @@ noUiSlider.create(testHtmlElement, { }), } }); +var range_all_sliders = { + 'min': [ 0 ], + '10%': [ 500, 500 ], + '50%': [ 4000, 1000 ], + 'max': [ 10000 ] +}; +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + pips: { + mode: 'range', + density: 3 + } +}) +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + direction: 'rtl', + pips: { + mode: 'range', + density: 3 + } +}); +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + orientation: 'vertical', + pips: { + mode: 'range', + density: 3 + } +}); +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + orientation: 'vertical', + direction: 'rtl', + pips: { + mode: 'range', + density: 3 + } +}); + +/** + * Pipes: Steps + */ +function filter500( value: any, type: any ){ + return value % 1000 ? 2 : 1; +} +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + pips: { + mode: 'steps', + density: 3, + filter: filter500, + format: wNumb({ + decimals: 2, + prefix: '$' + }) + } +}); + +/** + * Pipes: Positions + */ +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + pips: { + mode: 'positions', + values: [0,25,50,75,100], + density: 4 + } +}); +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + pips: { + mode: 'positions', + values: [0,25,50,75,100], + density: 4, + stepped: true + } +}); + +/** + * Pipes: Count + */ +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + pips: { + mode: 'count', + values: 6, + density: 4 + } +}); +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + pips: { + mode: 'count', + values: 6, + density: 4, + stepped: true + } +}); + +/** + * Pipes: Values + */ +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + pips: { + mode: 'values', + values: [50, 552, 2251, 3200, 5000, 7080, 9000], + density: 4 + } +}); +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + pips: { + mode: 'values', + values: [50, 552, 4651, 4952, 5000, 7080, 9000], + density: 4, + stepped: true + } +}); /** * Functions @@ -78,6 +493,9 @@ noUiSlider.create(testHtmlElement, { // Set both slider handles (testHtmlElement).noUiSlider.set([13.2, 15.7]); +// Set both slider handles +(testHtmlElement).noUiSlider.reset(); + // Events var callback: noUiSlider.Callback = (values, handle, unencoded) => {}; (testHtmlElement).noUiSlider.on('event', callback); diff --git a/nouislider/nouislider.d.ts b/nouislider/nouislider.d.ts index b3bd58c727..3ef467c666 100644 --- a/nouislider/nouislider.d.ts +++ b/nouislider/nouislider.d.ts @@ -1,6 +1,6 @@ -// Type definitions for nouislider v8.0.2 +// Type definitions for nouislider v9.0.0 // Project: https://github.com/leongersen/noUiSlider -// Definitions by: Patrick Davies +// Definitions by: Patrick Davies , Guust Nieuwenhuis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -16,23 +16,23 @@ declare namespace noUiSlider { */ start: number | number[] | number[][]; /** - * The connect setting can be used to control the bar between the handles, - * or the edges of the slider. Use "lower" to connect to the lower side, - * or "upper" to connect to the upper side. Setting true sets the bar between the handles. - */ + * The connect setting can be used to control the bar between the handles, + * or the edges of the slider. Use "lower" to connect to the lower side, + * or "upper" to connect to the upper side. Setting true sets the bar between the handles. + */ range: Object; /** - * noUiSlider offers several ways to handle user interaction. - * The range can be set to drag, and handles can move to taps. - * All these effects are optional, and can be enable by adding their keyword to the behaviour option. - * This option accepts a "-" separated list of "drag", "tap", "fixed", "snap" or "none". + * The connect setting can be used to control the (green) bar between the handles, or the edges of the slider. + * Pass an array with a boolean for every connecting element, including the edges of the slider. + * The length of this array must match the handle count + 1. + * Setting true sets the bars between the handles, but not between the handles and the sliders edges. */ - connect?: string | boolean; + connect?: boolean | boolean[]; /** - * When using two handles, the minimum distance between the handles can be set using the margin option. - * The margin value is relative to the value set in 'range'. - * This option is only available on standard linear sliders. - */ + * When using two handles, the minimum distance between the handles can be set using the margin option. + * The margin value is relative to the value set in 'range'. + * This option is only available on standard linear sliders. + */ margin?: number; /** * The limit option is the oposite of the margin option, @@ -51,17 +51,32 @@ declare namespace noUiSlider { * Set dimensions! Vertical sliders don't assume a default height, so you'll need to set one. * You can use any unit you want, including % or px. */ - orientation?: string; + orientation?: string; // "vertical" | "horizontal" /** * By default the sliders are top-to-bottom and left-to-right, * but you can change this using the direction option, * which decides where the upper side of the slider is. */ - direction?: string; + direction?: string; // "ltr" | "rtl" + /** + * noUiSlider can provide a basic tooltip without using its events system. + * Set the tooltips option to true to enable. + * This option can also accept formatting options to format the tooltips content. + * In that case, pass an array with a formatter for each handle, true to use the default or false to display no tooltip. + */ + tooltips?: boolean | Object | ((...args:any[]) => any); /** * Set the animate option to false to prevent the slider from animating to a new value with when calling .val(). */ animate?: boolean; + /** + * The animationDuration option can be used to set the animation speed assumed by the slider library. In addition to this, you must manually set the CSS (-webkit-)transition property for the .noUi-state-tap .noUi-origin selector. + */ + animationDuration?: number; + /** + * When a non-linear slider has been configured, the snap option can be set to true to force the slider to jump between the specified values. + */ + snap?: boolean; /** * All values on the slider are part of a range. The range has a minimum and maximum value. */ @@ -113,7 +128,7 @@ declare namespace noUiSlider { * format for step mode * see noUiSlider format */ - format?: Object; + format?: Object | ((...args:any[]) => any); /** * * values for positions and values mode @@ -168,6 +183,10 @@ declare namespace noUiSlider { * if you want to leave a handle unchanged. */ set(value: number | number[]): void; + /* + * To return to the initial slider values, you can use the .reset() method. This will only reset the slider values. + */ + reset(): void; } interface Instance extends HTMLElement { From edf6a02befc02cde70511c0798b69b854fb51f37 Mon Sep 17 00:00:00 2001 From: j-dc Date: Thu, 8 Dec 2016 21:03:46 +0100 Subject: [PATCH 21/51] #13037 (#13039) * #13037 * pointToLayer first argument type fixed GeoJSON.Point to GeoJSON.Feature --- leaflet/leaflet.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index b67134a8b6..944eec7540 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -805,7 +805,7 @@ declare namespace L { * } * ``` */ - pointToLayer?: (geoJsonPoint: GeoJSON.Point, latlng: LatLng) => Layer; // should import GeoJSON typings + pointToLayer?: (geoJsonPoint: GeoJSON.Feature, latlng: LatLng) => Layer; // should import GeoJSON typings /** * A Function defining the Path options for styling GeoJSON lines and polygons, From 09a4a1fd33a82937653c656a5736bca402017c35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Crist=C3=B3v=C3=A3o?= Date: Thu, 8 Dec 2016 20:04:38 +0000 Subject: [PATCH 22/51] Missing cc in sendgrid packate (#13063) The sendgrid package was missing the `cc` field, and the `bcc` field had a too generic type (`any` instead of `string[]`, as used on the `setCcs` and `setBccs` below. --- sendgrid/sendgrid.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sendgrid/sendgrid.d.ts b/sendgrid/sendgrid.d.ts index b61db7162e..07bc99a933 100644 --- a/sendgrid/sendgrid.d.ts +++ b/sendgrid/sendgrid.d.ts @@ -49,7 +49,8 @@ declare namespace Sendgrid { subject?: string; text?: string; html?: string; - bcc?: any; + cc?: string[]; + bcc?: string[]; replyto?: string; date?: Date; headers?: { [key: string]: string }; @@ -65,7 +66,8 @@ declare namespace Sendgrid { subject: string; text: string; html: string; - bcc: any; + cc: string[]; + bcc: string[]; replyto: string; date: Date; headers: { [key: string]: string }; From 37247316a72462507a809f062f1659a2ee648b94 Mon Sep 17 00:00:00 2001 From: Samuel Campos Date: Thu, 8 Dec 2016 20:05:32 +0000 Subject: [PATCH 23/51] Fixes #12414 (#13076) * Fixes #12414 * Make applicationServerKey optional --- service_worker_api/service_worker_api.d.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/service_worker_api/service_worker_api.d.ts b/service_worker_api/service_worker_api.d.ts index 6084efc4a0..62d864ca18 100644 --- a/service_worker_api/service_worker_api.d.ts +++ b/service_worker_api/service_worker_api.d.ts @@ -579,6 +579,26 @@ interface PushSubscription { subscriptionId: any; } +/** + * Object containing optional subscribe parameters. + */ +interface PushSubscriptionOptions { + /** + * A boolean indicating that the returned push subscription will only be used for + * messages whose effect is made visible to the user. + * @readonly + */ + userVisibleOnly: boolean; + + /** + * A public key your push server will use to send messages to client apps via a push server. + * This value is part of a signing key pair generated by your application server and usable + * with elliptic curve digital signature (ECDSA) over the P-256 curve. + * @readonly + */ + applicationServerKey?: Uint8Array; +} + /** * The PushManager interface provides a way to receive notifications from * third-party servers as well as request URLs for push notifications. @@ -590,7 +610,7 @@ interface PushManager { * Returns a promise that resolves to a PushSubscription with details of a * new push subscription. */ - subscribe(): Promise; + subscribe(options?: PushSubscriptionOptions): Promise; /** * Returns a promise that resolves to a PushSubscription details of From fe6427be572f4b4f89841c96a85d880f584cc685 Mon Sep 17 00:00:00 2001 From: Ryan Southgate Date: Thu, 8 Dec 2016 20:21:47 +0000 Subject: [PATCH 24/51] added ariaLabelledBy and ariaDescribedBy to IModalSettings (#13004) --- .../angular-ui-bootstrap-tests.ts | 2 ++ angular-ui-bootstrap/angular-ui-bootstrap.d.ts | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts index d92c90bc60..0056c70b52 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts @@ -154,6 +154,8 @@ testApp.controller('TestCtrl', ( * test the $modal service */ var modalInstance = $modal.open({ + ariaLabelledBy: "label", + ariaDescribedBy: "description", animation: false, backdrop: 'static', backdropClass: 'modal-backdrop-test', diff --git a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts index d6c389146b..bffd665725 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts @@ -1,6 +1,6 @@ // Type definitions for Angular UI Bootstrap 0.13.3 // Project: https://github.com/angular-ui/bootstrap -// Definitions by: Brian Surowiec +// Definitions by: Brian Surowiec , Ryan Southgate // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -411,6 +411,22 @@ declare namespace angular.ui.bootstrap { * - `resolve` - An object of the modal resolve values. See [UI Router resolves] for details. */ component?: string; + + /** + * Sets the `aria-describedby` property on the modal. + * The string should be an id (without the leading '#') pointing to the element that describes your modal. + * @type {string} + * @memberOf IModalSettings + */ + ariaDescribedBy?: string; + + /** + * Sets the `aria-labelledby` property on the modal. + * The string should be an id (without the leading '#') pointing to the element that labels your modal. + * @type {string} + * @memberOf IModalSettings + */ + ariaLabelledBy?: string; } interface IModalStackService { From 2279e694403464394401c2a4282d8a209abf976d Mon Sep 17 00:00:00 2001 From: Christophe Eymard Date: Thu, 8 Dec 2016 21:24:01 +0100 Subject: [PATCH 25/51] Ceymard leaflet (#13007) * replaced all overrides of LatLng by a single use of LatLngExpression when appropriate * Changed Point, PointTuple overrides to use PointExpression instead * Changet use of LatLngBounds and Bounds in general to use the Expression variant instead of having several overrides --- leaflet/leaflet.d.ts | 272 +++++++++++-------------------------------- 1 file changed, 71 insertions(+), 201 deletions(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 944eec7540..0c6f66127f 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -43,25 +43,15 @@ declare namespace L { } export interface CRS { - latLngToPoint(latlng: LatLng, zoom: number): Point; - latLngToPoint(latlng: LatLngLiteral, zoom: number): Point; - latLngToPoint(latlng: LatLngTuple, zoom: number): Point; - pointToLatLng(point: Point): LatLng; - pointToLatLng(point: PointTuple): LatLng; - project(latlng: LatLng): Point; - project(latlng: LatLngLiteral): Point; - project(latlng: LatLngTuple): Point; - unproject(point: Point): LatLng; - unproject(point: PointTuple): LatLng; + latLngToPoint(latlng: LatLngExpression, zoom: number): Point; + pointToLatLng(point: PointExpression): LatLng; + project(latlng: LatLngExpression): Point; + unproject(point: PointExpression): LatLng; scale(zoom: number): number; zoom(scale: number): number; getProjectedBounds(zoom: number): Bounds; - distance(latlng1: LatLng, latlng2: LatLng): number; - distance(latlng1: LatLngLiteral, latlng2: LatLngLiteral): number; - distance(latlng1: LatLngTuple, latlng2: LatLngTuple): number; - wrapLatLng(latlng: LatLng): LatLng; - wrapLatLng(latlng: LatLngLiteral): LatLng; - wrapLatLng(latlng: LatLngTuple): LatLng; + distance(latlng1: LatLngExpression, latlng2: LatLngExpression): number; + wrapLatLng(latlng: LatLngExpression): LatLng; code: string; wrapLng: [number, number]; @@ -78,11 +68,8 @@ declare namespace L { } export interface Projection { - project(latlng: LatLng): Point; - project(latlng: LatLngLiteral): Point; - project(latlng: LatLngTuple): Point; - unproject(point: Point): LatLng; - unproject(point: PointTuple): LatLng; + project(latlng: LatLngExpression): Point; + unproject(point: PointExpression): LatLng; bounds: LatLngBounds; } @@ -94,13 +81,9 @@ declare namespace L { } export interface LatLng { - equals(otherLatLng: LatLng, maxMargin?: number): boolean; - equals(otherLatLng: LatLngLiteral, maxMargin?: number): boolean; - equals(otherLatLng: LatLngTuple, maxMargin?: number): boolean; + equals(otherLatLng: LatLngExpression, maxMargin?: number): boolean; toString(): string; - distanceTo(otherLatLng: LatLng): number; - distanceTo(otherLatLng: LatLngLiteral): number; - distanceTo(otherLatLng: LatLngTuple): number; + distanceTo(otherLatLng: LatLngExpression): number; wrap(): LatLng; toBounds(sizeInMeters: number): LatLngBounds; @@ -129,11 +112,8 @@ declare namespace L { export function latLng(coords: {lat: number, lng: number, alt: number}): LatLng; export interface LatLngBounds { - extend(latlng: LatLng): this; - extend(latlng: LatLngLiteral): this; - extend(latlng: LatLngTuple): this; - extend(otherBounds: LatLngBounds): this; - extend(otherBounds: LatLngBoundsLiteral): this; + extend(latlng: LatLngExpression): this; + extend(otherBounds: LatLngBoundsExpression): this; pad(bufferRatio: number): LatLngBounds; // does this modify the current instance or does it return a new one? getCenter(): LatLng; getSouthWest(): LatLng; @@ -144,18 +124,12 @@ declare namespace L { getSouth(): number; getEast(): number; getNorth(): number; - contains(otherBounds: LatLngBounds): boolean; - contains(otherBounds: LatLngBoundsLiteral): boolean; - contains(latlng: LatLng): boolean; - contains(latlng: LatLngLiteral): boolean; - contains(latlng: LatLngTuple): boolean; - intersects(otherBounds: LatLngBounds): boolean; - intersects(otherBounds: LatLngLiteral): boolean; - overlaps(otherBounds: Bounds): boolean; // investigate if this is really bounds and not latlngbounds - overlaps(otherBounds: BoundsLiteral): boolean; + contains(otherBounds: LatLngBoundsExpression): boolean; + contains(latlng: LatLngExpression): boolean; + intersects(otherBounds: LatLngBoundsExpression): boolean; + overlaps(otherBounds: BoundsExpression): boolean; // investigate if this is really bounds and not latlngbounds toBBoxString(): string; - equals(otherBounds: LatLngBounds): boolean; - equals(otherBounds: LatLngBoundsLiteral): boolean; + equals(otherBounds: LatLngBoundsExpression): boolean; isValid(): boolean; } @@ -163,11 +137,7 @@ declare namespace L { type LatLngBoundsExpression = LatLngBounds | LatLngBoundsLiteral; - export function latLngBounds(southWest: LatLng, northEast: LatLng): LatLngBounds; - - export function latLngBounds(southWest: LatLngLiteral, northEast: LatLngLiteral): LatLngBounds; - - export function latLngBounds(southWest: LatLngTuple, northEast: LatLngTuple): LatLngBounds; + export function latLngBounds(southWest: LatLngExpression, northEast: LatLngExpression): LatLngBounds; export function latLngBounds(latlngs: LatLngBoundsLiteral): LatLngBounds; @@ -175,25 +145,18 @@ declare namespace L { export interface Point { clone(): Point; - add(otherPoint: Point): Point; // investigate if this mutates or returns a new instance - add(otherPoint: PointTuple): Point; - subtract(otherPoint: Point): Point; - subtract(otherPoint: PointTuple): Point; + add(otherPoint: PointExpression): Point; // investigate if this mutates or returns a new instance + subtract(otherPoint: PointExpression): Point; divideBy(num: number): Point; multiplyBy(num: number): Point; - scaleBy(scale: Point): Point; - scaleBy(scale: PointTuple): Point; - unscaleBy(scale: Point): Point; - unscaleBy(scale: PointTuple): Point; + scaleBy(scale: PointExpression): Point; + unscaleBy(scale: PointExpression): Point; round(): Point; floor(): Point; ceil(): Point; - distanceTo(otherPoint: Point): Point; - distanceTo(otherPoint: PointTuple): Point; - equals(otherPoint: Point): boolean; - equals(otherPoint: PointTuple): boolean; - contains(otherPoint: Point): boolean; - contains(otherPoint: PointTuple): boolean; + distanceTo(otherPoint: PointExpression): Point; + equals(otherPoint: PointExpression): boolean; + contains(otherPoint: PointExpression): boolean; toString(): string; } @@ -208,20 +171,15 @@ declare namespace L { export type BoundsLiteral = Array; export interface Bounds { - extend(point: Point): this; - extend(point: PointTuple): this; + extend(point: PointExpression): this; getCenter(round?: boolean): Point; getBottomLeft(): Point; getTopRight(): Point; getSize(): Point; - contains(otherBounds: Bounds): boolean; - contains(otherBounds: BoundsLiteral): boolean; - contains(point: Point): boolean; - contains(point: PointTuple): boolean; - intersects(otherBounds: Bounds): boolean; - intersects(otherBounds: BoundsLiteral): boolean; - overlaps(otherBounds: Bounds): boolean; - overlaps(otherBounds: BoundsLiteral): boolean; + contains(otherBounds: BoundsExpression): boolean; + contains(point: PointExpression): boolean; + intersects(otherBounds: BoundsExpression): boolean; + overlaps(otherBounds: BoundsExpression): boolean; min: Point; max: Point; @@ -229,9 +187,7 @@ declare namespace L { type BoundsExpression = Bounds | BoundsLiteral; - export function bounds(topLeft: Point, bottomRight: Point): Bounds; - - export function bounds(topLeft: PointTuple, bottomRight: PointTuple): Bounds; + export function bounds(topLeft: PointExpression, bottomRight: PointExpression): Bounds; export function bounds(points: Array): Bounds; @@ -404,9 +360,7 @@ declare namespace L { bindPopup(content: Popup): this; unbindPopup(): this; openPopup(): this; - openPopup(latlng: LatLng): this; - openPopup(latlng: LatLngLiteral): this; - openPopup(latlng: LatLngTuple): this; + openPopup(latlng: LatLngExpression): this; closePopup(): this; togglePopup(): this; isPopupOpen(): boolean; @@ -422,9 +376,7 @@ declare namespace L { bindTooltip(content: Tooltip, options?: TooltipOptions): this; unbindTooltip(): this; openTooltip(): this; - openTooltip(latlng: LatLng): this; - openTooltip(latlng: LatLngLiteral): this; - openTooltip(latlng: LatLngTuple): this; + openTooltip(latlng: LatLngExpression): this; closeTooltip(): this; toggleTooltip(): this; isTooltipOpen(): boolean; @@ -564,60 +516,34 @@ declare namespace L { interface InternalPolyline extends Path { getLatLngs(): Array; - setLatLngs(latlngs: Array): this; - setLatLngs(latlngs: Array): this; - setLatLngs(latlngs: Array): this; + setLatLngs(latlngs: Array): this; isEmpty(): boolean; getCenter(): LatLng; getBounds(): LatLngBounds; - addLatLng(latlng: LatLng): this; - addLatLng(latlng: LatLngLiteral): this; - addLatLng(latlng: LatLngTuple): this; - addLatLng(latlng: Array): this; // these three overloads aren't explicitly noted in the docs - addLatLng(latlng: Array): this; - addLatLng(latlng: Array): this; + addLatLng(latlng: LatLngExpression): this; + addLatLng(latlng: Array): this; // these three overloads aren't explicitly noted in the docs } export interface Polyline extends InternalPolyline { toGeoJSON(): GeoJSON.LineString | GeoJSON.MultiLineString; } - export function polyline(latlngs: Array, options?: PolylineOptions): Polyline; - - export function polyline(latlngs: Array, options?: PolylineOptions): Polyline; - - export function polyline(latlngs: Array, options?: PolylineOptions): Polyline; - - export function polyline(latlngs: Array>, options?: PolylineOptions): Polyline; - - export function polyline(latlngs: Array>, options?: PolylineOptions): Polyline; - - export function polyline(latlngs: Array>, options?: PolylineOptions): Polyline; + export function polyline(latlngs: Array, options?: PolylineOptions): Polyline; + export function polyline(latlngs: Array>, options?: PolylineOptions): Polyline; export interface Polygon extends InternalPolyline { toGeoJSON(): GeoJSON.Polygon | GeoJSON.MultiPolygon; } - export function polygon(latlngs: Array, options?: PolylineOptions): Polygon; + export function polygon(latlngs: Array, options?: PolylineOptions): Polygon; - export function polygon(latlngs: Array, options?: PolylineOptions): Polygon; - - export function polygon(latlngs: Array, options?: PolylineOptions): Polygon; - - export function polygon(latlngs: Array>, options?: PolylineOptions): Polygon; - - export function polygon(latlngs: Array>, options?: PolylineOptions): Polygon; - - export function polygon(latlngs: Array>, options?: PolylineOptions): Polygon; + export function polygon(latlngs: Array>, options?: PolylineOptions): Polygon; export interface Rectangle extends Polygon { - setBounds(latLngBounds: LatLngBounds): this; - setBounds(latLngBounds: LatLngBoundsLiteral): this; + setBounds(latLngBounds: LatLngBoundsExpression): this; } - export function rectangle(latLngBounds: LatLngBounds, options?: PolylineOptions): Rectangle; - - export function rectangle(latLngBounds: LatLngBoundsLiteral, options?: PolylineOptions): Rectangle; + export function rectangle(latLngBounds: LatLngBoundsExpression, options?: PolylineOptions): Rectangle; export interface CircleMarkerOptions extends PathOptions { radius?: number; @@ -625,19 +551,13 @@ declare namespace L { export interface CircleMarker extends Path { toGeoJSON(): GeoJSON.Point; - setLatLng(latLng: LatLng): this; - setLatLng(latLng: LatLngLiteral): this; - setLatLng(latLng: LatLngTuple): this; + setLatLng(latLng: LatLngExpression): this; getLatLng(): LatLng; setRadius(radius: number): this; getRadius(): number; } - export function circleMarker(latlng: LatLng, options?: CircleMarkerOptions): CircleMarker; - - export function circleMarker(latlng: LatLngLiteral, options?: CircleMarkerOptions): CircleMarker; - - export function circleMarker(latlng: LatLngLiteral, options?: CircleMarkerOptions): CircleMarker; + export function circleMarker(latlng: LatLngExpression, options?: CircleMarkerOptions): CircleMarker; export interface CircleOptions extends PathOptions { radius?: number; @@ -649,17 +569,8 @@ declare namespace L { getBounds(): LatLngBounds; } - export function circle(latlng: LatLng, options?: CircleOptions): Circle; - - export function circle(latlng: LatLngLiteral, options?: CircleOptions): Circle; - - export function circle(latlng: LatLngTuple, options?: CircleOptions): Circle; - - export function circle(latlng: LatLng, radius: number, options?: CircleOptions): Circle; - - export function circle(latlng: LatLngLiteral, radius: number, options?: CircleOptions): Circle; - - export function circle(latlng: LatLngTuple, radius: number, options?: CircleOptions): Circle; + export function circle(latlng: LatLngExpression, options?: CircleOptions): Circle; + export function circle(latlng: LatLngExpression, radius: number, options?: CircleOptions): Circle; export interface RendererOptions extends LayerOptions { padding?: number; @@ -1274,55 +1185,34 @@ declare namespace L { hasLayer(layer: Layer): boolean; eachLayer(fn: (layer: Layer) => void, context?: Object): this; openPopup(popup: Popup): this; - openPopup(content: string, latlng: LatLng, options?: PopupOptions): this; - openPopup(content: string, latlng: LatLngLiteral, options?: PopupOptions): this; - openPopup(content: string, latlng: LatLngTuple, options?: PopupOptions): this; - openPopup(content: HTMLElement, latlng: LatLng, options?: PopupOptions): this; - openPopup(content: HTMLElement, latlng: LatLngLiteral, options?: PopupOptions): this; - openPopup(content: HTMLElement, latlng: LatLngTuple, options?: PopupOptions): this; + openPopup(content: string, latlng: LatLngExpression, options?: PopupOptions): this; + openPopup(content: HTMLElement, latlng: LatLngExpression, options?: PopupOptions): this; closePopup(popup?: Popup): this; openTooltip(tooltip: Tooltip): this; - openTooltip(content: string, latlng: LatLng, options?: TooltipOptions): this; - openTooltip(content: string, latlng: LatLngLiteral, options?: TooltipOptions): this; - openTooltip(content: string, latlng: LatLngTuple, options?: TooltipOptions): this; - openTooltip(content: HTMLElement, latlng: LatLng, options?: TooltipOptions): this; - openTooltip(content: HTMLElement, latlng: LatLngLiteral, options?: TooltipOptions): this; - openTooltip(content: HTMLElement, latlng: LatLngTuple, options?: TooltipOptions): this; + openTooltip(content: string, latlng: LatLngExpression, options?: TooltipOptions): this; + openTooltip(content: HTMLElement, latlng: LatLngExpression, options?: TooltipOptions): this; closeTooltip(tooltip?: Tooltip): this; // Methods for modifying map state - setView(center: LatLng, zoom: number, options?: ZoomPanOptions): this; - setView(center: LatLngLiteral, zoom: number, options?: ZoomPanOptions): this; - setView(center: LatLngTuple, zoom: number, options?: ZoomPanOptions): this; + setView(center: LatLngExpression, zoom: number, options?: ZoomPanOptions): this; setZoom(zoom: number, options: ZoomPanOptions): this; zoomIn(delta?: number, options?: ZoomOptions): this; zoomOut(delta?: number, options?: ZoomOptions): this; - setZoomAround(latlng: LatLng, zoom: number, options: ZoomOptions): this; - setZoomAround(latlng: LatLngLiteral, zoom: number, options: ZoomOptions): this; - setZoomAround(latlng: LatLngTuple, zoom: number, options: ZoomOptions): this; // will the latlng version using tuple take precedence or will the point tuple version? + setZoomAround(latlng: LatLngExpression, zoom: number, options: ZoomOptions): this; setZoomAround(offset: Point, zoom: number, options: ZoomOptions): this; - fitBounds(bounds: LatLngBounds, options: FitBoundsOptions): this; - fitBounds(bounds: LatLngBoundsLiteral, options: FitBoundsOptions): this; + fitBounds(bounds: LatLngBoundsExpression, options: FitBoundsOptions): this; fitWorld(options?: FitBoundsOptions): this; - panTo(latlng: LatLng, options?: PanOptions): this; - panTo(latlng: LatLngLiteral, options?: PanOptions): this; - panTo(latlng: LatLngTuple, options?: PanOptions): this; - panBy(offset: Point): this; - panBy(offset: PointTuple): this; - setMaxBounds(bounds: LatLngBounds): this; - setMaxBounds(bounds: LatLngBoundsLiteral): this; + panTo(latlng: LatLngExpression, options?: PanOptions): this; + panBy(offset: PointExpression): this; + setMaxBounds(bounds: LatLngBoundsExpression): this; setMinZoom(zoom: number): this; setMaxZoom(zoom: number): this; - panInsideBounds(bounds: LatLngBounds, options?: PanOptions): this; - panInsideBounds(bounds: LatLngBoundsLiteral, options?: PanOptions): this; + panInsideBounds(bounds: LatLngBoundsExpression, options?: PanOptions): this; invalidateSize(options: ZoomPanOptions): this; invalidateSize(animate: boolean): this; stop(): this; - flyTo(latlng: LatLng, zoom?: number, options?: ZoomPanOptions): this; - flyTo(latlng: LatLngLiteral, zoom?: number, options?: ZoomPanOptions): this; - flyTo(latlng: LatLngTuple, zoom?: number, options?: ZoomPanOptions): this; - flyToBounds(bounds: LatLngBounds, options?: FitBoundsOptions): this; - flyToBounds(bounds: LatLngBoundsLiteral, options?: FitBoundsOptions): this; + flyTo(latlng: LatLngExpression, zoom?: number, options?: ZoomPanOptions): this; + flyToBounds(bounds: LatLngBoundsExpression, options?: FitBoundsOptions): this; // Other methods addHandler(name: string, HandlerClass: () => Handler): this; // HandlerClass is actually a constructor function, is this the right way? @@ -1340,8 +1230,7 @@ declare namespace L { getBounds(): LatLngBounds; getMinZoom(): number; getMaxZoom(): number; - getBoundsZoom(bounds: LatLngBounds, inside?: boolean): number; - getBoundsZoom(bounds: LatLngBoundsLiteral, inside?: boolean): number; + getBoundsZoom(bounds: LatLngBoundsExpression, inside?: boolean): number; getSize(): Point; getPixelBounds(): Bounds; getPixelOrigin(): Point; @@ -1350,29 +1239,16 @@ declare namespace L { // Conversion methods getZoomScale(toZoom: number, fromZoom: number): number; getScaleZoom(scale: number, fromZoom: number): number; - project(latlng: LatLng, zoom: number): Point; - project(latlng: LatLngLiteral, zoom: number): Point; - project(latlng: LatLngTuple, zoom: number): Point; - unproject(point: Point, zoom: number): LatLng; - unproject(point: PointTuple, zoom: number): LatLng; - layerPointToLatLng(point: Point): LatLng; - layerPointToLatLng(point: PointTuple): LatLng; - latLngToLayerPoint(latlng: LatLng): Point; - latLngToLayerPoint(latlng: LatLngLiteral): Point; - latLngToLayerPoint(latlng: LatLngTuple): Point; - wrapLatLng(latlng: LatLng): LatLng; - wrapLatLng(latlng: LatLngLiteral): LatLng; - wrapLatLng(latlng: LatLngTuple): LatLng; - distance(latlng1: LatLng, latlng2: LatLng): number; - distance(latlng1: LatLngLiteral, latlng2: LatLngLiteral): number; - distance(latlng1: LatLngTuple, latlng2: LatLngTuple): number; - containerPointToLayerPoint(point: Point): Point; - containerPointToLayerPoint(point: PointTuple): Point; - layerPointToContainerPoint(point: Point): Point; + project(latlng: LatLngExpression, zoom: number): Point; + unproject(point: PointExpression, zoom: number): LatLng; + layerPointToLatLng(point: PointExpression): LatLng; + latLngToLayerPoint(latlng: LatLngExpression): Point; + wrapLatLng(latlng: LatLngExpression): LatLng; + distance(latlng1: LatLngExpression, latlng2: LatLngExpression): number; + containerPointToLayerPoint(point: PointExpression): Point; + layerPointToContainerPoint(point: PointExpression): Point; layerPointToContainerPoint(point: PointTuple): Point; - latLngToContainerPoint(latlng: LatLng): Point; - latLngToContainerPoint(latlng: LatLngLiteral): Point; - latLngToContainerPoint(latlng: LatLngTuple): Point; + latLngToContainerPoint(latlng: LatLngExpression): Point; mouseEventToContainerPoint(ev: MouseEvent): Point; mouseEventToLayerPoint(ev: MouseEvent): Point; mouseEventToLatLng(ev: MouseEvent): LatLng; @@ -1450,9 +1326,7 @@ declare namespace L { export interface Marker extends Layer { getLatLng(): LatLng; - setLatLng(latlng: LatLng): this; - setLatLng(latlng: LatLngLiteral): this; - setLatLng(latlng: LatLngTuple): this; + setLatLng(latlng: LatLngExpression): this; setZIndexOffset(offset: number): this; setIcon(icon: Icon): this; setOpacity(opacity: number): this; @@ -1461,11 +1335,7 @@ declare namespace L { dragging: Handler; } - export function marker(latlng: LatLng, options?: MarkerOptions): Marker; - - export function marker(latlng: LatLngLiteral, options?: MarkerOptions): Marker; - - export function marker(latlng: LatLngTuple, options?: MarkerOptions): Marker; + export function marker(latlng: LatLngExpression, options?: MarkerOptions): Marker; export namespace Browser { export const ie: boolean; From 563ebfe839967004c27e0ec31621db0fc3825c3f Mon Sep 17 00:00:00 2001 From: Finn Poppinga Date: Thu, 8 Dec 2016 21:27:52 +0100 Subject: [PATCH 26/51] add ElasticSeach 5.x API function for deleteByQuery (#13014) * add ElasticSeach 5.x API function for deleteByQuery * use searchParams for deleteByQuery, as theses resemble the documentation. * add DeleteByQueryParams parameter type. * add deleteByQuery to tests. --- elasticsearch/elasticsearch-tests.ts | 9 +++++- elasticsearch/elasticsearch.d.ts | 44 ++++++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/elasticsearch/elasticsearch-tests.ts b/elasticsearch/elasticsearch-tests.ts index 6d308dc6ed..6a065e63df 100644 --- a/elasticsearch/elasticsearch-tests.ts +++ b/elasticsearch/elasticsearch-tests.ts @@ -85,4 +85,11 @@ client.cluster.state({ client.cluster.stats({ ignore: 1 }, (err, response) => { -}); \ No newline at end of file +}); + +client.deleteByQuery({ + index : 'index', + type : 'type' +}, (err, response) => { + +}); diff --git a/elasticsearch/elasticsearch.d.ts b/elasticsearch/elasticsearch.d.ts index 26a9a1e880..9f8b4c3175 100644 --- a/elasticsearch/elasticsearch.d.ts +++ b/elasticsearch/elasticsearch.d.ts @@ -15,6 +15,8 @@ declare module Elasticsearch { create(params: CreateDocumentParams, callback: (err: any, response: any, status: any) => void): void; delete(params: DeleteDocumentParams): PromiseLike; delete(params: DeleteDocumentParams, callback: (error: any, response: any) => void): void; + deleteByQuery(params : DeleteByQueryParams, callback : (error: any, response: any) => void): void; + deleteByQuery(params : DeleteByQueryParams): PromiseLike; exists(params: ExistsParams): PromiseLike; exists(params: ExistsParams, callback: (error: any, response: any, status?: any) => void): void; get(params: GetParams, callback: (error: any, response: GetResponse) => void): void; @@ -224,7 +226,7 @@ declare module Elasticsearch { type: string; id: string; body: T; - consistensy?: string; + consistency?: string; parent?: string; replication?: string; routing?: string; @@ -260,6 +262,44 @@ declare module Elasticsearch { timeout?: Date | number; } + export interface DeleteByQueryParams extends GenericParams { + index?: string; + type?: string | string[] | number; + body?: any; + q?: string; + analyzer?: string; + analyzeWildcard?: boolean; + defaultOperator?: 'AND' | 'OR'; + df?: string; + from?: number; + ignoreUnavailable?: boolean; + allowNoIndices?: boolean; + conflicts?: 'abort' | 'proceed'; + expandWildcards?: 'open' | 'closed' | 'none' | 'all'; + lenient?: boolean; + lowercaseExpandedTerms?: boolean; + preference?: string; + routing?: string | string[] | boolean; + scroll?: string; + searchType?: 'query_then_fetch' | 'dfs_query_then_fetch'; + searchTimeout?: string; + size?: number; + sort?: string | string[] | boolean; + _source?: string | string[] | boolean; + _sourceExclude?: string | string[] | boolean; + _sourceInclude?: string | string[] | boolean; + terminateAfter?: number; + stats?: string | string[] | boolean; + version?: boolean; + requestCache?: boolean; + refresh?: boolean; + timeout?: string; + waitForActiveShards?: string; + scrollSize?: number; + waitForCompletion?: boolean; + requestsPerSecond?: number; + } + export interface SearchResponse { took: number, timed_out: boolean, @@ -286,7 +326,7 @@ declare module Elasticsearch { }[] }, aggregations?: any - } + } export interface MSearchParams extends GenericParams { index?: string | string[] | Boolean; From 998028ff0f8bab6a2fe945206a56189f020e6c49 Mon Sep 17 00:00:00 2001 From: Pranay Prakash Date: Thu, 8 Dec 2016 14:45:58 -0600 Subject: [PATCH 27/51] Make `less` render options optional (#13078) --- less/less.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/less/less.d.ts b/less/less.d.ts index f8389d3d9b..354a342bf9 100644 --- a/less/less.d.ts +++ b/less/less.d.ts @@ -1,6 +1,6 @@ // Type definitions for LESS // Project: http://lesscss.org/ -// Definitions by: Tom Hasner +// Definitions by: Tom Hasner , Pranay Prakash // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Less { @@ -40,11 +40,11 @@ declare namespace Less { } interface SourceMapOption { - sourceMapURL: string; - sourceMapBasepath: string; - sourceMapRootpath: string; - outputSourceFiles: boolean; - sourceMapFileInline: boolean; + sourceMapURL?: string; + sourceMapBasepath?: string; + sourceMapRootpath?: string; + outputSourceFiles?: boolean; + sourceMapFileInline?: boolean; } interface StaticOptions { @@ -55,7 +55,7 @@ declare namespace Less { interface Options { sourceMap?: SourceMapOption; filename?: string; - plugins: Plugin[]; + plugins?: Plugin[]; rootFileInfo?: RootFileInfo; } From c26f34e6d5b531bebcb3d66feb1ba6b128552a52 Mon Sep 17 00:00:00 2001 From: Thomas Hendriksen Date: Thu, 8 Dec 2016 21:46:01 +0100 Subject: [PATCH 28/51] Added semver --- ng-dialog/ng-dialog.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ng-dialog/ng-dialog.d.ts b/ng-dialog/ng-dialog.d.ts index 71757165de..2663d0f4fa 100644 --- a/ng-dialog/ng-dialog.d.ts +++ b/ng-dialog/ng-dialog.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ngDialog +// Type definitions for ngDialog v0.6.4 // Project: https://github.com/likeastore/ngDialog // Definitions by: Stephen Lautier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From ceb00618ba4e017c586869787ca786c9d15d1636 Mon Sep 17 00:00:00 2001 From: MariusAlch Date: Thu, 8 Dec 2016 22:47:43 +0200 Subject: [PATCH 29/51] Updated gravity definition. (#13088) --- matter-js/matter-js.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/matter-js/matter-js.d.ts b/matter-js/matter-js.d.ts index f21ad2ef7b..8ba5673284 100644 --- a/matter-js/matter-js.d.ts +++ b/matter-js/matter-js.d.ts @@ -2924,10 +2924,14 @@ declare namespace Matter { } interface IWorldDefinition extends ICompositeDefinition { - gravity?: Vector; + gravity?: Gravity; bounds?: Bounds; } + interface Gravity extends Vector { + scale: number; + } + /** * The `Matter.World` module contains methods for creating and manipulating the world composite. * A `Matter.World` is a `Matter.Composite` body, which is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`. @@ -2994,7 +2998,7 @@ declare namespace Matter { */ static create(options: IWorldDefinition): World; - gravity: Vector; + gravity: Gravity; bounds: Bounds; } From 4e2f977a05b2d13a317ad4b8d344898cb0b16a6c Mon Sep 17 00:00:00 2001 From: Julien CROUZET Date: Thu, 8 Dec 2016 21:51:08 +0100 Subject: [PATCH 30/51] Full Redis client options (#13108) --- redis/redis.d.ts | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/redis/redis.d.ts b/redis/redis.d.ts index f5cba7c11f..2edccbb102 100644 --- a/redis/redis.d.ts +++ b/redis/redis.d.ts @@ -46,22 +46,33 @@ declare module "redis" { } export interface ClientOpts { - parser?: string; - return_buffers?: boolean; - detect_buffers?: boolean; - socket_nodelay?: boolean; - socket_keepalive?: boolean; - no_ready_check?: boolean; - enable_offline_queue?: boolean; - retry_max_delay?: number; - connect_timeout?: number; - max_attempts?: number; auth_pass?: string; - password?: string; - family?: string; command_queue_high_water?: number; command_queue_low_water?: number; + connect_timeout?: number; + db?: string; + detect_buffers?: boolean; + disable_resubscribing?: boolean; + enable_offline_queue?: boolean; + family?: string; + host?: string; + max_attempts?: number; + no_ready_check?: boolean; + parser?: string; + password?: string; + path?: string; + port?: number; + prefix?: string; + rename_commands?: any; + retry_max_delay?: number; retry_strategy?: RetryStrategy; + retry_unfulfilled_commands?: boolean; + return_buffers?: boolean; + socket_keepalive?: boolean; + socket_nodelay?: boolean; + string_numbers?: boolean; + tls?: any; + url?: string; } export interface RedisClient extends NodeJS.EventEmitter { From 3b9218b067fdbfaf0e2a6c31cc1fab1d8bca1914 Mon Sep 17 00:00:00 2001 From: Santiago Date: Thu, 8 Dec 2016 15:51:43 -0500 Subject: [PATCH 31/51] Added missing return type to on() methods. (#13082) From 91e8f4126cb10812f6aee0067fa2884326bec83c Mon Sep 17 00:00:00 2001 From: cailenmusselman Date: Thu, 8 Dec 2016 14:53:14 -0600 Subject: [PATCH 32/51] Update react-native.0.29.d.ts (#13118) drawerPosition is of type `number` Android DrawerConsts.DrawerPosition.Left is equivalent to DrawerLayoutAndroid.positions.Left Android DrawerConsts.DrawerPosition.Right is equivalent to DrawerLayoutAndroid.positions.Right --- react-native/react-native.0.29.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-native/react-native.0.29.d.ts b/react-native/react-native.0.29.d.ts index 61960d141a..7ae6f47c72 100644 --- a/react-native/react-native.0.29.d.ts +++ b/react-native/react-native.0.29.d.ts @@ -1871,7 +1871,7 @@ declare namespace __React { * Specifies the side of the screen from which the drawer will slide in. * enum(DrawerConsts.DrawerPosition.Left, DrawerConsts.DrawerPosition.Right) */ - drawerPosition?: any; + drawerPosition?: number; /** * Specifies the width of the drawer, more precisely the width of the From 26aec5f23467356366d46f38418ef060ef312fed Mon Sep 17 00:00:00 2001 From: Guy Date: Thu, 8 Dec 2016 12:54:55 -0800 Subject: [PATCH 33/51] Upgrade to match braintree-web 3.6.1 (#13098) * Update to match braintree-web version 3.3.0 * Upgrade to match Braintree-web v3.5.0 * upgrade to match braintree-web 3.6.1 add US bank class --- braintree-web/braintree-web.d.ts | 213 +++++++++++++++++++++++++++++-- 1 file changed, 202 insertions(+), 11 deletions(-) diff --git a/braintree-web/braintree-web.d.ts b/braintree-web/braintree-web.d.ts index e58cf7455b..b3ae9cd3c3 100644 --- a/braintree-web/braintree-web.d.ts +++ b/braintree-web/braintree-web.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Braintree-web v3.5.0 +// Type definitions for Braintree-web v3.6.1 // Project: https://github.com/braintree/braintree-web // Definitions by: Guy Shahine // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -97,7 +97,7 @@ declare namespace BraintreeWeb { // billingContact // Billing contact information for the user. // countryCode -//Required.The merchant’s two- letter ISO 3166 country code. +//Required.The merchants two- letter ISO 3166 country code. // currencyCode // Required.The three- letter ISO 4217 currency code for the payment. // lineItems @@ -427,10 +427,10 @@ declare namespace BraintreeWeb { * Used by other modules to formulate all network requests to the Braintree gateway. It is also capable of being used directly from your own form to tokenize credit card information. However, be sure to satisfy PCI compliance if you use direct card tokenization. * @public * @param {object} options Request options: - * @param {string} options.method HTTP method. i.e. "get" or "post" - * @param {string} options.endpoint Enpoint path. i.e. "payment_methods" + * @param {string} options.method HTTP method, e.g. "get" or "post" + * @param {string} options.endpoint Endpoint path. e.g. "payment_methods" * @param {object} options.data Data to send with the request - * @param {string} [options.timeout=60000] Timeout limit + * @param {number} [options.timeout=60000] Set a timeout (in milliseconds) for the request. * @param {callback} callback The second argument, data, is the returned server data. * @example * Direct Credit Card Tokenization @@ -447,7 +447,11 @@ declare namespace BraintreeWeb { * expirationDate: form['cc-date'].value, * billingAddress: { * postalCode: form['cc-postal'].value + * }, + * options: { + * validate: false * } + * } * } * }; * @@ -459,6 +463,7 @@ declare namespace BraintreeWeb { * method: 'post', * data: data * }, function (requestErr, response) { + * // More detailed example of handling API errors: https://codepen.io/braintree/pen/MbwjdM * if (requestErr) { throw new Error(requestErr); } * * console.log('Got nonce:', response.creditCards[0].nonce); @@ -477,6 +482,7 @@ declare namespace BraintreeWeb { /** * @static * @function create + * @description Creates a DataCollector instance. Requires advanced fraud protection to be enabled in the Braintree gateway. Contact our [support team](mailto:support@braintreepayments.com) to configure your Kount ID. * @param {object} options Creation options: * @param {Client} options.client A {@link Client} instance. * @param {boolean} [options.kount] If true, Kount fraud data collection is enabled. @@ -498,7 +504,7 @@ declare namespace BraintreeWeb { * @global * @name DataCollector * @description Do not use this constructor directly. Use {@link module:braintree-web/data-collector.create|braintree-web.data-collector.create} instead. - * @classdesc This class is used for advanced fraud integration with PayPal and Kount. Instances of this class have {@link DataCollector#deviceData|deviceData} which is used to correlate user sessions with server transactions. + * @classdesc This class is used for advanced fraud integration with PayPal and Kount. Instances of this class have {@link DataCollector#deviceData|deviceData} which is used to correlate user sessions with server transactions. Before using DataCollector, make sure you have enabled advanced fraud protection in the Braintree gateway. To use your own Kount ID, contact our support team ([support@braintreepayments.com](mailto:support@braintreepayments.com) or [877.434.2894](tel:877.434.2894)). */ export class DataCollector { /** @@ -740,7 +746,33 @@ declare namespace BraintreeWeb { * * These are the CSS properties that Hosted Fields supports. Any other CSS should be specified on your page and outside of any Braintree configuration. Trying to set unsupported properties will fail and put a warning in the console. * - * `color` `font-family` `font-size-adjust` `font-size` `font-stretch` `font-style` `font-variant-alternates` `font-variant-caps` `font-variant-east-asian` `font-variant-ligatures` `font-variant-numeric` `font-variant` `font-weight` `font` `line-height` `opacity` `outline` `text-shadow` `transition` `-moz-osx-font-smoothing` `-moz-tap-highlight-color` `-moz-transition` `-webkit-font-smoothing` `-webkit-tap-highlight-color` `-webkit-transition` + * Supported CSS properties are: + * `color` + * `font-family` + * `font-size-adjust` + * `font-size` + * `font-stretch` + * `font-style` + * `font-variant-alternates` + * `font-variant-caps` + * `font-variant-east-asian` + * `font-variant-ligatures` + * `font-variant-numeric` + * `font-variant` + * `font-weight` + * `font` + * `letter-spacing` + * `line-height` + * `opacity` + * `outline` + * `text-shadow` + * `transition` + * `-moz-osx-font-smoothing` + * `-moz-tap-highlight-color` + * `-moz-transition` + * `-webkit-font-smoothing` + * `-webkit-tap-highlight-color` + * `-webkit-transition` * @typedef {object} styleOptions */ styleOptions: any; @@ -976,7 +1008,9 @@ declare namespace BraintreeWeb { * @property {string} details.shippingAddress.postalCode Postal code. * @property {string} details.shippingAddress.countryCode 2 character country code (e.g. US). * @property {?object} details.billingAddress User's billing address details. - * You will also need to enable the PayPal Billing Address Request feature in your PayPal account. + * Not available to all merchants; [contact PayPal](https://developers.braintreepayments.com/support/guides/paypal/setup-guide#contacting-paypal-support) for details on eligibility and enabling this feature. + * To enable this feature, [contact PayPal](https://developers.braintreepayments.com/support/guides/paypal/setup-guide#contacting-paypal-support). + * Alternatively, see `shippingAddress` above as an available client opt * To enable this feature, [contact PayPal](https://developers.braintreepayments.com/support/guides/paypal/setup-guide#contacting-paypal-support). * @property {string} details.billingAddress.line1 Street number and name. * @property {string} details.billingAddress.line2 Extended address. @@ -1029,7 +1063,7 @@ declare namespace BraintreeWeb { * @param {Client} options.client A {@link Client} instance. * @param {callback} callback The second argument, `data`, is the {@link PayPal} instance. * @example - * braintree.paypal.create( + * braintree.paypal.create({ * client: clientInstance * }, function (createErr, paypalInstance) { * if (createErr) { @@ -1039,7 +1073,7 @@ declare namespace BraintreeWeb { * console.error('Error!', createErr); * } * } - * } + * }); * @returns {void} */ create: (options: { client: Client }, callback: callback) => void; @@ -1083,7 +1117,33 @@ declare namespace BraintreeWeb { * @param {string|number} [options.amount] The amount of the transaction. Required when using the Checkout flow. * @param {string} [options.currency] The currency code of the amount, such as 'USD'. Required when using the Checkout flow. * @param {string} [options.displayName] The merchant name displayed inside of the PayPal lightbox; defaults to the company name on your Braintree account - * @param {string} [options.locale=en_US] Use this option to change the language, links, and terminology used in the PayPal flow to suit the country and language of your customer. + * @param {string} [options.locale=en_US] Use this option to change the language, links, and terminology used in the PayPal flow. This locale will be used unless the buyer has set a preferred locale for their account. If an unsupported locale is supplied, a fallback locale (determined by buyer preference or browser data) will be used and no error will be thrown. + * + * Supported locales are: + * `da_DK`, + * `de_DE`, + * `en_AU`, + * `en_GB`, + * `en_US`, + * `es_ES`, + * `fr_CA`, + * `fr_FR`, + * `id_ID`, + * `it_IT`, + * `ja_JP`, + * `ko_KR`, + * `nl_NL`, + * `no_NO`, + * `pl_PL`, + * `pt_BR`, + * `pt_PT`, + * `ru_RU`, + * `sv_SE`, + * `th_TH`, + * `zh_CN`, + * `zh_HK`, + * and `zh_TW`. + * * @param {boolean} [options.enableShippingAddress=false] Returns a shipping address object in {@link PayPal#tokenize}. * @param {object} [options.shippingAddressOverride] Allows you to pass a shipping address you have already collected into the PayPal payment flow. * @param {string} options.shippingAddressOverride.line1 Street address. @@ -1603,6 +1663,134 @@ declare namespace BraintreeWeb { public teardown(callback?: callback): void; } + + /** + * @module braintree-web/us-bank-account + * @description This module is for accepting payments of US bank accounts. + */ + export interface USBankAccount { + /** + * @static + * @function create + * @param {object} options Creation options: + * @param {Client} options.client A {@link Client} instance. + * @param {callback} callback The second argument, `data`, is the {@link USBankAccount} instance. + * @returns {void} + */ + create: (options: { client: Client }, callback: callback) => void; + + /** + * @description The current version of the SDK, i.e. `{@pkg version}`. + * @type {string} + */ + VERSION: string; + } + + /** + * @class + * @param {object} options See {@link module:braintree-web/us-bank-account.create|us-bank-account.create}. + * @classdesc This class represents a US Bank Account component. Instances of this class can tokenize raw bank details or present a bank login. You cannot use this constructor directly. Use {@link module:braintree-web/us-bank-account.create|braintree.us-bank-account.create} instead. + */ + export class USBankAccount { + /** + * @class + * @param {object} options See {@link module:braintree-web/us-bank-account.create|us-bank-account.create}. + * @classdesc This class represents a US Bank Account component. Instances of this class can tokenize raw bank details or present a bank login. You cannot use this constructor directly. Use {@link module:braintree-web/us-bank-account.create|braintree.us-bank-account.create} instead. + */ + constructor(options: any) + + + /** + * Tokenizes bank information to return a payment method nonce. You can tokenize bank details by providing information like account and routing numbers. You can also tokenize with a bank login UI that prompts the customer to log into their bank account. + * @public + * @param {object} options All tokenization options for the US Bank Account component. + * @param {string} options.mandateText A string for proof of customer authorization. For example, `'I authorize Braintree to debit my bank account on behalf of My Online Store.'`. + * @param {object} [options.bankDetails] Bank detail information (such as account and routing numbers). `bankDetails` or `bankLogin` option must be provided. + * @param {string} options.bankDetails.routingNumber The customer's bank routing number, such as `'307075259'`. + * @param {string} options.bankDetails.accountNumber The customer's bank account number, such as `'999999999'`. + * @param {string} options.bankDetails.accountType The customer's bank account type. Must be `'checking'` or `'savings'`. + * @param {string} options.bankDetails.accountHolderName The customer's bank account holder name, such as `'Rosetta Fox'`. + * @param {object} options.bankDetails.billingAddress The customer's billing address. + * @param {string} options.bankDetails.billingAddress.streetAddress The street address for the customer's billing address, such as `'123 Fake St'`. + * @param {string} [options.bankDetails.billingAddress.extendedAddress] The extended street address for the customer's billing address, such as `'Apartment B'`. + * @param {string} options.bankDetails.billingAddress.locality The locality for the customer's billing address. This is typically a city, such as `'San Francisco'`. + * @param {string} options.bankDetails.billingAddress.region The region for the customer's billing address. This is typically a state, such as `'CA'`. + * @param {string} options.bankDetails.billingAddress.postalCode The postal code for the customer's billing address. This is typically a ZIP code, such as `'94119'`. + * @param {object} [options.bankLogin] Bank login information. `bankLogin` or `bankDetails` option must be provided. + * @param {string} options.bankLogin.displayName Display name for the bank login UI, such as `'My Store'`. + * @param {callback} callback The second argument, data, is a {@link USBankAccount~tokenizePayload|tokenizePayload}. + * @returns {void} + * @example + * Tokenizing raw bank details + * submitButton.addEventListener('click', function (event) { + * var routingNumberInput = document.querySelector('input#routing-number'); + * var accountNumberInput = document.querySelector('input#account-number'); + * var accountHolderNameInput = document.querySelector('input#account-holder-name'); + * var accountTypeInput = document.querySelector('input[name="account-type"]:checked'); + * var billingAddressStreetInput = document.querySelector('input#street-address'); + * var billingAddressExtendedInput = document.querySelector('input#extended-address'); + * var billingAddressLocalityInput = document.querySelector('input#locality'); + * var billingAddressRegionSelect = document.querySelector('select#region'); + * var billingAddressPostalInput = document.querySelector('input#postal-code'); + * + * event.preventDefault(); + * + * usBankAccountInstance.tokenize({ + * bankDetails: { + * routingNumber: routingNumberInput.value, + * accountNumber: accountNumberInput.value, + * accountHolderName: accountHolderNameInput.value, + * accountType: accountTypeInput.value, + * billingAddress: { + * streetAddress: billingAddressStreetInput.value, + * extendedAddress: billingAddressExtendedInput.value, + * locality: billingAddressLocalityInput.value, + * region: billingAddressRegionSelect.value, + * postalCode: billingAddressPostalInput.value + * } + * }, + * mandateText: 'I authorize Braintree to debit my bank account on behalf of My Online Store.' + * }, function (tokenizeErr, tokenizedPayload) { + * if (tokenizeErr) { + * console.error('There was an error tokenizing the bank details.'); + * return; + * } + * + * // Send tokenizePayload.nonce to your server here! + * }); + * }); + * @example + * Tokenizing with bank login UI + * bankLoginButton.addEventListener('click', function (event) { + * event.preventDefault(); + * + * usBankAccountInstance.tokenize({ + * bankLogin: { + * displayName: 'My Online Store' + * }, + * mandateText: 'I authorize Braintree to debit my bank account on behalf of My Online Store.' + * }, function (tokenizeErr, tokenizedPayload) { + * if (tokenizeErr) { + * console.error('There was an error tokenizing the bank details.'); + * return; + * } + * + * // Send tokenizePayload.nonce to your server here! + * }); + * }); + */ + public tokenize(options: { mandateText: string, bankDetails: any, bankLogin: any }, callback: callback): void; + + /** + * Cleanly tear down anything set up by {@link module:braintree-web/us-bank-account.create|create}. + * @public + * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully. + * @returns {void} + */ + public teardown(callback?: callback): void; + + } + } declare namespace BraintreeError { @@ -1733,6 +1921,9 @@ interface BraintreeStatic { /** @type {module:braintree-web/apple-pay} */ applePay: BraintreeWeb.ApplePay; + /** @type {module:braintree-web/us-bank-account} */ + usBankAccount: BraintreeWeb.USBankAccount; + /** * @description The current version of the SDK, i.e. `3.0.2`. * @type {string} From 4e5fbf297e2494b43ec9dba411bf9507b8341d1d Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Thu, 8 Dec 2016 15:55:15 -0500 Subject: [PATCH 34/51] Fix missing parameters from svg append (#13119) * Add parameter declarations to append() * Made insertFirst parameter optional --- chartist/chartist.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts index 0e92364812..40169a1963 100644 --- a/chartist/chartist.d.ts +++ b/chartist/chartist.d.ts @@ -423,7 +423,7 @@ declare namespace Chartist { /** * This method will append an element to the current element as a child. */ - append(): IChartistSvg; + append(element: IChartistSvg, insertFirst?: boolean): IChartistSvg; /** * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further. From cfa4509cce7d867d6a3c245585022e12847cf36c Mon Sep 17 00:00:00 2001 From: Nguyen Duc Binh Date: Fri, 9 Dec 2016 03:55:44 +0700 Subject: [PATCH 35/51] =?UTF-8?q?Correct=20missing=20=E2=80=98auto?= =?UTF-8?q?=E2=80=99=20option=20of=20GridList=E2=80=99s=20cellHeight=20(#1?= =?UTF-8?q?3094)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- material-ui/material-ui.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/material-ui/material-ui.d.ts b/material-ui/material-ui.d.ts index 475b719bea..0d83046938 100644 --- a/material-ui/material-ui.d.ts +++ b/material-ui/material-ui.d.ts @@ -966,7 +966,7 @@ declare namespace __MaterialUI { namespace GridList { interface GridListProps { - cellHeight?: number; + cellHeight?: number|'auto'; cols?: number; padding?: number; style?: React.CSSProperties; From 5f2450ba8001ed38c83eae3c0db93f0a3309180d Mon Sep 17 00:00:00 2001 From: Christopher Cortes Date: Thu, 8 Dec 2016 21:56:36 +0100 Subject: [PATCH 36/51] Add new Angular 1.5.9 methods to $compileProvider (#13096) * Add new Angular 1.5.9 methods to $compileProvider Add new methods available in Angular 1.5.9: onChangesTtl(), commentDirectivesEnabled() and cssClassDirectivesEnabled() * Add JSDoc to Angular 1.59 new methods of $compileProvider JSDoc for onChangesTtl(), commentDirectivesEnabled() and cssClassDirectivesEnabled() methods. * Expand $compileProvider JSDoc Urls added to JSDoc of Angular 1.5.9 new methods . --- angularjs/angular.d.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index b16438bdcb..87870bbbd6 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1205,6 +1205,33 @@ declare namespace angular { debugInfoEnabled(): boolean; debugInfoEnabled(enabled: boolean): ICompileProvider; + + /** + * Sets the number of times $onChanges hooks can trigger new changes before giving up and assuming that the model is unstable. + * Increasing the TTL could have performance implications, so you should not change it without proper justification. + * Default: 10. + * See: https://docs.angularjs.org/api/ng/provider/$compileProvider#onChangesTtl + */ + onChangesTtl(): number; + onChangesTtl(limit: number): ICompileProvider; + + /** + * It indicates to the compiler whether or not directives on comments should be compiled. + * It results in a compilation performance gain since the compiler doesn't have to check comments when looking for directives. + * Defaults to true. + * See: https://docs.angularjs.org/api/ng/provider/$compileProvider#commentDirectivesEnabled + */ + commentDirectivesEnabled(): boolean; + commentDirectivesEnabled(enabled: boolean): ICompileProvider; + + /** + * It indicates to the compiler whether or not directives on element classes should be compiled. + * It results in a compilation performance gain since the compiler doesn't have to check element classes when looking for directives. + * Defaults to true. + * See: https://docs.angularjs.org/api/ng/provider/$compileProvider#cssClassDirectivesEnabled + */ + cssClassDirectivesEnabled(): boolean; + cssClassDirectivesEnabled(enabled: boolean): ICompileProvider; } interface ICloneAttachFunction { From d78bd6ca2fc0afcf028d20ecdb5dcee29baa78a9 Mon Sep 17 00:00:00 2001 From: alex-korobko Date: Thu, 8 Dec 2016 15:56:54 -0500 Subject: [PATCH 37/51] Changed type of injectedScript property to string (#13120) The injectedScript property should take string value with script code, not the bool flag as in current version --- chrome/chrome.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index dbf6a12446..df1ac8e710 100644 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -1617,7 +1617,7 @@ declare namespace chrome.devtools.inspectedWindow { /** Optional. When true, the loader will ignore the cache for all inspected page resources loaded before the load event is fired. The effect is similar to pressing Ctrl+Shift+R in the inspected window or within the Developer Tools window. */ ignoreCache?: boolean; /** Optional. If specified, the script will be injected into every frame of the inspected page immediately upon load, before any of the frame's scripts. The script will not be injected after subsequent reloads—for example, if the user presses Ctrl+R. */ - injectedScript?: boolean; + injectedScript?: string; /** * Optional. * If specified, this script evaluates into a function that accepts three string arguments: the source to preprocess, the URL of the source, and a function name if the source is an DOM event handler. The preprocessorerScript function should return a string to be compiled by Chrome in place of the input source. In the case that the source is a DOM event handler, the returned source must compile to a single JS function. From 1e2e0b9354ad143021bf1395585bdbf0e09dd301 Mon Sep 17 00:00:00 2001 From: Ilia Choly Date: Thu, 8 Dec 2016 15:57:26 -0500 Subject: [PATCH 38/51] Use unions for openlayers string enums (#13134) --- openlayers/openlayers.d.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index a48e26071b..e52407f450 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -827,7 +827,7 @@ declare module ol { * `'nautical'`, `'metric'`, `'us'`. * @enum {string} */ - type Units = string; + type Units = "degrees" | "imperial" | "nautical" | "metric" | "us"; } /** @@ -2535,7 +2535,7 @@ declare module ol { * IGC altitude/z. One of 'barometric', 'gps', 'none'. * @enum {string} */ - type IGCZ = string; + type IGCZ = "barometric" | "gps" | "none"; /** * @classdesc @@ -3608,7 +3608,7 @@ declare module ol { * `'GeometryCollection'`, `'Circle'`. * @enum {string} */ - type GeometryType = string; + type GeometryType = "Point" | "LineString" | "LinearRing" | "Polygon" | "MultiPoint" | "MultiLineString" | "MultiPolygon" | "GeometryCollection" | "Circle"; /** * The coordinate layout for geometries, indicating whether a 3rd or 4th z ('Z') @@ -3616,7 +3616,7 @@ declare module ol { * `'XYZ'`, `'XYM'`, `'XYZM'`. * @enum {string} */ - type GeometryLayout = string; + type GeometryLayout = "XY" | "XYZ" | "XYM" | "XYZM"; /** * @classdesc @@ -6417,7 +6417,7 @@ declare module ol { * even during animations, but slower performance than the other options. * @api */ - type VectorTileRenderType = string; + type VectorTileRenderType = "image" | "hybrid" | "vector"; /** * @classdesc @@ -7386,7 +7386,7 @@ declare module ol { * `'top-center'`, `'top-right'` * @enum {string} */ - type OverlayPositioning = string; + type OverlayPositioning = "bottom-left" | "bottom-center" | "bottom-right" | "center-left" | "center-center" | "center-right" | "top-left" | "top-center" | "top-right"; /** * @classdesc @@ -7608,7 +7608,7 @@ declare module ol { * `'us-ft'`. * @enum {string} */ - type Units = string; + type Units = "degress" | "ft" | "m" | "pixels" | "tile-pixels" | "us-ft"; /** * Meters per unit lookup table. @@ -8170,13 +8170,13 @@ declare module ol { * Available renderers: `'canvas'`, `'dom'` or `'webgl'`. * @enum {string} */ - type RendererType = string; + type RendererType = "canvas" | "dom" | "webgl"; /** * Raster operation type. Supported values are `'pixel'` and `'image'`. * @enum {string} */ - type RasterOperationType = string; + type RasterOperationType = "pixel" | "image"; /** * @namespace ol.source @@ -8825,7 +8825,7 @@ declare module ol { * State of the source, one of 'undefined', 'loading', 'ready' or 'error'. * @enum {string} */ - type State = string; + type State = "undefined" | "loading" | "ready" | "error"; /** * @classdesc @@ -9606,7 +9606,7 @@ declare module ol { * specification that OpenLayers can make use of. * @enum {string} */ - type ServerType = string; + type ServerType = "carmentaserver" | "geoserver" | "mapserver" | "qgis"; } @@ -9614,7 +9614,7 @@ declare module ol { * Request encoding. One of 'KVP', 'REST'. * @enum {string} */ - type WMTSRequestEncoding = string; + type WMTSRequestEncoding = "KVP" | "REST"; /** * @classdesc @@ -10071,13 +10071,13 @@ declare module ol { * Icon anchor units. One of 'fraction', 'pixels'. * @enum {string} */ - type IconAnchorUnits = string; + type IconAnchorUnits = "fraction" | "pixels"; /** * Icon origin. One of 'bottom-left', 'bottom-right', 'top-left', 'top-right'. * @enum {string} */ - type IconOrigin = string; + type IconOrigin = "bottom-left" | "bottom-right" | "top-left" | "top-right"; /** * @classdesc From a8a8a493f00471f6c02da96fec25f1ef4e162fb9 Mon Sep 17 00:00:00 2001 From: Kiarash Date: Thu, 8 Dec 2016 21:58:18 +0100 Subject: [PATCH 39/51] Update google.maps.MapPane interface (#13122) --- googlemaps/google.maps-tests.ts | 13 +++++++++++++ googlemaps/google.maps.d.ts | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/googlemaps/google.maps-tests.ts b/googlemaps/google.maps-tests.ts index 9b10c40ad3..28d37e811c 100644 --- a/googlemaps/google.maps-tests.ts +++ b/googlemaps/google.maps-tests.ts @@ -140,3 +140,16 @@ var mapTypeStyle: google.maps.MapTypeStyle ={ elementType: 'labels', stylers: [], }; + +/***** OverlayView *****/ +var div = document.createElement('div'); +var overlay = new google.maps.OverlayView(); +var panes = overlay.getPanes(); +panes.floatPane.appendChild(div); +panes.floatShadow.appendChild(div); +panes.mapPane.appendChild(div); +panes.markerLayer.appendChild(div); +panes.overlayImage.appendChild(div); +panes.overlayLayer.appendChild(div); +panes.overlayMouseTarget.appendChild(div); +panes.overlayShadow.appendChild(div); \ No newline at end of file diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index c4168645a6..dff5c1cd90 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -1,6 +1,6 @@ // Type definitions for Google Maps JavaScript API 3.25 // Project: https://developers.google.com/maps/ -// Definitions by: Folia A/S , Chris Wrench +// Definitions by: Folia A/S , Chris Wrench , Kiarash Ghiaseddin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /* @@ -871,10 +871,13 @@ declare namespace google.maps { export interface MapPanes { floatPane: Element; + floatShadow: Element; mapPane: Element; markerLayer: Element; + overlayImage: Element; overlayLayer: Element; overlayMouseTarget: Element; + overlayShadow: Element; } export class MapCanvasProjection extends MVCObject { From 372eed3885ccdf35cb62e76755ee7e729ed78cfa Mon Sep 17 00:00:00 2001 From: Alex Staroselsky Date: Thu, 8 Dec 2016 13:58:36 -0700 Subject: [PATCH 40/51] Removing myself (AlStar01) as definition author from angular-material.d.ts (#13125) --- angular-material/angular-material.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts index f100fd4d4b..506a696e5b 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -1,6 +1,6 @@ // Type definitions for Angular Material 1.1.0-rc5+ (angular.material module) // Project: https://github.com/angular/material -// Definitions by: Alex Staroselsky , Blake Bigelow , Peter Hajdu +// Definitions by: Blake Bigelow , Peter Hajdu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From b294befbaf6e7eefb7ca282fd5ab5eb130212a62 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 8 Dec 2016 13:02:21 -0800 Subject: [PATCH 41/51] Clarify that notNeededPackages.json is just for packages formerly on DefinitelyTyped (#13156) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7187e9e8f6..d974c86493 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,8 @@ Make a PR doing the following: * Any other packages in DefinitelyTyped that referenced the deleted package should be updated to reference the bundled types. To do this, add a `package.json` with `"dependencies": { "foo": "x.y.z" }`. +If a package was never on DefinitelyTyped, it does not need to be added to `notNeededPackages.json`. + #### Lint From 5da11b9a1fa97fb472af1d94ef69ceb340303878 Mon Sep 17 00:00:00 2001 From: wmrowan Date: Thu, 8 Dec 2016 13:04:55 -0800 Subject: [PATCH 42/51] Update Parsimmon typings (#13146) --- parsimmon/parsimmon-tests.ts | 16 +++++++-- parsimmon/parsimmon.d.ts | 67 ++++++++++++++++++++++++++++++++++-- 2 files changed, 77 insertions(+), 6 deletions(-) diff --git a/parsimmon/parsimmon-tests.ts b/parsimmon/parsimmon-tests.ts index 0cd201cd44..8f87227740 100644 --- a/parsimmon/parsimmon-tests.ts +++ b/parsimmon/parsimmon-tests.ts @@ -46,6 +46,7 @@ var barPar: Parser; var anyArrPar: Parser; +var strArrPar: Parser; var fooArrPar: Parser; var barArrPar: Parser; @@ -68,7 +69,16 @@ index = fooResult.index; // -- -- -- -- -- -- -- -- -- -- -- -- -- +fooResult = P.makeSuccess(0, foo); +fooResult = P.makeFailure(0, ''); + +fooPar = P((input: string, i: number) => P.makeSuccess(0, foo)); +fooPar = P.Parser((input: string, i: number) => P.makeSuccess(0, foo)); + +// -- -- -- -- -- -- -- -- -- -- -- -- -- + fooResult = fooPar.parse(str); +foo = fooPar.tryParse(str); fooPar = fooPar.or(fooPar); anyPar = fooPar.or(barPar); @@ -171,9 +181,9 @@ numPar = P.seqMap(P.digit, P.digits, (a: string, b: string) => 42); strPar = P.seqMap(P.digit, P.digits, P.letter, (a: string, b: string, c: string) => 'foo'); strPar = P.seqMap(P.digit, P.digits, P.letter, P.letters.map(Number), (a: string, b: string, c: string, d: number) => 'foo'); -strPar = P.sepBy(P.string('foo'), P.string('bar')); -strPar = P.sepBy1(P.string('foo'), P.string('bar')); +strArrPar = P.sepBy(P.string('foo'), P.string('bar')); +strArrPar = P.sepBy1(P.string('foo'), P.string('bar')); strPar = P.test((a: string) => false); -strPar = P.takeWhile((a: string) => true); \ No newline at end of file +strPar = P.takeWhile((a: string) => true); diff --git a/parsimmon/parsimmon.d.ts b/parsimmon/parsimmon.d.ts index fa356a799c..22bfa1283b 100644 --- a/parsimmon/parsimmon.d.ts +++ b/parsimmon/parsimmon.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Parsimmon 0.9.2 +// Type definitions for Parsimmon 1.0.0 // Project: https://github.com/jneen/parsimmon // Definitions by: Bart van der Schoor , Mizunashi Mana , Boris Cherny , Benny van Reeven // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,6 +6,42 @@ // TODO convert to generics declare module 'parsimmon' { + + /** + * **NOTE:** You probably will never need to use this function. Most parsing + * can be accomplished using `Parsimmon.regexp` and combination with + * `Parsimmon.seq` and `Parsimmon.alt`. + * + * You can add a primitive parser (similar to the included ones) by using + * `Parsimmon(fn)`. This is an example of how to create a parser that matches + * any character except the one provided: + * + * ```javascript + * function notChar(char) { + * return Parsimmon(function(input, i) { + * if (input.charAt(i) !== char) { + * return Parsimmon.makeSuccess(i + 1, input.charAt(i)); + * } + * return Parsimmon.makeFailure(i, 'anything different than "' + char + '"'); + * }); + * } + * ``` + * + * This parser can then be used and composed the same way all the existing + * ones are used and composed, for example: + * + * ```javascript + * var parser = + * Parsimmon.seq( + * Parsimmon.string('a'), + * notChar('b').times(5) + * ); + * parser.parse('accccc'); + * //=> {status: true, value: ['a', ['c', 'c', 'c', 'c', 'c']]} + * ``` + */ + function Parsimmon(fn: (input: string, i: number) => Parsimmon.Result): Parsimmon.Parser; + namespace Parsimmon { export type StreamType = string; @@ -37,6 +73,12 @@ declare module 'parsimmon' { * parse the string */ parse(input: string): Result; + /** + * Like parser.parse(input) but either returns the parsed value or throws + * an error on failure. The error object contains additional properties + * about the error. + */ + tryParse(input: string): T; /** * returns a new parser which tries parser, and if it fails uses otherParser. */ @@ -101,6 +143,25 @@ declare module 'parsimmon' { desc(description: string): Parser; } + /** + * Alias of `Parsimmon(fn)` for backwards compatibility. + */ + export function Parser(fn: (input: string, i: number) => Parsimmon.Result): Parser; + + /** + * To be used inside of Parsimmon(fn). Generates an object describing how + * far the successful parse went (index), and what value it created doing + * so. See documentation for Parsimmon(fn). + */ + export function makeSuccess(index: number, value: T): Result; + + /** + * To be used inside of Parsimmon(fn). Generates an object describing how + * far the unsuccessful parse went (index), and what kind of syntax it + * expected to see (expectation). See documentation for Parsimmon(fn). + */ + export function makeFailure(furthest: number, expectation: string): Result; + /** * Returns true if obj is a Parsimmon parser, otherwise false. */ @@ -193,12 +254,12 @@ declare module 'parsimmon' { /** * Accepts two parsers, and expects zero or more matches for content, separated by separator, yielding an array. */ - export function sepBy(content: Parser, separator: Parser): Parser + export function sepBy(content: Parser, separator: Parser): Parser /** * This is the same as Parsimmon.sepBy, but matches the content parser at least once. */ - export function sepBy1(content: Parser, separator: Parser): Parser + export function sepBy1(content: Parser, separator: Parser): Parser /** * accepts a function that returns a parser, which is evaluated the first time the parser is used. From 40a819097c82655a7479063d60d1e372db84aa6e Mon Sep 17 00:00:00 2001 From: EamonHetherton Date: Fri, 9 Dec 2016 07:13:26 +1000 Subject: [PATCH 43/51] Update AmCharts.d.ts (#13170) --- amcharts/AmCharts.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index ae5baad50e..26057c4396 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -2314,6 +2314,8 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val numberFormatter: Object; /** Name of the open field (used by floating columns, candlesticks and ohlc) in your dataProvider. */ openField: string; + /**Precision of values. Will use chart's precision if not set any.*/ + precision: number; /** Specifies where data points should be placed - on the beginning of the period (day, hour, etc) or in the middle (only when parseDates property of categoryAxis is set to true). This setting affects Serial chart only. Possible values are "start" and "middle". middle */ pointPosition: string; /** If graph's type is column and labelText is set, graph hides labels which do not fit into the column's space. If you don't want these labels to be hidden, set this to true. */ @@ -2587,5 +2589,8 @@ Your function should return string.*/ enabled: boolean; libs: Object; menu: Object; + config: any; + capture(config: any, callback: () => void); + toJPG(config: any, callback: (config:any) => void); } } From e45879a3b4a6d7e265f21103ae044cefb3cee37c Mon Sep 17 00:00:00 2001 From: Paul Oppenheim Date: Thu, 8 Dec 2016 13:14:35 -0800 Subject: [PATCH 44/51] knex: add MySqlConnectionConfig, tests (#13161) * knex: add MySqlConnectionConfig, tests * knex: add types for MySqlConnectionConfig queryFormat params --- knex/knex-tests.ts | 13 +++++++++++++ knex/knex.d.ts | 28 +++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/knex/knex-tests.ts b/knex/knex-tests.ts index b103562b83..780e41b340 100644 --- a/knex/knex-tests.ts +++ b/knex/knex-tests.ts @@ -36,6 +36,19 @@ var knex = Knex({ } }); +// Mysql configuration +var knex = Knex({ + debug: true, + client: 'mysql', + connection: { + host : '127.0.0.1', + user : 'your_database_user', + password : 'your_database_password', + db : 'myapp_test', + trace: false + } +}); + // Pooling var knex = Knex({ client: 'mysql', diff --git a/knex/knex.d.ts b/knex/knex.d.ts index c1cf4f6cba..822d82a197 100644 --- a/knex/knex.d.ts +++ b/knex/knex.d.ts @@ -455,7 +455,7 @@ declare module "knex" { client?: string; dialect?: string; connection?: string|ConnectionConfig|MariaSqlConnectionConfig| - Sqlite3ConnectionConfig|SocketConnectionConfig; + MySqlConnectionConfig|Sqlite3ConnectionConfig|SocketConnectionConfig; pool?: PoolConfig; migrations?: MigratorConfig; acquireConnectionTimeout?: number; @@ -503,6 +503,32 @@ declare module "knex" { rejectUnauthorized?: boolean; } + // Config object for mysql: https://github.com/mysqljs/mysql#connection-options + interface MySqlConnectionConfig { + host?: string; + port?: number; + localAddress?: string; + socketPath?: string; + user?: string; + password?: string; + database?: string; + charset?: string; + timezone?: string; + connectTimeout?: number; + stringifyObjects?: boolean; + insecureAuth?: boolean; + typeCast?: boolean; + queryFormat?: (query: string, values: any) => string; + supportBigNumbers?: boolean; + bigNumberStrings?: boolean; + dateStrings?: boolean; + debug?: boolean; + trace?: boolean; + multipleStatements?: boolean; + flags?: string; + ssl?: string | MariaSslConfiguration; + } + /** Used with SQLite3 adapter */ interface Sqlite3ConnectionConfig { filename: string; From b78bbc88c9013ff019e74e0f466aa9ea58c4d5d8 Mon Sep 17 00:00:00 2001 From: marcovdb Date: Sun, 11 Dec 2016 13:55:51 +0100 Subject: [PATCH 45/51] Update index.d.ts drawOutOfBounds => drawOutOfBound --- wordcloud/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wordcloud/index.d.ts b/wordcloud/index.d.ts index cdc7e1678f..c7cd98aafb 100644 --- a/wordcloud/index.d.ts +++ b/wordcloud/index.d.ts @@ -47,7 +47,7 @@ declare namespace WordCloud { /** origin of the “cloud” in [x, y]. */ origin?: [number, number]; /** set to true to allow word being draw partly outside of the canvas. Allow word bigger than the size of the canvas to be drawn. */ - drawOutOfBounds?: boolean; + drawOutOfBound?: boolean; /** visualize the grid by draw squares to mask the drawn areas. */ drawMask?: boolean; From 50b94f140d81b9fc4a06d9d7bf48465bd0bf36e5 Mon Sep 17 00:00:00 2001 From: Elias Winberg Date: Sun, 11 Dec 2016 18:42:47 +0100 Subject: [PATCH 46/51] Fix definitions for 'mapValues', 'mapValuesLimit', 'mapValuesSeries' --- async/async-tests.ts | 4 ++-- async/index.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/async/async-tests.ts b/async/async-tests.ts index 2a21a6cabb..abc2653f60 100644 --- a/async/async-tests.ts +++ b/async/async-tests.ts @@ -648,7 +648,7 @@ async.mapValues({ }, 500); -}, function(err: Error, results: string[]): void { +}, function(err: Error, results: Dictionary): void { console.log("async.mapValues: done with results", results); @@ -668,7 +668,7 @@ async.mapValuesSeries({ }, 500); -}, function(err: Error, results: string[]): void { +}, function(err: Error, results: Dictionary): void { console.log("async.mapValuesSeries: done with results", results); diff --git a/async/index.d.ts b/async/index.d.ts index 45d39ea955..86aa17ea6b 100644 --- a/async/index.d.ts +++ b/async/index.d.ts @@ -111,8 +111,8 @@ interface Async { mapSeries: typeof async.map; mapLimit(arr: T[], limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; mapLimit(arr: Dictionary, limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; - mapValuesLimit(obj: Dictionary, limit: number, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultCallback): void; - mapValues(obj: Dictionary, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultCallback): void; + mapValuesLimit(obj: Dictionary, limit: number, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultObjectCallback): void; + mapValues(obj: Dictionary, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultObjectCallback): void; mapValuesSeries: typeof async.mapValues; filter(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; filter(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; From 6b3bc735ad028ca115c06721fb1c71ffc0e7a546 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 12 Dec 2016 09:24:06 -0800 Subject: [PATCH 47/51] Add note in readme about tsjs-lib-generator (#13210) --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index d974c86493..0b1474cd75 100644 --- a/README.md +++ b/README.md @@ -222,6 +222,10 @@ If you're targeting master, we may change it to the new style when merging from Here are the [currently requested definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest). +#### What about type definitions for the DOM? + +If types are part of a web standard, they should be contributed to [TSJS-lib-generator](https://github.com/Microsoft/TSJS-lib-generator) so that they can become part of the default `lib.dom.d.ts`. + ## License From da815a45df69b26db5a80a14bf2fd9539e9c6d30 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 12 Dec 2016 10:46:32 -0800 Subject: [PATCH 48/51] Add definitions for redux-localstorage and main enhancers (#13115) --- redux-localstorage-debounce/index.d.ts | 12 +++++++ redux-localstorage-debounce/package.json | 5 +++ .../redux-localstorage-debounce-tests.ts | 21 +++++++++++ redux-localstorage-debounce/tsconfig.json | 19 ++++++++++ redux-localstorage-debounce/tslint.json | 1 + redux-localstorage-filter/index.d.ts | 9 +++++ redux-localstorage-filter/package.json | 5 +++ .../redux-localstorage-filter-tests.ts | 16 +++++++++ redux-localstorage-filter/tsconfig.json | 19 ++++++++++ redux-localstorage-filter/tslint.json | 1 + redux-localstorage/index.d.ts | 29 +++++++++++++++ .../lib/adapters/AsyncStorage.d.ts | 3 ++ .../lib/adapters/localStorage.d.ts | 3 ++ .../lib/adapters/sessionStorage.d.ts | 3 ++ redux-localstorage/package.json | 5 +++ .../redux-localstorage-tests.ts | 35 +++++++++++++++++++ redux-localstorage/tsconfig.json | 19 ++++++++++ redux-localstorage/tslint.json | 7 ++++ 18 files changed, 212 insertions(+) create mode 100644 redux-localstorage-debounce/index.d.ts create mode 100644 redux-localstorage-debounce/package.json create mode 100644 redux-localstorage-debounce/redux-localstorage-debounce-tests.ts create mode 100644 redux-localstorage-debounce/tsconfig.json create mode 100644 redux-localstorage-debounce/tslint.json create mode 100644 redux-localstorage-filter/index.d.ts create mode 100644 redux-localstorage-filter/package.json create mode 100644 redux-localstorage-filter/redux-localstorage-filter-tests.ts create mode 100644 redux-localstorage-filter/tsconfig.json create mode 100644 redux-localstorage-filter/tslint.json create mode 100644 redux-localstorage/index.d.ts create mode 100644 redux-localstorage/lib/adapters/AsyncStorage.d.ts create mode 100644 redux-localstorage/lib/adapters/localStorage.d.ts create mode 100644 redux-localstorage/lib/adapters/sessionStorage.d.ts create mode 100644 redux-localstorage/package.json create mode 100644 redux-localstorage/redux-localstorage-tests.ts create mode 100644 redux-localstorage/tsconfig.json create mode 100644 redux-localstorage/tslint.json diff --git a/redux-localstorage-debounce/index.d.ts b/redux-localstorage-debounce/index.d.ts new file mode 100644 index 0000000000..5cdc5bbd40 --- /dev/null +++ b/redux-localstorage-debounce/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for redux-localstorage-debounce 0.1 +// Project: https://github.com/elgerlambert/redux-localstorage-debounce +// Definitions by: Karol Janyst +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { StorageAdapter } from "redux-localstorage"; + +interface DebounceOptions { + maxWait?: number; + [key: string]: any; +} +export default function debounce(wait: number, options?: number | DebounceOptions): (adapter: StorageAdapter) => StorageAdapter; diff --git a/redux-localstorage-debounce/package.json b/redux-localstorage-debounce/package.json new file mode 100644 index 0000000000..6cfd8dc05c --- /dev/null +++ b/redux-localstorage-debounce/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} \ No newline at end of file diff --git a/redux-localstorage-debounce/redux-localstorage-debounce-tests.ts b/redux-localstorage-debounce/redux-localstorage-debounce-tests.ts new file mode 100644 index 0000000000..bb15d77121 --- /dev/null +++ b/redux-localstorage-debounce/redux-localstorage-debounce-tests.ts @@ -0,0 +1,21 @@ +import { compose } from "redux" +import { + default as persistState +} from "redux-localstorage" +import * as adapter from "redux-localstorage/lib/adapters/localStorage" +import { default as debounce } from "redux-localstorage-debounce" + +const storageWait = compose( + debounce(100) +)(adapter(window.localStorage)) +const enhancerWait = persistState(storageWait, "test") + +const storageMax = compose( + debounce(100, 200) +)(adapter(window.localStorage)) +const enhancerMax = persistState(storageMax, "test") + +const storageOpts = compose( + debounce(100, { maxWait : 200, foo : "bar" }) +)(adapter(window.localStorage)) +const enhancerOpts = persistState(storageOpts, "test") diff --git a/redux-localstorage-debounce/tsconfig.json b/redux-localstorage-debounce/tsconfig.json new file mode 100644 index 0000000000..3d9a2cc37b --- /dev/null +++ b/redux-localstorage-debounce/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", + "redux-localstorage-debounce-tests.ts" + ] +} \ No newline at end of file diff --git a/redux-localstorage-debounce/tslint.json b/redux-localstorage-debounce/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/redux-localstorage-debounce/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file diff --git a/redux-localstorage-filter/index.d.ts b/redux-localstorage-filter/index.d.ts new file mode 100644 index 0000000000..17a0c376ff --- /dev/null +++ b/redux-localstorage-filter/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for redux-localstorage-filter 0.1 +// Project: https://github.com/elgerlambert/redux-localstorage-filter +// Definitions by: Karol Janyst +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { StorageAdapter } from "redux-localstorage"; + +export function getSubset (obj: any, paths: string[]): any; +export default function filter (paths?: string | string[]): (adapter: StorageAdapter) => StorageAdapter; diff --git a/redux-localstorage-filter/package.json b/redux-localstorage-filter/package.json new file mode 100644 index 0000000000..6cfd8dc05c --- /dev/null +++ b/redux-localstorage-filter/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} \ No newline at end of file diff --git a/redux-localstorage-filter/redux-localstorage-filter-tests.ts b/redux-localstorage-filter/redux-localstorage-filter-tests.ts new file mode 100644 index 0000000000..83939ea310 --- /dev/null +++ b/redux-localstorage-filter/redux-localstorage-filter-tests.ts @@ -0,0 +1,16 @@ +import { compose } from "redux" +import { + default as persistState +} from "redux-localstorage" +import * as adapter from "redux-localstorage/lib/adapters/localStorage" +import { default as filter } from "redux-localstorage-filter" + +const storageSingle = compose( + filter("foo") +)(adapter(window.localStorage)) +const enhancerSingle = persistState(storageSingle, "test") + +const storageMulti = compose( + filter(["foo", "bar"]) +)(adapter(window.localStorage)) +const enhancerMulti = persistState(storageMulti, "test") diff --git a/redux-localstorage-filter/tsconfig.json b/redux-localstorage-filter/tsconfig.json new file mode 100644 index 0000000000..05831de9b1 --- /dev/null +++ b/redux-localstorage-filter/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", + "redux-localstorage-filter-tests.ts" + ] +} \ No newline at end of file diff --git a/redux-localstorage-filter/tslint.json b/redux-localstorage-filter/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/redux-localstorage-filter/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file diff --git a/redux-localstorage/index.d.ts b/redux-localstorage/index.d.ts new file mode 100644 index 0000000000..b0922a9279 --- /dev/null +++ b/redux-localstorage/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for redux-localstorage 1.0 +// Project: https://github.com/elgerlambert/redux-localstorage +// Definitions by: Karol Janyst +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as Redux from "redux"; + +export interface ActionTypes { + INIT: string; +} + +export type AdapterCallback = (err?: any, result?: A) => void; + +export interface StorageAdapter { + 0: A; + put(key: string, value: any, callback: AdapterCallback): void; + get(key: string, callback: AdapterCallback): void; + del(key: string, callback: AdapterCallback): void; +} + +export type StorageAdapterCreator = (storage: A) => StorageAdapter; + +export interface StorageAdapterEnhancer {} + +export function mergePersistedState (merge?: (initialState: A1, persistentState: A2) => A1 & A2): (next: Redux.Reducer) => Redux.Reducer; + +export default function persistState (storage?: StorageAdapter, key?: string, callback?: Function): Redux.GenericStoreEnhancer; + +export const actionTypes: ActionTypes; diff --git a/redux-localstorage/lib/adapters/AsyncStorage.d.ts b/redux-localstorage/lib/adapters/AsyncStorage.d.ts new file mode 100644 index 0000000000..f917bcc1d0 --- /dev/null +++ b/redux-localstorage/lib/adapters/AsyncStorage.d.ts @@ -0,0 +1,3 @@ +import { StorageAdapterCreator } from "redux-localstorage"; +declare const adapterCreator: StorageAdapterCreator; +export = adapterCreator; diff --git a/redux-localstorage/lib/adapters/localStorage.d.ts b/redux-localstorage/lib/adapters/localStorage.d.ts new file mode 100644 index 0000000000..65fad8d445 --- /dev/null +++ b/redux-localstorage/lib/adapters/localStorage.d.ts @@ -0,0 +1,3 @@ +import { StorageAdapterCreator } from "redux-localstorage"; +declare const adapterCreator: StorageAdapterCreator; +export = adapterCreator; diff --git a/redux-localstorage/lib/adapters/sessionStorage.d.ts b/redux-localstorage/lib/adapters/sessionStorage.d.ts new file mode 100644 index 0000000000..65fad8d445 --- /dev/null +++ b/redux-localstorage/lib/adapters/sessionStorage.d.ts @@ -0,0 +1,3 @@ +import { StorageAdapterCreator } from "redux-localstorage"; +declare const adapterCreator: StorageAdapterCreator; +export = adapterCreator; diff --git a/redux-localstorage/package.json b/redux-localstorage/package.json new file mode 100644 index 0000000000..e52256ea90 --- /dev/null +++ b/redux-localstorage/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} \ No newline at end of file diff --git a/redux-localstorage/redux-localstorage-tests.ts b/redux-localstorage/redux-localstorage-tests.ts new file mode 100644 index 0000000000..4c647c8410 --- /dev/null +++ b/redux-localstorage/redux-localstorage-tests.ts @@ -0,0 +1,35 @@ +// Imports +// -------------------------------------------------------------------------------- +import { Reducer, compose, combineReducers, createStore } from "redux" +import { + default as persistState, + mergePersistedState, + actionTypes +} from "redux-localstorage" +import * as adapterAsyncStorage from "redux-localstorage/lib/adapters/AsyncStorage" +import * as adapterLocalStorage from "redux-localstorage/lib/adapters/localStorage" +import * as adapterSessionStorage from "redux-localstorage/lib/adapters/sessionStorage" + +const AsyncStorage: any = {} + +const rootReducer: Reducer = (state: any, action: any) => state + +const reducer = compose( + mergePersistedState() +)(rootReducer) + +const storageAsyncStorage = adapterAsyncStorage(AsyncStorage) +const storageLocalStorage = adapterLocalStorage(window.localStorage) +const storageSessionStorage = adapterSessionStorage(window.sessionStorage) + +const createStoreAsyncStorage = compose( + persistState(storageAsyncStorage, "foo") +)(createStore)(reducer) + +const createStoreLocalStorage = compose( + persistState(storageLocalStorage, "foo") +)(createStore)(reducer) + +const createStoreSessionStorage = compose( + persistState(storageSessionStorage, "foo") +)(createStore)(reducer) diff --git a/redux-localstorage/tsconfig.json b/redux-localstorage/tsconfig.json new file mode 100644 index 0000000000..41c01c51d5 --- /dev/null +++ b/redux-localstorage/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", + "redux-localstorage-tests.ts" + ] +} \ No newline at end of file diff --git a/redux-localstorage/tslint.json b/redux-localstorage/tslint.json new file mode 100644 index 0000000000..e050abdce9 --- /dev/null +++ b/redux-localstorage/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "../tslint.json", + "rules": { + "forbidden-types": false, + "no-empty-interface": false + } +} \ No newline at end of file From c968762595456c86498fc38c340d2b94acec00fd Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 12 Dec 2016 11:00:28 -0800 Subject: [PATCH 49/51] Merge 'master' to 'types-2.0' one last time (#13277) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added missing nconf.required(keys) and Provider.required(keys) methods. * update to 4.7.0, add querycursor.map() and schema.loadClass() * add error callback for schema.post() * Added playsInline property as introduced in React 15.3.2 * Add definitions for redux-localstorage and main enhancers (#12580) * Add definitions for redux-localstorage * Add definitions for redux-localstorage-filter enhancer * Add definitions for redux-localstorage-debounce enhancer * csurf.d.ts relying on CookieOptions from express It seems express no longer exports `CookieOptions`, we need to import `express-serve-static-core` instead. * Added height property to IDialogOptions * versionKey type * kendo-ui: mark toString() params as optional (#13164) These function parameters are optional according to the upstream docs, e.g. http://docs.telerik.com/kendo-ui/api/javascript/geometry/matrix#methods-toString * Ensure that zoneAbbr and zoneName are expected type (string). * Update moment-timezone.d.ts * Fix syntax error in interact.d.ts A parameter name was missing making TypeScript compiler fail. * adding type for move to fs-extra * fixing signature of sinon/alwaysReturned based on the http://sinonjs.org/docs/#sinonspy * increasing version number * returning back the version number to the origin number * reversing changes in fs-extra * Request that PRs have meaningful titles * Improvement to existing nouislider type definition. (#12033) * updated nouislider version and added a lot of tests out of the documentation * corrected intentation * corrected untyped variables, issue raised by Travis * incorporated feedback on pull request * #13037 (#13039) * #13037 * pointToLayer first argument type fixed GeoJSON.Point to GeoJSON.Feature * Missing cc in sendgrid packate (#13063) The sendgrid package was missing the `cc` field, and the `bcc` field had a too generic type (`any` instead of `string[]`, as used on the `setCcs` and `setBccs` below. * Fixes #12414 (#13076) * Fixes #12414 * Make applicationServerKey optional * added ariaLabelledBy and ariaDescribedBy to IModalSettings (#13004) * Ceymard leaflet (#13007) * replaced all overrides of LatLng by a single use of LatLngExpression when appropriate * Changed Point, PointTuple overrides to use PointExpression instead * Changet use of LatLngBounds and Bounds in general to use the Expression variant instead of having several overrides * add ElasticSeach 5.x API function for deleteByQuery (#13014) * add ElasticSeach 5.x API function for deleteByQuery * use searchParams for deleteByQuery, as theses resemble the documentation. * add DeleteByQueryParams parameter type. * add deleteByQuery to tests. * Make `less` render options optional (#13078) * Added semver * Updated gravity definition. (#13088) * Full Redis client options (#13108) * Added missing return type to on() methods. (#13082) * Update react-native.0.29.d.ts (#13118) drawerPosition is of type `number` Android DrawerConsts.DrawerPosition.Left is equivalent to DrawerLayoutAndroid.positions.Left Android DrawerConsts.DrawerPosition.Right is equivalent to DrawerLayoutAndroid.positions.Right * Upgrade to match braintree-web 3.6.1 (#13098) * Update to match braintree-web version 3.3.0 * Upgrade to match Braintree-web v3.5.0 * upgrade to match braintree-web 3.6.1 add US bank class * Fix missing parameters from svg append (#13119) * Add parameter declarations to append() * Made insertFirst parameter optional * Correct missing ‘auto’ option of GridList’s cellHeight (#13094) * Add new Angular 1.5.9 methods to $compileProvider (#13096) * Add new Angular 1.5.9 methods to $compileProvider Add new methods available in Angular 1.5.9: onChangesTtl(), commentDirectivesEnabled() and cssClassDirectivesEnabled() * Add JSDoc to Angular 1.59 new methods of $compileProvider JSDoc for onChangesTtl(), commentDirectivesEnabled() and cssClassDirectivesEnabled() methods. * Expand $compileProvider JSDoc Urls added to JSDoc of Angular 1.5.9 new methods . * Changed type of injectedScript property to string (#13120) The injectedScript property should take string value with script code, not the bool flag as in current version * Use unions for openlayers string enums (#13134) * Update google.maps.MapPane interface (#13122) * Removing myself (AlStar01) as definition author from angular-material.d.ts (#13125) * Clarify that notNeededPackages.json is just for packages formerly on DefinitelyTyped (#13156) * Update Parsimmon typings (#13146) * Update AmCharts.d.ts (#13170) * knex: add MySqlConnectionConfig, tests (#13161) * knex: add MySqlConnectionConfig, tests * knex: add types for MySqlConnectionConfig queryFormat params * Add note in readme about tsjs-lib-generator (#13210) * Remove redux-localstorage packages; added by #13115 instead --- PULL_REQUEST_TEMPLATE.md | 1 + README.md | 6 + amcharts/index.d.ts | 5 + angular-material/index.d.ts | 8 +- .../angular-ui-bootstrap-tests.ts | 2 + angular-ui-bootstrap/index.d.ts | 18 +- angular/index.d.ts | 27 ++ braintree-web/index.d.ts | 211 ++++++++- chartist/index.d.ts | 2 +- chrome/index.d.ts | 2 +- csurf/index.d.ts | 2 +- googlemaps/google.maps-tests.ts | 13 + googlemaps/index.d.ts | 9 +- interact.js/index.d.ts | 2 +- kendo-ui/index.d.ts | 6 +- knex/index.d.ts | 28 +- knex/knex-tests.ts | 13 + leaflet/index.d.ts | 274 +++--------- less/index.d.ts | 14 +- material-ui/index.d.ts | 2 +- matter-js/index.d.ts | 8 +- moment-timezone/index.d.ts | 4 +- moment-timezone/moment-timezone-tests.ts | 4 +- mongoose/mongoose-tests.ts | 2 +- nconf/index.d.ts | 2 + nconf/nconf-tests.ts | 2 + ng-dialog/index.d.ts | 7 +- nouislider/index.d.ts | 39 +- nouislider/nouislider-8.0.2.d.ts | 180 ++++++++ nouislider/nouislider-tests-8.0.2.ts | 88 ++++ nouislider/nouislider-tests.ts | 420 +++++++++++++++++- openlayers/index.d.ts | 28 +- parsimmon/index.d.ts | 66 ++- parsimmon/parsimmon-tests.ts | 14 +- react-native/react-native.0.29.d.ts | 2 +- redis/index.d.ts | 39 +- sendgrid/index.d.ts | 6 +- service_worker_api/index.d.ts | 22 +- sinon/index.d.ts | 2 +- 39 files changed, 1287 insertions(+), 293 deletions(-) create mode 100644 nouislider/nouislider-8.0.2.d.ts create mode 100644 nouislider/nouislider-tests-8.0.2.ts diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 95d0041063..78acfdb5c9 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,7 @@ Please fill in this template. - [ ] Prefer to make your PR against the `types-2.0` branch. +- [ ] Use a meaningful title for the pull request. Include the name of the package modified. - [ ] Test the change in your own code. - [ ] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped#make-a-pull-request). - [ ] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped#common-mistakes). diff --git a/README.md b/README.md index 7187e9e8f6..0b1474cd75 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,8 @@ Make a PR doing the following: * Any other packages in DefinitelyTyped that referenced the deleted package should be updated to reference the bundled types. To do this, add a `package.json` with `"dependencies": { "foo": "x.y.z" }`. +If a package was never on DefinitelyTyped, it does not need to be added to `notNeededPackages.json`. + #### Lint @@ -220,6 +222,10 @@ If you're targeting master, we may change it to the new style when merging from Here are the [currently requested definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest). +#### What about type definitions for the DOM? + +If types are part of a web standard, they should be contributed to [TSJS-lib-generator](https://github.com/Microsoft/TSJS-lib-generator) so that they can become part of the default `lib.dom.d.ts`. + ## License diff --git a/amcharts/index.d.ts b/amcharts/index.d.ts index 45c848e5af..41f7615ee3 100644 --- a/amcharts/index.d.ts +++ b/amcharts/index.d.ts @@ -2321,6 +2321,8 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val numberFormatter: Object; /** Name of the open field (used by floating columns, candlesticks and ohlc) in your dataProvider. */ openField: string; + /**Precision of values. Will use chart's precision if not set any.*/ + precision: number; /** Specifies where data points should be placed - on the beginning of the period (day, hour, etc) or in the middle (only when parseDates property of categoryAxis is set to true). This setting affects Serial chart only. Possible values are "start" and "middle". middle */ pointPosition: string; /** If graph's type is column and labelText is set, graph hides labels which do not fit into the column's space. If you don't want these labels to be hidden, set this to true. */ @@ -2594,5 +2596,8 @@ Your function should return string.*/ enabled: boolean; libs: Object; menu: Object; + config: any; + capture(config: any, callback: () => void); + toJPG(config: any, callback: (config:any) => void); } } diff --git a/angular-material/index.d.ts b/angular-material/index.d.ts index ffdab5839b..e3804acbc8 100644 --- a/angular-material/index.d.ts +++ b/angular-material/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Angular Material 1.1.0-rc5+ (angular.material module) // Project: https://github.com/angular/material -// Definitions by: Alex Staroselsky , Blake Bigelow , Peter Hajdu +// Definitions by: Blake Bigelow , Peter Hajdu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as angular from 'angular'; @@ -155,7 +155,7 @@ declare module 'angular' { highlightClass(highlightClass: string): T; capsule(capsule: boolean): T; theme(theme: string): T; - hideDelay(delay: number): T; + hideDelay(delay: number | false): T; position(position: string): T; parent(parent?: string | Element | JQuery): T; // default: root node toastClass(toastClass: string): T; @@ -170,7 +170,7 @@ declare module 'angular' { autoWrap?: boolean; scope?: angular.IScope; // default: new child scope preserveScope?: boolean; // default: false - hideDelay?: number; // default (ms): 3000 + hideDelay?: number | false; // default (ms): 3000 position?: string; // any combination of 'bottom'/'left'/'top'/'right'/'fit'; default: 'bottom left' toastClass?: string; controller?: string | Function; @@ -344,6 +344,8 @@ declare module 'angular' { id: string; config: IPanelConfig; isAttached: boolean; + panelContainer: JQuery; + panelEl: JQuery; open(): angular.IPromise; close(): angular.IPromise; attach(): angular.IPromise; diff --git a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts index 43266798a6..84ddd63790 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts @@ -154,6 +154,8 @@ testApp.controller('TestCtrl', ( * test the $modal service */ var modalInstance = $modal.open({ + ariaLabelledBy: "label", + ariaDescribedBy: "description", animation: false, backdrop: 'static', backdropClass: 'modal-backdrop-test', diff --git a/angular-ui-bootstrap/index.d.ts b/angular-ui-bootstrap/index.d.ts index 7163bef4be..21677a911a 100644 --- a/angular-ui-bootstrap/index.d.ts +++ b/angular-ui-bootstrap/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Angular UI Bootstrap 0.13.3 // Project: https://github.com/angular-ui/bootstrap -// Definitions by: Brian Surowiec +// Definitions by: Brian Surowiec , Ryan Southgate // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -402,6 +402,22 @@ declare module 'angular' { * - `resolve` - An object of the modal resolve values. See [UI Router resolves] for details. */ component?: string; + + /** + * Sets the `aria-describedby` property on the modal. + * The string should be an id (without the leading '#') pointing to the element that describes your modal. + * @type {string} + * @memberOf IModalSettings + */ + ariaDescribedBy?: string; + + /** + * Sets the `aria-labelledby` property on the modal. + * The string should be an id (without the leading '#') pointing to the element that labels your modal. + * @type {string} + * @memberOf IModalSettings + */ + ariaLabelledBy?: string; } interface IModalStackService { diff --git a/angular/index.d.ts b/angular/index.d.ts index d07777d2cf..4b85c4a804 100644 --- a/angular/index.d.ts +++ b/angular/index.d.ts @@ -1205,6 +1205,33 @@ declare namespace angular { debugInfoEnabled(): boolean; debugInfoEnabled(enabled: boolean): ICompileProvider; + + /** + * Sets the number of times $onChanges hooks can trigger new changes before giving up and assuming that the model is unstable. + * Increasing the TTL could have performance implications, so you should not change it without proper justification. + * Default: 10. + * See: https://docs.angularjs.org/api/ng/provider/$compileProvider#onChangesTtl + */ + onChangesTtl(): number; + onChangesTtl(limit: number): ICompileProvider; + + /** + * It indicates to the compiler whether or not directives on comments should be compiled. + * It results in a compilation performance gain since the compiler doesn't have to check comments when looking for directives. + * Defaults to true. + * See: https://docs.angularjs.org/api/ng/provider/$compileProvider#commentDirectivesEnabled + */ + commentDirectivesEnabled(): boolean; + commentDirectivesEnabled(enabled: boolean): ICompileProvider; + + /** + * It indicates to the compiler whether or not directives on element classes should be compiled. + * It results in a compilation performance gain since the compiler doesn't have to check element classes when looking for directives. + * Defaults to true. + * See: https://docs.angularjs.org/api/ng/provider/$compileProvider#cssClassDirectivesEnabled + */ + cssClassDirectivesEnabled(): boolean; + cssClassDirectivesEnabled(enabled: boolean): ICompileProvider; } interface ICloneAttachFunction { diff --git a/braintree-web/index.d.ts b/braintree-web/index.d.ts index d62ec01fd1..a5bd0ccd14 100644 --- a/braintree-web/index.d.ts +++ b/braintree-web/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Braintree-web v3.5.0 +// Type definitions for Braintree-web v3.6.1 // Project: https://github.com/braintree/braintree-web // Definitions by: Guy Shahine // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -427,10 +427,10 @@ declare namespace BraintreeWeb { * Used by other modules to formulate all network requests to the Braintree gateway. It is also capable of being used directly from your own form to tokenize credit card information. However, be sure to satisfy PCI compliance if you use direct card tokenization. * @public * @param {object} options Request options: - * @param {string} options.method HTTP method. i.e. "get" or "post" - * @param {string} options.endpoint Enpoint path. i.e. "payment_methods" + * @param {string} options.method HTTP method, e.g. "get" or "post" + * @param {string} options.endpoint Endpoint path. e.g. "payment_methods" * @param {object} options.data Data to send with the request - * @param {string} [options.timeout=60000] Timeout limit + * @param {number} [options.timeout=60000] Set a timeout (in milliseconds) for the request. * @param {callback} callback The second argument, data, is the returned server data. * @example * Direct Credit Card Tokenization @@ -447,6 +447,10 @@ declare namespace BraintreeWeb { * expirationDate: form['cc-date'].value, * billingAddress: { * postalCode: form['cc-postal'].value + * }, + * options: { + * validate: false + * } * } * } * }; @@ -459,6 +463,7 @@ declare namespace BraintreeWeb { * method: 'post', * data: data * }, function (requestErr, response) { + * // More detailed example of handling API errors: https://codepen.io/braintree/pen/MbwjdM * if (requestErr) { throw new Error(requestErr); } * * console.log('Got nonce:', response.creditCards[0].nonce); @@ -477,6 +482,7 @@ declare namespace BraintreeWeb { /** * @static * @function create + * @description Creates a DataCollector instance. Requires advanced fraud protection to be enabled in the Braintree gateway. Contact our [support team](mailto:support@braintreepayments.com) to configure your Kount ID. * @param {object} options Creation options: * @param {Client} options.client A {@link Client} instance. * @param {boolean} [options.kount] If true, Kount fraud data collection is enabled. @@ -498,7 +504,7 @@ declare namespace BraintreeWeb { * @global * @name DataCollector * @description Do not use this constructor directly. Use {@link module:braintree-web/data-collector.create|braintree-web.data-collector.create} instead. - * @classdesc This class is used for advanced fraud integration with PayPal and Kount. Instances of this class have {@link DataCollector#deviceData|deviceData} which is used to correlate user sessions with server transactions. + * @classdesc This class is used for advanced fraud integration with PayPal and Kount. Instances of this class have {@link DataCollector#deviceData|deviceData} which is used to correlate user sessions with server transactions. Before using DataCollector, make sure you have enabled advanced fraud protection in the Braintree gateway. To use your own Kount ID, contact our support team ([support@braintreepayments.com](mailto:support@braintreepayments.com) or [877.434.2894](tel:877.434.2894)). */ export class DataCollector { /** @@ -740,7 +746,33 @@ declare namespace BraintreeWeb { * * These are the CSS properties that Hosted Fields supports. Any other CSS should be specified on your page and outside of any Braintree configuration. Trying to set unsupported properties will fail and put a warning in the console. * - * `color` `font-family` `font-size-adjust` `font-size` `font-stretch` `font-style` `font-variant-alternates` `font-variant-caps` `font-variant-east-asian` `font-variant-ligatures` `font-variant-numeric` `font-variant` `font-weight` `font` `line-height` `opacity` `outline` `text-shadow` `transition` `-moz-osx-font-smoothing` `-moz-tap-highlight-color` `-moz-transition` `-webkit-font-smoothing` `-webkit-tap-highlight-color` `-webkit-transition` + * Supported CSS properties are: + * `color` + * `font-family` + * `font-size-adjust` + * `font-size` + * `font-stretch` + * `font-style` + * `font-variant-alternates` + * `font-variant-caps` + * `font-variant-east-asian` + * `font-variant-ligatures` + * `font-variant-numeric` + * `font-variant` + * `font-weight` + * `font` + * `letter-spacing` + * `line-height` + * `opacity` + * `outline` + * `text-shadow` + * `transition` + * `-moz-osx-font-smoothing` + * `-moz-tap-highlight-color` + * `-moz-transition` + * `-webkit-font-smoothing` + * `-webkit-tap-highlight-color` + * `-webkit-transition` * @typedef {object} styleOptions */ styleOptions: any; @@ -976,7 +1008,9 @@ declare namespace BraintreeWeb { * @property {string} details.shippingAddress.postalCode Postal code. * @property {string} details.shippingAddress.countryCode 2 character country code (e.g. US). * @property {?object} details.billingAddress User's billing address details. - * You will also need to enable the PayPal Billing Address Request feature in your PayPal account. + * Not available to all merchants; [contact PayPal](https://developers.braintreepayments.com/support/guides/paypal/setup-guide#contacting-paypal-support) for details on eligibility and enabling this feature. + * To enable this feature, [contact PayPal](https://developers.braintreepayments.com/support/guides/paypal/setup-guide#contacting-paypal-support). + * Alternatively, see `shippingAddress` above as an available client opt * To enable this feature, [contact PayPal](https://developers.braintreepayments.com/support/guides/paypal/setup-guide#contacting-paypal-support). * @property {string} details.billingAddress.line1 Street number and name. * @property {string} details.billingAddress.line2 Extended address. @@ -1029,7 +1063,7 @@ declare namespace BraintreeWeb { * @param {Client} options.client A {@link Client} instance. * @param {callback} callback The second argument, `data`, is the {@link PayPal} instance. * @example - * braintree.paypal.create( + * braintree.paypal.create({ * client: clientInstance * }, function (createErr, paypalInstance) { * if (createErr) { @@ -1039,7 +1073,7 @@ declare namespace BraintreeWeb { * console.error('Error!', createErr); * } * } - * } + * }); * @returns {void} */ create: (options: { client: Client }, callback: callback) => void; @@ -1083,7 +1117,33 @@ declare namespace BraintreeWeb { * @param {string|number} [options.amount] The amount of the transaction. Required when using the Checkout flow. * @param {string} [options.currency] The currency code of the amount, such as 'USD'. Required when using the Checkout flow. * @param {string} [options.displayName] The merchant name displayed inside of the PayPal lightbox; defaults to the company name on your Braintree account - * @param {string} [options.locale=en_US] Use this option to change the language, links, and terminology used in the PayPal flow to suit the country and language of your customer. + * @param {string} [options.locale=en_US] Use this option to change the language, links, and terminology used in the PayPal flow. This locale will be used unless the buyer has set a preferred locale for their account. If an unsupported locale is supplied, a fallback locale (determined by buyer preference or browser data) will be used and no error will be thrown. + * + * Supported locales are: + * `da_DK`, + * `de_DE`, + * `en_AU`, + * `en_GB`, + * `en_US`, + * `es_ES`, + * `fr_CA`, + * `fr_FR`, + * `id_ID`, + * `it_IT`, + * `ja_JP`, + * `ko_KR`, + * `nl_NL`, + * `no_NO`, + * `pl_PL`, + * `pt_BR`, + * `pt_PT`, + * `ru_RU`, + * `sv_SE`, + * `th_TH`, + * `zh_CN`, + * `zh_HK`, + * and `zh_TW`. + * * @param {boolean} [options.enableShippingAddress=false] Returns a shipping address object in {@link PayPal#tokenize}. * @param {object} [options.shippingAddressOverride] Allows you to pass a shipping address you have already collected into the PayPal payment flow. * @param {string} options.shippingAddressOverride.line1 Street address. @@ -1603,6 +1663,134 @@ declare namespace BraintreeWeb { public teardown(callback?: callback): void; } + + /** + * @module braintree-web/us-bank-account + * @description This module is for accepting payments of US bank accounts. + */ + export interface USBankAccount { + /** + * @static + * @function create + * @param {object} options Creation options: + * @param {Client} options.client A {@link Client} instance. + * @param {callback} callback The second argument, `data`, is the {@link USBankAccount} instance. + * @returns {void} + */ + create: (options: { client: Client }, callback: callback) => void; + + /** + * @description The current version of the SDK, i.e. `{@pkg version}`. + * @type {string} + */ + VERSION: string; + } + + /** + * @class + * @param {object} options See {@link module:braintree-web/us-bank-account.create|us-bank-account.create}. + * @classdesc This class represents a US Bank Account component. Instances of this class can tokenize raw bank details or present a bank login. You cannot use this constructor directly. Use {@link module:braintree-web/us-bank-account.create|braintree.us-bank-account.create} instead. + */ + export class USBankAccount { + /** + * @class + * @param {object} options See {@link module:braintree-web/us-bank-account.create|us-bank-account.create}. + * @classdesc This class represents a US Bank Account component. Instances of this class can tokenize raw bank details or present a bank login. You cannot use this constructor directly. Use {@link module:braintree-web/us-bank-account.create|braintree.us-bank-account.create} instead. + */ + constructor(options: any) + + + /** + * Tokenizes bank information to return a payment method nonce. You can tokenize bank details by providing information like account and routing numbers. You can also tokenize with a bank login UI that prompts the customer to log into their bank account. + * @public + * @param {object} options All tokenization options for the US Bank Account component. + * @param {string} options.mandateText A string for proof of customer authorization. For example, `'I authorize Braintree to debit my bank account on behalf of My Online Store.'`. + * @param {object} [options.bankDetails] Bank detail information (such as account and routing numbers). `bankDetails` or `bankLogin` option must be provided. + * @param {string} options.bankDetails.routingNumber The customer's bank routing number, such as `'307075259'`. + * @param {string} options.bankDetails.accountNumber The customer's bank account number, such as `'999999999'`. + * @param {string} options.bankDetails.accountType The customer's bank account type. Must be `'checking'` or `'savings'`. + * @param {string} options.bankDetails.accountHolderName The customer's bank account holder name, such as `'Rosetta Fox'`. + * @param {object} options.bankDetails.billingAddress The customer's billing address. + * @param {string} options.bankDetails.billingAddress.streetAddress The street address for the customer's billing address, such as `'123 Fake St'`. + * @param {string} [options.bankDetails.billingAddress.extendedAddress] The extended street address for the customer's billing address, such as `'Apartment B'`. + * @param {string} options.bankDetails.billingAddress.locality The locality for the customer's billing address. This is typically a city, such as `'San Francisco'`. + * @param {string} options.bankDetails.billingAddress.region The region for the customer's billing address. This is typically a state, such as `'CA'`. + * @param {string} options.bankDetails.billingAddress.postalCode The postal code for the customer's billing address. This is typically a ZIP code, such as `'94119'`. + * @param {object} [options.bankLogin] Bank login information. `bankLogin` or `bankDetails` option must be provided. + * @param {string} options.bankLogin.displayName Display name for the bank login UI, such as `'My Store'`. + * @param {callback} callback The second argument, data, is a {@link USBankAccount~tokenizePayload|tokenizePayload}. + * @returns {void} + * @example + * Tokenizing raw bank details + * submitButton.addEventListener('click', function (event) { + * var routingNumberInput = document.querySelector('input#routing-number'); + * var accountNumberInput = document.querySelector('input#account-number'); + * var accountHolderNameInput = document.querySelector('input#account-holder-name'); + * var accountTypeInput = document.querySelector('input[name="account-type"]:checked'); + * var billingAddressStreetInput = document.querySelector('input#street-address'); + * var billingAddressExtendedInput = document.querySelector('input#extended-address'); + * var billingAddressLocalityInput = document.querySelector('input#locality'); + * var billingAddressRegionSelect = document.querySelector('select#region'); + * var billingAddressPostalInput = document.querySelector('input#postal-code'); + * + * event.preventDefault(); + * + * usBankAccountInstance.tokenize({ + * bankDetails: { + * routingNumber: routingNumberInput.value, + * accountNumber: accountNumberInput.value, + * accountHolderName: accountHolderNameInput.value, + * accountType: accountTypeInput.value, + * billingAddress: { + * streetAddress: billingAddressStreetInput.value, + * extendedAddress: billingAddressExtendedInput.value, + * locality: billingAddressLocalityInput.value, + * region: billingAddressRegionSelect.value, + * postalCode: billingAddressPostalInput.value + * } + * }, + * mandateText: 'I authorize Braintree to debit my bank account on behalf of My Online Store.' + * }, function (tokenizeErr, tokenizedPayload) { + * if (tokenizeErr) { + * console.error('There was an error tokenizing the bank details.'); + * return; + * } + * + * // Send tokenizePayload.nonce to your server here! + * }); + * }); + * @example + * Tokenizing with bank login UI + * bankLoginButton.addEventListener('click', function (event) { + * event.preventDefault(); + * + * usBankAccountInstance.tokenize({ + * bankLogin: { + * displayName: 'My Online Store' + * }, + * mandateText: 'I authorize Braintree to debit my bank account on behalf of My Online Store.' + * }, function (tokenizeErr, tokenizedPayload) { + * if (tokenizeErr) { + * console.error('There was an error tokenizing the bank details.'); + * return; + * } + * + * // Send tokenizePayload.nonce to your server here! + * }); + * }); + */ + public tokenize(options: { mandateText: string, bankDetails: any, bankLogin: any }, callback: callback): void; + + /** + * Cleanly tear down anything set up by {@link module:braintree-web/us-bank-account.create|create}. + * @public + * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully. + * @returns {void} + */ + public teardown(callback?: callback): void; + + } + } declare namespace BraintreeError { @@ -1733,6 +1921,9 @@ interface BraintreeStatic { /** @type {module:braintree-web/apple-pay} */ applePay: BraintreeWeb.ApplePay; + /** @type {module:braintree-web/us-bank-account} */ + usBankAccount: BraintreeWeb.USBankAccount; + /** * @description The current version of the SDK, i.e. `3.0.2`. * @type {string} diff --git a/chartist/index.d.ts b/chartist/index.d.ts index ed6c10ac67..f2a74d7c31 100644 --- a/chartist/index.d.ts +++ b/chartist/index.d.ts @@ -423,7 +423,7 @@ declare namespace Chartist { /** * This method will append an element to the current element as a child. */ - append(): IChartistSvg; + append(element: IChartistSvg, insertFirst?: boolean): IChartistSvg; /** * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further. diff --git a/chrome/index.d.ts b/chrome/index.d.ts index ed9e3e9ef2..942c5ef5eb 100644 --- a/chrome/index.d.ts +++ b/chrome/index.d.ts @@ -1617,7 +1617,7 @@ declare namespace chrome.devtools.inspectedWindow { /** Optional. When true, the loader will ignore the cache for all inspected page resources loaded before the load event is fired. The effect is similar to pressing Ctrl+Shift+R in the inspected window or within the Developer Tools window. */ ignoreCache?: boolean; /** Optional. If specified, the script will be injected into every frame of the inspected page immediately upon load, before any of the frame's scripts. The script will not be injected after subsequent reloads—for example, if the user presses Ctrl+R. */ - injectedScript?: boolean; + injectedScript?: string; /** * Optional. * If specified, this script evaluates into a function that accepts three string arguments: the source to preprocess, the URL of the source, and a function name if the source is an DOM event handler. The preprocessorerScript function should return a string to be compiled by Chrome in place of the input source. In the case that the source is a DOM event handler, the returned source must compile to a single JS function. diff --git a/csurf/index.d.ts b/csurf/index.d.ts index 011b10a7f1..53b86392f1 100644 --- a/csurf/index.d.ts +++ b/csurf/index.d.ts @@ -12,7 +12,7 @@ declare namespace Express { } declare module "csurf" { - import express = require('express'); + import express = require('express-serve-static-core'); function csurf(options?: { value?: (req: express.Request) => string; diff --git a/googlemaps/google.maps-tests.ts b/googlemaps/google.maps-tests.ts index e960c8915b..9829a23a1a 100644 --- a/googlemaps/google.maps-tests.ts +++ b/googlemaps/google.maps-tests.ts @@ -153,3 +153,16 @@ function initMap() { map: map }); } + +/***** OverlayView *****/ +var div = document.createElement('div'); +var overlay = new google.maps.OverlayView(); +var panes = overlay.getPanes(); +panes.floatPane.appendChild(div); +panes.floatShadow.appendChild(div); +panes.mapPane.appendChild(div); +panes.markerLayer.appendChild(div); +panes.overlayImage.appendChild(div); +panes.overlayLayer.appendChild(div); +panes.overlayMouseTarget.appendChild(div); +panes.overlayShadow.appendChild(div); diff --git a/googlemaps/index.d.ts b/googlemaps/index.d.ts index 1364536e27..dff5c1cd90 100644 --- a/googlemaps/index.d.ts +++ b/googlemaps/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Google Maps JavaScript API 3.25 // Project: https://developers.google.com/maps/ -// Definitions by: Folia A/S , Chris Wrench +// Definitions by: Folia A/S , Chris Wrench , Kiarash Ghiaseddin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /* @@ -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; @@ -871,10 +871,13 @@ declare namespace google.maps { export interface MapPanes { floatPane: Element; + floatShadow: Element; mapPane: Element; markerLayer: Element; + overlayImage: Element; overlayLayer: Element; overlayMouseTarget: Element; + overlayShadow: Element; } export class MapCanvasProjection extends MVCObject { diff --git a/interact.js/index.d.ts b/interact.js/index.d.ts index 7d17b5ac5d..c9d15a2a5f 100644 --- a/interact.js/index.d.ts +++ b/interact.js/index.d.ts @@ -200,7 +200,7 @@ declare namespace Interact { (element: HTMLElement): Interactable; (element: SVGElement): Interactable; (element: string): Interactable; - (element: string, { context: Element } : { context: Element }): Interactable; + (element: string, options: {context: Element}): Interactable; // returns boolean or {[key: string]: any} autoScroll(): any; autoScroll(options: boolean): InteractStatic; diff --git a/kendo-ui/index.d.ts b/kendo-ui/index.d.ts index 00f11b029e..4a528b706a 100644 --- a/kendo-ui/index.d.ts +++ b/kendo-ui/index.d.ts @@ -8505,7 +8505,7 @@ declare namespace kendo.geometry { round(digits: number): kendo.geometry.Matrix; multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; toArray(digits: number): any; - toString(digits: number, separator: string): string; + toString(digits?: number, separator?: string): string; } @@ -8551,7 +8551,7 @@ declare namespace kendo.geometry { setX(value: number): kendo.geometry.Point; setY(value: number): kendo.geometry.Point; toArray(digits: number): any; - toString(digits: number, separator: string): string; + toString(digits?: number, separator?: string): string; transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; translate(dx: number, dy: number): kendo.geometry.Point; @@ -19212,7 +19212,7 @@ declare namespace kendo.dataviz.geometry { round(digits: number): kendo.geometry.Matrix; multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; toArray(digits: number): any; - toString(digits: number, separator: string): string; + toString(digits?: number, separator?: string): string; } diff --git a/knex/index.d.ts b/knex/index.d.ts index 0b69f64109..95bab7ac69 100644 --- a/knex/index.d.ts +++ b/knex/index.d.ts @@ -453,7 +453,7 @@ declare namespace Knex { client?: string; dialect?: string; connection?: string | ConnectionConfig | MariaSqlConnectionConfig | - Sqlite3ConnectionConfig | SocketConnectionConfig; + MySqlConnectionConfig | Sqlite3ConnectionConfig | SocketConnectionConfig; pool?: PoolConfig; migrations?: MigratorConfig; acquireConnectionTimeout?: number; @@ -501,6 +501,32 @@ declare namespace Knex { rejectUnauthorized?: boolean; } + // Config object for mysql: https://github.com/mysqljs/mysql#connection-options + interface MySqlConnectionConfig { + host?: string; + port?: number; + localAddress?: string; + socketPath?: string; + user?: string; + password?: string; + database?: string; + charset?: string; + timezone?: string; + connectTimeout?: number; + stringifyObjects?: boolean; + insecureAuth?: boolean; + typeCast?: boolean; + queryFormat?: (query: string, values: any) => string; + supportBigNumbers?: boolean; + bigNumberStrings?: boolean; + dateStrings?: boolean; + debug?: boolean; + trace?: boolean; + multipleStatements?: boolean; + flags?: string; + ssl?: string | MariaSslConfiguration; + } + /** Used with SQLite3 adapter */ interface Sqlite3ConnectionConfig { filename: string; diff --git a/knex/knex-tests.ts b/knex/knex-tests.ts index 353c382973..e149612ea9 100644 --- a/knex/knex-tests.ts +++ b/knex/knex-tests.ts @@ -33,6 +33,19 @@ var knex = Knex({ } }); +// Mysql configuration +var knex = Knex({ + debug: true, + client: 'mysql', + connection: { + host : '127.0.0.1', + user : 'your_database_user', + password : 'your_database_password', + db : 'myapp_test', + trace: false + } +}); + // Pooling var knex = Knex({ client: 'mysql', diff --git a/leaflet/index.d.ts b/leaflet/index.d.ts index 1adf9f0b0b..c3a53f60b3 100644 --- a/leaflet/index.d.ts +++ b/leaflet/index.d.ts @@ -43,25 +43,15 @@ declare namespace L { } export interface CRS { - latLngToPoint(latlng: LatLng, zoom: number): Point; - latLngToPoint(latlng: LatLngLiteral, zoom: number): Point; - latLngToPoint(latlng: LatLngTuple, zoom: number): Point; - pointToLatLng(point: Point): LatLng; - pointToLatLng(point: PointTuple): LatLng; - project(latlng: LatLng): Point; - project(latlng: LatLngLiteral): Point; - project(latlng: LatLngTuple): Point; - unproject(point: Point): LatLng; - unproject(point: PointTuple): LatLng; + latLngToPoint(latlng: LatLngExpression, zoom: number): Point; + pointToLatLng(point: PointExpression): LatLng; + project(latlng: LatLngExpression): Point; + unproject(point: PointExpression): LatLng; scale(zoom: number): number; zoom(scale: number): number; getProjectedBounds(zoom: number): Bounds; - distance(latlng1: LatLng, latlng2: LatLng): number; - distance(latlng1: LatLngLiteral, latlng2: LatLngLiteral): number; - distance(latlng1: LatLngTuple, latlng2: LatLngTuple): number; - wrapLatLng(latlng: LatLng): LatLng; - wrapLatLng(latlng: LatLngLiteral): LatLng; - wrapLatLng(latlng: LatLngTuple): LatLng; + distance(latlng1: LatLngExpression, latlng2: LatLngExpression): number; + wrapLatLng(latlng: LatLngExpression): LatLng; code: string; wrapLng: [number, number]; @@ -78,11 +68,8 @@ declare namespace L { } export interface Projection { - project(latlng: LatLng): Point; - project(latlng: LatLngLiteral): Point; - project(latlng: LatLngTuple): Point; - unproject(point: Point): LatLng; - unproject(point: PointTuple): LatLng; + project(latlng: LatLngExpression): Point; + unproject(point: PointExpression): LatLng; bounds: LatLngBounds; } @@ -94,13 +81,9 @@ declare namespace L { } export interface LatLng { - equals(otherLatLng: LatLng, maxMargin?: number): boolean; - equals(otherLatLng: LatLngLiteral, maxMargin?: number): boolean; - equals(otherLatLng: LatLngTuple, maxMargin?: number): boolean; + equals(otherLatLng: LatLngExpression, maxMargin?: number): boolean; toString(): string; - distanceTo(otherLatLng: LatLng): number; - distanceTo(otherLatLng: LatLngLiteral): number; - distanceTo(otherLatLng: LatLngTuple): number; + distanceTo(otherLatLng: LatLngExpression): number; wrap(): LatLng; toBounds(sizeInMeters: number): LatLngBounds; @@ -129,11 +112,8 @@ declare namespace L { export function latLng(coords: {lat: number, lng: number, alt: number}): LatLng; export interface LatLngBounds { - extend(latlng: LatLng): this; - extend(latlng: LatLngLiteral): this; - extend(latlng: LatLngTuple): this; - extend(otherBounds: LatLngBounds): this; - extend(otherBounds: LatLngBoundsLiteral): this; + extend(latlng: LatLngExpression): this; + extend(otherBounds: LatLngBoundsExpression): this; pad(bufferRatio: number): LatLngBounds; // does this modify the current instance or does it return a new one? getCenter(): LatLng; getSouthWest(): LatLng; @@ -144,18 +124,12 @@ declare namespace L { getSouth(): number; getEast(): number; getNorth(): number; - contains(otherBounds: LatLngBounds): boolean; - contains(otherBounds: LatLngBoundsLiteral): boolean; - contains(latlng: LatLng): boolean; - contains(latlng: LatLngLiteral): boolean; - contains(latlng: LatLngTuple): boolean; - intersects(otherBounds: LatLngBounds): boolean; - intersects(otherBounds: LatLngLiteral): boolean; - overlaps(otherBounds: Bounds): boolean; // investigate if this is really bounds and not latlngbounds - overlaps(otherBounds: BoundsLiteral): boolean; + contains(otherBounds: LatLngBoundsExpression): boolean; + contains(latlng: LatLngExpression): boolean; + intersects(otherBounds: LatLngBoundsExpression): boolean; + overlaps(otherBounds: BoundsExpression): boolean; // investigate if this is really bounds and not latlngbounds toBBoxString(): string; - equals(otherBounds: LatLngBounds): boolean; - equals(otherBounds: LatLngBoundsLiteral): boolean; + equals(otherBounds: LatLngBoundsExpression): boolean; isValid(): boolean; } @@ -163,11 +137,7 @@ declare namespace L { type LatLngBoundsExpression = LatLngBounds | LatLngBoundsLiteral; - export function latLngBounds(southWest: LatLng, northEast: LatLng): LatLngBounds; - - export function latLngBounds(southWest: LatLngLiteral, northEast: LatLngLiteral): LatLngBounds; - - export function latLngBounds(southWest: LatLngTuple, northEast: LatLngTuple): LatLngBounds; + export function latLngBounds(southWest: LatLngExpression, northEast: LatLngExpression): LatLngBounds; export function latLngBounds(latlngs: LatLngBoundsLiteral): LatLngBounds; @@ -175,25 +145,18 @@ declare namespace L { export interface Point { clone(): Point; - add(otherPoint: Point): Point; // investigate if this mutates or returns a new instance - add(otherPoint: PointTuple): Point; - subtract(otherPoint: Point): Point; - subtract(otherPoint: PointTuple): Point; + add(otherPoint: PointExpression): Point; // investigate if this mutates or returns a new instance + subtract(otherPoint: PointExpression): Point; divideBy(num: number): Point; multiplyBy(num: number): Point; - scaleBy(scale: Point): Point; - scaleBy(scale: PointTuple): Point; - unscaleBy(scale: Point): Point; - unscaleBy(scale: PointTuple): Point; + scaleBy(scale: PointExpression): Point; + unscaleBy(scale: PointExpression): Point; round(): Point; floor(): Point; ceil(): Point; - distanceTo(otherPoint: Point): Point; - distanceTo(otherPoint: PointTuple): Point; - equals(otherPoint: Point): boolean; - equals(otherPoint: PointTuple): boolean; - contains(otherPoint: Point): boolean; - contains(otherPoint: PointTuple): boolean; + distanceTo(otherPoint: PointExpression): Point; + equals(otherPoint: PointExpression): boolean; + contains(otherPoint: PointExpression): boolean; toString(): string; } @@ -208,20 +171,15 @@ declare namespace L { export type BoundsLiteral = Array; export interface Bounds { - extend(point: Point): this; - extend(point: PointTuple): this; + extend(point: PointExpression): this; getCenter(round?: boolean): Point; getBottomLeft(): Point; getTopRight(): Point; getSize(): Point; - contains(otherBounds: Bounds): boolean; - contains(otherBounds: BoundsLiteral): boolean; - contains(point: Point): boolean; - contains(point: PointTuple): boolean; - intersects(otherBounds: Bounds): boolean; - intersects(otherBounds: BoundsLiteral): boolean; - overlaps(otherBounds: Bounds): boolean; - overlaps(otherBounds: BoundsLiteral): boolean; + contains(otherBounds: BoundsExpression): boolean; + contains(point: PointExpression): boolean; + intersects(otherBounds: BoundsExpression): boolean; + overlaps(otherBounds: BoundsExpression): boolean; min: Point; max: Point; @@ -229,9 +187,7 @@ declare namespace L { type BoundsExpression = Bounds | BoundsLiteral; - export function bounds(topLeft: Point, bottomRight: Point): Bounds; - - export function bounds(topLeft: PointTuple, bottomRight: PointTuple): Bounds; + export function bounds(topLeft: PointExpression, bottomRight: PointExpression): Bounds; export function bounds(points: Array): Bounds; @@ -404,9 +360,7 @@ declare namespace L { bindPopup(content: Popup): this; unbindPopup(): this; openPopup(): this; - openPopup(latlng: LatLng): this; - openPopup(latlng: LatLngLiteral): this; - openPopup(latlng: LatLngTuple): this; + openPopup(latlng: LatLngExpression): this; closePopup(): this; togglePopup(): this; isPopupOpen(): boolean; @@ -422,9 +376,7 @@ declare namespace L { bindTooltip(content: Tooltip, options?: TooltipOptions): this; unbindTooltip(): this; openTooltip(): this; - openTooltip(latlng: LatLng): this; - openTooltip(latlng: LatLngLiteral): this; - openTooltip(latlng: LatLngTuple): this; + openTooltip(latlng: LatLngExpression): this; closeTooltip(): this; toggleTooltip(): this; isTooltipOpen(): boolean; @@ -564,60 +516,34 @@ declare namespace L { interface InternalPolyline extends Path { getLatLngs(): Array; - setLatLngs(latlngs: Array): this; - setLatLngs(latlngs: Array): this; - setLatLngs(latlngs: Array): this; + setLatLngs(latlngs: Array): this; isEmpty(): boolean; getCenter(): LatLng; getBounds(): LatLngBounds; - addLatLng(latlng: LatLng): this; - addLatLng(latlng: LatLngLiteral): this; - addLatLng(latlng: LatLngTuple): this; - addLatLng(latlng: Array): this; // these three overloads aren't explicitly noted in the docs - addLatLng(latlng: Array): this; - addLatLng(latlng: Array): this; + addLatLng(latlng: LatLngExpression): this; + addLatLng(latlng: Array): this; // these three overloads aren't explicitly noted in the docs } export interface Polyline extends InternalPolyline { toGeoJSON(): GeoJSON.LineString | GeoJSON.MultiLineString; } - export function polyline(latlngs: Array, options?: PolylineOptions): Polyline; - - export function polyline(latlngs: Array, options?: PolylineOptions): Polyline; - - export function polyline(latlngs: Array, options?: PolylineOptions): Polyline; - - export function polyline(latlngs: Array>, options?: PolylineOptions): Polyline; - - export function polyline(latlngs: Array>, options?: PolylineOptions): Polyline; - - export function polyline(latlngs: Array>, options?: PolylineOptions): Polyline; + export function polyline(latlngs: Array, options?: PolylineOptions): Polyline; + export function polyline(latlngs: Array>, options?: PolylineOptions): Polyline; export interface Polygon extends InternalPolyline { toGeoJSON(): GeoJSON.Polygon | GeoJSON.MultiPolygon; } - export function polygon(latlngs: Array, options?: PolylineOptions): Polygon; + export function polygon(latlngs: Array, options?: PolylineOptions): Polygon; - export function polygon(latlngs: Array, options?: PolylineOptions): Polygon; - - export function polygon(latlngs: Array, options?: PolylineOptions): Polygon; - - export function polygon(latlngs: Array>, options?: PolylineOptions): Polygon; - - export function polygon(latlngs: Array>, options?: PolylineOptions): Polygon; - - export function polygon(latlngs: Array>, options?: PolylineOptions): Polygon; + export function polygon(latlngs: Array>, options?: PolylineOptions): Polygon; export interface Rectangle extends Polygon { - setBounds(latLngBounds: LatLngBounds): this; - setBounds(latLngBounds: LatLngBoundsLiteral): this; + setBounds(latLngBounds: LatLngBoundsExpression): this; } - export function rectangle(latLngBounds: LatLngBounds, options?: PolylineOptions): Rectangle; - - export function rectangle(latLngBounds: LatLngBoundsLiteral, options?: PolylineOptions): Rectangle; + export function rectangle(latLngBounds: LatLngBoundsExpression, options?: PolylineOptions): Rectangle; export interface CircleMarkerOptions extends PathOptions { radius?: number; @@ -625,19 +551,13 @@ declare namespace L { export interface CircleMarker extends Path { toGeoJSON(): GeoJSON.Point; - setLatLng(latLng: LatLng): this; - setLatLng(latLng: LatLngLiteral): this; - setLatLng(latLng: LatLngTuple): this; + setLatLng(latLng: LatLngExpression): this; getLatLng(): LatLng; setRadius(radius: number): this; getRadius(): number; } - export function circleMarker(latlng: LatLng, options?: CircleMarkerOptions): CircleMarker; - - export function circleMarker(latlng: LatLngLiteral, options?: CircleMarkerOptions): CircleMarker; - - export function circleMarker(latlng: LatLngLiteral, options?: CircleMarkerOptions): CircleMarker; + export function circleMarker(latlng: LatLngExpression, options?: CircleMarkerOptions): CircleMarker; export interface CircleOptions extends PathOptions { radius?: number; @@ -649,17 +569,8 @@ declare namespace L { getBounds(): LatLngBounds; } - export function circle(latlng: LatLng, options?: CircleOptions): Circle; - - export function circle(latlng: LatLngLiteral, options?: CircleOptions): Circle; - - export function circle(latlng: LatLngTuple, options?: CircleOptions): Circle; - - export function circle(latlng: LatLng, radius: number, options?: CircleOptions): Circle; - - export function circle(latlng: LatLngLiteral, radius: number, options?: CircleOptions): Circle; - - export function circle(latlng: LatLngTuple, radius: number, options?: CircleOptions): Circle; + export function circle(latlng: LatLngExpression, options?: CircleOptions): Circle; + export function circle(latlng: LatLngExpression, radius: number, options?: CircleOptions): Circle; export interface RendererOptions extends LayerOptions { padding?: number; @@ -805,7 +716,7 @@ declare namespace L { * } * ``` */ - pointToLayer?: (geoJsonPoint: GeoJSON.Point, latlng: LatLng) => Layer; // should import GeoJSON typings + pointToLayer?: (geoJsonPoint: GeoJSON.Feature, latlng: LatLng) => Layer; // should import GeoJSON typings /** * A Function defining the Path options for styling GeoJSON lines and polygons, @@ -1274,55 +1185,34 @@ declare namespace L { hasLayer(layer: Layer): boolean; eachLayer(fn: (layer: Layer) => void, context?: Object): this; openPopup(popup: Popup): this; - openPopup(content: string, latlng: LatLng, options?: PopupOptions): this; - openPopup(content: string, latlng: LatLngLiteral, options?: PopupOptions): this; - openPopup(content: string, latlng: LatLngTuple, options?: PopupOptions): this; - openPopup(content: HTMLElement, latlng: LatLng, options?: PopupOptions): this; - openPopup(content: HTMLElement, latlng: LatLngLiteral, options?: PopupOptions): this; - openPopup(content: HTMLElement, latlng: LatLngTuple, options?: PopupOptions): this; + openPopup(content: string, latlng: LatLngExpression, options?: PopupOptions): this; + openPopup(content: HTMLElement, latlng: LatLngExpression, options?: PopupOptions): this; closePopup(popup?: Popup): this; openTooltip(tooltip: Tooltip): this; - openTooltip(content: string, latlng: LatLng, options?: TooltipOptions): this; - openTooltip(content: string, latlng: LatLngLiteral, options?: TooltipOptions): this; - openTooltip(content: string, latlng: LatLngTuple, options?: TooltipOptions): this; - openTooltip(content: HTMLElement, latlng: LatLng, options?: TooltipOptions): this; - openTooltip(content: HTMLElement, latlng: LatLngLiteral, options?: TooltipOptions): this; - openTooltip(content: HTMLElement, latlng: LatLngTuple, options?: TooltipOptions): this; + openTooltip(content: string, latlng: LatLngExpression, options?: TooltipOptions): this; + openTooltip(content: HTMLElement, latlng: LatLngExpression, options?: TooltipOptions): this; closeTooltip(tooltip?: Tooltip): this; // Methods for modifying map state - setView(center: LatLng, zoom: number, options?: ZoomPanOptions): this; - setView(center: LatLngLiteral, zoom: number, options?: ZoomPanOptions): this; - setView(center: LatLngTuple, zoom: number, options?: ZoomPanOptions): this; + setView(center: LatLngExpression, zoom: number, options?: ZoomPanOptions): this; setZoom(zoom: number, options: ZoomPanOptions): this; zoomIn(delta?: number, options?: ZoomOptions): this; zoomOut(delta?: number, options?: ZoomOptions): this; - setZoomAround(latlng: LatLng, zoom: number, options: ZoomOptions): this; - setZoomAround(latlng: LatLngLiteral, zoom: number, options: ZoomOptions): this; - setZoomAround(latlng: LatLngTuple, zoom: number, options: ZoomOptions): this; // will the latlng version using tuple take precedence or will the point tuple version? + setZoomAround(latlng: LatLngExpression, zoom: number, options: ZoomOptions): this; setZoomAround(offset: Point, zoom: number, options: ZoomOptions): this; - fitBounds(bounds: LatLngBounds, options: FitBoundsOptions): this; - fitBounds(bounds: LatLngBoundsLiteral, options: FitBoundsOptions): this; + fitBounds(bounds: LatLngBoundsExpression, options: FitBoundsOptions): this; fitWorld(options?: FitBoundsOptions): this; - panTo(latlng: LatLng, options?: PanOptions): this; - panTo(latlng: LatLngLiteral, options?: PanOptions): this; - panTo(latlng: LatLngTuple, options?: PanOptions): this; - panBy(offset: Point): this; - panBy(offset: PointTuple): this; - setMaxBounds(bounds: LatLngBounds): this; - setMaxBounds(bounds: LatLngBoundsLiteral): this; + panTo(latlng: LatLngExpression, options?: PanOptions): this; + panBy(offset: PointExpression): this; + setMaxBounds(bounds: LatLngBoundsExpression): this; setMinZoom(zoom: number): this; setMaxZoom(zoom: number): this; - panInsideBounds(bounds: LatLngBounds, options?: PanOptions): this; - panInsideBounds(bounds: LatLngBoundsLiteral, options?: PanOptions): this; + panInsideBounds(bounds: LatLngBoundsExpression, options?: PanOptions): this; invalidateSize(options: ZoomPanOptions): this; invalidateSize(animate: boolean): this; stop(): this; - flyTo(latlng: LatLng, zoom?: number, options?: ZoomPanOptions): this; - flyTo(latlng: LatLngLiteral, zoom?: number, options?: ZoomPanOptions): this; - flyTo(latlng: LatLngTuple, zoom?: number, options?: ZoomPanOptions): this; - flyToBounds(bounds: LatLngBounds, options?: FitBoundsOptions): this; - flyToBounds(bounds: LatLngBoundsLiteral, options?: FitBoundsOptions): this; + flyTo(latlng: LatLngExpression, zoom?: number, options?: ZoomPanOptions): this; + flyToBounds(bounds: LatLngBoundsExpression, options?: FitBoundsOptions): this; // Other methods addHandler(name: string, HandlerClass: () => Handler): this; // HandlerClass is actually a constructor function, is this the right way? @@ -1340,8 +1230,7 @@ declare namespace L { getBounds(): LatLngBounds; getMinZoom(): number; getMaxZoom(): number; - getBoundsZoom(bounds: LatLngBounds, inside?: boolean): number; - getBoundsZoom(bounds: LatLngBoundsLiteral, inside?: boolean): number; + getBoundsZoom(bounds: LatLngBoundsExpression, inside?: boolean): number; getSize(): Point; getPixelBounds(): Bounds; getPixelOrigin(): Point; @@ -1350,29 +1239,16 @@ declare namespace L { // Conversion methods getZoomScale(toZoom: number, fromZoom: number): number; getScaleZoom(scale: number, fromZoom: number): number; - project(latlng: LatLng, zoom: number): Point; - project(latlng: LatLngLiteral, zoom: number): Point; - project(latlng: LatLngTuple, zoom: number): Point; - unproject(point: Point, zoom: number): LatLng; - unproject(point: PointTuple, zoom: number): LatLng; - layerPointToLatLng(point: Point): LatLng; - layerPointToLatLng(point: PointTuple): LatLng; - latLngToLayerPoint(latlng: LatLng): Point; - latLngToLayerPoint(latlng: LatLngLiteral): Point; - latLngToLayerPoint(latlng: LatLngTuple): Point; - wrapLatLng(latlng: LatLng): LatLng; - wrapLatLng(latlng: LatLngLiteral): LatLng; - wrapLatLng(latlng: LatLngTuple): LatLng; - distance(latlng1: LatLng, latlng2: LatLng): number; - distance(latlng1: LatLngLiteral, latlng2: LatLngLiteral): number; - distance(latlng1: LatLngTuple, latlng2: LatLngTuple): number; - containerPointToLayerPoint(point: Point): Point; - containerPointToLayerPoint(point: PointTuple): Point; - layerPointToContainerPoint(point: Point): Point; + project(latlng: LatLngExpression, zoom: number): Point; + unproject(point: PointExpression, zoom: number): LatLng; + layerPointToLatLng(point: PointExpression): LatLng; + latLngToLayerPoint(latlng: LatLngExpression): Point; + wrapLatLng(latlng: LatLngExpression): LatLng; + distance(latlng1: LatLngExpression, latlng2: LatLngExpression): number; + containerPointToLayerPoint(point: PointExpression): Point; + layerPointToContainerPoint(point: PointExpression): Point; layerPointToContainerPoint(point: PointTuple): Point; - latLngToContainerPoint(latlng: LatLng): Point; - latLngToContainerPoint(latlng: LatLngLiteral): Point; - latLngToContainerPoint(latlng: LatLngTuple): Point; + latLngToContainerPoint(latlng: LatLngExpression): Point; mouseEventToContainerPoint(ev: MouseEvent): Point; mouseEventToLayerPoint(ev: MouseEvent): Point; mouseEventToLatLng(ev: MouseEvent): LatLng; @@ -1450,9 +1326,7 @@ declare namespace L { export interface Marker extends Layer { getLatLng(): LatLng; - setLatLng(latlng: LatLng): this; - setLatLng(latlng: LatLngLiteral): this; - setLatLng(latlng: LatLngTuple): this; + setLatLng(latlng: LatLngExpression): this; setZIndexOffset(offset: number): this; setIcon(icon: Icon): this; setOpacity(opacity: number): this; @@ -1461,11 +1335,7 @@ declare namespace L { dragging: Handler; } - export function marker(latlng: LatLng, options?: MarkerOptions): Marker; - - export function marker(latlng: LatLngLiteral, options?: MarkerOptions): Marker; - - export function marker(latlng: LatLngTuple, options?: MarkerOptions): Marker; + export function marker(latlng: LatLngExpression, options?: MarkerOptions): Marker; export namespace Browser { export const ie: boolean; diff --git a/less/index.d.ts b/less/index.d.ts index f8389d3d9b..354a342bf9 100644 --- a/less/index.d.ts +++ b/less/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for LESS // Project: http://lesscss.org/ -// Definitions by: Tom Hasner +// Definitions by: Tom Hasner , Pranay Prakash // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Less { @@ -40,11 +40,11 @@ declare namespace Less { } interface SourceMapOption { - sourceMapURL: string; - sourceMapBasepath: string; - sourceMapRootpath: string; - outputSourceFiles: boolean; - sourceMapFileInline: boolean; + sourceMapURL?: string; + sourceMapBasepath?: string; + sourceMapRootpath?: string; + outputSourceFiles?: boolean; + sourceMapFileInline?: boolean; } interface StaticOptions { @@ -55,7 +55,7 @@ declare namespace Less { interface Options { sourceMap?: SourceMapOption; filename?: string; - plugins: Plugin[]; + plugins?: Plugin[]; rootFileInfo?: RootFileInfo; } diff --git a/material-ui/index.d.ts b/material-ui/index.d.ts index f81eb04b10..fd586cf2f7 100644 --- a/material-ui/index.d.ts +++ b/material-ui/index.d.ts @@ -998,7 +998,7 @@ declare namespace __MaterialUI { namespace GridList { interface GridListProps { - cellHeight?: number; + cellHeight?: number|'auto'; cols?: number; padding?: number; style?: React.CSSProperties; diff --git a/matter-js/index.d.ts b/matter-js/index.d.ts index 2ecf70d680..36e948a5c1 100644 --- a/matter-js/index.d.ts +++ b/matter-js/index.d.ts @@ -2923,10 +2923,14 @@ declare namespace Matter { } interface IWorldDefinition extends ICompositeDefinition { - gravity?: Vector; + gravity?: Gravity; bounds?: Bounds; } + interface Gravity extends Vector { + scale: number; + } + /** * The `Matter.World` module contains methods for creating and manipulating the world composite. * A `Matter.World` is a `Matter.Composite` body, which is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`. @@ -2993,7 +2997,7 @@ declare namespace Matter { */ static create(options: IWorldDefinition): World; - gravity: Vector; + gravity: Gravity; bounds: Bounds; } diff --git a/moment-timezone/index.d.ts b/moment-timezone/index.d.ts index 6d45938c18..991af87fea 100644 --- a/moment-timezone/index.d.ts +++ b/moment-timezone/index.d.ts @@ -60,8 +60,8 @@ declare module "moment" { interface Moment { tz(): string; tz(timezone: string): Moment; - zoneAbbr() :Moment; - zoneName() :Moment; + zoneAbbr(): string; + zoneName(): string; } const tz: MomentTimezone.MomentTimezone; diff --git a/moment-timezone/moment-timezone-tests.ts b/moment-timezone/moment-timezone-tests.ts index fa85c8010a..2d728fc70e 100644 --- a/moment-timezone/moment-timezone-tests.ts +++ b/moment-timezone/moment-timezone-tests.ts @@ -80,7 +80,7 @@ moment.tz.setDefault('America/Los_Angeles'); moment.tz.guess(); -moment.tz('America/Los_Angeles').zoneAbbr(); +var zoneAbbr: string = moment.tz('America/Los_Angeles').zoneAbbr(); -moment.tz('America/Los_Angeles').zoneName(); +var zoneName: string = moment.tz('America/Los_Angeles').zoneName(); diff --git a/mongoose/mongoose-tests.ts b/mongoose/mongoose-tests.ts index 28785d301e..95badddedd 100644 --- a/mongoose/mongoose-tests.ts +++ b/mongoose/mongoose-tests.ts @@ -266,7 +266,7 @@ schema.plugin(function (schema, opts) { schema.get('path'); opts.hasOwnProperty(''); }).plugin(cb, {opts: true}); -import { Schema, Model, Document, NativeError } from 'mongoose'; + schema .post('save', function (error, doc, next) { error.stack; diff --git a/nconf/index.d.ts b/nconf/index.d.ts index 8d6e49021d..3a9a06edb4 100644 --- a/nconf/index.d.ts +++ b/nconf/index.d.ts @@ -32,6 +32,7 @@ export declare function defaults(options?: IOptions): Provider; export declare function init(options?: IOptions): void; export declare function overrides(options?: IOptions): Provider; export declare function remove(name: string): void; +export declare function required(keys: string[]): boolean; export declare function create(name: string, options: IOptions): IStore; export declare function key(...values: any[]): string; @@ -95,6 +96,7 @@ export declare class Provider { init(options?: IOptions): void; overrides(options?: IOptions): Provider; remove(name: string): void; + required(keys: string[]): boolean; create(name: string, options: IOptions): IStore; } diff --git a/nconf/nconf-tests.ts b/nconf/nconf-tests.ts index e7a18d68a8..382407e6eb 100644 --- a/nconf/nconf-tests.ts +++ b/nconf/nconf-tests.ts @@ -56,6 +56,7 @@ nconf.init(opts); p = nconf.overrides(); p = nconf.overrides(opts); nconf.remove(str); +bool = nconf.required(strArr); store = nconf.create(str, opts); str = nconf.key(value, value); @@ -117,6 +118,7 @@ p = p.defaults(opts); p.init(opts); p = p.overrides(opts); p.remove(str); +bool = p.required(strArr); store = p.create(str, opts); // - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ng-dialog/index.d.ts b/ng-dialog/index.d.ts index f38757afbf..f165f31225 100644 --- a/ng-dialog/index.d.ts +++ b/ng-dialog/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ngDialog +// Type definitions for ngDialog 0.6 // Project: https://github.com/likeastore/ngDialog // Definitions by: Stephen Lautier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -228,6 +228,11 @@ declare module 'angular' { * Specifies the width of the dialog content element. Default value is null (unspecified) */ width?: string|number; + + /** + * Specifies the height of the dialog content element. Default value is null (unspecified) + */ + height?: string|number; } /** diff --git a/nouislider/index.d.ts b/nouislider/index.d.ts index 8b75146011..9662de4204 100644 --- a/nouislider/index.d.ts +++ b/nouislider/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for nouislider v8.0.2 +// Type definitions for nouislider v9.0.0 // Project: https://github.com/leongersen/noUiSlider -// Definitions by: Patrick Davies +// Definitions by: Patrick Davies , Guust Nieuwenhuis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -25,12 +25,12 @@ declare namespace noUiSlider { */ range: Object; /** - * noUiSlider offers several ways to handle user interaction. - * The range can be set to drag, and handles can move to taps. - * All these effects are optional, and can be enable by adding their keyword to the behaviour option. - * This option accepts a "-" separated list of "drag", "tap", "fixed", "snap" or "none". + * The connect setting can be used to control the (green) bar between the handles, or the edges of the slider. + * Pass an array with a boolean for every connecting element, including the edges of the slider. + * The length of this array must match the handle count + 1. + * Setting true sets the bars between the handles, but not between the handles and the sliders edges. */ - connect?: string | boolean; + connect?: boolean | boolean[]; /** * When using two handles, the minimum distance between the handles can be set using the margin option. * The margin value is relative to the value set in 'range'. @@ -54,17 +54,32 @@ declare namespace noUiSlider { * Set dimensions! Vertical sliders don't assume a default height, so you'll need to set one. * You can use any unit you want, including % or px. */ - orientation?: string; + orientation?: string; // "vertical" | "horizontal" /** * By default the sliders are top-to-bottom and left-to-right, * but you can change this using the direction option, * which decides where the upper side of the slider is. */ - direction?: string; + direction?: string; // "ltr" | "rtl" + /** + * noUiSlider can provide a basic tooltip without using its events system. + * Set the tooltips option to true to enable. + * This option can also accept formatting options to format the tooltips content. + * In that case, pass an array with a formatter for each handle, true to use the default or false to display no tooltip. + */ + tooltips?: boolean | Object | ((...args:any[]) => any); /** * Set the animate option to false to prevent the slider from animating to a new value with when calling .val(). */ animate?: boolean; + /** + * The animationDuration option can be used to set the animation speed assumed by the slider library. In addition to this, you must manually set the CSS (-webkit-)transition property for the .noUi-state-tap .noUi-origin selector. + */ + animationDuration?: number; + /** + * When a non-linear slider has been configured, the snap option can be set to true to force the slider to jump between the specified values. + */ + snap?: boolean; /** * All values on the slider are part of a range. The range has a minimum and maximum value. */ @@ -116,7 +131,7 @@ declare namespace noUiSlider { * format for step mode * see noUiSlider format */ - format?: Object; + format?: Object | ((...args:any[]) => any); /** * * values for positions and values mode @@ -171,6 +186,10 @@ declare namespace noUiSlider { * if you want to leave a handle unchanged. */ set(value: number | number[]): void; + /* + * To return to the initial slider values, you can use the .reset() method. This will only reset the slider values. + */ + reset(): void; } interface Instance extends HTMLElement { diff --git a/nouislider/nouislider-8.0.2.d.ts b/nouislider/nouislider-8.0.2.d.ts new file mode 100644 index 0000000000..b3bd58c727 --- /dev/null +++ b/nouislider/nouislider-8.0.2.d.ts @@ -0,0 +1,180 @@ +// Type definitions for nouislider v8.0.2 +// Project: https://github.com/leongersen/noUiSlider +// Definitions by: Patrick Davies +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +declare namespace noUiSlider { + /** + * To create a slider, call noUiSlider.create() with an element and your options. + */ + function create(target: HTMLElement, options: Options): void; + + interface Options { + /** + * The start option sets the number of handles and their start positions, relative to range. + */ + start: number | number[] | number[][]; + /** + * The connect setting can be used to control the bar between the handles, + * or the edges of the slider. Use "lower" to connect to the lower side, + * or "upper" to connect to the upper side. Setting true sets the bar between the handles. + */ + range: Object; + /** + * noUiSlider offers several ways to handle user interaction. + * The range can be set to drag, and handles can move to taps. + * All these effects are optional, and can be enable by adding their keyword to the behaviour option. + * This option accepts a "-" separated list of "drag", "tap", "fixed", "snap" or "none". + */ + connect?: string | boolean; + /** + * When using two handles, the minimum distance between the handles can be set using the margin option. + * The margin value is relative to the value set in 'range'. + * This option is only available on standard linear sliders. + */ + margin?: number; + /** + * The limit option is the oposite of the margin option, + * limiting the maximum distance between two handles. + * As with the margin option, the limit option can only be used on linear sliders. + */ + limit?: number; + /** + * By default, the slider slides fluently. + * In order to make the handles jump between intervals, you can use this option. + * The step option is relative to the values provided to range. + */ + step?: number; + /** + * The orientation setting can be used to set the slider to "vertical" or "horizontal". + * Set dimensions! Vertical sliders don't assume a default height, so you'll need to set one. + * You can use any unit you want, including % or px. + */ + orientation?: string; + /** + * By default the sliders are top-to-bottom and left-to-right, + * but you can change this using the direction option, + * which decides where the upper side of the slider is. + */ + direction?: string; + /** + * Set the animate option to false to prevent the slider from animating to a new value with when calling .val(). + */ + animate?: boolean; + /** + * All values on the slider are part of a range. The range has a minimum and maximum value. + */ + behaviour?: string; + /** + * To format the slider output, noUiSlider offers a format option. + * Simply specify to and from functions to encode and decode the values. + * See manual formatting to the right for usage information. + * By default, noUiSlider will format output with 2 decimals. + */ + format?: Object | ((...args:any[]) => any); + + /** + * Allows you to generate points along the slider. + */ + pips?: PipsOptions; + } + + interface PipsOptions { + /** + * The 'range' mode uses the slider range to determine where the pips should be. A pip is generated for every percentage specified. + * + * The 'steps', like 'range', uses the slider range. In steps mode, a pip is generated for every step. + * The 'filter' option can be used to filter the generated pips from the 'steps' options' + * The filter function must return 0 (no value), 1 (large value) or 2 (small value). + * + * In 'positions' mode, pips are generated at percentage-based positions on the slider. + * Optionally, the stepped option can be set to true to match the pips to the slider steps. + * + * The 'count' mode can be used to generate a fixed number of pips. As with positions mode, the stepped option can be used. + * + * The 'values' mode is similar to positions, but it accepts values instead of percentages. The stepped option can be used for this mode. + * + */ + mode: string; // "range" | "steps" | "positions" | "count" | "values" + /** + * Range Mode: percentage for range mode + * Step Mode: step number for steps + * Positions Mode: percentage-based positions on the slider + * Count Mode: positions between pips + */ + density?: number; + /** + * Step Mode: The filter option can be used to filter the generated pips. + * The filter function must return 0 (no value), 1 (large value) or 2 (small value). + */ + filter?: (...args: any[]) => PipFilterResult; + /** + * format for step mode + * see noUiSlider format + */ + format?: Object; + /** + * + * values for positions and values mode + * number pips for count mode + */ + values?: number | number[]; + /** + * stepped option for positions, values and count mode + */ + stepped?: boolean; + } + + const enum PipFilterResult { + NoValue, + LargeValue, + SmallValue, + } + + interface Callback { + /** + * Array for both one-handle and two-handle sliders. It contains the current slider values, + * with formatting applied. + */ + (values: any[], handle: number, unencoded: number): void + } + + + interface noUiSlider { + /** + * Bind event to the slider. + */ + on(eventName: string, callback: Callback): void; + /** + * Unbind event to the slider. + */ + off(eventName: string): void; + /** + * Destroy's the slider. + */ + destroy(): void; + + /** + * To get the current slider value. For one-handle sliders, calling .get() will return the value. + * For two-handle sliders, an array[value, value] will be returned. + */ + get(): number | number[]; + /** + * noUiSlider will keep your values within the slider range, which saves you a bunch of validation. + * If you have configured the slider to use one handle, you can change the current value by passing + * a number to the .set() method. If you have two handles, pass an array. One-handled sliders + * will also accept arrays. Within an array, you can set one position to null + * if you want to leave a handle unchanged. + */ + set(value: number | number[]): void; + } + + interface Instance extends HTMLElement { + noUiSlider: noUiSlider + } +} + +declare module "nouislider" { + export = noUiSlider; +} diff --git a/nouislider/nouislider-tests-8.0.2.ts b/nouislider/nouislider-tests-8.0.2.ts new file mode 100644 index 0000000000..2739e609ce --- /dev/null +++ b/nouislider/nouislider-tests-8.0.2.ts @@ -0,0 +1,88 @@ +/// + +var testHtmlElement = document.getElementById('test'); + +/** + * Basic + */ +noUiSlider.create(testHtmlElement, { + start: 80, + range: { + 'min': 0, + 'max': 10000 + } +}); + +/** + * All options + */ +noUiSlider.create(testHtmlElement, { + start: [ 20, 80 ], + step: 10, + margin: 20, + connect: true, + direction: 'rtl', + orientation: 'vertical', + + // Configure tapping, or make the selected range dragable. + behaviour: 'tap-drag', + + // Full number format support. + format: wNumb({ + mark: ',', + decimals: 1 + }), + + // Support for non-linear ranges by adding intervals. + range: { + 'min': 0, + 'max': 100 + } +}); + +/** + * Pips + */ +noUiSlider.create(testHtmlElement, { + start: 0, + range: { + min: 0, + max: 10 + }, + pips: { + mode: 'steps', + density: 3, + filter: function () { return 1 }, + format: wNumb({ + decimals: 2, + prefix: '$' + }), + } +}); + +/** + * Functions + * Need to cast the HTMLElement as noUiSlider.Instance. + */ +// Get value +(testHtmlElement).noUiSlider.get(); + +// Set one value +(testHtmlElement).noUiSlider.set(10); +(testHtmlElement).noUiSlider.set([150]); + +// Set the upper handle, +// don't change the lower one. +(testHtmlElement).noUiSlider.set([null, 14]); + +// Set both slider handles +(testHtmlElement).noUiSlider.set([13.2, 15.7]); + +// Events +var callback: noUiSlider.Callback = (values, handle, unencoded) => {}; +(testHtmlElement).noUiSlider.on('event', callback); + +(testHtmlElement).noUiSlider.off('event'); + +(testHtmlElement).noUiSlider.destroy(); + diff --git a/nouislider/nouislider-tests.ts b/nouislider/nouislider-tests.ts index 9588797fcf..a1428a3bcc 100644 --- a/nouislider/nouislider-tests.ts +++ b/nouislider/nouislider-tests.ts @@ -41,7 +41,291 @@ noUiSlider.create(testHtmlElement, { }); /** - * Pips + * Start + */ +noUiSlider.create(testHtmlElement, { + start: [20, 80], + range: { + 'min': [ 0 ], + 'max': [ 100 ] + } +}); + +/** + * Handles + */ +noUiSlider.create(testHtmlElement, { + start: [ 4000, 8000 ], + range: { + 'min': [ 2000 ], + 'max': [ 10000 ] + } +}); + +/** + * More than two handles + */ +noUiSlider.create(testHtmlElement, { + start: [ 4000, 8000, 12000, 16000 ], + connect: [false, true, true, false, true], + range: { + 'min': [ 2000 ], + 'max': [ 20000 ] + } +}); + +/** + * Range + */ +noUiSlider.create(testHtmlElement, { + start: [ 4000 ], + range: { + 'min': [ 2000 ], + 'max': [ 10000 ] + } +}); + +/** + * Stepping and snapping to values + */ +noUiSlider.create(testHtmlElement, { + start: [ 4000 ], + step: 1000, + range: { + 'min': [ 2000 ], + 'max': [ 10000 ] + } +}); + +/** + * Non-linear sliders + */ +noUiSlider.create(testHtmlElement, { + start: [ 4000 ], + range: { + 'min': [ 2000 ], + '30%': [ 4000 ], + '70%': [ 8000 ], + 'max': [ 10000 ] + } +}); + +/** + * Stepping in non-linear sliders + */ +noUiSlider.create(testHtmlElement, { + start: [ 500, 4000 ], + range: { + 'min': [ 0 ], + '10%': [ 500, 500 ], + '50%': [ 4000, 1000 ], + 'max': [ 10000 ] + } +}); + +/** + * Snapping between steps + */ +noUiSlider.create(testHtmlElement, { + start: [ 0, 500 ], + snap: true, + connect: true, + range: { + 'min': 0, + '10%': 50, + '20%': 100, + '30%': 150, + '40%': 500, + '50%': 800, + 'max': 1000 + } +}); + +/** + * Connect + */ +noUiSlider.create(testHtmlElement, { + start: 40, + connect: [true, false], + range: { + 'min': 0, + 'max': 100 + } +}); +noUiSlider.create(testHtmlElement, { + start: [20, 40, 60], + connect: [true, false, true, true], + range: { + 'min': 0, + 'max': 80 + } +}); + +/** + * Margin + */ +noUiSlider.create(testHtmlElement, { + start: [ 20, 80 ], + margin: 30, + range: { + 'min': 0, + 'max': 100 + } +}); + +/** + * Limit + */ +noUiSlider.create(testHtmlElement, { + start: [ 10, 120 ], + limit: 40, + behaviour: 'drag', + connect: true, + range: { + 'min': 0, + 'max': 100 + } +}); + +/** + * Steps + */ +noUiSlider.create(testHtmlElement, { + start: [ 20, 80 ], + step: 10, + range: { + 'min': 0, + 'max': 100 + } +}); + +/** + * Orientation + */ +noUiSlider.create(testHtmlElement, { + start: 40, + orientation: 'vertical', + range: { + 'min': 0, + 'max': 100 + } +}); + +/** + * Direction + */ +noUiSlider.create(testHtmlElement, { + start: 20, + direction: 'rtl', + range: { + 'min': 0, + 'max': 100 + } +}); + +/** + * Tooltips + */ +noUiSlider.create(testHtmlElement, { + start: [20, 80, 120], + range: { + 'min': 0, + 'max': 200 + }, + tooltips: [ false, wNumb({ decimals: 1 }), true ] +}); + +/** + * Animate + */ +noUiSlider.create(testHtmlElement, { + animate: true, + animationDuration: 300, + start: 20, + range: { + min: 0, + max: 100 + } +}); +noUiSlider.create(testHtmlElement, { + animate: false, + start: 20, + range: { + min: 0, + max: 100 + } + }); + +/** + * Behaviour + */ +noUiSlider.create(testHtmlElement, { + start: [ 20, 40 ], + step: 10, + behaviour: 'drag', + connect: true, + range: { + 'min': 20, + 'max': 80 + } + }); +noUiSlider.create(testHtmlElement, { + start: 40, + behaviour: 'tap', + connect: [false, true], + range: { + 'min': 20, + 'max': 80 + } +}); +noUiSlider.create(testHtmlElement, { + start: [ 40, 60 ], + behaviour: 'drag', + connect: true, + range: { + 'min': 20, + 'max': 80 + } +}); +noUiSlider.create(testHtmlElement, { + start: [ 40, 60 ], + behaviour: 'drag-fixed', + connect: true, + range: { + 'min': 20, + 'max': 80 + } +}); +noUiSlider.create(testHtmlElement, { + start: 40, + behaviour: 'snap', + connect: [true, false], + range: { + 'min': 20, + 'max': 80 + } +}); +noUiSlider.create(testHtmlElement, { + start: 20, + behaviour: 'hover-snap', + direction: 'rtl', + range: { + 'min': 0, + 'max': 10 + } +}); +noUiSlider.create(testHtmlElement, { + start: [ 40, 60 ], + behaviour: 'drag-tap', + connect: true, + range: { + 'min': 20, + 'max': 80 + } +}); + +/** + * Pips: range */ noUiSlider.create(testHtmlElement, { start: 0, @@ -59,6 +343,137 @@ noUiSlider.create(testHtmlElement, { }), } }); +var range_all_sliders = { + 'min': [ 0 ], + '10%': [ 500, 500 ], + '50%': [ 4000, 1000 ], + 'max': [ 10000 ] +}; +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + pips: { + mode: 'range', + density: 3 + } +}) +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + direction: 'rtl', + pips: { + mode: 'range', + density: 3 + } +}); +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + orientation: 'vertical', + pips: { + mode: 'range', + density: 3 + } +}); +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + orientation: 'vertical', + direction: 'rtl', + pips: { + mode: 'range', + density: 3 + } +}); + +/** + * Pipes: Steps + */ +function filter500( value: any, type: any ){ + return value % 1000 ? 2 : 1; +} +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + pips: { + mode: 'steps', + density: 3, + filter: filter500, + format: wNumb({ + decimals: 2, + prefix: '$' + }) + } +}); + +/** + * Pipes: Positions + */ +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + pips: { + mode: 'positions', + values: [0,25,50,75,100], + density: 4 + } +}); +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + pips: { + mode: 'positions', + values: [0,25,50,75,100], + density: 4, + stepped: true + } +}); + +/** + * Pipes: Count + */ +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + pips: { + mode: 'count', + values: 6, + density: 4 + } +}); +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + pips: { + mode: 'count', + values: 6, + density: 4, + stepped: true + } +}); + +/** + * Pipes: Values + */ +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + pips: { + mode: 'values', + values: [50, 552, 2251, 3200, 5000, 7080, 9000], + density: 4 + } +}); +noUiSlider.create(testHtmlElement, { + range: range_all_sliders, + start: 0, + pips: { + mode: 'values', + values: [50, 552, 4651, 4952, 5000, 7080, 9000], + density: 4, + stepped: true + } +}); /** * Functions @@ -78,6 +493,9 @@ noUiSlider.create(testHtmlElement, { // Set both slider handles (testHtmlElement).noUiSlider.set([13.2, 15.7]); +// Set both slider handles +(testHtmlElement).noUiSlider.reset(); + // Events var callback: noUiSlider.Callback = (values, handle, unencoded) => {}; (testHtmlElement).noUiSlider.on('event', callback); diff --git a/openlayers/index.d.ts b/openlayers/index.d.ts index a48e26071b..e52407f450 100644 --- a/openlayers/index.d.ts +++ b/openlayers/index.d.ts @@ -827,7 +827,7 @@ declare module ol { * `'nautical'`, `'metric'`, `'us'`. * @enum {string} */ - type Units = string; + type Units = "degrees" | "imperial" | "nautical" | "metric" | "us"; } /** @@ -2535,7 +2535,7 @@ declare module ol { * IGC altitude/z. One of 'barometric', 'gps', 'none'. * @enum {string} */ - type IGCZ = string; + type IGCZ = "barometric" | "gps" | "none"; /** * @classdesc @@ -3608,7 +3608,7 @@ declare module ol { * `'GeometryCollection'`, `'Circle'`. * @enum {string} */ - type GeometryType = string; + type GeometryType = "Point" | "LineString" | "LinearRing" | "Polygon" | "MultiPoint" | "MultiLineString" | "MultiPolygon" | "GeometryCollection" | "Circle"; /** * The coordinate layout for geometries, indicating whether a 3rd or 4th z ('Z') @@ -3616,7 +3616,7 @@ declare module ol { * `'XYZ'`, `'XYM'`, `'XYZM'`. * @enum {string} */ - type GeometryLayout = string; + type GeometryLayout = "XY" | "XYZ" | "XYM" | "XYZM"; /** * @classdesc @@ -6417,7 +6417,7 @@ declare module ol { * even during animations, but slower performance than the other options. * @api */ - type VectorTileRenderType = string; + type VectorTileRenderType = "image" | "hybrid" | "vector"; /** * @classdesc @@ -7386,7 +7386,7 @@ declare module ol { * `'top-center'`, `'top-right'` * @enum {string} */ - type OverlayPositioning = string; + type OverlayPositioning = "bottom-left" | "bottom-center" | "bottom-right" | "center-left" | "center-center" | "center-right" | "top-left" | "top-center" | "top-right"; /** * @classdesc @@ -7608,7 +7608,7 @@ declare module ol { * `'us-ft'`. * @enum {string} */ - type Units = string; + type Units = "degress" | "ft" | "m" | "pixels" | "tile-pixels" | "us-ft"; /** * Meters per unit lookup table. @@ -8170,13 +8170,13 @@ declare module ol { * Available renderers: `'canvas'`, `'dom'` or `'webgl'`. * @enum {string} */ - type RendererType = string; + type RendererType = "canvas" | "dom" | "webgl"; /** * Raster operation type. Supported values are `'pixel'` and `'image'`. * @enum {string} */ - type RasterOperationType = string; + type RasterOperationType = "pixel" | "image"; /** * @namespace ol.source @@ -8825,7 +8825,7 @@ declare module ol { * State of the source, one of 'undefined', 'loading', 'ready' or 'error'. * @enum {string} */ - type State = string; + type State = "undefined" | "loading" | "ready" | "error"; /** * @classdesc @@ -9606,7 +9606,7 @@ declare module ol { * specification that OpenLayers can make use of. * @enum {string} */ - type ServerType = string; + type ServerType = "carmentaserver" | "geoserver" | "mapserver" | "qgis"; } @@ -9614,7 +9614,7 @@ declare module ol { * Request encoding. One of 'KVP', 'REST'. * @enum {string} */ - type WMTSRequestEncoding = string; + type WMTSRequestEncoding = "KVP" | "REST"; /** * @classdesc @@ -10071,13 +10071,13 @@ declare module ol { * Icon anchor units. One of 'fraction', 'pixels'. * @enum {string} */ - type IconAnchorUnits = string; + type IconAnchorUnits = "fraction" | "pixels"; /** * Icon origin. One of 'bottom-left', 'bottom-right', 'top-left', 'top-right'. * @enum {string} */ - type IconOrigin = string; + type IconOrigin = "bottom-left" | "bottom-right" | "top-left" | "top-right"; /** * @classdesc diff --git a/parsimmon/index.d.ts b/parsimmon/index.d.ts index 6e137af26c..f9512a2429 100644 --- a/parsimmon/index.d.ts +++ b/parsimmon/index.d.ts @@ -1,13 +1,46 @@ -// Type definitions for Parsimmon 0.9.2 +// Type definitions for Parsimmon 1.0.0 // Project: https://github.com/jneen/parsimmon // Definitions by: Bart van der Schoor , Mizunashi Mana , Boris Cherny , Benny van Reeven // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TODO convert to generics +/** + * **NOTE:** You probably will never need to use this function. Most parsing + * can be accomplished using `Parsimmon.regexp` and combination with + * `Parsimmon.seq` and `Parsimmon.alt`. + * + * You can add a primitive parser (similar to the included ones) by using + * `Parsimmon(fn)`. This is an example of how to create a parser that matches + * any character except the one provided: + * + * ```javascript + * function notChar(char) { + * return Parsimmon(function(input, i) { + * if (input.charAt(i) !== char) { + * return Parsimmon.makeSuccess(i + 1, input.charAt(i)); + * } + * return Parsimmon.makeFailure(i, 'anything different than "' + char + '"'); + * }); + * } + * ``` + * + * This parser can then be used and composed the same way all the existing + * ones are used and composed, for example: + * + * ```javascript + * var parser = + * Parsimmon.seq( + * Parsimmon.string('a'), + * notChar('b').times(5) + * ); + * parser.parse('accccc'); + * //=> {status: true, value: ['a', ['c', 'c', 'c', 'c', 'c']]} + * ``` + */ +declare function Parsimmon(fn: (input: string, i: number) => Parsimmon.Result): Parsimmon.Parser; declare namespace Parsimmon { - export type StreamType = string; export interface Index { @@ -38,6 +71,12 @@ declare namespace Parsimmon { */ parse(input: string): Result; /** + * Like parser.parse(input) but either returns the parsed value or throws + * an error on failure. The error object contains additional properties + * about the error. + */ + tryParse(input: string): T; + /** * returns a new parser which tries parser, and if it fails uses otherParser. */ or(otherParser: Parser): Parser; @@ -102,6 +141,25 @@ declare namespace Parsimmon { } /** + * Alias of `Parsimmon(fn)` for backwards compatibility. + */ + export function Parser(fn: (input: string, i: number) => Parsimmon.Result): Parser; + + /** + * To be used inside of Parsimmon(fn). Generates an object describing how + * far the successful parse went (index), and what value it created doing + * so. See documentation for Parsimmon(fn). + */ + export function makeSuccess(index: number, value: T): Result; + + /** + * To be used inside of Parsimmon(fn). Generates an object describing how + * far the unsuccessful parse went (index), and what kind of syntax it + * expected to see (expectation). See documentation for Parsimmon(fn). + */ + export function makeFailure(furthest: number, expectation: string): Result; + + /** * Returns true if obj is a Parsimmon parser, otherwise false. */ export function isParser(obj: any): boolean; @@ -193,12 +251,12 @@ declare namespace Parsimmon { /** * Accepts two parsers, and expects zero or more matches for content, separated by separator, yielding an array. */ - export function sepBy(content: Parser, separator: Parser): Parser + export function sepBy(content: Parser, separator: Parser): Parser /** * This is the same as Parsimmon.sepBy, but matches the content parser at least once. */ - export function sepBy1(content: Parser, separator: Parser): Parser + export function sepBy1(content: Parser, separator: Parser): Parser /** * accepts a function that returns a parser, which is evaluated the first time the parser is used. diff --git a/parsimmon/parsimmon-tests.ts b/parsimmon/parsimmon-tests.ts index a13e0aa64e..8d20c093cc 100644 --- a/parsimmon/parsimmon-tests.ts +++ b/parsimmon/parsimmon-tests.ts @@ -45,6 +45,7 @@ var barPar: Parser; var anyArrPar: Parser; +var strArrPar: Parser; var fooArrPar: Parser; var barArrPar: Parser; @@ -67,7 +68,16 @@ index = fooResult.index; // -- -- -- -- -- -- -- -- -- -- -- -- -- +fooResult = P.makeSuccess(0, foo); +fooResult = P.makeFailure(0, ''); + +fooPar = P((input: string, i: number) => P.makeSuccess(0, foo)); +fooPar = P.Parser((input: string, i: number) => P.makeSuccess(0, foo)); + +// -- -- -- -- -- -- -- -- -- -- -- -- -- + fooResult = fooPar.parse(str); +foo = fooPar.tryParse(str); fooPar = fooPar.or(fooPar); anyPar = fooPar.or(barPar); @@ -170,8 +180,8 @@ numPar = P.seqMap(P.digit, P.digits, (a: string, b: string) => 42); strPar = P.seqMap(P.digit, P.digits, P.letter, (a: string, b: string, c: string) => 'foo'); strPar = P.seqMap(P.digit, P.digits, P.letter, P.letters.map(Number), (a: string, b: string, c: string, d: number) => 'foo'); -strPar = P.sepBy(P.string('foo'), P.string('bar')); -strPar = P.sepBy1(P.string('foo'), P.string('bar')); +strArrPar = P.sepBy(P.string('foo'), P.string('bar')); +strArrPar = P.sepBy1(P.string('foo'), P.string('bar')); strPar = P.test((a: string) => false); diff --git a/react-native/react-native.0.29.d.ts b/react-native/react-native.0.29.d.ts index 61960d141a..7ae6f47c72 100644 --- a/react-native/react-native.0.29.d.ts +++ b/react-native/react-native.0.29.d.ts @@ -1871,7 +1871,7 @@ declare namespace __React { * Specifies the side of the screen from which the drawer will slide in. * enum(DrawerConsts.DrawerPosition.Left, DrawerConsts.DrawerPosition.Right) */ - drawerPosition?: any; + drawerPosition?: number; /** * Specifies the width of the drawer, more precisely the width of the diff --git a/redis/index.d.ts b/redis/index.d.ts index 0c2e107646..9d794ca057 100644 --- a/redis/index.d.ts +++ b/redis/index.d.ts @@ -45,22 +45,33 @@ export interface RetryStrategy { } export interface ClientOpts { - parser?: string; - return_buffers?: boolean; - detect_buffers?: boolean; - socket_nodelay?: boolean; - socket_keepalive?: boolean; - no_ready_check?: boolean; - enable_offline_queue?: boolean; - retry_max_delay?: number; - connect_timeout?: number; - max_attempts?: number; auth_pass?: string; - password?: string; - family?: string; command_queue_high_water?: number; command_queue_low_water?: number; - retry_strategy?: RetryStrategy; + connect_timeout?: number; + db?: string; + detect_buffers?: boolean; + disable_resubscribing?: boolean; + enable_offline_queue?: boolean; + family?: string; + host?: string; + max_attempts?: number; + no_ready_check?: boolean; + parser?: string; + password?: string; + path?: string; + port?: number; + prefix?: string; + rename_commands?: any; + retry_max_delay?: number; + retry_strategy?: RetryStrategy; + retry_unfulfilled_commands?: boolean; + return_buffers?: boolean; + socket_keepalive?: boolean; + socket_nodelay?: boolean; + string_numbers?: boolean; + tls?: any; + url?: string; } export interface RedisClient extends NodeJS.EventEmitter { @@ -385,7 +396,7 @@ export interface RedisClient extends NodeJS.EventEmitter { hscan(args: any[], callback?: ResCallbackT): boolean; zscan(...args: any[]): boolean; zscan(args: any[], callback?: ResCallbackT): boolean; - + // Extras duplicate(options?:any[], callback?:ResCallbackT): RedisClient; } diff --git a/sendgrid/index.d.ts b/sendgrid/index.d.ts index 09bb333ba4..a02e23f037 100644 --- a/sendgrid/index.d.ts +++ b/sendgrid/index.d.ts @@ -52,7 +52,8 @@ declare namespace Sendgrid { subject?: string; text?: string; html?: string; - bcc?: any; + cc?: string[]; + bcc?: string[]; replyto?: string; date?: Date; headers?: { [key: string]: string }; @@ -68,7 +69,8 @@ declare namespace Sendgrid { subject: string; text: string; html: string; - bcc: any; + cc: string[]; + bcc: string[]; replyto: string; date: Date; headers: { [key: string]: string }; diff --git a/service_worker_api/index.d.ts b/service_worker_api/index.d.ts index a608cb7b84..b688719d34 100644 --- a/service_worker_api/index.d.ts +++ b/service_worker_api/index.d.ts @@ -579,6 +579,26 @@ interface PushSubscription { subscriptionId: any; } +/** + * Object containing optional subscribe parameters. + */ +interface PushSubscriptionOptions { + /** + * A boolean indicating that the returned push subscription will only be used for + * messages whose effect is made visible to the user. + * @readonly + */ + userVisibleOnly: boolean; + + /** + * A public key your push server will use to send messages to client apps via a push server. + * This value is part of a signing key pair generated by your application server and usable + * with elliptic curve digital signature (ECDSA) over the P-256 curve. + * @readonly + */ + applicationServerKey?: Uint8Array; +} + /** * The PushManager interface provides a way to receive notifications from * third-party servers as well as request URLs for push notifications. @@ -590,7 +610,7 @@ interface PushManager { * Returns a promise that resolves to a PushSubscription with details of a * new push subscription. */ - subscribe(): Promise; + subscribe(options?: PushSubscriptionOptions): Promise; /** * Returns a promise that resolves to a PushSubscription details of diff --git a/sinon/index.d.ts b/sinon/index.d.ts index bcea91929f..eb3b0bfa9f 100644 --- a/sinon/index.d.ts +++ b/sinon/index.d.ts @@ -76,7 +76,7 @@ declare namespace Sinon { alwaysThrew(): boolean; alwaysThrew(type: string): boolean; alwaysThrew(obj: any): boolean; - alwaysReturned(): boolean; + alwaysReturned(obj: any): boolean; invokeCallback(...args: any[]): void; getCall(n: number): SinonSpyCall; reset(): void; From de2d213bfdf660b059d1a3a1e742c41187402694 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 12 Dec 2016 11:24:09 -0800 Subject: [PATCH 50/51] Master to 2.0 12 dec part2 (#13278) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added missing nconf.required(keys) and Provider.required(keys) methods. * update to 4.7.0, add querycursor.map() and schema.loadClass() * add error callback for schema.post() * Added playsInline property as introduced in React 15.3.2 * Add definitions for redux-localstorage and main enhancers (#12580) * Add definitions for redux-localstorage * Add definitions for redux-localstorage-filter enhancer * Add definitions for redux-localstorage-debounce enhancer * csurf.d.ts relying on CookieOptions from express It seems express no longer exports `CookieOptions`, we need to import `express-serve-static-core` instead. * Added height property to IDialogOptions * versionKey type * kendo-ui: mark toString() params as optional (#13164) These function parameters are optional according to the upstream docs, e.g. http://docs.telerik.com/kendo-ui/api/javascript/geometry/matrix#methods-toString * Ensure that zoneAbbr and zoneName are expected type (string). * Update moment-timezone.d.ts * Fix syntax error in interact.d.ts A parameter name was missing making TypeScript compiler fail. * adding type for move to fs-extra * fixing signature of sinon/alwaysReturned based on the http://sinonjs.org/docs/#sinonspy * increasing version number * returning back the version number to the origin number * reversing changes in fs-extra * Request that PRs have meaningful titles * Improvement to existing nouislider type definition. (#12033) * updated nouislider version and added a lot of tests out of the documentation * corrected intentation * corrected untyped variables, issue raised by Travis * incorporated feedback on pull request * #13037 (#13039) * #13037 * pointToLayer first argument type fixed GeoJSON.Point to GeoJSON.Feature * Missing cc in sendgrid packate (#13063) The sendgrid package was missing the `cc` field, and the `bcc` field had a too generic type (`any` instead of `string[]`, as used on the `setCcs` and `setBccs` below. * Fixes #12414 (#13076) * Fixes #12414 * Make applicationServerKey optional * added ariaLabelledBy and ariaDescribedBy to IModalSettings (#13004) * Ceymard leaflet (#13007) * replaced all overrides of LatLng by a single use of LatLngExpression when appropriate * Changed Point, PointTuple overrides to use PointExpression instead * Changet use of LatLngBounds and Bounds in general to use the Expression variant instead of having several overrides * add ElasticSeach 5.x API function for deleteByQuery (#13014) * add ElasticSeach 5.x API function for deleteByQuery * use searchParams for deleteByQuery, as theses resemble the documentation. * add DeleteByQueryParams parameter type. * add deleteByQuery to tests. * Make `less` render options optional (#13078) * Added semver * Updated gravity definition. (#13088) * Full Redis client options (#13108) * Added missing return type to on() methods. (#13082) * Update react-native.0.29.d.ts (#13118) drawerPosition is of type `number` Android DrawerConsts.DrawerPosition.Left is equivalent to DrawerLayoutAndroid.positions.Left Android DrawerConsts.DrawerPosition.Right is equivalent to DrawerLayoutAndroid.positions.Right * Upgrade to match braintree-web 3.6.1 (#13098) * Update to match braintree-web version 3.3.0 * Upgrade to match Braintree-web v3.5.0 * upgrade to match braintree-web 3.6.1 add US bank class * Fix missing parameters from svg append (#13119) * Add parameter declarations to append() * Made insertFirst parameter optional * Correct missing ‘auto’ option of GridList’s cellHeight (#13094) * Add new Angular 1.5.9 methods to $compileProvider (#13096) * Add new Angular 1.5.9 methods to $compileProvider Add new methods available in Angular 1.5.9: onChangesTtl(), commentDirectivesEnabled() and cssClassDirectivesEnabled() * Add JSDoc to Angular 1.59 new methods of $compileProvider JSDoc for onChangesTtl(), commentDirectivesEnabled() and cssClassDirectivesEnabled() methods. * Expand $compileProvider JSDoc Urls added to JSDoc of Angular 1.5.9 new methods . * Changed type of injectedScript property to string (#13120) The injectedScript property should take string value with script code, not the bool flag as in current version * Use unions for openlayers string enums (#13134) * Update google.maps.MapPane interface (#13122) * Removing myself (AlStar01) as definition author from angular-material.d.ts (#13125) * Clarify that notNeededPackages.json is just for packages formerly on DefinitelyTyped (#13156) * Update Parsimmon typings (#13146) * Update AmCharts.d.ts (#13170) * knex: add MySqlConnectionConfig, tests (#13161) * knex: add MySqlConnectionConfig, tests * knex: add types for MySqlConnectionConfig queryFormat params * Add note in readme about tsjs-lib-generator (#13210) --- redis/index.d.ts | 2 +- redux-localstorage/redux-localstorage-tests.ts | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/redis/index.d.ts b/redis/index.d.ts index 9d794ca057..75745b99f4 100644 --- a/redis/index.d.ts +++ b/redis/index.d.ts @@ -64,7 +64,7 @@ export interface ClientOpts { prefix?: string; rename_commands?: any; retry_max_delay?: number; - retry_strategy?: RetryStrategy; + retry_strategy?: RetryStrategy; retry_unfulfilled_commands?: boolean; return_buffers?: boolean; socket_keepalive?: boolean; diff --git a/redux-localstorage/redux-localstorage-tests.ts b/redux-localstorage/redux-localstorage-tests.ts index 4c647c8410..e0e5ad4bfa 100644 --- a/redux-localstorage/redux-localstorage-tests.ts +++ b/redux-localstorage/redux-localstorage-tests.ts @@ -1,5 +1,3 @@ -// Imports -// -------------------------------------------------------------------------------- import { Reducer, compose, combineReducers, createStore } from "redux" import { default as persistState, From ccc65d990d7b785a2ab987026ea268686c08b356 Mon Sep 17 00:00:00 2001 From: Adam Gordon Date: Mon, 12 Dec 2016 15:32:52 -0800 Subject: [PATCH 51/51] expose interface types for importing --- angular-ui-bootstrap/index.d.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/angular-ui-bootstrap/index.d.ts b/angular-ui-bootstrap/index.d.ts index 21677a911a..24f8405125 100644 --- a/angular-ui-bootstrap/index.d.ts +++ b/angular-ui-bootstrap/index.d.ts @@ -7,6 +7,29 @@ import * as angular from 'angular'; +export type IAccordionConfig = angular.ui.bootstrap.IAccordionConfig; +export type IButtonConfig = angular.ui.bootstrap.IButtonConfig; +export type IDatepickerConfig = angular.ui.bootstrap.IDatepickerConfig; +export type IDatepickerPopupConfig = angular.ui.bootstrap.IDatepickerPopupConfig; +export type IModalProvider = angular.ui.bootstrap.IModalProvider; +export type IModalService = angular.ui.bootstrap.IModalService; +export type IModalServiceInstance = angular.ui.bootstrap.IModalServiceInstance; +export type IModalScope = angular.ui.bootstrap.IModalScope; +export type IModalSettings = angular.ui.bootstrap.IModalSettings; +export type IModalStackService = angular.ui.bootstrap.IModalStackService; +export type IModalStackedMapKeyValuePair = angular.ui.bootstrap.IModalStackedMapKeyValuePair; +export type IPaginationConfig = angular.ui.bootstrap.IPaginationConfig; +export type IPagerConfig = angular.ui.bootstrap.IPagerConfig; +export type IPositionCoordinates = angular.ui.bootstrap.IPositionCoordinates; +export type IPositionService = angular.ui.bootstrap.IPositionService; +export type IProgressConfig = angular.ui.bootstrap.IProgressConfig; +export type IRatingConfig = angular.ui.bootstrap.IRatingConfig; +export type ITimepickerConfig = angular.ui.bootstrap.ITimepickerConfig; +export type ITooltipOptions = angular.ui.bootstrap.ITooltipOptions; +export type ITooltipProvider = angular.ui.bootstrap.ITooltipProvider; +export type ITransitionService = angular.ui.bootstrap.ITransitionService; +export type ITransitionServiceOptions = angular.ui.bootstrap.ITransitionServiceOptions; + declare module 'angular' { export namespace ui.bootstrap {