@angular-wave/angular.ts 0.0.38 → 0.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/Makefile +8 -5
  2. package/README.md +1 -1
  3. package/dist/angular-ts.esm.js +2 -1
  4. package/dist/angular-ts.umd.js +2 -1
  5. package/package.json +2 -4
  6. package/rollup.config.js +11 -2
  7. package/src/angular.spec.js +25 -26
  8. package/src/animations/animate-css-driver.js +3 -3
  9. package/src/animations/animate-queue.js +7 -7
  10. package/src/animations/animation.js +2 -2
  11. package/src/animations/shared.js +6 -6
  12. package/src/binding.spec.js +7 -7
  13. package/src/core/animate/animate.js +5 -5
  14. package/src/core/animate/animate.spec.js +31 -31
  15. package/src/core/cache/cache-factory.html +18 -0
  16. package/src/core/cache/{cache-factor.test.js → cache-factory.test.js} +1 -1
  17. package/src/core/compile/compile.js +31 -25
  18. package/src/core/compile/compile.md +2 -2
  19. package/src/core/cookie-reader.spec.js +2 -2
  20. package/src/core/core.html +22 -0
  21. package/src/core/core.test.js +12 -0
  22. package/src/core/document.spec.js +4 -4
  23. package/src/core/exception-handler.js +30 -23
  24. package/src/core/interpolate/interpolate.js +7 -0
  25. package/src/core/{cache/cache-factor.html → location/location.html} +1 -1
  26. package/src/core/location/location.js +2 -2
  27. package/src/core/location/location.spec.js +17 -17
  28. package/src/core/location/location.test.js +12 -0
  29. package/src/core/on.spec.js +3 -3
  30. package/src/core/parser/parse.html +18 -0
  31. package/src/core/parser/parse.spec.js +1 -1
  32. package/src/core/parser/parse.test.js +12 -0
  33. package/src/core/prop.spec.js +3 -4
  34. package/src/core/pubsub/pubsub.html +18 -0
  35. package/src/core/pubsub/pubsub.spec.js +1 -1
  36. package/src/core/pubsub/pubsub.test.js +12 -0
  37. package/src/core/q/q.html +18 -0
  38. package/src/core/q/q.js +33 -0
  39. package/src/core/q/q.test.js +0 -0
  40. package/src/core/root-element.spec.js +4 -4
  41. package/src/core/sanitize/sanitize-uri.spec.js +1 -1
  42. package/src/core/sanitize/sanitize-uri.test.js +12 -0
  43. package/src/core/sanitize/sanitize.html +21 -0
  44. package/src/core/sce/sce.html +18 -0
  45. package/src/core/sce/sce.spec.js +2 -1
  46. package/src/core/sce/sce.test.js +12 -0
  47. package/src/core/scope/scope.html +18 -0
  48. package/src/core/scope/scope.js +5 -8
  49. package/src/core/scope/scope.spec.js +1 -1
  50. package/src/core/scope/scope.test.js +12 -0
  51. package/src/core/task-tracker-factory.js +9 -11
  52. package/src/core/timeout/timeout.html +18 -0
  53. package/src/core/timeout/timeout.js +9 -0
  54. package/src/core/timeout/timeout.spec.js +2 -2
  55. package/src/core/timeout/timout.test.js +12 -0
  56. package/src/core/url-utils/url-utils.html +18 -0
  57. package/src/core/url-utils/url-utils.spec.js +4 -2
  58. package/src/core/url-utils/url-utils.test.js +12 -0
  59. package/src/directive/attrs/attrs.spec.js +1 -2
  60. package/src/directive/attrs/boolean.spec.js +1 -2
  61. package/src/directive/attrs/element-style.spec.js +6 -7
  62. package/src/directive/attrs/src.spec.js +1 -2
  63. package/src/directive/bind/bind.spec.js +1 -2
  64. package/src/directive/class/class.spec.js +15 -16
  65. package/src/directive/cloak/cloak.spec.js +3 -4
  66. package/src/directive/controller/controller.spec.js +4 -5
  67. package/src/directive/events/click.spec.js +1 -2
  68. package/src/directive/events/event.spec.js +1 -1
  69. package/src/directive/events/events.js +7 -0
  70. package/src/directive/form/form.spec.js +17 -17
  71. package/src/directive/if/if.spec.js +2 -2
  72. package/src/directive/include/include.js +2 -2
  73. package/src/directive/include/include.spec.js +32 -32
  74. package/src/directive/init/init.spec.js +2 -3
  75. package/src/directive/input/input.spec.js +3 -3
  76. package/src/directive/list/list.spec.js +1 -2
  77. package/src/directive/model/model.js +13 -0
  78. package/src/directive/model/model.spec.js +4 -5
  79. package/src/directive/model-options/model-options.spec.js +3 -3
  80. package/src/directive/non-bindable/non-bindable.spec.js +1 -2
  81. package/src/directive/options/options.js +5 -5
  82. package/src/directive/options/options.spec.js +13 -13
  83. package/src/directive/ref/href.spec.js +1 -2
  84. package/src/directive/repeat/repeat.spec.js +12 -12
  85. package/src/directive/script/script.spec.js +2 -3
  86. package/src/directive/select/select.js +6 -6
  87. package/src/directive/select/select.spec.js +5 -5
  88. package/src/directive/show-hide/show-hide.spec.js +12 -13
  89. package/src/directive/style/style.spec.js +3 -4
  90. package/src/directive/switch/switch.spec.js +2 -3
  91. package/src/directive/validators/validators.spec.js +1 -1
  92. package/src/exts/aria/aria.spec.js +1 -2
  93. package/src/exts/messages/messages.spec.js +5 -5
  94. package/src/filters/filter.spec.js +5 -5
  95. package/src/filters/filters.html +21 -0
  96. package/src/filters/filters.spec.js +3 -3
  97. package/src/filters/filters.test.js +12 -0
  98. package/src/filters/limit-to.md +1 -1
  99. package/src/filters/limit-to.spec.js +4 -4
  100. package/src/filters/order-by.spec.js +2 -2
  101. package/src/index.js +462 -1
  102. package/src/loader.js +62 -17
  103. package/src/public.js +6 -2
  104. package/src/router/directives/state-directives.spec.js +90 -90
  105. package/src/router/directives/view-directive.js +2 -2
  106. package/src/router/directives/view-directive.spec.js +9 -9
  107. package/src/router/state/state.spec.js +2 -4
  108. package/src/router/template-factory.spec.js +2 -2
  109. package/src/router/transition/hook-registry.js +2 -2
  110. package/src/router/view/view.spec.js +1 -1
  111. package/src/services/browser.js +56 -39
  112. package/src/services/document.js +16 -13
  113. package/src/services/log.js +39 -43
  114. package/src/services/template-request.js +9 -0
  115. package/src/shared/common.js +0 -3
  116. package/src/shared/jqlite/jqlite.js +83 -89
  117. package/src/shared/jqlite/jqlite.spec.js +218 -222
  118. package/src/shared/strings.js +2 -2
  119. package/src/shared/test-utils.js +2 -2
  120. package/src/shared/utils.js +8 -11
  121. package/src/src.test.js +10 -0
  122. package/tsconfig.json +1 -1
  123. package/tsconfig.types.json +11 -0
  124. package/types/animations/animate-cache.d.ts +7 -7
  125. package/types/animations/animate-children-directive.d.ts +3 -6
  126. package/types/animations/animate-swap.d.ts +7 -16
  127. package/types/animations/animation.d.ts +2 -11
  128. package/types/animations/raf-scheduler.d.ts +3 -3
  129. package/types/animations/shared.d.ts +9 -24
  130. package/types/core/{animate-css.d.ts → animate/animate-css.d.ts} +2 -8
  131. package/types/core/{cache.d.ts → cache/cache.d.ts} +5 -5
  132. package/types/core/compile/compile.d.ts +173 -0
  133. package/types/core/controller/controller.d.ts +32 -0
  134. package/types/core/exception-handler.d.ts +9 -42
  135. package/types/core/filter/filter.d.ts +9 -0
  136. package/types/core/{interpolate.d.ts → interpolate/interpolate.d.ts} +23 -39
  137. package/types/core/interval/interval-factory.d.ts +4 -0
  138. package/types/core/{interval.d.ts → interval/interval.d.ts} +1 -1
  139. package/types/core/location/location.d.ts +209 -0
  140. package/types/core/pubsub/pubsub.d.ts +156 -0
  141. package/types/core/q/q.d.ts +65 -0
  142. package/types/core/sanitize/sanitize-uri.d.ts +53 -0
  143. package/types/core/{sce.d.ts → sce/sce.d.ts} +80 -86
  144. package/types/core/scope/scope.d.ts +727 -0
  145. package/types/core/task-tracker-factory.d.ts +45 -38
  146. package/types/core/timeout/timeout.d.ts +29 -0
  147. package/types/core/{urlUtils.d.ts → url-utils/url-utils.d.ts} +2 -7
  148. package/types/directive/{bind.d.ts → bind/bind.d.ts} +4 -10
  149. package/types/directive/{class.d.ts → class/class.d.ts} +12 -21
  150. package/types/directive/controller/controller.d.ts +6 -0
  151. package/types/directive/events/events.d.ts +5 -0
  152. package/types/directive/form/form.d.ts +200 -0
  153. package/types/directive/if/if.d.ts +8 -0
  154. package/types/directive/include/include.d.ts +14 -0
  155. package/types/directive/{input.d.ts → input/input.d.ts} +20 -69
  156. package/types/directive/{model.d.ts → model/model.d.ts} +281 -280
  157. package/types/directive/options/options.d.ts +9 -0
  158. package/types/directive/ref/ref.d.ts +5 -0
  159. package/types/directive/repeat/repeat.d.ts +8 -0
  160. package/types/directive/{script.d.ts → script/script.d.ts} +5 -8
  161. package/types/directive/{show-hide.d.ts → show-hide/show-hide.d.ts} +10 -16
  162. package/types/directive/switch/switch.d.ts +17 -0
  163. package/types/directive/transclude/transclude.d.ts +4 -0
  164. package/types/directive/{validators.d.ts → validators/validators.d.ts} +20 -35
  165. package/types/filters/filters.d.ts +10 -16
  166. package/types/filters/order-by.d.ts +2 -4
  167. package/types/index.d.ts +702 -0
  168. package/types/injector.d.ts +12 -0
  169. package/types/public.d.ts +5 -0
  170. package/types/router/common/coreservices.d.ts +2 -2
  171. package/types/router/common/glob.d.ts +9 -9
  172. package/types/router/common/queue.d.ts +13 -13
  173. package/types/router/common/trace.d.ts +43 -43
  174. package/types/router/directives/view-directive.d.ts +13 -32
  175. package/types/router/globals.d.ts +20 -20
  176. package/types/router/hooks/lazy-load.d.ts +2 -11
  177. package/types/router/hooks/redirect-to.d.ts +1 -4
  178. package/types/router/hooks/url.d.ts +1 -5
  179. package/types/router/hooks/views.d.ts +1 -4
  180. package/types/router/params/param-factory.d.ts +5 -5
  181. package/types/router/params/param-type.d.ts +35 -35
  182. package/types/router/params/param-types.d.ts +11 -11
  183. package/types/router/params/param.d.ts +38 -38
  184. package/types/router/params/state-params.d.ts +10 -10
  185. package/types/router/path/path-node.d.ts +34 -34
  186. package/types/router/path/path-utils.d.ts +73 -77
  187. package/types/router/resolve/resolvable.d.ts +32 -32
  188. package/types/router/resolve/resolve-context.d.ts +84 -84
  189. package/types/router/services.d.ts +4 -9
  190. package/types/router/state/state-builder.d.ts +27 -27
  191. package/types/router/state/state-matcher.d.ts +5 -5
  192. package/types/router/state/state-object.d.ts +58 -58
  193. package/types/router/state/state-queue-manager.d.ts +10 -16
  194. package/types/router/state/state-registry.d.ts +100 -107
  195. package/types/router/state/state-service.d.ts +411 -411
  196. package/types/router/state/target-state.d.ts +64 -69
  197. package/types/router/state/views.d.ts +31 -37
  198. package/types/router/state-filters.d.ts +7 -7
  199. package/types/router/state-provider.d.ts +105 -105
  200. package/types/router/template-factory.d.ts +83 -112
  201. package/types/router/transition/hook-builder.d.ts +25 -25
  202. package/types/router/transition/hook-registry.d.ts +68 -83
  203. package/types/router/transition/interface.d.ts +7 -7
  204. package/types/router/transition/reject-factory.d.ts +34 -34
  205. package/types/router/transition/transition-event-type.d.ts +9 -18
  206. package/types/router/transition/transition-hook.d.ts +77 -82
  207. package/types/router/transition/transition-service.d.ts +82 -99
  208. package/types/router/transition/transition.d.ts +369 -377
  209. package/types/router/url/url-config.d.ts +84 -84
  210. package/types/router/url/url-matcher.d.ts +115 -119
  211. package/types/router/url/url-rule.d.ts +114 -124
  212. package/types/router/url/url-rules.d.ts +217 -217
  213. package/types/router/url/url-service.d.ts +264 -269
  214. package/types/router/view/view.d.ts +114 -117
  215. package/types/router/view-scroll.d.ts +2 -2
  216. package/types/services/anchor-scroll.d.ts +2 -8
  217. package/types/services/browser.d.ts +157 -135
  218. package/types/services/cache-factory.d.ts +25 -25
  219. package/types/services/cookie-reader.d.ts +2 -2
  220. package/types/services/document.d.ts +13 -9
  221. package/types/services/http/http.d.ts +145 -0
  222. package/types/services/{http-backend.d.ts → http-backend/http-backend.d.ts} +3 -35
  223. package/types/services/log.d.ts +55 -52
  224. package/types/services/template-request.d.ts +44 -53
  225. package/types/shared/common.d.ts +4 -20
  226. package/types/{constants.d.ts → shared/constants.d.ts} +6 -6
  227. package/types/shared/hof.d.ts +1 -1
  228. package/types/{jqLite.d.ts → shared/jqlite/jqlite.d.ts} +16 -17
  229. package/types/shared/test-utils.d.ts +11 -0
  230. package/types/shared/utils.d.ts +29 -46
  231. package/types-back/global.d.ts +3 -1
  232. package/types-back/index.d.ts +3 -296
  233. package/types/core/compile.d.ts +0 -206
  234. package/types/core/controller.d.ts +0 -42
  235. package/types/core/filter.d.ts +0 -9
  236. package/types/core/interval-factory.d.ts +0 -21
  237. package/types/core/location.d.ts +0 -234
  238. package/types/core/pubsub.d.ts +0 -164
  239. package/types/core/q.d.ts +0 -33
  240. package/types/core/root-scope.d.ts +0 -754
  241. package/types/core/sanitize-uri.d.ts +0 -57
  242. package/types/core/timeout.d.ts +0 -31
  243. package/types/directive/controller.d.ts +0 -6
  244. package/types/directive/events.d.ts +0 -12
  245. package/types/directive/form.d.ts +0 -230
  246. package/types/directive/if.d.ts +0 -17
  247. package/types/directive/include.d.ts +0 -33
  248. package/types/directive/options.d.ts +0 -16
  249. package/types/directive/ref.d.ts +0 -11
  250. package/types/directive/repeat.d.ts +0 -23
  251. package/types/directive/switch.d.ts +0 -23
  252. package/types/directive/transclude.d.ts +0 -15
  253. package/types/services/http.d.ts +0 -157
  254. /package/src/core/cache/{cache-factor.spec.js → cache-factory.spec.js} +0 -0
  255. /package/types/directive/{attrs.d.ts → attrs/attrs.d.ts} +0 -0
  256. /package/types/directive/{change.d.ts → change/change.d.ts} +0 -0
  257. /package/types/directive/{cloak.d.ts → cloak/cloak.d.ts} +0 -0
  258. /package/types/directive/{init.d.ts → init/init.d.ts} +0 -0
  259. /package/types/directive/{list.d.ts → list/list.d.ts} +0 -0
  260. /package/types/directive/{non-bindable.d.ts → non-bindable/non-bindable.d.ts} +0 -0
  261. /package/types/directive/{style.d.ts → style/style.d.ts} +0 -0
  262. /package/types/exts/{aria.d.ts → aria/aria.d.ts} +0 -0
  263. /package/types/exts/{messages.d.ts → messages/messages.d.ts} +0 -0
