Commit Graph
30 Commits
Author SHA1 Message Date
Retsam 42b8e18474 Modify tests so that they verify the inference of filtered catch handlers 2017-12-13 15:45:49 -05:00
Retsam d73f413fb6 Fix inferred types for targetted error handlers
The typings for targetted catch statements don't infer properly with Error constructors, for example with `.catch(SomeErrorSubtype, (e) => /*...*/)`, `e` is inferred to be the constructor of SomeErrorSubtype, not an instance of SomeErrorSubtype, so this must be explicitly typed as `.catch(SomeErrorSubtype, (e: SomeErrorSubtype) => /*...*/)` for the typings to be accurate.  The root causes is that it is erroneously falling into the wrong overload, the overload that accepts arbitrary objects as the first argument to .catch.  This fix requires loosening the restriction that SomeErrorSubtype must be a subtype of Error, but otherwise preserves existing behavior.

Also, makes a utility type to reduce some of the boilerplate.
2017-12-13 14:02:42 -05:00
Retsam 79258c041a Make caught an alias for catch 2017-12-13 13:56:16 -05:00
segayuu a83743d071 [WIP] cleanup lint error: max-line-length(490->280) 2017-10-27 14:25:44 +09:00
segayuu 30ae02db23 cleanup lint error: no-redundant-undefined 2017-10-26 10:23:22 +09:00
segayuu df2f503d13 [Bluebird] Cleanup ignore lint error and Enable strintFunctionTypes and noImplicitThis (#20945)
* Cleanup part of lint error "no-unnecessary-generics"

* Cleanup lint error: adjacent-overload-signatures

* Arguments Array to Iterable(Bluebird not support ArrayLike)

* Delete already resolved TODO

* [WIP] cleanup lint-errors: void-return

* cleanup lint error: no-unnecessary-callback-wrapper

* cleanup ignore lint error: no-void-expression

* clean self

* Enable noImplicitThis

* Enable strictFunctionTypes

* Fix error dependent on tsc version(tsc version: 20171024)

* Cleanup lint error: void-return

* Apply https://github.com/DefinitelyTyped/DefinitelyTyped/pull/20945#discussion_r146791411
2017-10-25 11:17:24 -07:00
Andy 19f89399e4 Ensure every package has a tslint.json (#21009)
* Ensure every package has a tslint.json

* Fixes
2017-10-25 11:13:50 -07:00
Andy 097d2acf71 Miscellaneous lint fixes (#20849) 2017-10-22 15:22:50 -07:00
segayuu 90649b73fe [Bluebird] cleanup lint errors (#20449)
* Cleanup Lint Error: ban-types

* Cleanup lint error: unified-signatures(exclude Promise.props())

* Cleanup lint error: array-type

* Setting max-line-length not to exceed current length

* Cleanup lint error: one-line

* Cleanup lint error: lintstrict-export-declare-modifiers

* [request] toJSON() return Object => object
2017-10-12 13:41:30 -07:00
segayuu c7a368b276 [bluebird]Fix simple lint errors (#20222)
* Fix lint-error dt-header

* Fix lint-error no-var-keyword

* Fix lint error no-padding

* Fix lint error only-arrow-functions

* Fix lint error space-before-function-paren

* Fix lint error prefer-method-signature

* Fix lint error typedef-whitespace

* Fic Lint ignore whitespace

* Fix lint error no-consecutive-blank-lines

* Fix lint error semicolon

* Fix lint error member-access

* Fix lint error comment-format
2017-10-09 14:47:48 -07:00
Andy 947a8fb761 Enable strictFunctionTypes (#20373) 2017-10-06 14:03:03 -07:00
Ben Gladman d06df01e3c More expressive type definition for Bluebird.method (#20279) 2017-10-04 22:26:08 +09:00
segayuu 65c3042950 [bluebird] Added tslint.json. (#19816)
* Added tslint.json

* Merge commit from source fork (#2)

* Add setVisible to iFrame control

* Initial API without namespaces.

* Did more work on typings.

* Final changes to the typings.

* add className prop and make manager prop optional

* [jquery.fancytree] added enableUpdate method (reference http://www.wwwendt.de/tech/fancytree/doc/jsdoc/Fancytree.html#enableUpdate)

* Fix typo (any -> all) for everyWhere description

* Minor Pixi.js updates to v4.5.5

* mfiles: Added missing CLSID constants

* Reduce strictness of types for redux actions to reduce false positives

* Set required tsc version for depended package

* Update to index.d.ts

Added change suggested by @pocesar

* Updated test to reflect remote changes

Second class, remoteBool to test for remote is boolean

* mfiles: Added support for application platform property

* bootstrap-datepicker - append all available datepicker events

* Update Ignite UI typing definition according the latest 17.1 build

* Added 'static' to Model.remoteMethod
Integrated the remoteMethod ideas from https://github.com/Sequoia/loopback-type-definitions/blob/master/loopback.d.ts into the existing type
Improves remoteMethod composition and checking.  No impact on other types

* add lost options member add comments

* Updating comment in remoteMethod JSDoc
Added simple test for remoteMethod

* Fixing dtslint issues

* Fixed errors from running tests. Travis CI should pass now

* Updated test example with real parameters

* update ColorWrap types

* change type name

* feat(prettier): update to version 1.7

* [angular-strap] updated all options to 2.3.8

* [angular-strap] added tslint and resolved linting issues

* Remove moved file

* Add separate process event contexts

* export all interfaces from pdfjs-dist

* Fix lint errors

* Typo fix

* Add editorState param to event handlers

* Fix parse_response type and use lookup type

* Change stage direction to proper case

* [react-data-grid] Added openCellEditor signature to ReactDataGrid instance

* Add remaining missing Xrm.Page.data.process methods

* Add new label type for X/YAxis

* Add contribution name

* Update definitions for @types/angular-loading-bar to be accurate

* Formatting update

* Adding type for the function instead of just Function

* Adding a test

* Try to fix tests for angular-loading-bar types

* feat(react-native-elements): pull from iRoachie

* Update Label type

* Support multiple colors / styles

Winston supports configuring multiple styles rather than a single color.  For example you could winston.addColors( { error: ['white', 'underline', 'bgRed'] });

* feat(react-native-element): add multiple components

The work is not yet completed, however there are several components provided and the rest will be completed in the next few days.

* fix(react-native-elements): unneeded breaking imports

* Update d3-geo to version 1.7.1
Includes geoNaturalEarth1 and geoNaturalEarth1Raw

* Type definitions for react-mce 0.6.

* Use generic defaults.

* Reduce TypeScript version to 2.3

* feat(react-native-elements): add rating component

* feat(react-native-elements): add SearchBar component

* webpack: improve loader context typings
emitError() and emitWarning() both can accept an Error as well, for exposing caught Errors.
See: https://github.com/webpack/webpack/blob/master/lib/NormalModule.js#L115

Added relevant type tests.

* fix: do not make use of es6's Map and Set

this should fix #16587

* feat(react-native-elements): add SideMenu component

* feat(react-native-elements): add Slider component

* feat(react-native-elements): add SocialIcons component

* feat(react-native-elements): add SwipeDeck component

* feat(react-native-elements): add Tabs component

* feat(react-native-elements): add Tile component

* feat(react-native-elements): add utility exports

* docs(react-native-elements): remove deprecated message

* first pass at the electron-winstaller declaration

* lint

* Adding definitions for prosemirror-table

* Added minArea to DragBoxOptions (https://openlayers.org/en/latest/apidoc/ol.interaction.DragBox.html)

* added minArea to test

* Remove myself from list of maintainers

* stripe-v3: Add basic typings for createSource method

* stripe-v3: Lint SourceOptions

* stripe-v3: Conert tabs to spaces

* Add ChartFontOptions to global Chart.js options

* angular-ui-router: Can't export a string literal (#19839)

* angular-gridster: Can't export a string literal (#19842)

* react-router/v2: Fix default export of object (#19849)

* history/v2 and /v3: Fix export default of object (#19847)

* Add definitions for W3C Web USB API

* logat: Fix export (#19848)

* adal: Fix export style (#19838)

* strophe: Fix export (#19850)

* express-brute-mongo: Fix export (#19851)

* argparse: Remove unnecessary type parameters (#19843)

* Support conditional values in Vega

* Add onLoad animation configuration

Alluded to here in documentation:

https://formidable.com/open-source/victory/docs/victory-stack

Code references:
https://github.com/FormidableLabs/victory-core/blob/e28d4b81eaa0b303d88d7c3124aec4c77d8c9970/src/victory-util/default-transitions.js#L5
https://github.com/FormidableLabs/victory-core/blob/e28d4b81eaa0b303d88d7c3124aec4c77d8c9970/src/victory-util/default-transitions.js#L19

* Fix restify declarations to comply with standard lint rules.

This change requires TypeScript 2.2 because the type
'object' did not exist in 2.1.

* hopscotch

small fixes, no breaking changes

* fix typo

fix typo

* bull: added missing method "promote" from bull v3 to typings

* Minor fixes from review

* stripe-v3: Lint

* types for tabulator

* Ramda: disable no-unnecessary-generics (#19785)

* fixing tests

* adding more test

* Merge PR #19726: [react-data-grid] Added getValidateFilterValues signature to GridProps

* [react-data-grid] Added getValidateFilterValues signature to GridProps

* Add resizerClassName

* More verbose definition for pathOr

* strictNullChecks: true
2017-10-02 15:05:45 -07:00
Retsam 259e578a48 Bluebird: improve typings for Promise.coroutine (#20148)
* Add better support for Bluebird.coroutine

* Add Promise.coroutine options argument

* Improve TODO comment

* Fix inconsistent indentation

* Move T argument to the beginning of the coroutine type params

* Remove unnecessary comment from tests
2017-10-02 10:31:39 -07:00
calebboyd 891de135be fix: add static named Promise export (#19859) 2017-09-25 12:20:32 -07:00
segayuu b7346ede24 changed type from "Function" to "Arrow function format". 2017-09-14 19:13:39 +09:00
Klaus Kopruch 5a76f5bc51 replaced Thenable by PromiseLike 2017-09-07 12:17:11 +02:00
Klaus Kopruch 8639c26382 fixed broken tests under TypeScript 2.5..2
fixed type of expected callback of promisify's first argument
2017-09-07 10:23:53 +02:00
Benjamin Feng 073b961832 Unwrap Bluebird.props() via generics 2017-06-24 15:52:54 -05:00
Wellington Mendoza a8617ad7c7 Update catch definitions to type-check objects for generic types 2017-06-20 19:06:00 -05:00
Wellington Mendoza bd36ddb202 Fix predicate and object types for bluebird 2017-06-20 16:29:30 -05:00
Andy Hanson b5c94b0020 Add onReject parameter to the simpler overload 2017-06-16 12:50:03 -07:00
Andy Hanson c9f6b78761 Add another then overload for simpler signature help 2017-06-16 10:29:06 -07:00
Andy Hanson 74c978a9a9 Replace Bluebird.Thenable with PromiseLike 2017-06-16 09:02:18 -07:00
Andy Hanson c15e214e5a bluebird: Make Thenable an alias to the builtin PromiseLike. 2017-06-16 09:02:18 -07:00
Juan Carlos Paucar 707e46062b bluebird - Add variadic version for catch and caught 2017-06-01 11:07:51 -05:00
Simon Schick e6fa0b8211 Correct return type for no parameters in return method in bluebird 2017-05-11 17:11:34 +02:00
arlecchino c4077c19e4 @types/bluebird: Make AggregateError ArrayLike (#16148)
* Make AggregateError ArrayLike

For simplification extend AggregateError from Array<Error>

* Make AggregateError implementing ArrayLike

AggregateError should be an Error and also an ArrayLike of Errors with a bunch of Array-methods.
2017-04-26 14:35:30 -07:00
Andy 6d28e7b0bf bluebird/v1: Change name of type Promise type parameter to T (#15992) 2017-04-19 10:08:17 -07:00
Andy Hanson 354cec620d Move all packages to a types directory 2017-03-24 14:27:52 -07:00