Commit Graph
28 Commits
Author SHA1 Message Date
Andy ae4fe7b6de Use "lib" in tsconfigs instead of "target". (#13968)
* Use "lib" in tsconfigs instead of "target".

Only add "dom" to libraries that need it. This is determined by a script, so many libraries that have "dom" maybe should not.

* Update new-package and readme

* Add back "target" where necessary
2017-01-18 07:51:51 -08:00
Andy a4bd9fa3c1 Add "noImplicitThis" to all tsconfig.json (#13446)
* Add "noImplicitThis" to all tsconfig.json

* Use `"noImplicitThis": false` on packages with broken tests.
2016-12-19 14:11:46 -08:00
Ethan 8ef8a160c9 Twilio tweaks (#12109)
* Cleanup Imports

These should be uniform, and should all use the require() syntax, as
they’re referring to common js modules.

* Enable client.calls.list()

* Split up RestMethod signature

By splitting up the union into an overload, we get much more useful
autocomplete info.

* Remove BaseRequestCallback

BaseRequestCallback was only used in RestMethod, and it’s incorrect:
the user’s callback is always called with 3 arguments. I think this was
an attempt to say that the user’s callback doesn’t need to specify a
third argument, but a two-argument callback will already conform to
RequestCallback anyway.

As the updated tests show, this change gives us better type inference too.

* Use new Node HTTP Interface

This MiddlewareFunction type isn’t assignable to an express middleware
otherwise, as the latest express-static-core type declarations removes
Http.ServerRequest from the type definition of an express RequestHandler
2016-11-07 22:34:54 +09:00
Andy Hanson 91d1d6d60f Merge remote-tracking branch 'origin/master' into merge_21sep 2016-09-21 09:45:05 -07:00
Ethan Resnick 962044d3ce Capitalize WebhookOptions 2016-09-20 10:46:08 -04:00
Ethan Resnick b434572f41 fixup tests
Note that these tests aren’t currently passing on master either; the
last PR only passed because travis didn’t actually run the tests:
https://travis-ci.org/DefinitelyTyped/DefinitelyTyped/builds/160110579
2016-09-19 23:05:24 -04:00
Ethan Resnick 92b7191938 Allow TwimlMethods with no arguments
E.g. hangup() doesn’t take any arguments.
2016-09-19 19:00:58 -04:00
Ethan Resnick 3d032bd510 Split up TwimlMethod signature
By splitting up the union into an overload, we get much more useful
typing than just (any, any)
2016-09-19 18:59:41 -04:00
Ethan Resnick ae92456e05 In TwimlCallback, Node shouldn't be optional
Because the callback is always called with the Node.

This change is based on the advice here:
https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/decla
ration%20files/Do's%20and%20Don'ts.md#optional-parameters-in-callbacks
2016-09-19 18:58:18 -04:00
Ethan Resnick 6164f95bb1 Fix MiddlewareFunction interface
1. Change client request/response to server request/response, because
the client ones are for when node is acting as a client (making
outgoing requests), whereas here it’s acting as a server. This change
is needed to work with express.

2. Change the `next` argument, because next (in express) is a function
called with 0 or 1 arguments, where that argument can be an any (for
the error). Next is decidedly *not* a function with the
MiddlewareFunction signature.

3. Import express with a capital E, for consistency with Http, since
we’re using it for its namespace.
2016-09-19 18:58:03 -04:00
Ethan Resnick d705c4e9da Add missing webhook() signature 2016-09-19 18:55:03 -04:00
Ethan Resnick e822a596e4 Replace deprecated module keyword 2016-09-19 18:54:46 -04:00
Andy Hanson 28ef3d201b Remove <reference path="../xxx/xxx.d.ts"> from definitions files and replace it with import * as Xxx from "xxx" or <reference types="xxx"/> 2016-09-16 08:59:57 -07:00
TonyYang 08850929a3 Since express has been imported, it should be used 2016-09-15 17:10:58 +08:00
zhengbli c2a54db3e9 Merge branch 'master' into types-2.0
# Conflicts:
#	amcharts/AmCharts.d.ts
#	angular-gettext/angular-gettext.d.ts
#	angular-jwt/angular-jwt.d.ts
#	angular-material/angular-material.d.ts
#	angularjs/angular.d.ts
#	auth0-js/auth0-js.d.ts
#	aws-lambda/aws-lambda.d.ts
#	aws-sdk/aws-sdk.d.ts
#	azure-mobile-apps/azure-mobile-apps.d.ts
#	azure-mobile-services-client/AzureMobileServicesClient.d.ts
#	blessed/blessed-tests.ts
#	blessed/blessed.d.ts
#	bootbox/bootbox.d.ts
#	bowser/bowser.d.ts
#	cache-manager/cache-manager.d.ts
#	chai-things/chai-things.d.ts
#	colors/colors.d.ts
#	cordova/cordova-tests.ts
#	cordova/plugins/Contacts.d.ts
#	cordova/plugins/FileSystem.d.ts
#	couchbase/couchbase.d.ts
#	cucumber/cucumber-tests.ts
#	cucumber/cucumber.d.ts
#	d3/d3.d.ts
#	dojo/dojo.d.ts
#	dustjs-linkedin/dustjs-linkedin.d.ts
#	esprima/esprima.d.ts
#	express-serve-static-core/express-serve-static-core.d.ts
#	express-session/express-session.d.ts
#	fetch-mock/fetch-mock.d.ts
#	fs-extra/fs-extra.d.ts
#	fullCalendar/fullCalendar.d.ts
#	github-electron/github-electron.d.ts
#	gulp-uglify/gulp-uglify.d.ts
#	gulp/gulp.d.ts
#	highcharts/highcharts.d.ts
#	imap/imap.d.ts
#	incremental-dom/incremental-dom.d.ts
#	inversify/inversify.d.ts
#	ionic/ionic.d.ts
#	ioredis/ioredis.d.ts
#	isomorphic-fetch/isomorphic-fetch-tests.ts
#	jake/jake.d.ts
#	joi/joi.d.ts
#	jquery-mockjax/jquery-mockjax.d.ts
#	jquery/jquery.d.ts
#	js-data-http/js-data-http-tests.ts
#	js-data-http/js-data-http.d.ts
#	js-data/js-data.d.ts
#	jsdom/jsdom.d.ts
#	jsts/jsts-tests.ts
#	knex/knex.d.ts
#	koa-favicon/koa-favicon.d.ts
#	koa-router/koa-router-tests.ts
#	koa-router/koa-router.d.ts
#	lodash/lodash.d.ts
#	mailparser/mailparser.d.ts
#	maquette/maquette.d.ts
#	material-ui/material-ui.d.ts
#	matter-js/matter-js.d.ts
#	moment/moment.d.ts
#	mongoose-promise/mongoose-promise-tests.ts
#	mongoose/mongoose-tests.ts
#	mongoose/mongoose.d.ts
#	multer/multer.d.ts
#	ncp/ncp.d.ts
#	nock/nock.d.ts
#	node/node-tests.ts
#	node/node.d.ts
#	nvd3/nvd3.d.ts
#	object-assign/object-assign.d.ts
#	openlayers/openlayers.d.ts
#	parse/parse.d.ts
#	pdf/pdf.d.ts
#	pdfkit/pdfkit.d.ts
#	pg/pg.d.ts
#	pixi.js/pixi.js.d.ts
#	progress/progress.d.ts
#	pusher-js/pusher-js.d.ts
#	quill/quill-tests.ts
#	quill/quill.d.ts
#	radium/radium.d.ts
#	ravenjs/ravenjs-tests.ts
#	react-dropzone/react-dropzone.d.ts
#	react-mdl/react-mdl.d.ts
#	react-native/react-native.d.ts
#	react-notification-system/react-notification-system.d.ts
#	react-router/history-tests.ts
#	react-router/react-router-tests.tsx
#	react-router/react-router.d.ts
#	react-select/react-select-tests.tsx
#	react-select/react-select.d.ts
#	react/react.d.ts
#	redux-form/redux-form.d.ts
#	request-promise/request-promise.d.ts
#	resolve-from/resolve-from.d.ts
#	riot-api-nodejs/riot-api-nodejs.d.ts
#	sanitize-html/sanitize-html.d.ts
#	segment-analytics/segment-analytics.d.ts
#	simple-assign/simple-assign-tests.ts
#	simple-assign/simple-assign.d.ts
#	slate-irc/slate-irc.d.ts
#	soap/soap.d.ts
#	socket.io/socket.io.d.ts
#	sql.js/sql.js-tests.ts
#	sql.js/sql.js.d.ts
#	steam/steam.d.ts
#	stylus/stylus.d.ts
#	swiper/swiper.d.ts
#	tedious/tedious.d.ts
#	threejs/three.d.ts
#	twilio/twilio.d.ts
#	underscore/underscore.d.ts
#	ws/ws.d.ts
#	yeoman-generator/yeoman-generator.d.ts
2016-09-14 18:44:24 -07:00
Ethan 0ddcac8352 Fix broken Q import 2016-09-05 23:17:09 -04:00
Nicholas Iannone e22e65e6f6 Tweaked module exporting for Twilio API. (#10885)
* Changed exporting syntax.

* Fixed import.

* Fixed export.

* Fixed import statement.
2016-08-30 23:39:05 +09:00
Nicholas Iannone b860065390 Swapped type definition for interface definition for backwards compatibility. 2016-08-11 15:09:20 -05:00
Nicholas Iannone 479d12f779 Cleaned up resource interfaces. 2016-08-11 14:56:46 -05:00
Nicholas Iannone ebe80b9f21 Fixed Q import (hopefully?) and cleaned up implicit types in test 2016-08-09 11:22:17 -05:00
Nicholas Iannone 4fadd40471 Added imports. 2016-08-09 10:55:35 -05:00
Nicholas Iannone 95c58d3e81 Forgot a few export statements. 2016-08-09 10:52:08 -05:00
Nicholas Iannone 920cfea632 Fixed importing and added examples from twilio-node as tests. 2016-08-09 10:35:47 -05:00
Nicholas Iannone 0d0133104d Tweaks to try and get this working. 2016-08-08 19:04:30 -05:00
Nicholas Iannone 35e7542be4 Tweaks to eliminate unnecessary cruft. 2016-08-08 18:45:51 -05:00
Nicholas Iannone b1af25b5d5 Added a few more files. 2016-08-08 17:36:27 -05:00
Nicholas Iannone d0b1b90963 Fleshed out more of Twilio Node API. 2016-08-08 16:48:38 -05:00
Nicholas Iannone 0d001a04a1 Started preliminary work on Twilio Node API typedefs. 2016-08-08 10:44:38 -05:00