Commit Graph

17 Commits

Author SHA1 Message Date
Josh Carroll
c983f12458 Changed reject to be 'any' per angular docs 2013-03-21 12:01:28 -04:00
Anton Zolotkov
26d0c8a757 AngularJS: fixed typing of the ng.IPromise.then function
The type definition for ng.IPromise.then was, in my opinion, incorrect
semantically, and breaking on practical examples in my codebase.

An `IPromise`' `then` function takes a callback which is called with the
value of the promise once it's fulfilled. This could be a number, a
string, some object, an array of strings, anything really. Yet the
typing in angular.d.ts specified `then` as taking a `successCallback` of
type `(response: PromiseCallbackArg) => any`.

The definition of `PromiseCallbackArg` seems very permissive at first
glance, as it is defined to be an object with a bunch of fields, all
optional. Any object, a number, and a string all type check correctly
with such a type, but an array of strings, for example, does not
(`cPromise` in the provided list of test).

Furthermore, it seems to me that the `PromiseCallbackArg` definition was
added specifically to support the response type for promises returned by
the Angular `$http` service, the `ng.IHttpPromise`.

So instead of having an incorrect type on the `ng.IPromise.then` function,
I propose we return it to its generic form, and instead override the
type of the inherited `then` function in the `ng.IHttpPromise` interface.
This would also warrant renaming `PromiseCallbackArg` to
`IHttpPromiseCallbackArg`.
2013-03-20 11:48:15 +09:00
JakubMrozek
b807b616d8 angular.mock.inject() return any type 2013-03-07 19:37:45 +01:00
JakubMrozek
e9dfb35006 Rename IRouteProviderProvider to IRouteProvider for angular.d.ts 2013-03-07 18:28:52 +01:00
Andrew Davey
c086738251 IHttpBackendService#flush count parameter optional
The `count` parameter of `IHttpBackendService#flush` is optional.
2013-03-07 16:34:13 +00:00
Diullei Gomes
aed0b8aecd bug fix #369 - status property on angularjs response object 2013-03-06 22:47:53 -03:00
Jason Swearingen
a46ab6bb93 minor fixes+typings, mostly adding documentation
angularjs: docs around first page tutorials
jquery: fix for known lib.d.ts big
knockback: add typing for observable based on tutorial, add docs around
observable.
2013-02-14 18:34:00 +07:00
Jason Swearingen
1886a6ca66 add interface+docs around resource factory
re following official "Wire up a BAckend" demo:
http://angularjs.org/#mongolab-js
2013-02-13 13:27:06 +07:00
Boris Yankov
209d95071a Update reference paths 2013-01-17 20:03:30 +02:00
Boris Yankov
78b78fe00b More file renames 2013-01-17 17:19:40 +02:00
Boris Yankov
c98eebb137 Rename all definition files, remove versions 2013-01-17 17:17:27 +02:00
Natan Vivo
c7d2934d6d Update project references to use jQuery 1.9 instead of missing 1.8 file. 2013-01-17 12:05:06 -02:00
Greg Weber
047b242d2f add responseInterceptors 2013-01-13 20:06:47 -08:00
Diego Vilar
306dd2f52f Fixed a type on the IHttpBackendService interface: there was a ; instead of a : 2012-11-21 03:01:26 -03:00
Boris Yankov
7c82efb17a Update reference paths 2012-11-19 01:28:08 +02:00
Boris Yankov
96f52520fc Add Angular.js readme 2012-11-18 23:57:29 +02:00
Boris Yankov
c91c45f9ae Move definitions and test in separate folders
This enables each definition to have a readme if necessary.
Also a .json metadata file to help with package managers.
And last, to have different versions of the definitions.
2012-11-18 22:28:44 +02:00