package/src/index.js CHANGED
@@ -2,7 +2,468 @@ import { Angular, angularInit } from "./loader";
2
2
  import { publishExternalAPI } from "./public";
3
3
 
4
4
  /**
5
- * @type {angular.IAngularStatic}
5
+ * @typedef {Object} angular.BootstrapConfig
6
+ * @description Configuration option for AngularTS bootstrap process.
7
+ * @property {boolean} debugInfoEnabled - Indicates whether debug information should be enabled. Setting this to `false` can improve performance but will disable some debugging features.
8
+ * @property {boolean} [strictDi] - Disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. Defaults to `false`.
9
+ */
10
+
11
+ /**
12
+ * @typedef {Function|Array<string|Function>} angular.Injectable
13
+ * @description Represents a type that can be injected, either as a function or an array of strings/functions.
14
+ * @template T
15
+ */
16
+
17
+ /**
18
+ * @typedef {Object} angular.ComponentOptions
19
+ * @description Component definition object (a simplified directive definition object)
20
+ * @property {string | angular.angular.Injectable<angular.ControllerConstructor>> | undefined} [controller]
21
+ * Controller constructor function or name of a registered controller.
22
+ * Use array form for dependencies (necessary with strictDi).
23
+ * @property {string | undefined} [controllerAs]
24
+ * Identifier name for the controller published to its scope (default: '$ctrl').
25
+ * @property {string | angular.angular.Injectable<(...args: any[]) => string> | undefined} [template]
26
+ * HTML template string or function returning an HTML template.
27
+ * If a function, injects $element and $attrs.
28
+ * Use array form for dependencies (necessary with strictDi).
29
+ * @property {string | angular.angular.Injectable<(...args: any[]) => string> | undefined} [templateUrl]
30
+ * Path or function returning a path to an HTML template.
31
+ * If a function, injects $element and $attrs.
32
+ * Use array form for dependencies (necessary with strictDi).
33
+ * @property {{ [boundProperty: string]: string } | undefined} [bindings]
34
+ * DOM attribute bindings to component properties.
35
+ * Component properties are bound to the controller, not the scope.
36
+ * @property {boolean | { [slot: string]: string } | undefined} [transclude]
37
+ * Whether transclusion is enabled. Disabled by default.
38
+ * @property {{ [controller: string]: string } | undefined} [require]
39
+ * Requires controllers of other directives, binding them to this component's controller.
40
+ * Keys specify property names under which required controllers (object values) are bound.
41
+ * Required controllers available before $onInit method execution.
42
+ */
43
+
44
+ /**
45
+ * @typedef {Function} angular.ControllerConstructor
46
+ * @description Controller constructor type for AngularJS. Note: Instead of classes, plain functions are often used as controller constructors, especially in examples.
47
+ * @param {...any} args Arguments passed to the controller constructor.
48
+ * @returns {void | angular.Controller} Returns nothing or an instance of IController.
49
+ */
50
+
51
+ /**
52
+ * @typedef {Object} angular.OnChangesObject
53
+ * @description Object representing changes in one-way bound properties.
54
+ * Keys are the names of the bound properties that have changed, and values are instances of IChangesObject.
55
+ * @property {angular.ChangesObject<any>} property - Represents a changed property.
56
+ */
57
+
58
+ /**
59
+ * @typedef {Object} angular.ChangesObject
60
+ * @description Object representing changes in a property.
61
+ * @property {*} currentValue - Current value of the property.
62
+ * @property {*} previousValue - Previous value of the property.
63
+ * @property {function(): boolean} isFirstChange - Function to check if it's the first change of the property.
64
+ */
65
+
66
+ /**
67
+ * @typedef {Object} angular.Controller
68
+ * @description Interface representing the lifecycle hooks for AngularJS directive controllers.
69
+ * @see {@link https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks}
70
+ * @see {@link https://docs.angularjs.org/guide/component}
71
+ *
72
+ * @property {function(): void} [$onInit]
73
+ * Called on each controller after all the controllers on an element have been constructed and had their bindings
74
+ * initialized (and before the pre & post linking functions for the directives on this element). This is a good
75
+ * place to put initialization code for your controller.
76
+ *
77
+ * @property {function(): void} [$doCheck]
78
+ * Called on each turn of the digest cycle. Provides an opportunity to detect and act on changes.
79
+ * Any actions that you wish to take in response to the changes that you detect must be invoked from this hook;
80
+ * implementing this has no effect on when `$onChanges` is called. For example, this hook could be useful if you wish
81
+ * to perform a deep equality check, or to check a `Date` object, changes to which would not be detected by Angular's
82
+ * change detector and thus not trigger `$onChanges`. This hook is invoked with no arguments; if detecting changes,
83
+ * you must store the previous value(s) for comparison to the current values.
84
+ *
85
+ * @property {function(angular.OnChangesObject): void} [$onChanges]
86
+ * Called whenever one-way bindings are updated. The onChangesObj is a hash whose keys are the names of the bound
87
+ * properties that have changed, and the values are an {@link IChangesObject} object of the form
88
+ * { currentValue, previousValue, isFirstChange() }. Use this hook to trigger updates within a component such as
89
+ * cloning the bound value to prevent accidental mutation of the outer value.
90
+ *
91
+ * @property {function(): void} [$onDestroy]
92
+ * Called on a controller when its containing scope is destroyed. Use this hook for releasing external resources,
93
+ * watches and event handlers.
94
+ *
95
+ * @property {function(): void} [$postLink]
96
+ * Called after this controller's element and its children have been linked. Similar to the post-link function this
97
+ * hook can be used to set up DOM event handlers and do direct DOM manipulation. Note that child elements that contain
98
+ * templateUrl directives will not have been compiled and linked since they are waiting for their template to load
99
+ * asynchronously and their own compilation and linking has been suspended until that occurs. This hook can be considered
100
+ * analogous to the ngAfterViewInit and ngAfterContentInit hooks in Angular 2. Since the compilation process is rather
101
+ * different in Angular 1 there is no direct mapping and care should be taken when upgrading.
102
+ *
103
+ * @property {*} [s: string]
104
+ * IController implementations frequently do not implement any of its methods.
105
+ * A string indexer indicates to TypeScript not to issue a weak type error in this case.
106
+ */
107
+
108
+ /**
109
+ * @typedef {Object.<string, any>} angular.Attributes
110
+ *
111
+ * @property {(name: string) => string} $normalize
112
+ * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with x- or data-) to its normalized, camelCase form.
113
+ * Also there is special case for Moz prefix starting with upper case letter.
114
+ *
115
+ * @property {(newClasses: string, oldClasses: string) => void} $updateClass
116
+ * Adds and removes the appropriate CSS class values to the element based on the difference between
117
+ * the new and old CSS class values (specified as newClasses and oldClasses).
118
+ *
119
+ * @property {(key: string, value: any) => void} $set
120
+ * Set DOM element attribute value.
121
+ *
122
+ * @property {<T>(name: string, fn: (value?: T) => any) => Function} $observe
123
+ * Observes an interpolated attribute.
124
+ * The observer function will be invoked once during the next $digest
125
+ * following compilation. The observer is then invoked whenever the
126
+ * interpolated value changes.
127
+ *
128
+ * @property {Object.<string, string>} $attr
129
+ * A map of DOM element attribute names to the normalized name. This is needed
130
+ * to do reverse lookup from normalized name back to actual name.
131
+ * @see http://docs.angularjs.org/api/ng/type/$compile.directive.Attributes
132
+ */
133
+
134
+ /**
135
+ * @typedef {import('./core/scope/scope').Scope} TScope
136
+ */
137
+
138
+ /**
139
+ * @typedef {import('./shared/jqlite/jqlite').JQLite} TElement
140
+ */
141
+
142
+ /**
143
+ * @typedef {angular.Attributes} TAttributes
144
+ */
145
+
146
+ /**
147
+ * @typedef {angular.DirectiveController} TController
148
+ */
149
+
150
+ /**
151
+ * @typedef {angular.Controller | angular.Controller[] | { [key: string]: angular.Controller }} angular.DirectiveController
152
+ * @description Represents a directive controller, which can be:
153
+ * - A single instance of {@link angular.Controller}
154
+ * - An array of {@link angular.Controller}
155
+ * - An object where keys are string identifiers and values are {@link angular.Controller}
156
+ */
157
+
158
+ /**
159
+ * @template [S=import('./core/scope/scope').Scope]
160
+ * @template {TScope} S - The type of the directive's scope.
161
+ *
162
+ * @template [T=import('./shared/jqlite/jqlite').JQLite]
163
+ * @template {TElement} T - The type of the directive's element.
164
+ *
165
+ * @template [A=angular.Attributes]
166
+ * @template {TAttributes} A - The type of the directive's attributes.
167
+ *
168
+ * @template [C=angular.Controller]
169
+ * @template {TController} C - The type of the directive's controller.
170
+ */
171
+
172
+ /**
173
+ * Compile function for an AngularJS directive.
174
+ *
175
+ * @template TScope
176
+ * @template TElement
177
+ * @template TAttributes
178
+ * @template TController
179
+ * @callback angular.DirectiveCompileFn
180
+ * @param {TElement} templateElement - The template element.
181
+ * @param {TAttributes} templateAttributes - The template attributes.
182
+ * @param {angular.TranscludeFunction} transclude - @deprecated The transclude function. Note: The transclude function that is passed to the compile function is deprecated,
183
+ * as it e.g. does not know about the right outer scope. Please use the transclude function
184
+ * that is passed to the link function instead.
185
+ * @returns {void | angular.DirectiveLinkFn<S, T, A, C> | angular.DirectivePrePost<S, T, A, C>} Returns void, angular.DirectiveLinkFn, or angular.DirectivePrePost.
186
+ */
187
+
188
+ /**
189
+ * Link function for an AngularJS directive.
190
+ *
191
+ * @template TScope
192
+ * @template TElement
193
+ * @template TAttributes
194
+ * @template TController
195
+ * @callback angular.DirectiveLinkFn
196
+ * @param {TScope} scope
197
+ * @param {TElement} instanceElement
198
+ * @param {TAttributes} instanceAttributes
199
+ * @param {TController} [controller]
200
+ * @param {angular.TranscludeFunction} [transclude]
201
+ * @returns {void}
202
+ */
203
+
204
+ /**
205
+ * @callback angular.CloneAttachFunction
206
+ * @param {JQLite} [clonedElement]
207
+ * @param {Scope} [scope] // Let's hint but not force cloneAttachFn's signature
208
+ * @returns {any}
209
+ */
210
+
211
+ /**
212
+ * This corresponds to $transclude passed to controllers and to the transclude function passed to link functions.
213
+ * https://docs.angularjs.org/api/ng/service/$compile#-controller-
214
+ * http://teropa.info/blog/2015/06/09/transclusion.html
215
+ *
216
+ * @typedef {Object} angular.TranscludeFunction
217
+ * @property {function(TScope, angular.CloneAttachFunction, JQLite=, string=): JQLite} transcludeWithScope
218
+ * @property {function(angular.CloneAttachFunction=, JQLite=, string=): JQLite} transcludeWithoutScope
219
+ * @property {function(string): boolean} isSlotFilled - Returns true if the specified slot contains content (i.e., one or more DOM nodes)
220
+ */
221
+
222
+ /**
223
+ * @typedef {function(TScope, angular.CloneAttachFunction, JQLite=, string=): JQLite} transcludeWithScope
224
+ */
225
+
226
+ /**
227
+ * @typedef {function(angular.CloneAttachFunction=, JQLite=, string=): JQLite} transcludeWithoutScope
228
+ */
229
+
230
+ /**
231
+ * Represents the pre and post linking functions of a directive.
232
+ *
233
+ * @template TScope The type of scope associated with the directive.
234
+ * @template TElement The type of element that the directive matches.
235
+ * @template TAttributes The type of attributes of the directive.
236
+ * @template TController The type of controller associated with the directive.
237
+ *
238
+ * @typedef {Object} angular.DirectivePrePost
239
+ * @property {angular.DirectiveLinkFn<S, T, A, C> | undefined} [pre]
240
+ * The pre-linking function of the directive.
241
+ * @property {angular.DirectiveLinkFn<S, T, A, C> | undefined} [post]
242
+ * The post-linking function of the directive.
243
+ */
244
+
245
+ /**
246
+ * Directive definition object.
247
+ *
248
+ * @template TScope - The type of the directive's scope.
249
+ * @template TElement - The type of the directive's element.
250
+ * @template TAttributes - The type of the directive's attributes.
251
+ * @template TController - The type of the directive's controller.
252
+ *
253
+ * @typedef {Object} angular.Directive
254
+ * @property {angular.DirectiveCompileFn<S, T, A, C> | undefined} [compile]
255
+ * Compile function for the directive.
256
+ * @property {string | angular.Injectable<angular.ControllerConstructor> | undefined} [controller]
257
+ * Controller constructor or name.
258
+ * @property {string | undefined} [controllerAs]
259
+ * Controller alias.
260
+ * @property {boolean | { [boundProperty: string]: string } | undefined} [bindToController]
261
+ * Bindings to controller.
262
+ * @property {angular.DirectiveLinkFn<S, T, A, C> | angular.DirectivePrePost<S, T, A, C> | undefined} [link]
263
+ * Link function.
264
+ * @property {boolean | undefined} [multiElement]
265
+ * Multi-element directive flag.
266
+ * @property {number | undefined} [priority]
267
+ * Directive priority.
268
+ * @property {boolean | undefined} [replace]
269
+ * Deprecated: Replace flag.
270
+ * @property {string | string[] | { [controller: string]: string } | undefined} [require]
271
+ * Required controllers.
272
+ * @property {string | undefined} [restrict]
273
+ * Restriction mode.
274
+ * @property {boolean | { [boundProperty: string]: string } | undefined} [scope]
275
+ * Scope options.
276
+ * @property {string | ((tElement: TElement, tAttrs: TAttributes) => string) | undefined} [template]
277
+ * HTML template.
278
+ * @property {string | undefined} [templateNamespace]
279
+ * Template namespace.
280
+ * @property {string | ((tElement: TElement, tAttrs: TAttributes) => string) | undefined} [templateUrl]
281
+ * HTML template URL.
282
+ * @property {boolean | "element" | { [slot: string]: string } | undefined} [transclude]
283
+ * Transclusion options.
284
+ */
285
+
286
+ /**
287
+ * Factory function for creating directives.
288
+ *
289
+ * @template TScope - The type of the directive's scope.
290
+ * @template TElement - The type of the directive's element.
291
+ * @template TAttributes - The type of the directive's attributes.
292
+ * @template TController - The type of the directive's controller.
293
+ *
294
+ * @typedef {(...args: any[]) => angular.Directive<S, T, A, C> | angular.DirectiveLinkFn<S, T, A, C>} angular.DirectiveFactory
295
+ */
296
+
297
+ /**
298
+ * @typedef {Function} angular.FilterFunction
299
+ * @property {boolean|undefined} [$stateful] By default, filters are only run once the input value changes. By marking the filter as `$stateful`, the filter will be run on every `$digest` to update the output. **This is strongly discouraged.** See https://docs.angularjs.org/guide/filter#stateful-filters
300
+ */
301
+
302
+ /**
303
+ * @typedef {Function} angular.FilterFactory
304
+ * @returns {angular.FilterFunction}
305
+ */
306
+
307
+ /**
308
+ * Interface for a service provider class.
309
+ * @typedef {Object} angular.ServiceProviderClass
310
+ * @property {Function} constructor - The constructor for the service provider.
311
+ * @param {...any} args - The arguments for the constructor.
312
+ * @returns {angular.ServiceProvider}
313
+ */
314
+
315
+ /**
316
+ * Interface for a service provider factory function.
317
+ * @typedef {Function} angular.ServiceProviderFactory
318
+ * @param {...any} args - The arguments for the factory function.
319
+ * @returns {angular.ServiceProvider}
320
+ */
321
+
322
+ /**
323
+ * Interface for a service provider.
324
+ * @typedef {Object} angular.ServiceProvider
325
+ * @property {*} $get - The $get property that represents a service instance or a factory function.
326
+ */
327
+
328
+ /** @type {angular.ServiceProvider} */
329
+ export const ServiceProvider = {
330
+ $get: undefined,
331
+ };
332
+
333
+ /**
334
+ * @typedef {Object} angular.Module
335
+ * @description AngularJS module interface for registering components, services, providers, etc.
336
+ * @property {function(string, angular.ComponentOptions): angular.Module} component
337
+ * Use this method to register a component.
338
+ * @property {function({ [componentName: string]: angular.ComponentOptions }): angular.Module} component
339
+ * Use this method to register multiple components.
340
+ * @property {function(Function): angular.Module} config
341
+ * Use this method to register work which needs to be performed on module loading.
342
+ * @property {function(any[]): angular.Module} config
343
+ * Use this method to register work which needs to be performed on module loading.
344
+ * @property {function<T>(string, T): angular.Module} constant
345
+ * Register a constant service with the $injector.
346
+ * @property {function(Object): angular.Module} constant
347
+ * Register multiple constant services.
348
+ * @property {function(string, angular.Injectable<angular.ControllerConstructor>): angular.Module} controller
349
+ * Register a controller with the $controller service.
350
+ * @property {function({ [name: string]: angular.Injectable<angular.ControllerConstructor>> }): angular.Module} controller
351
+ * Register multiple controllers.
352
+ * @property {function<S, T, A, C>(string, angular.Injectable<angular.DirectiveFactory<S, T, A, C>>): angular.Module} directive
353
+ * Register a directive with the compiler.
354
+ * @property {function<S, T, A, C>(Object.<string, angular.Injectable<angular.DirectiveFactory<S, T, A, C>>>): angular.Module} directive
355
+ * Register multiple directives.
356
+ * @property {function(string, angular.Injectable<Function>): angular.Module} factory
357
+ * Register a service factory with the $injector.
358
+ * @property {function(Object.<string, angular.Injectable<Function>>): angular.Module} factory
359
+ * Register multiple service factories.
360
+ * @property {function(string, angular.Injectable<angular.FilterFactory>): angular.Module} filter
361
+ * Register a filter service.
362
+ * @property {function(Object.<string, angular.Injectable<angular.FilterFactory>>): angular.Module} filter
363
+ * Register multiple filter services.
364
+ * @property {function(string, angular.ServiceProviderFactory): angular.Module} provider
365
+ * Register a provider service factory.
366
+ * @property {function(string, angular.ServiceProviderClass): angular.Module} provider
367
+ * Register a provider service constructor.
368
+ * @property {function(string, any[]): angular.Module} provider
369
+ * Register a provider service with inline annotated constructor.
370
+ * @property {function(angular.Injectable<Function>): angular.Module} run
371
+ * Register code to be run during module loading.
372
+ * @property {function(string, angular.Injectable<Function>): angular.Module} service
373
+ * Register a service constructor.
374
+ * @property {function(Object.<string, angular.Injectable<Function>>): angular.Module} service
375
+ * Register multiple service constructors.
376
+ * @property {function<T>(string, T): angular.Module} value
377
+ * Register a value service with the $injector.
378
+ * @property {function(Object): angular.Module} value
379
+ * Register multiple value services.
380
+ * @property {function(string, angular.Injectable<Function>): angular.Module} decorator
381
+ * Register a service decorator with the $injector.
382
+ * @property {string} name
383
+ * The name of the AngularJS module.
384
+ * @property {string[]} requires
385
+ * Array of module names that this module depends on.
386
+ */
387
+
388
+ /**
389
+ * @typedef {Object} angular.FormController
390
+ * @property {boolean} $pristine - True if the form has not been modified.
391
+ * @property {boolean} $dirty - True if the form has been modified.
392
+ * @property {boolean} $valid - True if the form is valid.
393
+ * @property {boolean} $invalid - True if the form is invalid.
394
+ * @property {boolean} $submitted - True if the form has been submitted.
395
+ * @property {Object.<string, Array.<angular.NgModelController|angular.FormController>>} $error - An object containing arrays of controls with validation errors keyed by validation error keys.
396
+ * @property {string|undefined} [$name] - The name of the form.
397
+ * @property {Object.<string, Array.<angular.NgModelController|angular.FormController>>|undefined} [$pending] - An object containing arrays of controls that are pending validation, keyed by validation error keys.
398
+ * @property {function(angular.NgModelController|angular.FormController): void} $addControl - Adds a control to the form.
399
+ * @property {function(): ReadonlyArray.<angular.NgModelController|angular.FormController>} $getControls - Returns an array of all controls in the form.
400
+ * @property {function(angular.NgModelController|angular.FormController): void} $removeControl - Removes a control from the form.
401
+ * @property {function(string, boolean, angular.NgModelController|angular.FormController): void} $setValidity - Sets the validity of a control in the form.
402
+ * @property {function(): void} $setDirty - Marks the form as dirty.
403
+ * @property {function(): void} $setPristine - Marks the form as pristine.
404
+ * @property {function(): void} $commitViewValue - Commits the view value of all controls in the form.
405
+ * @property {function(): void} $rollbackViewValue - Rolls back the view value of all controls in the form.
406
+ * @property {function(): void} $setSubmitted - Marks the form as submitted.
407
+ * @property {function(): void} $setUntouched - Marks the form controls as untouched.
408
+ * @property {function(string): any} [name] - An indexer for additional properties.
409
+ */
410
+
411
+ /**
412
+ * @typedef {Object} angular.NgModelController
413
+ * @property {function(): void} $render - Renders the view value.
414
+ * @property {function(string, boolean): void} $setValidity - Sets the validity state.
415
+ * @property {function(any, string=): void} $setViewValue - Sets the view value.
416
+ * @property {function(): void} $setPristine - Marks the control as pristine.
417
+ * @property {function(): void} $setDirty - Marks the control as dirty.
418
+ * @property {function(): void} $validate - Validates the control.
419
+ * @property {function(): void} $setTouched - Marks the control as touched.
420
+ * @property {function(): void} $setUntouched - Marks the control as untouched.
421
+ * @property {function(): void} $rollbackViewValue - Rolls back the view value.
422
+ * @property {function(): void} $commitViewValue - Commits the view value.
423
+ * @property {function(): void} $processModelValue - Processes the model value.
424
+ * @property {function(any): boolean} $isEmpty - Checks if the value is empty.
425
+ * @property {function(angular.NgModelOptions): void} $overrideModelOptions - Overrides model options.
426
+ * @property {*} $viewValue - The current view value.
427
+ * @property {*} $modelValue - The current model value.
428
+ * @property {Array.<function(any, any): boolean>} $parsers - Array of parsers.
429
+ * @property {Array.<function(any): any>} $formatters - Array of formatters.
430
+ * @property {Array.<function(): any>} $viewChangeListeners - Array of view change listeners.
431
+ * @property {Object.<string, boolean>} $error - Validation errors.
432
+ * @property {string|undefined} [$name] - The name of the control.
433
+ * @property {boolean} $touched - True if the control has been touched.
434
+ * @property {boolean} $untouched - True if the control has not been touched.
435
+ * @property {Object.<string, function(any, any): boolean>} $validators - Synchronous validators.
436
+ * @property {Object.<string, function(any, any): angular.Promise<any>>} $asyncValidators - Asynchronous validators.
437
+ * @property {Object.<string, boolean>|undefined} [$pending] - Pending validation.
438
+ * @property {boolean} $pristine - True if the control is pristine.
439
+ * @property {boolean} $dirty - True if the control is dirty.
440
+ * @property {boolean} $valid - True if the control is valid.
441
+ * @property {boolean} $invalid - True if the control is invalid.
442
+ */
443
+
444
+ /**
445
+ * @typedef {Object} angular.NgModelOptions
446
+ * @property {string|undefined} [updateOn] - The event to update on.
447
+ * @property {number|Object.<string, number>|undefined} [debounce] - The debounce delay.
448
+ * @property {boolean|undefined} [allowInvalid] - Allows invalid models.
449
+ * @property {boolean|undefined} [getterSetter] - Indicates if getter/setter syntax is allowed.
450
+ * @property {string|undefined} [timezone] - The timezone.
451
+ * @property {string|undefined} [timeSecondsFormat] - The format for seconds in time and datetime-local inputs.
452
+ * @property {boolean|undefined} [timeStripZeroSeconds] - Indicates if zero seconds should be stripped.
453
+ */
454
+
455
+ /**
456
+ * @typedef {Object.<string, function(any, any): boolean>} IModelValidators
457
+ * @property {function(any, any): boolean} [index] - Validator function for each index.
458
+ */
459
+
460
+ /**
461
+ * @typedef {Object.<string, function(any, any): IPromise<any>>} IAsyncModelValidators
462
+ * @property {function(any, any): IPromise<any>} [index] - Async validator function for each index.
463
+ */
464
+
465
+ /**
466
+ * @type {Angular}
6
467
  */
