Debian Codegraph @

contrib/externs/angular.js

raw symbols SCIP
1 /*
2 * Copyright 2012 The Closure Compiler Authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 /**
18 * @fileoverview Externs for Angular 1.
19 *
20 * TODO: Mocks.
21 * TODO: Remaining Services:
22 * $compileProvider
23 * $controller
24 * $controllerProvider
25 * $cookies
26 * $cookieStore
27 * $document
28 * $exceptionHandler
29 * $filter
30 * $filterProvider
31 * $httpBackend
32 * $interpolate
33 * $locale
34 * $parse
35 * $resource
36 * $rootElement
37 * $rootScope
38 * $rootScopeProvider
39 * $routeParams
40 * $sanitize
41 * $templateCache
42 * $window
43 * TODO: Resolve two issues with angular.$http
44 * 1) angular.$http cannot be declared as a callable type.
45 * Its helper methods should be used instead.
46 * 2) angular.$http.delete cannot be added as an extern
47 * as it is a reserved keyword.
48 * Its use is potentially not supported in IE.
49 * It may be aliased as 'remove' in a future version.
50 *
51 * @see http://angularjs.org/
52 * @externs
53 */
54
55 /**
56 * @typedef {(Window|Document|Element|Array.<Element>|string|angular.JQLite|
57 * NodeList|{length: number})}
58 */
59 var JQLiteSelector;
60
61 /**
62 * @type {Object}
63 * @const
64 */
65 var angular = {};
66
67 /**
68 * @param {Object} self
69 * @param {Function} fn
70 * @param {...*} args
71 * @return {Function}
72 */
73 angular.bind = function(self, fn, args) {};
74
75 /**
76 * @param {Element} element
77 * @param {Array.<string|Function>=} opt_modules
78 * @return {function()}
79 */
80 angular.bootstrap = function(element, opt_modules) {};
81
82 /**
83 * @param {T} source
84 * @param {(Object|Array)=} opt_dest
85 * @return {T}
86 * @template T
87 */
88 angular.copy = function(source, opt_dest) {};
89
90 /**
91 * @param {(JQLiteSelector|Object)} element
92 * @param {(JQLiteSelector|Object)=} opt_context
93 * @return {Object}
94 */
95 angular.element = function(element, opt_context) {};
96
97 /**
98 * @param {*} o1
99 * @param {*} o2
100 * @return {boolean}
101 */
102 angular.equals = function(o1, o2) {};
103
104 /**
105 * @param {Object} dest
106 * @param {...Object} srcs
107 */
108 angular.extend = function(dest, srcs) {};
109
110 /**
111 * @param {Object|Array} obj
112 * @param {Function} iterator
113 * @param {Object=} opt_context
114 * @return {Object|Array}
115 */
116 angular.forEach = function(obj, iterator, opt_context) {};
117
118 /**
119 * @param {string|T} json
120 * @return {Object|Array|Date|T}
121 * @template T
122 */
123 angular.fromJson = function(json) {};
124
125 /**
126 * @param {*} arg
127 * @return {*}
128 */
129 angular.identity = function(arg) {};
130
131 /**
132 * @param {Array.<string|Function>} modules
133 * @return {angular.$injector}
134 */
135 angular.injector = function(modules) {};
136
137 /**
138 * @param {*} value
139 * @return {boolean}
140 */
141 angular.isArray = function(value) {};
142
143 /**
144 * @param {*} value
145 * @return {boolean}
146 */
147 angular.isDate = function(value) {};
148
149 /**
150 * @param {*} value
151 * @return {boolean}
152 */
153 angular.isDefined = function(value) {};
154
155 /**
156 * @param {*} value
157 * @return {boolean}
158 */
159 angular.isElement = function(value) {};
160
161 /**
162 * @param {*} value
163 * @return {boolean}
164 */
165 angular.isFunction = function(value) {};
166
167 /**
168 * @param {*} value
169 * @return {boolean}
170 */
171 angular.isNumber = function(value) {};
172
173 /**
174 * @param {*} value
175 * @return {boolean}
176 */
177 angular.isObject = function(value) {};
178
179 /**
180 * @param {*} value
181 * @return {boolean}
182 */
183 angular.isString = function(value) {};
184
185 /**
186 * @param {*} value
187 * @return {boolean}
188 */
189 angular.isUndefined = function(value) {};
190
191 /**
192 * @param {string} s
193 * @return {string}
194 */
195 angular.lowercase = function(s) {};
196
197 angular.mock = {};
198
199 /**
200 * @param {string} name
201 * @param {Array.<string>=} opt_requires
202 * @param {(Function|Array.<string|Function>)=} opt_configFn
203 * @return {angular.Module}
204 */
205 angular.module = function(name, opt_requires, opt_configFn) {};
206
207 /**
208 * @typedef {{
209 * $normalize: function(string): string,
210 * $observe: function(string, function(*)): function(*),
211 * $set: function(string, ?(string|boolean), boolean=, string=)
212 * }}
213 */
214 angular.Attributes;
215
216 /**
217 * @param {string} name
218 * @return {string}
219 */
220 angular.Attributes.$normalize = function(name) {};
221
222 /**
223 * @param {string} key
224 * @param {function(*)} fn
225 * @return {function(*)}
226 */
227 angular.Attributes.$observe = function(key, fn) {};
228
229 /**
230 * @param {string} key
231 * @param {?(string|boolean)} value
232 * @param {boolean=} opt_writeAttr
233 * @param {string=} opt_attrName
234 */
235 angular.Attributes.$set = function(key, value, opt_writeAttr, opt_attrName) {};
236
237 /**
238 * @typedef {{
239 * addClass: function(string): angular.JQLite,
240 * after: function(JQLiteSelector): angular.JQLite,
241 * append: function(JQLiteSelector): angular.JQLite,
242 * attr: function(string, (string|boolean)=): (angular.JQLite|string|boolean),
243 * bind: function(string, Function): angular.JQLite,
244 * children: function(): angular.JQLite,
245 * clone: function(): angular.JQLite,
246 * contents: function(): angular.JQLite,
247 * controller: function(string=): Object,
248 * css: function(string, string=): (angular.JQLite|string),
249 * data: function(string=, *=): *,
250 * eq: function(number): angular.JQLite,
251 * find: function(string): angular.JQLite,
252 * hasClass: function(string): boolean,
253 * html: function(string=): (angular.JQLite|string),
254 * inheritedData: function(string=, *=): *,
255 * injector: function(): angular.$injector,
256 * length: number,
257 * next: function(): angular.JQLite,
258 * parent: function(): angular.JQLite,
259 * prepend: function(JQLiteSelector): angular.JQLite,
260 * prop: function(string, *=): *,
261 * ready: function(Function): angular.JQLite,
262 * remove: function(): angular.JQLite,
263 * removeAttr: function(string): angular.JQLite,
264 * removeClass: function(string): angular.JQLite,
265 * removeData: function(): angular.JQLite,
266 * replaceWith: function(JQLiteSelector): angular.JQLite,
267 * scope: function(): angular.Scope,
268 * text: function(string=): (angular.JQLite|string),
269 * toggleClass: function(string, boolean=): angular.JQLite,
270 * unbind: function(string=, Function=): angular.JQLite,
271 * val: function(string=): (angular.JQLite|string),
272 * wrap: function(JQLiteSelector): angular.JQLite
273 * }}
274 */
275 angular.JQLite;
276
277 /**
278 * @param {string} name
279 * @return {angular.JQLite}
280 */
281 angular.JQLite.addClass = function(name) {};
282
283 /**
284 * @param {JQLiteSelector} element
285 * @return {angular.JQLite}
286 */
287 angular.JQLite.after = function(element) {};
288
289 /**
290 * @param {JQLiteSelector} element
291 * @return {angular.JQLite}
292 */
293 angular.JQLite.append = function(element) {};
294
295 /**
296 * @param {string} name
297 * @param {(string|boolean)=} opt_value
298 * @return {angular.JQLite|string|boolean}
299 */
300 angular.JQLite.attr = function(name, opt_value) {};
301
302 /**
303 * @param {string} type
304 * @param {Function} fn
305 * @return {angular.JQLite}
306 */
307 angular.JQLite.bind = function(type, fn) {};
308
309 /**
310 * @return {angular.JQLite}
311 */
312 angular.JQLite.children = function() {};
313
314 /**
315 * @return {angular.JQLite}
316 */
317 angular.JQLite.clone = function() {};
318
319 /**
320 * @return {angular.JQLite}
321 */
322 angular.JQLite.contents = function() {};
323
324 /**
325 * @param {string=} opt_name
326 * @return {Object}
327 */
328 angular.JQLite.controller = function(opt_name) {};
329
330 /**
331 * @param {string} name
332 * @param {string=} opt_value
333 * @return {angular.JQLite|string}
334 */
335 angular.JQLite.css = function(name, opt_value) {};
336
337 /**
338 * @param {string=} opt_key
339 * @param {*=} opt_value
340 * @return {*}
341 */
342 angular.JQLite.data = function(opt_key, opt_value) {};
343
344 /**
345 * @param {number} index
346 * @return {angular.JQLite}
347 */
348 angular.JQLite.eq = function(index) {};
349
350 /**
351 * @param {string} selector
352 * @return {angular.JQLite}
353 */
354 angular.JQLite.find = function(selector) {};
355
356 /**
357 * @param {string} name
358 * @return {boolean}
359 */
360 angular.JQLite.hasClass = function(name) {};
361
362 /**
363 * @param {string=} opt_value
364 * @return {angular.JQLite|string}
365 */
366 angular.JQLite.html = function(opt_value) {};
367
368 /**
369 * @param {string=} opt_key
370 * @param {*=} opt_value
371 * @return {*}
372 */
373 angular.JQLite.inheritedData = function(opt_key, opt_value) {};
374
375 /**
376 * @return {angular.$injector}
377 */
378 angular.JQLite.injector = function() {};
379
380 /** @type {number} */
381 angular.JQLite.length;
382
383 /**
384 * @return {angular.JQLite}
385 */
386 angular.JQLite.next = function() {};
387
388 /**
389 * @return {angular.JQLite}
390 */
391 angular.JQLite.parent = function() {};
392
393 /**
394 * @param {JQLiteSelector} element
395 * @return {angular.JQLite}
396 */
397 angular.JQLite.prepend = function(element) {};
398
399 /**
400 * @param {string} name
401 * @param {*=} opt_value
402 * @return {*}
403 */
404 angular.JQLite.prop = function(name, opt_value) {};
405
406 /**
407 * @param {Function} fn
408 * @return {angular.JQLite}
409 */
410 angular.JQLite.ready = function(fn) {};
411
412 /**
413 * @return {angular.JQLite}
414 */
415 angular.JQLite.remove = function() {};
416
417 /**
418 * @param {string} name
419 * @return {angular.JQLite}
420 */
421 angular.JQLite.removeAttr = function(name) {};
422
423 /**
424 * @param {string} name
425 * @return {angular.JQLite}
426 */
427 angular.JQLite.removeClass = function(name) {};
428
429 /**
430 * @return {angular.JQLite}
431 */
432 angular.JQLite.removeData = function() {};
433
434 /**
435 * @param {JQLiteSelector} element
436 * @return {angular.JQLite}
437 */
438 angular.JQLite.replaceWith = function(element) {};
439
440 /**
441 * @return {angular.Scope}
442 */
443 angular.JQLite.scope = function() {};
444
445 /**
446 * @param {string=} opt_value
447 * @return {angular.JQLite|string}
448 */
449 angular.JQLite.text = function(opt_value) {};
450
451 /**
452 * @param {string} name
453 * @param {boolean=} opt_condition
454 * @return {angular.JQLite}
455 */
456 angular.JQLite.toggleClass = function(name, opt_condition) {};
457
458 /**
459 * @param {string=} opt_type
460 * @param {Function=} opt_fn
461 * @return {angular.JQLite}
462 */
463 angular.JQLite.unbind = function(opt_type, opt_fn) {};
464
465 /**
466 * @param {string=} opt_value
467 * @return {angular.JQLite|string}
468 */
469 angular.JQLite.val = function(opt_value) {};
470
471 /**
472 * @param {JQLiteSelector} element
473 * @return {angular.JQLite}
474 */
475 angular.JQLite.wrap = function(element) {};
476
477 /**
478 * @typedef {{
479 * config: function((Function|Array.<string|Function>)):angular.Module,
480 * constant: function(string, *):angular.Module,
481 * controller:
482 * function(string, (Function|Array.<string|Function>)):angular.Module,
483 * directive:
484 * (function(string, (Function|Array.<string|Function>)):angular.Module|
485 * function(!Object.<(Function|Array.<string|Function>)>):angular.Module),
486 * factory:
487 * function(string, (Function|Array.<string|Function>)):angular.Module,
488 * filter:
489 * function(string, (Function|Array.<string|Function>)):angular.Module,
490 * name: string,
491 * provider: function(string,
492 * (Object|Function|Array.<string|Function>)):angular.Module,
493 * requires: Array.<string>,
494 * run: function((Function|Array.<string|Function>)):angular.Module,
495 * service:
496 * function(string, (Function|Array.<string|Function>)):angular.Module,
497 * value: function(string, *):angular.Module
498 * }}
499 */
500 angular.Module;
501
502 /**
503 * @param {Function|Array.<string|Function>} configFn
504 * @return {angular.Module}
505 */
506 angular.Module.config = function(configFn) {};
507
508 /**
509 * @param {string} name
510 * @param {*} object
511 * @return {angular.Module}
512 */
513 angular.Module.constant = function(name, object) {};
514
515 /**
516 * @param {string} name
517 * @param {Function|Array.<string|Function>} constructor
518 * @return {angular.Module}
519 */
520 angular.Module.controller = function(name, constructor) {};
521
522 /**
523 * @param {string} name
524 * @param {Function|Array.<string|Function>} directiveFactory
525 * @return {angular.Module}
526 */
527 angular.Module.directive = function(name, directiveFactory) {};
528
529 /**
530 * @param {string} name
531 * @param {Function|Array.<string|Function>} providerFunction
532 * @return {angular.Module}
533 */
534 angular.Module.factory = function(name, providerFunction) {};
535
536 /**
537 * @param {string} name
538 * @param {Function|Array.<string|Function>} filterFactory
539 * @return {angular.Module}
540 */
541 angular.Module.filter = function(name, filterFactory) {};
542
543 /**
544 * @param {string} name
545 * @param {Function|Array.<string|Function>} providerType
546 * @return {angular.Module}
547 */
548 angular.Module.provider = function(name, providerType) {};
549
550 /**
551 * @param {Function|Array.<string|Function>} initializationFn
552 * @return {angular.Module}
553 */
554 angular.Module.run = function(initializationFn) {};
555
556 /**
557 * @param {string} name
558 * @param {Function|Array.<string|Function>} constructor
559 * @return {angular.Module}
560 */
561 angular.Module.service = function(name, constructor) {};
562
563 /**
564 * @param {string} name
565 * @param {*} object
566 * @return {angular.Module}
567 */
568 angular.Module.value = function(name, object) {};
569
570 /**
571 * @type {string}
572 */
573 angular.Module.name = '';
574
575 /**
576 * @type {Array.<string>}
577 */
578 angular.Module.requires;
579
580 angular.noop = function() {};
581
582 /**
583 * @typedef {{
584 * $apply: function((string|function(angular.Scope))=):*,
585 * $broadcast: function(string, ...[*]),
586 * $destroy: function(),
587 * $digest: function(),
588 * $emit: function(string, ...[*]),
589 * $eval: function((string|function(angular.Scope))=, Object=):*,
590 * $evalAsync: function((string|function())=),
591 * $id: string,
592 * $new: function(boolean=):angular.Scope,
593 * $on: function(string, function(angular.Scope.Event, ...[?])):function(),
594 * $parent: angular.Scope,
595 * $watch: function(
596 * (string|Function), (string|Function)=, boolean=):function()
597 * }}
598 */
599 angular.Scope;
600
601 /**
602 * @param {(string|function(angular.Scope))=} opt_exp
603 * @return {*}
604 */
605 angular.Scope.$apply = function(opt_exp) {};
606
607 /**
608 * @param {string} name
609 * @param {...*} args
610 */
611 angular.Scope.$broadcast = function(name, args) {};
612
613 angular.Scope.$destroy = function() {};
614
615 angular.Scope.$digest = function() {};
616
617 /**
618 * @param {string} name
619 * @param {...*} args
620 */
621 angular.Scope.$emit = function(name, args) {};
622
623 /**
624 * @param {(string|function())=} opt_exp
625 * @param {Object=} opt_locals
626 * @return {*}
627 */
628 angular.Scope.$eval = function(opt_exp, opt_locals) {};
629
630 /**
631 * @param {(string|function())=} opt_exp
632 */
633 angular.Scope.$evalAsync = function(opt_exp) {};
634
635 /** @type {string} */
636 angular.Scope.$id;
637
638 /**
639 * @param {boolean=} opt_isolate
640 * @return {angular.Scope}
641 */
642 angular.Scope.$new = function(opt_isolate) {};
643
644 /**
645 * @param {string} name
646 * @param {function(angular.Scope.Event, ...[?])} listener
647 * @return {function()}
648 */
649 angular.Scope.$on = function(name, listener) {};
650
651 /** @type {angular.Scope} */
652 angular.Scope.$parent;
653
654 /**
655 * @param {string|Function} exp
656 * @param {(string|Function)=} opt_listener
657 * @param {boolean=} opt_objectEquality
658 * @return {function()}
659 */
660 angular.Scope.$watch = function(exp, opt_listener, opt_objectEquality) {};
661
662 /**
663 * @typedef {{
664 * currentScope: angular.Scope,
665 * defaultPrevented: boolean,
666 * name: string,
667 * preventDefault: function(),
668 * stopPropagation: function(),
669 * targetScope: angular.Scope
670 * }}
671 */
672 angular.Scope.Event;
673
674 /** @type {angular.Scope} */
675 angular.Scope.Event.currentScope;
676
677 /** @type {boolean} */
678 angular.Scope.Event.defaultPrevented;
679
680 /** @type {string} */
681 angular.Scope.Event.name;
682
683 angular.Scope.Event.preventDefault = function() {};
684
685 angular.Scope.Event.stopPropagation = function() {};
686
687 /** @type {angular.Scope} */
688 angular.Scope.Event.targetScope;
689
690 /**
691 * @param {Object|Array|Date|string|number} obj
692 * @param {boolean=} opt_pretty
693 * @return {string}
694 */
695 angular.toJson = function(obj, opt_pretty) {};
696
697 /**
698 * @param {string} s
699 * @return {string}
700 */
701 angular.uppercase = function(s) {};
702
703 /**
704 * @type {Object}
705 */
706 angular.version = {};
707
708 /**
709 * @type {string}
710 */
711 angular.version.full = '';
712
713 /**
714 * @type {number}
715 */
716 angular.version.major = 0;
717
718 /**
719 * @type {number}
720 */
721 angular.version.minor = 0;
722
723 /**
724 * @type {number}
725 */
726 angular.version.dot = 0;
727
728 /**
729 * @type {string}
730 */
731 angular.version.codeName = '';
732
733 /******************************************************************************
734 * $anchorScroll Service
735 *****************************************************************************/
736
737 /**
738 * @typedef {function()}
739 */
740 angular.$anchorScroll;
741
742 /******************************************************************************
743 * $anchorScrollProvider Service
744 *****************************************************************************/
745
746 /**
747 * @typedef {{
748 * disableAutoScrolling: function()
749 * }}
750 */
751 angular.$anchorScrollProvider;
752
753 /**
754 * @type {function()}
755 */
756 angular.$anchorScrollProvider.disableAutoScrolling = function() {};
757
758 /******************************************************************************
759 * $compile Service
760 *****************************************************************************/
761
762 /**
763 * @typedef {
764 * function(
765 * (JQLiteSelector|Object), function(angular.Scope, Function=)=, number=):
766 * function(angular.Scope, function(Object, angular.Scope=)=): Object}
767 */
768 angular.$compile;
769
770 /******************************************************************************
771 * $cacheFactory Service
772 *****************************************************************************/
773
774 /**
775 * @typedef {
776 * function(string, angular.$cacheFactory.Options=):
777 * !angular.$cacheFactory.Cache}
778 */
779 angular.$cacheFactory;
780
781 /** @typedef {{capacity: (number|undefined)}} */
782 angular.$cacheFactory.Options;
783
784 /**
785 * @typedef {{
786 * info: function():angular.$cacheFactory.Cache.Info,
787 * put: function(string, *),
788 * get: function(string):*,
789 * remove: function(string),
790 * removeAll: function(),
791 * destroy: function()
792 * }}
793 */
794 angular.$cacheFactory.Cache;
795
796 /**
797 * @typedef {{
798 * id: string,
799 * size: number,
800 * options: angular.$cacheFactory.Options
801 * }}
802 */
803 angular.$cacheFactory.Cache.Info;
804
805 /******************************************************************************
806 * $http Service
807 *****************************************************************************/
808
809 /**
810 * This is a typedef because the closure compiler does not allow
811 * defining a type that is a function with properties.
812 * If you are trying to use the $http service as a function, try
813 * using one of the helper functions instead.
814 * @typedef {{
815 * delete: function(string, angular.$http.Config=):angular.$http.HttpPromise,
816 * get: function(string, angular.$http.Config=):angular.$http.HttpPromise,
817 * head: function(string, angular.$http.Config=):angular.$http.HttpPromise,
818 * jsonp: function(string, angular.$http.Config=):angular.$http.HttpPromise,
819 * post: function(string, *, angular.$http.Config=):angular.$http.HttpPromise,
820 * put: function(string, *, angular.$http.Config=):angular.$http.HttpPromise,
821 * defaults: angular.$http.Config,
822 * pendingRequests: Array.<angular.$http.Config>
823 * }}
824 */
825 angular.$http;
826
827 /**
828 * @typedef {{
829 * cache: (boolean|angular.$cacheFactory.Cache|undefined),
830 * data: (string|Object|undefined),
831 * headers: (Object|undefined),
832 * method: (string|undefined),
833 * params: (Object.<(string|Object)>|undefined),
834 * timeout: (number|undefined),
835 * transformRequest:
836 * (function((string|Object), Object):(string|Object)|
837 * Array.<function((string|Object), Object):(string|Object)>|undefined),
838 * transformResponse:
839 * (function((string|Object), Object):(string|Object)|
840 * Array.<function((string|Object), Object):(string|Object)>|undefined),
841 * url: (string|undefined),
842 * withCredentials: (boolean|undefined)
843 * }}
844 */
845 angular.$http.Config;
846
847 // /**
848 // * This extern is currently incomplete as delete is a reserved word.
849 // * To use delete, index $http.
850 // * Example: $http['delete'](url, opt_config);
851 // * @param {string} url
852 // * @param {angular.$http.Config=} opt_config
853 // * @return {angular.$http.HttpPromise}
854 // */
855 // angular.$http.delete = function(url, opt_config) {};
856
857 /**
858 * @param {string} url
859 * @param {angular.$http.Config=} opt_config
860 * @return {angular.$http.HttpPromise}
861 */
862 angular.$http.get = function(url, opt_config) {};
863
864 /**
865 * @param {string} url
866 * @param {angular.$http.Config=} opt_config
867 * @return {angular.$http.HttpPromise}
868 */
869 angular.$http.head = function(url, opt_config) {};
870
871 /**
872 * @param {string} url
873 * @param {angular.$http.Config=} opt_config
874 * @return {angular.$http.HttpPromise}
875 */
876 angular.$http.jsonp = function(url, opt_config) {};
877
878 /**
879 * @param {string} url
880 * @param {*} data
881 * @param {angular.$http.Config=} opt_config
882 * @return {angular.$http.HttpPromise}
883 */
884 angular.$http.post = function(url, data, opt_config) {};
885
886 /**
887 * @param {string} url
888 * @param {*} data
889 * @param {angular.$http.Config=} opt_config
890 * @return {angular.$http.HttpPromise}
891 */
892 angular.$http.put = function(url, data, opt_config) {};
893
894 /**
895 * @type {angular.$http.Config}
896 */
897 angular.$http.defaults;
898
899 /**
900 * @type {Array.<angular.$http.Config>}
901 * @const
902 */
903 angular.$http.pendingRequests;
904
905 /**
906 * @typedef {{
907 * then: function(
908 * ?function(!angular.$http.Response),
909 * function(!angular.$http.Response)=): angular.$http.HttpPromise,
910 * success: function(function(
911 * (string|Object), number, function(string=): (string|Object),
912 * !angular.$http.Config)),
913 * error: function(function(
914 * (string|Object), number, function(string=): (string|Object),
915 * !angular.$http.Config))
916 * }}
917 */
918 angular.$http.HttpPromise;
919
920 /**
921 * @param {?function(!angular.$http.Response)} successCallback
922 * @param {function(!angular.$http.Response)=} opt_errorCallback
923 * @return {angular.$http.HttpPromise}
924 */
925 angular.$http.HttpPromise.then = function(
926 successCallback, opt_errorCallback) {};
927
928 /**
929 * @param {function((string|Object), number,
930 * function(string):string, Object)} callback
931 */
932 angular.$http.HttpPromise.success = function(callback) {};
933
934 /**
935 * @param {function((string|Object), number,
936 * function(string):string, Object)} callback
937 */
938 angular.$http.HttpPromise.error = function(callback) {};
939
940 /**
941 * @typedef {{
942 * data: (string|Object),
943 * status: number,
944 * headers: function(string=): (string|Object),
945 * config: !angular.$http.Config
946 * }}
947 */
948 angular.$http.Response;
949
950 /******************************************************************************
951 * $injector Service
952 *****************************************************************************/
953
954 /**
955 * @typedef {{
956 * annotate: function((Function|Array.<string|Function>)):Array.<string>,
957 * get: function(string):*,
958 * instantiate: function(Function, Object=):Object,
959 * invoke: function(
960 * (Function|Array.<string|Function>), Object=, Object=):*
961 * }}
962 */
963 angular.$injector;
964
965 /**
966 * @param {(Function|Array.<string|Function>)} fn
967 * @return {Array.<string>}
968 */
969 angular.$injector.annotate = function(fn) {};
970
971 /**
972 * @param {string} name
973 * @return {*}
974 */
975 angular.$injector.get = function(name) {};
976
977 /**
978 * @param {Function} type
979 * @param {Object=} opt_locals
980 * @return {Object}
981 */
982 angular.$injector.instantiate = function(type, opt_locals) {};
983
984 /**
985 * @param {(Function|Array.<string|Function>)} fn
986 * @param {Object=} opt_self
987 * @param {Object=} opt_locals
988 * @return {*}
989 */
990 angular.$injector.invoke = function(fn, opt_self, opt_locals) {};
991
992 /******************************************************************************
993 * $interpolateProvider Service
994 *****************************************************************************/
995
996 /**
997 * @typedef {{
998 * startSymbol: function(string),
999 * endSymbol: function(string)
1000 * }}
1001 */
1002 angular.$interpolateProvider;
1003
1004 /** @type {function(string)} */
1005 angular.$interpolateProvider.startSymbol;
1006
1007 /** @type {function(string)} */
1008 angular.$interpolateProvider.endSymbol;
1009
1010 /******************************************************************************
1011 * $location Service
1012 *****************************************************************************/
1013
1014 /**
1015 * @typedef {{
1016 * absUrl: function():string,
1017 * hash: function(string=):string,
1018 * host: function():string,
1019 * path: function(string=):(string|angular.$location),
1020 * port: function():number,
1021 * protocol: function():string,
1022 * replace: function(),
1023 * search: function((string|Object.<string, string>)=, ?string=):
1024 * (string|!Object.<string, string>),
1025 * url: function(string=):string
1026 * }}
1027 */
1028 angular.$location;
1029
1030 /**
1031 * @return {string}
1032 */
1033 angular.$location.absUrl = function() {};
1034
1035 /**
1036 * @param {string=} opt_hash
1037 * @return {string}
1038 */
1039 angular.$location.hash = function(opt_hash) {};
1040
1041 /**
1042 * @return {string}
1043 */
1044 angular.$location.host = function() {};
1045
1046 /**
1047 * @param {string=} opt_path
1048 * @return {string|angular.$location}
1049 */
1050 angular.$location.path = function(opt_path) {};
1051
1052 /**
1053 * @return {number}
1054 */
1055 angular.$location.port = function() {};
1056
1057 /**
1058 * @return {string}
1059 */
1060 angular.$location.protocol = function() {};
1061
1062 /**
1063 * @type {function()}
1064 */
1065 angular.$location.replace = function() {};
1066
1067 /**
1068 * @param {(string|Object.<string, string>)=} opt_search
1069 * @param {?string=} opt_paramValue
1070 * @return {string|!Object.<string, string>}
1071 */
1072 angular.$location.search = function(opt_search, opt_paramValue) {};
1073
1074 /**
1075 * @param {string=} opt_url
1076 * @return {string}
1077 */
1078 angular.$location.url = function(opt_url) {};
1079
1080 /******************************************************************************
1081 * $locationProvider Service
1082 *****************************************************************************/
1083
1084 /**
1085 * @typedef {{
1086 * hashPrefix:
1087 * function(string=): (string|angular.$locationProvider),
1088 * html5Mode:
1089 * function(boolean=): (boolean|angular.$locationProvider)
1090 * }}
1091 */
1092 angular.$locationProvider;
1093
1094 /**
1095 * @param {string=} opt_prefix
1096 * @return {string|angular.$locationProvider}
1097 */
1098 angular.$locationProvider.hashPrefix = function(opt_prefix) {};
1099
1100 /**
1101 * @param {boolean=} opt_enabled
1102 * @return {boolean|angular.$locationProvider}
1103 */
1104 angular.$locationProvider.html5Mode = function(opt_enabled) {};
1105
1106 /******************************************************************************
1107 * $log Service
1108 *****************************************************************************/
1109
1110 /**
1111 * @typedef {{
1112 * error: function(...[*]),
1113 * info: function(...[*]),
1114 * log: function(...[*]),
1115 * warn: function(...[*])
1116 * }}
1117 */
1118 angular.$log;
1119
1120 /**
1121 * @param {...*} var_args
1122 */
1123 angular.$log.error = function(var_args) {};
1124
1125 /**
1126 * @param {...*} var_args
1127 */
1128 angular.$log.info = function(var_args) {};
1129
1130 /**
1131 * @param {...*} var_args
1132 */
1133 angular.$log.log = function(var_args) {};
1134
1135 /**
1136 * @param {...*} var_args
1137 */
1138 angular.$log.warn = function(var_args) {};
1139
1140 /******************************************************************************
1141 * NgModelController
1142 *****************************************************************************/
1143
1144 /**
1145 * @constructor
1146 */
1147 angular.NgModelController = function() {};
1148
1149 /**
1150 * @type {?}
1151 */
1152 angular.NgModelController.prototype.$modelValue;
1153
1154 /**
1155 * @type {boolean}
1156 */
1157 angular.NgModelController.prototype.$dirty;
1158
1159 /**
1160 * @type {!Object.<boolean>}
1161 */
1162 angular.NgModelController.prototype.$error;
1163
1164 /**
1165 * @type {!Array.<function(?):*>}
1166 */
1167 angular.NgModelController.prototype.$formatters;
1168
1169 /**
1170 * @type {boolean}
1171 */
1172 angular.NgModelController.prototype.$invalid;
1173
1174 /**
1175 * @type {!Array.<function(?):*>}
1176 */
1177 angular.NgModelController.prototype.$parsers;
1178
1179 /**
1180 * @type {boolean}
1181 */
1182 angular.NgModelController.prototype.$pristine;
1183
1184 angular.NgModelController.prototype.$render = function() {};
1185
1186 /**
1187 * @param {string} key
1188 * @param {boolean} isValid
1189 */
1190 angular.NgModelController.prototype.$setValidity = function(key, isValid) {};
1191
1192 /**
1193 * @param {?} value
1194 */
1195 angular.NgModelController.prototype.$setViewValue = function(value) {};
1196
1197 /**
1198 * @type {boolean}
1199 */
1200 angular.NgModelController.prototype.$valid;
1201
1202 /**
1203 * @type {!Array.<function()>}
1204 */
1205 angular.NgModelController.prototype.$viewChangeListeners;
1206
1207 /**
1208 * @type {?}
1209 */
1210 angular.NgModelController.prototype.$viewValue;
1211
1212 /******************************************************************************
1213 * $provide Service
1214 *****************************************************************************/
1215
1216 /**
1217 * @typedef {{
1218 * constant: function(string, *): Object,
1219 * decorator: function(string, (Function|Array.<string|Function>)),
1220 * factory: function(string, (Function|Array.<string|Function>)): Object,
1221 * provider: function(string, (Function|Array.<string|Function>)): Object,
1222 * service: function(string, (Function|Array.<string|Function>)): Object,
1223 * value: function(string, *): Object
1224 * }}
1225 */
1226 angular.$provide;
1227
1228 /**
1229 * @param {string} name
1230 * @param {*} object
1231 * @return {Object}
1232 */
1233 angular.$provide.constant = function(name, object) {};
1234
1235 /**
1236 * @param {string} name
1237 * @param {Function|Array.<string|Function>} decorator
1238 */
1239 angular.$provide.decorator = function(name, decorator) {};
1240
1241 /**
1242 * @param {string} name
1243 * @param {Function|Array.<string|Function>} providerFunction
1244 * @return {Object}
1245 */
1246 angular.$provide.factory = function(name, providerFunction) {};
1247
1248 /**
1249 * @param {string} name
1250 * @param {Function|Array.<string|Function>} providerType
1251 * @return {Object}
1252 */
1253 angular.$provide.provider = function(name, providerType) {};
1254
1255 /**
1256 * @param {string} name
1257 * @param {Function|Array.<string|Function>} constructor
1258 * @return {Object}
1259 */
1260 angular.$provide.service = function(name, constructor) {};
1261
1262 /**
1263 * @param {string} name
1264 * @param {*} object
1265 * @return {Object}
1266 */
1267 angular.$provide.value = function(name, object) {};
1268
1269 /******************************************************************************
1270 * $q Service
1271 *****************************************************************************/
1272
1273 /**
1274 * @typedef {{
1275 * all: function(Array.<angular.$q.Promise>): angular.$q.Promise,
1276 * defer: function():angular.$q.Deferred,
1277 * reject: function(*):angular.$q.Promise,
1278 * when: function(*):angular.$q.Promise
1279 * }}
1280 */
1281 angular.$q;
1282
1283 /**
1284 * @param {Array.<angular.$q.Promise>} promises
1285 * @return {angular.$q.Promise}
1286 */
1287 angular.$q.all = function(promises) {};
1288
1289 /**
1290 * @return {angular.$q.Deferred}
1291 */
1292 angular.$q.defer = function() {};
1293
1294 /**
1295 * @param {*} reason
1296 * @return {angular.$q.Promise}
1297 */
1298 angular.$q.reject = function(reason) {};
1299
1300 /**
1301 * @param {*} value
1302 * @return {angular.$q.Promise}
1303 */
1304 angular.$q.when = function(value) {};
1305
1306 /**
1307 * @typedef {{
1308 * resolve: function(*=),
1309 * reject: function(*=),
1310 * promise: angular.$q.Promise
1311 * }}
1312 */
1313 angular.$q.Deferred;
1314
1315 /** @param {*=} opt_value */
1316 angular.$q.Deferred.resolve = function(opt_value) {};
1317
1318 /** @param {*=} opt_reason */
1319 angular.$q.Deferred.reject = function(opt_reason) {};
1320
1321 /** @type {angular.$q.Promise} */
1322 angular.$q.Deferred.promise;
1323
1324 /**
1325 * @typedef {{then: function(?function(?), function(?)=): angular.$q.Promise}}
1326 */
1327 angular.$q.Promise;
1328
1329 /**
1330 * @param {?function(?)} successCallback
1331 * @param {function(?)=} opt_errorCallback
1332 * @return {angular.$q.Promise}
1333 */
1334 angular.$q.Promise.then = function(successCallback, opt_errorCallback) {};
1335
1336 /******************************************************************************
1337 * $route Service
1338 *****************************************************************************/
1339
1340 /**
1341 * @typedef {{
1342 * reload: function(),
1343 * current: angular.$route.Route,
1344 * routes: Array.<angular.$route.Route>
1345 * }}
1346 */
1347 angular.$route;
1348
1349 /** @type {function()} */
1350 angular.$route.reload = function() {};
1351
1352 /** @type {angular.$route.Route} */
1353 angular.$route.current;
1354
1355 /** @type {Array.<angular.$route.Route>} */
1356 angular.$route.routes;
1357
1358 /**
1359 * @typedef {{
1360 * $route: angular.$routeProvider.Params,
1361 * locals: Object.<string, *>,
1362 * params: Object.<string, string>,
1363 * pathParams: Object.<string, string>,
1364 * scope: Object.<string, *>
1365 * }}
1366 */
1367 angular.$route.Route;
1368
1369 /** @type {angular.$routeProvider.Params} */
1370 angular.$route.Route.$route;
1371
1372 /** @type {Object.<string, *>} */
1373 angular.$route.Route.locals;
1374
1375 /** @type {Object.<string, string>} */
1376 angular.$route.Route.params;
1377
1378 /** @type {Object.<string, string>} */
1379 angular.$route.Route.pathParams;
1380
1381 /** @type {Object.<string, *>} */
1382 angular.$route.Route.scope;
1383
1384 /******************************************************************************
1385 * $routeProvider Service
1386 *****************************************************************************/
1387
1388 /**
1389 * @typedef {{
1390 * otherwise:
1391 * function(angular.$routeProvider.Params): angular.$routeProvider,
1392 * when:
1393 * function(
1394 * string, angular.$routeProvider.Params): angular.$routeProvider
1395 * }}
1396 */
1397 angular.$routeProvider;
1398
1399 /**
1400 * @param {angular.$routeProvider.Params} params
1401 * @return {angular.$routeProvider}
1402 */
1403 angular.$routeProvider.otherwise = function(params) {};
1404
1405 /**
1406 * @param {string} path
1407 * @param {angular.$routeProvider.Params} route
1408 * @return {angular.$routeProvider}
1409 */
1410 angular.$routeProvider.when = function(path, route) {};
1411
1412 /**
1413 * @typedef {{
1414 * controller: (Function|Array.<string|Function>|string|undefined),
1415 * template: (string|undefined),
1416 * templateUrl: (string|undefined),
1417 * resolve: (Object.<string, (
1418 * string|Function|Array.<string|Function>|angular.$q.Promise
1419 * )>|undefined),
1420 * redirectTo: (string|function()|undefined),
1421 * reloadOnSearch: (boolean|undefined)
1422 * }}
1423 */
1424 angular.$routeProvider.Params;
1425
1426 /** @type {Function|Array.<string|Function>|string} */
1427 angular.$routeProvider.Params.controller;
1428
1429 /** @type {string} */
1430 angular.$routeProvider.Params.template;
1431
1432 /** @type {string} */
1433 angular.$routeProvider.Params.templateUrl;
1434
1435 /**
1436 * @type {
1437 * Object.<string, (
1438 * string|Function|Array.<string|Function>|angular.$q.Promise
1439 * )>}
1440 */
1441 angular.$routeProvider.Params.resolve;
1442
1443 /** @type {string|function()} */
1444 angular.$routeProvider.Params.redirectTo;
1445
1446 /** @type {boolean} */
1447 angular.$routeProvider.Params.reloadOnSearch;
1448
1449 /******************************************************************************
1450 * $timeout Service
1451 *****************************************************************************/
1452
1453 /**
1454 * @typedef {function(function(), number=, boolean=):angular.$q.Promise}
1455 */
1456 angular.$timeout;
1457
1458 /**
1459 * Augment the angular.$timeout type definition by reopening the type via an
1460 * artificial angular.$timeout instance.
1461 *
1462 * This allows us to define methods on function objects which is something
1463 * that can't be expressed via typical type annotations.
1464 *
1465 * @type {angular.$timeout}
1466 */
1467 angular.$timeout_;
1468
1469 /**
1470 * @type {function(angular.$q.Promise):boolean}
1471 */
1472 angular.$timeout_.cancel = function(promise) {};