Commit Graph

52 Commits

Author SHA1 Message Date
gstamac
f942d086b0 AngularJS: fixed for 0.9.1.1 2013-08-25 12:48:46 +02:00
Ben Jackman
7bd81009a2 angularjs.d.ts: fixed implicit any errors
Signed-off-by: Ben Jackman <ben@jackman.biz>
2013-08-16 00:40:36 -05:00
Boris Yankov
c5ddb2e5c3 Merge pull request #851 from anchann/angulartyping
Angular: typing promises, deferreds
2013-08-09 10:14:20 -07:00
Santi Albo
922051a6d5 Update documentation for angularjs $httpBackend expect methods.
Both `expect`, `expectPOST`, `expectPUT` and `expectPATCH` can accept:
- string
- RegExp
- function(string)
- Object

This can be seen in https://github.com/angular/angular.js/blob/master/src/ngMock/angular-mocks.js#L1504

Definition will be simpler if we just allow `data` to have type `any`.
2013-08-09 11:50:29 +01:00
anchann
135a8579ee Angular: typing promises, deferreds 2013-08-09 16:28:13 +09:00
Boris Yankov
6f998bc2c0 Merge pull request #829 from georgiosd/master
Added generics to IHttpPromise and some missing properties/overloads
2013-08-05 06:17:22 -07:00
Georgios Diamantopoulos
25c88427fb Added generics to IHttpPromise and some missing properties/overloads
I know you haven't used generics so far so I hope this is a welcome
change - the only nuisance is that it will "break" current compilation
but will increase type safety by far.

Also added params to ICurrentRoute and inline injection notation to
$provide.decorator as per
https://github.com/borisyankov/DefinitelyTyped/issues/799
2013-08-05 12:06:53 +03:00
biiiipy
2112b07817 Add "name" prop to IRoute 2013-08-05 11:31:43 +03:00
Diullei Gomes
2089d27c7f Merge pull request #823 from basarat/patch-1
Update angular.d.ts for dependency injection
2013-08-03 09:13:40 -07:00
basarat
6fc8cd92ed Update angular.d.ts
allows the following syntax :
 
function foo($scope){}
foo.$inject = ['$scope']
2013-08-03 14:45:05 +10:00
danieljsinclair
f711d046d5 IRoute.templateUrl also now accepts a function instead of a string.
Adjusted templateUrl of IRoute because $routeProvider now allows function templateUrls to be defined such as;

        .when("/:controller/:action", { 
            templateUrl: function ($routeParams) {
                console.log("Default rule");
                return '/ng/app/views/partials/' + $routeParams.action.toLowerCase() + '.htm';
            }
        })
2013-08-01 18:12:31 +01:00
Brian Surowiec
512ccaba0a Angular JS: adding debug() to the log service 2013-07-26 23:56:39 -04:00
jraymakers
0d35893c08 Replace bool with boolean in angular 2013-07-25 22:56:10 -07:00
James Hudon
1a32cce3e0 AngularJS: give an interface to $http callback functions
- add IHttpPromiseCallback for both `error` and `success` promise calls

use case is if we're passing around the callback, we don't want to be
repeating that entire function declaration every time, and we cannot use
`Function` as that doesn't satisfy the compiler. (see test case)
2013-07-23 23:45:49 -04:00
Boris Yankov
e1c6346884 Merge pull request #779 from basarat/patch-5
scopes have $parent which are also scopes
2013-07-17 08:25:50 -07:00
basarat
155b253f81 the $observe function
http://docs.angularjs.org/guide/directive#attributes
2013-07-17 22:18:16 +10:00
basarat
98a5df369c scopes have $parent which are also scopes
scopes have $parent which are also scopes
2013-07-17 22:12:07 +10:00
Tomas Carnecky
859afa5d55 Change type of angularjs module config fuction to any
It can be subject to dependency injection, eg.