7
468
  window.angular = new Angular();
8
469
 
package/src/loader.js CHANGED
@@ -23,48 +23,94 @@ import {
23
23
  isValidObjectMaxDepth,
24
24
  minErrConfig,
25
25
  } from "./shared/utils";
26
- import { jqLite, startingTag } from "./shared/jqlite/jqlite";
26
+ import { JQLite, startingTag } from "./shared/jqlite/jqlite";
27
27
  import { createInjector } from "./injector";
28
28
  import { CACHE } from "./core/cache/cache";
29
29
 
30
+ /**
31
+ * @type {string} `version` from `package.json`, injected by Rollup plugin
32
+ */
33
+ export const VERSION = "[VI]{version}[/VI]";
34
+
30
35
  const ngMinErr = minErr("ng");
31
36
 
32
- /** @type {Object.<string, angular.IModule>} */
37
+ /** @type {Object.<string, import('./index.js').angular.Module>} */
33
38
  const moduleCache = {};
34
39
 
35
40
  /**
36
- * @type {ng.IAngularStatic}
41
+ * Configuration option for AngularTS bootstrap process.
42
+ *
43
+ * @typedef {Object} AngularBootstrapConfig
44
+ * @property {boolean} debugInfoEnabled - Indicates whether debug information should be enabled. Setting this to `false` can improve performance but will disable some debugging features.
45
+ * @property {boolean} [strictDi] - Disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. Defaults to `false`.
46
+ */
47
+
48
+ /**
49
+ * @class
37
50
  */
