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..24f8405125 100644 --- a/angular-ui-bootstrap/index.d.ts +++ b/angular-ui-bootstrap/index.d.ts @@ -1,12 +1,35 @@ // 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 /// 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 { @@ -402,6 +425,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/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; diff --git a/braintree-web/index.d.ts b/braintree-web/index.d.ts index d62ec01fd1..6d896a5efe 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,9 @@ declare namespace BraintreeWeb { * expirationDate: form['cc-date'].value, * billingAddress: { * postalCode: form['cc-postal'].value + * }, + * options: { + * validate: false * } * } * }; @@ -459,6 +462,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 +481,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 +503,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 +745,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 +1007,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 +1062,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 +1072,7 @@ declare namespace BraintreeWeb { * console.error('Error!', createErr); * } * } - * } + * }); * @returns {void} */ create: (options: { client: Client }, callback: callback) => void; @@ -1083,7 +1116,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 +1662,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 +1920,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/node/index.d.ts b/node/index.d.ts index 340ecbc6f2..a428c3a6ad 100644 --- a/node/index.d.ts +++ b/node/index.d.ts @@ -571,25 +571,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 c0d61a0cb0..ae1d6f2a5e 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -2,6 +2,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"; @@ -143,6 +144,10 @@ namespace events_tests { } } } + + { + new events2(); + } } //////////////////////////////////////////////////// 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..9b3cd9a46b 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/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..6dc61539ab 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; @@ -101,6 +140,25 @@ declare namespace 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 +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..011148973a 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,9 +180,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/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..75745b99f4 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; + 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/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..e0e5ad4bfa --- /dev/null +++ b/redux-localstorage/redux-localstorage-tests.ts @@ -0,0 +1,33 @@ +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 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; 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;