angular.module('myModule', [], [$rootScope, function($rootScope){}]);
2013-07-08 13:32:53 +02:00
Tomas Carnecky
e4693b884b Change IDirective.transclude to be of any type
It can actually be bool or string, but TypeScript doesn't allow union types (see http://typescript.codeplex.com/workitem/120).
2013-07-05 13:52:23 +02:00
Neil Stalker
cee8f3ebc2 Fix iScroll and angular definitions 2013-06-24 17:26:24 +01:00
Nick Berardi
02aac96d09 added IScope.$apply()
It was marked as '// Documentation says exp is optional, but actual implementaton counts on it' but that is not actually the case.
2013-06-20 13:47:33 -04:00
Diullei Gomes
f2363808d2 Merge pull request #620 from PicnicBasket/master
Compatibility with TS 0.9
2013-06-19 16:54:09 -07:00
Basarat Syed
af07ce5360 fixing tests to work with TS0.9 2013-06-20 09:31:14 +10:00
David Iffland
dfcb5aa038 Added declare modifier to angular-resource 2013-06-19 12:00:23 -05:00
Basarat Syed
694b1d528f Fixed for TS0.9 :
angular-resource: declare required
chai-assert: 'declare' modifier not allowed for code already in an ambient context.
chai: Trailing comma not allowed
2013-06-19 18:08:15 +10:00
vvakame
92d23e046c Update angular-mocks.d.ts
fixed error "error TS1046: 'declare' modifier required for top level element."
2013-06-19 10:55:40 +09:00
Gregory Petrosyan
8d71d227bf angular.d.ts — make 'scope' be any, not bool
See http://docs.angularjs.org/guide/directive: `scope` can be either `true`, or object hash which defines a set of local scope properties derived from the parent scope.
2013-06-06 17:59:36 +04:00
hansrwindhoff
c1fa6344db adding scenario for e2e tesing 2013-05-25 09:38:10 -06:00
Brett Postin
2bfb2aab09 Added animation() signatures to IModule
AngularJS 1.1.4 now has animation support baked into the framework, as outlined here:

http://www.yearofmoo.com/2013/04/animation-in-angularjs.html

API documentation can be found here:

http://code.angularjs.org/1.1.4/docs/api/angular.Module
2013-05-15 10:49:16 +02:00
basarat
07419c77d2 Update angular.d.ts
Fixing Error in TS0.8:  '...' parameters require both a parameter name and an array type annotation to be specified.

Error does not show up in TS0.9.
Comment: https://github.com/borisyankov/DefinitelyTyped/pull/542#issuecomment-17853980
2013-05-14 10:07:26 +07:00
basarat
0cb3ae2192 Update angular.d.ts
More detailed directive function
2013-05-13 13:35:34 +11:00
Bart Joy
ff43d9c144 Added module and inject to the 'global' or 'window' object. 2013-05-10 22:36:14 +12:00
basarat
d5fc0335e8 Compatibility with TS 0.9
'declare' now required for top level non-interface : 

https://typescript.codeplex.com/wikipage?title=Known%20breaking%20changes%20between%200.8%20and%200.9
2013-04-30 10:11:43 +07:00
Albert Weinert
558d616fd5 angular.d.t.s ng.IModule use of Object instead of {}, added tests 2013-04-03 16:05:10 +02:00
Albert Weinert
50d34ac8db angular.d.ts: added some overrides to ng.IModule
with angular it is possible to register controllers, directives 
etc. per convention if you create an object which has the 
functions defined.

So that your module initialization must not know every controller 
etc.

As an example look at

https://github.com/DerAlbertCom/SignagePages/blob/develop/src/SignagePages/app/app.ts
https://github.com/DerAlbertCom/SignagePages/blob/develop/src/SignagePages/app/LoginController.js
https://github.com/DerAlbertCom/SignagePages/blob/develop/src/SignagePages/app/DailyMealsController.ts
2013-04-03 14:44:24 +03:00
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