38
51
  export class Angular {
39
52
  constructor() {
53
+ CACHE.clear(); // a ensure new instance of angular gets a clean cache
54
+
55
+ /** @type {Map<number, import("./core/cache/cache").ExpandoStore>} */
40
56
  this.cache = CACHE;
41
- this.cache.clear(); // a ensure new instance of angular gets a clean cache
42
- this.version = {
43
- full: "",
44
- major: 0,
45
- minor: 0,
46
- dot: 0,
47
- codeName: "",
48
- };
57
+
58
+ /** @type {string} */
59
+ this.version = VERSION;
49
60
 
50
61
  // Utility methods kept for backwards purposes
62
+ /** @type {bind} */
51
63
  this.bind = bind;
64
+
65
+ /** @type {equals} */
52
66
  this.equals = equals;
53
- this.element = jqLite;
67
+
68
+ /** @type {import('./shared/jqlite/jqlite').JQLite} */
69
+ this.element = JQLite;
70
+
71
+ /** @type {extend} */
54
72
  this.extend = extend;
73
+
74
+ /** @type {forEach} */
55
75
  this.forEach = forEach;
76
+
77
+ /** @type {fromJson} */
56
78
  this.fromJson = fromJson;
79
+
80
+ /** @type {toJson} */
57
81
  this.toJson = toJson;
82
+
83
+ /** @type {identity} */
58
84
  this.identity = identity;
85
+
86
+ /** @type {isDate} */
59
87
  this.isDate = isDate;
88
+
89
+ /** @type {isDefined} */
60
90
  this.isDefined = isDefined;
91
+
92
+ /** @type {isElement} */
61
93
  this.isElement = isElement;
94
+
95
+ /** @type {isFunction} */
62
96
  this.isFunction = isFunction;
97
+
98
+ /** @type {isNumber} */
63
99
  this.isNumber = isNumber;
100
+
101
+ /** @type {isObject} */
64
102
  this.isObject = isObject;
103
+
104
+ /** @type {isString} */
65
105
  this.isString = isString;
106
+
107
+ /** @type {isUndefined} */
66
108
  this.isUndefined = isUndefined;
109
+
110
+ /** @type {merge} */
67
111
  this.merge = merge;
112
+
113
+ /** @type {errorHandlingConfig} */
68
114
  this.errorHandlingConfig = errorHandlingConfig;
69
115
  }
70
116
 
@@ -119,7 +165,7 @@ export class Angular {
119
165
  * Each item in the array should be the name of a predefined module or a (DI annotated)
120
166
  * function that will be invoked by the injector as a `config` block.
121
167
  * See: {@link angular.module modules}
122
- * @param {angular.IAngularBootstrapConfig} config an object for defining configuration options for the application. The
168
+ * @param {AngularBootstrapConfig} [config] an object for defining configuration options for the application. The
123
169
  * following keys are supported:
124
170
  *
125
171
  * * `strictDi` - disable automatic function annotation for the application. This is meant to
@@ -129,14 +175,13 @@ export class Angular {
129
175
  */
130
176
  bootstrap(element, modules, config) {
131
177
  // eslint-disable-next-line no-param-reassign
132
- if (!isObject(config)) config = {};
133
- const defaultConfig = {
178
+ config = config || {
179
+ debugInfoEnabled: false,
134
180
  strictDi: false,
135
181
  };
136
- config = extend(defaultConfig, config);
137
182
  this.doBootstrap = function () {
138
183
  // @ts-ignore
139
- element = jqLite(element);
184
+ element = JQLite(element);
140
185
 
141
186
  if (element.injector()) {
142
187
  const tag =
package/src/public.js CHANGED
@@ -103,7 +103,12 @@ import { initAnimateModule } from "./animations/module";
103
103
  import { initMessageModule } from "./exts/messages/messages";
104
104
  import { initAriaModule } from "./exts/aria/aria";
105
105
  import { initRouter } from "./router/index";
106
+ import { VERSION } from "./loader";
106
107
 
108
+ /**
109
+ * Initializes `ng`, `animate`, `message`, `aria` and `router` modules.
110
+ * @returns {import('./index').angular.Module} `ng`module
111
+ */
107
112
  export function publishExternalAPI() {
108
113
  const module = setupModuleLoader(window);
109
114
  const ng = module(
@@ -207,12 +212,11 @@ export function publishExternalAPI() {
207
212
  });
208
213
  },
209
214
  ],
210
- ).info({ angularVersion: '"NG_VERSION_FULL"' });
215
+ ).info({ angularVersion: VERSION });
211
216
 
212
217
  initAnimateModule();
213
218
  initMessageModule();
214
219
  initAriaModule();
215
220
  initRouter();
216
-
217
221
  return ng;
218
222
  }