@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
@@ -0,0 +1,209 @@
1
+ /**
2
+ *
3
+ * @param {string} base
4
+ * @param {string} url
5
+ * @returns {string} returns text from `url` after `base` or `undefined` if it does not begin with
6
+ * the expected string.
7
+ */
8
+ export function stripBaseUrl(base: string, url: string): string;
9
+ export function stripHash(url: any): any;
10
+ export function stripFile(url: any): any;
11
+ export function serverBase(url: any): any;
12
+ /**
13
+ * LocationHtml5Url represents a URL
14
+ * This object is exposed as $location service when HTML5 mode is enabled and supported
15
+ *
16
+ * @constructor
17
+ * @param {string} appBase application base URL
18
+ * @param {string} appBaseNoFile application base URL stripped of any filename
19
+ * @param {string} basePrefix URL path prefix
20
+ */
21
+ export function LocationHtml5Url(appBase: string, appBaseNoFile: string, basePrefix: string): void;
22
+ export class LocationHtml5Url {
23
+ /**
24
+ * LocationHtml5Url represents a URL
25
+ * This object is exposed as $location service when HTML5 mode is enabled and supported
26
+ *
27
+ * @constructor
28
+ * @param {string} appBase application base URL
29
+ * @param {string} appBaseNoFile application base URL stripped of any filename
30
+ * @param {string} basePrefix URL path prefix
31
+ */
32
+ constructor(appBase: string, appBaseNoFile: string, basePrefix: string);
33
+ $$html5: boolean;
34
+ /**
35
+ * Parse given HTML5 (regular) URL string into properties
36
+ * @param {string} url HTML5 URL
37
+ * @private
38
+ */
39
+ private $$parse;
40
+ $$normalizeUrl: (url: any) => string;
41
+ $$parseLinkUrl: (url: any, relHref: any) => boolean;
42
+ }
43
+ /**
44
+ * LocationHashbangUrl represents URL
45
+ * This object is exposed as $location service when developer doesn't opt into html5 mode.
46
+ * It also serves as the base class for html5 mode fallback on legacy browsers.
47
+ *
48
+ * @constructor
49
+ * @param {string} appBase application base URL
50
+ * @param {string} appBaseNoFile application base URL stripped of any filename
51
+ * @param {string} hashPrefix hashbang prefix
52
+ */
53
+ export function LocationHashbangUrl(appBase: string, appBaseNoFile: string, hashPrefix: string): void;
54
+ export class LocationHashbangUrl {
55
+ /**
56
+ * LocationHashbangUrl represents URL
57
+ * This object is exposed as $location service when developer doesn't opt into html5 mode.
58
+ * It also serves as the base class for html5 mode fallback on legacy browsers.
59
+ *
60
+ * @constructor
61
+ * @param {string} appBase application base URL
62
+ * @param {string} appBaseNoFile application base URL stripped of any filename
63
+ * @param {string} hashPrefix hashbang prefix
64
+ */
65
+ constructor(appBase: string, appBaseNoFile: string, hashPrefix: string);
66
+ /**
67
+ * Parse given hashbang URL into properties
68
+ * @param {string} url Hashbang URL
69
+ * @private
70
+ */
71
+ private $$parse;
72
+ $$normalizeUrl: (url: any) => string;
73
+ $$parseLinkUrl: (url: any) => boolean;
74
+ }
75
+ /**
76
+ * LocationHashbangUrl represents URL
77
+ * This object is exposed as $location service when html5 history api is enabled but the browser
78
+ * does not support it.
79
+ *
80
+ * @constructor
81
+ * @param {string} appBase application base URL
82
+ * @param {string} appBaseNoFile application base URL stripped of any filename
83
+ * @param {string} hashPrefix hashbang prefix
84
+ */
85
+ export function LocationHashbangInHtml5Url(appBase: string, appBaseNoFile: string, hashPrefix: string, ...args: any[]): void;
86
+ export class LocationHashbangInHtml5Url {
87
+ /**
88
+ * LocationHashbangUrl represents URL
89
+ * This object is exposed as $location service when html5 history api is enabled but the browser
90
+ * does not support it.
91
+ *
92
+ * @constructor
93
+ * @param {string} appBase application base URL
94
+ * @param {string} appBaseNoFile application base URL stripped of any filename
95
+ * @param {string} hashPrefix hashbang prefix
96
+ */
97
+ constructor(appBase: string, appBaseNoFile: string, hashPrefix: string, ...args: any[]);
98
+ $$html5: boolean;
99
+ $$parseLinkUrl: (url: any, relHref: any) => boolean;
100
+ $$normalizeUrl: (url: any) => string;
101
+ }
102
+ /**
103
+ * @ngdoc service
104
+ * @name $location
105
+ *
106
+ * @requires $rootElement
107
+ *
108
+ * @description
109
+ * The $location service parses the URL in the browser address bar (based on the
110
+ * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL
111
+ * available to your application. Changes to the URL in the address bar are reflected into
112
+ * $location service and changes to $location are reflected into the browser address bar.
113
+ *
114
+ * **The $location service:**
115
+ *
116
+ * - Exposes the current URL in the browser address bar, so you can
117
+ * - Watch and observe the URL.
118
+ * - Change the URL.
119
+ * - Synchronizes the URL with the browser when the user
120
+ * - Changes the address bar.
121
+ * - Clicks the back or forward button (or clicks a History link).
122
+ * - Clicks on a link.
123
+ * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash).
124
+ *
125
+ * For more information see {@link guide/$location Developer Guide: Using $location}
126
+ */
127
+ /**
128
+ * @ngdoc provider
129
+ * @name $locationProvider
130
+ *
131
+ *
132
+ * @description
133
+ * Use the `$locationProvider` to configure how the application deep linking paths are stored.
134
+ */
135
+ export function $LocationProvider(): void;
136
+ export class $LocationProvider {
137
+ /**
138
+ * @ngdoc method
139
+ * @name $locationProvider#hashPrefix
140
+ * @description
141
+ * The default value for the prefix is `'!'`.
142
+ * @param {string=} prefix Prefix for hash part (containing path and search)
143
+ * @returns {*} current value if used as getter or itself (chaining) if used as setter
144
+ */
145
+ hashPrefix: (prefix?: string | undefined) => any;
146
+ /**
147
+ * @ngdoc method
148
+ * @name $locationProvider#html5Mode
149
+ * @description
150
+ * @param {(boolean|Object)=} mode If boolean, sets `html5Mode.enabled` to value.
151
+ * If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported
152
+ * properties:
153
+ * - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to
154
+ * change urls where supported. Will fall back to hash-prefixed paths in browsers that do not
155
+ * support `pushState`.
156
+ * - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies
157
+ * whether or not a <base> tag is required to be present. If `enabled` and `requireBase` are
158
+ * true, and a base tag is not present, an error will be thrown when `$location` is injected.
159
+ * See the {@link guide/$location $location guide for more information}
160
+ * - **rewriteLinks** - `{boolean|string}` - (default: `true`) When html5Mode is enabled,
161
+ * enables/disables URL rewriting for relative links. If set to a string, URL rewriting will
162
+ * only happen on links with an attribute that matches the given string. For example, if set
163
+ * to `'internal-link'`, then the URL will only be rewritten for `<a internal-link>` links.
164
+ * Note that [attribute name normalization](guide/directive#normalization) does not apply
165
+ * here, so `'internalLink'` will **not** match `'internal-link'`.
166
+ *
167
+ * @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter
168
+ */
169
+ html5Mode: (mode?: (boolean | any) | undefined) => any;
170
+ /**
171
+ * @ngdoc event
172
+ * @name $location#$locationChangeStart
173
+ * @eventType broadcast on root scope
174
+ * @description
175
+ * Broadcasted before a URL will change.
176
+ *
177
+ * This change can be prevented by calling
178
+ * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more
179
+ * details about event object. Upon successful change
180
+ * {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired.
181
+ *
182
+ * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when
183
+ * the browser supports the HTML5 History API.
184
+ *
185
+ * @param {Object} angularEvent Synthetic event object.
186
+ * @param {string} newUrl New URL
187
+ * @param {string=} oldUrl URL that was before it was changed.
188
+ * @param {string=} newState New history state object
189
+ * @param {string=} oldState History state object that was before it was changed.
190
+ */
191
+ /**
192
+ * @ngdoc event
193
+ * @name $location#$locationChangeSuccess
194
+ * @eventType broadcast on root scope
195
+ * @description
196
+ * Broadcasted after a URL was changed.
197
+ *
198
+ * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when
199
+ * the browser supports the HTML5 History API.
200
+ *
201
+ * @param {Object} angularEvent Synthetic event object.
202
+ * @param {string} newUrl New URL
203
+ * @param {string=} oldUrl URL that was before it was changed.
204
+ * @param {string=} newState New history state object
205
+ * @param {string=} oldState History state object that was before it was changed.
206
+ */
207
+ $get: (string | (($rootScope: any, $browser: any, $rootElement: any) => LocationHtml5Url | LocationHashbangUrl))[];
208
+ }
209
+ export const PATH_MATCH: RegExp;
@@ -0,0 +1,156 @@
1
+ export class PubSub {
2
+ /**
3
+ * Runs a function asynchronously.
4
+ *
5
+ * @private
6
+ * @param {Function} fn Function to run.
7
+ * @param {Object} context Context in which to run the function.
8
+ * @param {Array} args Arguments to pass to the function.
9
+ */
10
+ private static runAsync_;
11
+ /**
12
+ * Topic-based publish/subscribe channel. Maintains a map of topics to
13
+ * subscriptions. When a message is published to a topic, all functions
14
+ * subscribed to that topic are invoked in the order they were added.
15
+ * Uncaught errors abort publishing.
16
+ *
17
+ * Topics may be identified by any nonempty string, <strong>except</strong>
18
+ * strings corresponding to native Object properties, e.g. "constructor",
19
+ * "toString", "hasOwnProperty", etc.
20
+ *
21
+ * @param {boolean=} opt_async Enable asynchronous behavior. Recommended for
22
+ * new code. See notes on the publish() method.
23
+ */
24
+ constructor(opt_async?: boolean | undefined);
25
+ disposed: boolean;
26
+ /**
27
+ * The next available subscription key. Internally, this is an index into the
28
+ * sparse array of subscriptions.
29
+ *
30
+ * @private {number}
31
+ */
32
+ private key;
33
+ /**
34
+ * Array of subscription keys pending removal once publishing is done.
35
+ *
36
+ * @private {!Array<number>}
37
+ * @const
38
+ */
39
+ private pendingKeys;
40
+ /**
41
+ * Lock to prevent the removal of subscriptions during publishing. Incremented
42
+ * at the beginning of {@link #publish}, and decremented at the end.
43
+ *
44
+ * @private {number}
45
+ */
46
+ private publishDepth;
47
+ /**
48
+ * Sparse array of subscriptions. Each subscription is represented by a tuple
49
+ * comprising a topic identifier, a function, and an optional context object.
50
+ * Each tuple occupies three consecutive positions in the array, with the
51
+ * topic identifier at index n, the function at index (n + 1), the context
52
+ * object at index (n + 2), the next topic at index (n + 3), etc. (This
53
+ * representation minimizes the number of object allocations and has been
54
+ * shown to be faster than an array of objects with three key-value pairs or
55
+ * three parallel arrays, especially on IE.) Once a subscription is removed
56
+ * via {@link #unsubscribe} or {@link #unsubscribeByKey}, the three
57
+ * corresponding array elements are deleted, and never reused. This means the
58
+ * total number of subscriptions during the lifetime of the pubsub channel is
59
+ * limited by the maximum length of a JavaScript array to (2^32 - 1) / 3 =
60
+ * 1,431,655,765 subscriptions, which should suffice for most applications.
61
+ *
62
+ * @private {!Array<?>}
63
+ * @const
64
+ */
65
+ private subscriptions;
66
+ /**
67
+ * Map of topics to arrays of subscription keys.
68
+ *
69
+ * @private {!Object<!Array<number>>}
70
+ */
71
+ private topics;
72
+ /**
73
+ * @private @const {boolean}
74
+ */
75
+ private async_;
76
+ /**
77
+ * Subscribes a function to a topic. The function is invoked as a method on
78
+ * the given `opt_context` object, or in the global scope if no context
79
+ * is specified. Subscribing the same function to the same topic multiple
80
+ * times will result in multiple function invocations while publishing.
81
+ * Returns a subscription key that can be used to unsubscribe the function from
82
+ * the topic via {@link #unsubscribeByKey}.
83
+ *
84
+ * @param {string} topic Topic to subscribe to.
85
+ * @param {Function} fn Function to be invoked when a message is published to
86
+ * the given topic.
87
+ * @param {Object=} opt_context Object in whose context the function is to be
88
+ * called (the global scope if none).
89
+ * @return {number} Subscription key.
90
+ */
91
+ subscribe(topic: string, fn: Function, opt_context?: any | undefined): number;
92
+ /**
93
+ * Subscribes a single-use function to a topic. The function is invoked as a
94
+ * method on the given `opt_context` object, or in the global scope if
95
+ * no context is specified, and is then unsubscribed. Returns a subscription
96
+ * key that can be used to unsubscribe the function from the topic via
97
+ * {@link #unsubscribeByKey}.
98
+ *
99
+ * @param {string} topic Topic to subscribe to.
100
+ * @param {Function} fn Function to be invoked once and then unsubscribed when
101
+ * a message is published to the given topic.
102
+ * @param {Object=} opt_context Object in whose context the function is to be
103
+ * called (the global scope if none).
104
+ * @return {number} Subscription key.
105
+ */
106
+ subscribeOnce(topic: string, fn: Function, opt_context?: any | undefined): number;
107
+ /**
108
+ * Unsubscribes a function from a topic. Only deletes the first match found.
109
+ * Returns a Boolean indicating whether a subscription was removed.
110
+ *
111
+ * @param {string} topic Topic to unsubscribe from.
112
+ * @param {Function} fn Function to unsubscribe.
113
+ * @param {Object=} opt_context Object in whose context the function was to be
114
+ * called (the global scope if none).
115
+ * @return {boolean} Whether a matching subscription was removed.
116
+ */
117
+ unsubscribe(topic: string, fn: Function, opt_context?: any | undefined): boolean;
118
+ /**
119
+ * Removes a subscription based on the key returned by {@link #subscribe}.
120
+ * No-op if no matching subscription is found. Returns a Boolean indicating
121
+ * whether a subscription was removed.
122
+ *
123
+ * @param {number} key Subscription key.
124
+ * @return {boolean} Whether a matching subscription was removed.
125
+ */
126
+ unsubscribeByKey(key: number): boolean;
127
+ /**
128
+ * Publishes a message to a topic. Calls functions subscribed to the topic in
129
+ * the order in which they were added, passing all arguments along.
130
+ *
131
+ * If this object was created with async=true, subscribed functions are called
132
+ * via setTimeout(). Otherwise, the functions are called directly, and if
133
+ * any of them throw an uncaught error, publishing is aborted.
134
+ *
135
+ * @param {string} topic Topic to publish to.
136
+ * @param {...*} var_args Arguments that are applied to each subscription
137
+ * function.
138
+ * @return {boolean} Whether any subscriptions were called.
139
+ */
140
+ publish(topic: string, ...var_args: any[]): boolean;
141
+ /**
142
+ * Clears the subscription list for a topic, or all topics if unspecified.
143
+ * @param {string=} opt_topic Topic to clear (all topics if unspecified).
144
+ */
145
+ clear(opt_topic?: string | undefined): void;
146
+ /**
147
+ * Returns the number of subscriptions to the given topic (or all topics if
148
+ * unspecified). This number will not change while publishing any messages.
149
+ * @param {string=} opt_topic The topic (all topics if unspecified).
150
+ * @return {number} Number of subscriptions to the topic.
151
+ */
152
+ getCount(opt_topic?: string | undefined): number;
153
+ isDisposed(): boolean;
154
+ dispose(): void;
155
+ }
156
+ export const EventBus: PubSub;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * @ngdoc provider
3
+ * @name $qProvider
4
+ *
5
+ *
6
+ * @description
7
+ */
8
+ export function $QProvider(): void;
9
+ export class $QProvider {
10
+ $get: (string | (($rootScope: any, $exceptionHandler: import("../exception-handler").angular.ErrorHandler) => any))[];
11
+ /**
12
+ * @ngdoc method
13
+ * @name $qProvider#errorOnUnhandledRejections
14
+ * @kind function
15
+ *
16
+ * @description
17
+ * Retrieves or overrides whether to generate an error when a rejected promise is not handled.
18
+ * This feature is enabled by default.
19
+ *
20
+ * @param {boolean=} value Whether to generate an error when a rejected promise is not handled.
21
+ * @returns {boolean|ng.$qProvider} Current value when called without a new value or self for
22
+ * chaining otherwise.
23
+ */
24
+ errorOnUnhandledRejections: (value?: boolean | undefined) => boolean | ng.$qProvider;
25
+ }
26
+ export function $$QProvider(): void;
27
+ export class $$QProvider {
28
+ $get: (string | (($browser: any, $exceptionHandler: any) => any))[];
29
+ errorOnUnhandledRejections: (value: any) => boolean | this;
30
+ }
31
+ export function markQExceptionHandled(q: any): void;
32
+ export namespace angular {
33
+ type QPromise<T> = {
34
+ /**
35
+ * - Calls one of the success or error callbacks asynchronously as soon as the result is available.
36
+ */
37
+ then: (arg0: ((value: T) => (PromiseLike<never> | PromiseLike<T> | T)) | null, arg1: ((reason: any) => (PromiseLike<never> | PromiseLike<T> | T)) | null, arg2: ((state: any) => any)) => angular.QPromise<T | never>;
38
+ /**
39
+ * - Shorthand for promise.then(null, errorCallback).
40
+ */
41
+ catch: (arg0: ((reason: any) => (PromiseLike<never> | PromiseLike<T> | T)) | null) => angular.QPromise<T> | T;
42
+ /**
43
+ * - Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value.
44
+ */
45
+ finally: (arg0: () => void) => angular.QPromise<T>;
46
+ };
47
+ type Deferred<T> = {
48
+ /**
49
+ * - Resolves the promise with a value or another promise.
50
+ */
51
+ resolve: (arg0: T | angular.QPromise<T>) => void;
52
+ /**
53
+ * - Rejects the promise with a reason.
54
+ */
55
+ reject: (arg0: any) => void;
56
+ /**
57
+ * - Provides a progress notification.
58
+ */
59
+ notify: (arg0: any) => void;
60
+ /**
61
+ * - The promise associated with this deferred object.
62
+ */
63
+ promise: angular.QPromise<T>;
64
+ };
65
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ *
3
+ * @description
4
+ * Private service to sanitize uris for links and images. Used by $compile.
5
+ */
6
+ export function SanitizeUriProvider(): void;
7
+ export class SanitizeUriProvider {
8
+ /**
9
+ * @description
10
+ * Retrieves or overrides the default regular expression that is used for determining trusted safe
11
+ * urls during a[href] sanitization.
12
+ *
13
+ * The sanitization is a security measure aimed at prevent XSS attacks via HTML anchor links.
14
+ *
15
+ * Any url due to be assigned to an `a[href]` attribute via interpolation is marked as requiring
16
+ * the $sce.URL security context. When interpolation occurs a call is made to `$sce.trustAsUrl(url)`
17
+ * which in turn may call `$$sanitizeUri(url, isMedia)` to sanitize the potentially malicious URL.
18
+ *
19
+ * If the URL matches the `aHrefSanitizationTrustedUrlList` regular expression, it is returned unchanged.
20
+ *
21
+ * If there is no match the URL is returned prefixed with `'unsafe:'` to ensure that when it is written
22
+ * to the DOM it is inactive and potentially malicious code will not be executed.
23
+ *
24
+ * @param {RegExp=} regexp New regexp to trust urls with.
25
+ * @returns {RegExp|ng.ICompileProvider} Current RegExp if called without value or self for
26
+ * chaining otherwise.
27
+ */
28
+ aHrefSanitizationTrustedUrlList: (regexp?: RegExp | undefined) => RegExp | ng.ICompileProvider;
29
+ /**
30
+ * @description
31
+ * Retrieves or overrides the default regular expression that is used for determining trusted safe
32
+ * urls during img[src] sanitization.
33
+ *
34
+ * The sanitization is a security measure aimed at prevent XSS attacks via HTML image src links.
35
+ *
36
+ * Any URL due to be assigned to an `img[src]` attribute via interpolation is marked as requiring
37
+ * the $sce.MEDIA_URL security context. When interpolation occurs a call is made to
38
+ * `$sce.trustAsMediaUrl(url)` which in turn may call `$$sanitizeUri(url, isMedia)` to sanitize
39
+ * the potentially malicious URL.
40
+ *
41
+ * If the URL matches the `imgSrcSanitizationTrustedUrlList` regular expression, it is returned
42
+ * unchanged.
43
+ *
44
+ * If there is no match the URL is returned prefixed with `'unsafe:'` to ensure that when it is written
45
+ * to the DOM it is inactive and potentially malicious code will not be executed.
46
+ *
47
+ * @param {RegExp=} regexp New regexp to trust urls with.
48
+ * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
49
+ * chaining otherwise.
50
+ */
51
+ imgSrcSanitizationTrustedUrlList: (regexp?: RegExp | undefined) => RegExp | ng.$compileProvider;
52
+ $get: () => (uri: any, isMediaUrl: any) => any;
53
+ }
@@ -91,76 +91,70 @@ export function adjustMatcher(matcher: any): any;
91
91
  */
92
92
  export function $SceDelegateProvider(): void;
93
93
  export class $SceDelegateProvider {
94
- SCE_CONTEXTS: {
95
- HTML: string;
96
- CSS: string;
97
- MEDIA_URL: string;
98
- URL: string;
99
- RESOURCE_URL: string;
100
- JS: string;
101
- };
102
- /**
103
- * @ngdoc method
104
- * @name $sceDelegateProvider#trustedResourceUrlList
105
- * @kind function
106
- *
107
- * @param {Array=} trustedResourceUrlList When provided, replaces the trustedResourceUrlList with
108
- * the value provided. This must be an array or null. A snapshot of this array is used so
109
- * further changes to the array are ignored.
110
- * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
111
- * allowed in this array.
112
- *
113
- * @return {Array} The currently set trusted resource URL array.
114
- *
115
- * @description
116
- * Sets/Gets the list trusted of resource URLs.
117
- *
118
- * The **default value** when no `trustedResourceUrlList` has been explicitly set is `['self']`
119
- * allowing only same origin resource requests.
120
- *
121
- * <div class="alert alert-warning">
122
- * **Note:** the default `trustedResourceUrlList` of 'self' is not recommended if your app shares
123
- * its origin with other apps! It is a good idea to limit it to only your application's directory.
124
- * </div>
125
- */
126
- trustedResourceUrlList: (value: any, ...args: any[]) => any[];
127
- /**
128
- * @ngdoc method
129
- * @name $sceDelegateProvider#bannedResourceUrlList
130
- * @kind function
131
- *
132
- * @param {Array=} bannedResourceUrlList When provided, replaces the `bannedResourceUrlList` with
133
- * the value provided. This must be an array or null. A snapshot of this array is used so
134
- * further changes to the array are ignored.</p><p>
135
- * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
136
- * allowed in this array.</p><p>
137
- * The typical usage for the `bannedResourceUrlList` is to **block
138
- * [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as
139
- * these would otherwise be trusted but actually return content from the redirected domain.
140
- * </p><p>
141
- * Finally, **the banned resource URL list overrides the trusted resource URL list** and has
142
- * the final say.
143
- *
144
- * @return {Array} The currently set `bannedResourceUrlList` array.
145
- *
146
- * @description
147
- * Sets/Gets the `bannedResourceUrlList` of trusted resource URLs.
148
- *
149
- * The **default value** when no trusted resource URL list has been explicitly set is the empty
150
- * array (i.e. there is no `bannedResourceUrlList`.)
151
- */
152
- bannedResourceUrlList: (value: any, ...args: any[]) => any[];
153
- $get: (
154
- | string
155
- | ((
156
- $injector: any,
157
- $$sanitizeUri: any,
158
- ) => {
94
+ SCE_CONTEXTS: {
95
+ HTML: string;
96
+ CSS: string;
97
+ MEDIA_URL: string;
98
+ URL: string;
99
+ RESOURCE_URL: string;
100
+ JS: string;
101
+ };
102
+ /**
103
+ * @ngdoc method
104
+ * @name $sceDelegateProvider#trustedResourceUrlList
105
+ * @kind function
106
+ *
107
+ * @param {Array=} trustedResourceUrlList When provided, replaces the trustedResourceUrlList with
108
+ * the value provided. This must be an array or null. A snapshot of this array is used so
109
+ * further changes to the array are ignored.
110
+ * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
111
+ * allowed in this array.
112
+ *
113
+ * @return {Array} The currently set trusted resource URL array.
114
+ *
115
+ * @description
116
+ * Sets/Gets the list trusted of resource URLs.
117
+ *
118
+ * The **default value** when no `trustedResourceUrlList` has been explicitly set is `['self']`
119
+ * allowing only same origin resource requests.
120
+ *
121
+ * <div class="alert alert-warning">
122
+ * **Note:** the default `trustedResourceUrlList` of 'self' is not recommended if your app shares
123
+ * its origin with other apps! It is a good idea to limit it to only your application's directory.
124
+ * </div>
125
+ */
126
+ trustedResourceUrlList: (value: any, ...args: any[]) => any[];
127
+ /**
128
+ * @ngdoc method
129
+ * @name $sceDelegateProvider#bannedResourceUrlList
130
+ * @kind function
131
+ *
132
+ * @param {Array=} bannedResourceUrlList When provided, replaces the `bannedResourceUrlList` with
133
+ * the value provided. This must be an array or null. A snapshot of this array is used so
134
+ * further changes to the array are ignored.</p><p>
135
+ * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
136
+ * allowed in this array.</p><p>
137
+ * The typical usage for the `bannedResourceUrlList` is to **block
138
+ * [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as
139
+ * these would otherwise be trusted but actually return content from the redirected domain.
140
+ * </p><p>
141
+ * Finally, **the banned resource URL list overrides the trusted resource URL list** and has
142
+ * the final say.
143
+ *
144
+ * @return {Array} The currently set `bannedResourceUrlList` array.
145
+ *
146
+ * @description
147
+ * Sets/Gets the `bannedResourceUrlList` of trusted resource URLs.
148
+ *
149
+ * The **default value** when no trusted resource URL list has been explicitly set is the empty
150
+ * array (i.e. there is no `bannedResourceUrlList`.)
151
+ */
152
+ bannedResourceUrlList: (value: any, ...args: any[]) => any[];
153
+ $get: (string | (($injector: any, $$sanitizeUri: any) => {
159
154
  trustAs: (type: string, trustedValue: any) => any;
160
155
  getTrusted: (type: string, maybeTrusted: any) => any;
161
156
  valueOf: (maybeTrusted: any) => any;
162
- })
163
- )[];
157
+ }))[];
164
158
  }
165
159
  /**
166
160
  * @ngdoc provider
@@ -408,25 +402,25 @@ export class $SceDelegateProvider {
408
402
  */
409
403
  export function $SceProvider(): void;
410
404
  export class $SceProvider {
411
- /**
412
- * @ngdoc method
413
- * @name $sceProvider#enabled
414
- * @kind function
415
- *
416
- * @param {boolean=} value If provided, then enables/disables SCE application-wide.
417
- * @return {boolean} True if SCE is enabled, false otherwise.
418
- *
419
- * @description
420
- * Enables/disables SCE and returns the current value.
421
- */
422
- enabled: (value?: boolean | undefined, ...args: any[]) => boolean;
423
- $get: (string | (($parse: any, $sceDelegate: any) => any))[];
405
+ /**
406
+ * @ngdoc method
407
+ * @name $sceProvider#enabled
408
+ * @kind function
409
+ *
410
+ * @param {boolean=} value If provided, then enables/disables SCE application-wide.
411
+ * @return {boolean} True if SCE is enabled, false otherwise.
412
+ *
413
+ * @description
414
+ * Enables/disables SCE and returns the current value.
415
+ */
416
+ enabled: (value?: boolean | undefined, ...args: any[]) => boolean;
417
+ $get: (string | (($parse: any, $sceDelegate: any) => any))[];
424
418
  }
425
419
  export namespace SCE_CONTEXTS {
426
- let HTML: string;
427
- let CSS: string;
428
- let MEDIA_URL: string;
429
- let URL: string;
430
- let RESOURCE_URL: string;
431
- let JS: string;
420
+ let HTML: string;
421
+ let CSS: string;
422
+ let MEDIA_URL: string;
423
+ let URL: string;
424
+ let RESOURCE_URL: string;
425
+ let JS: string;
432
426
  }