@angular-wave/angular.ts 0.7.8 → 0.8.1

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 (308) hide show
  1. package/@types/{loader.d.ts → angular.d.ts} +3 -3
  2. package/@types/core/di/ng-module.d.ts +61 -25
  3. package/@types/core/parse/parse.d.ts +6 -7
  4. package/@types/directive/bind/bind.d.ts +2 -1
  5. package/@types/index.d.ts +1 -1
  6. package/@types/interface.d.ts +4 -2
  7. package/@types/{public.d.ts → ng.d.ts} +2 -2
  8. package/@types/router/directives/state-directives.d.ts +2 -2
  9. package/@types/router/directives/view-directive.d.ts +1 -1
  10. package/@types/router/params/param-type.d.ts +0 -1
  11. package/@types/router/path/path-utils.d.ts +8 -11
  12. package/@types/router/{globals.d.ts → router.d.ts} +2 -2
  13. package/@types/router/state/interface.d.ts +1 -1
  14. package/@types/router/state/state-object.d.ts +1 -1
  15. package/@types/router/state/state-registry.d.ts +2 -2
  16. package/@types/router/state/state-service.d.ts +14 -16
  17. package/@types/router/state-filters.d.ts +24 -2
  18. package/@types/router/transition/transition-service.d.ts +3 -3
  19. package/@types/router/transition/transition.d.ts +16 -19
  20. package/@types/router/url/url-matcher.d.ts +3 -4
  21. package/@types/router/url/url-rule.d.ts +14 -4
  22. package/@types/router/url/url-rules.d.ts +26 -6
  23. package/@types/router/url/url-service.d.ts +28 -38
  24. package/@types/services/http/http.d.ts +48 -1
  25. package/@types/services/http-backend/http-backend.d.ts +48 -35
  26. package/@types/services/location/interface.d.ts +55 -0
  27. package/@types/services/location/location.d.ts +225 -252
  28. package/@types/shared/common.d.ts +0 -2
  29. package/@types/shared/hof.d.ts +0 -6
  30. package/@types/shared/interface.d.ts +0 -4
  31. package/@types/{router/common → shared}/queue.d.ts +2 -2
  32. package/@types/shared/url-utils/interface.d.ts +0 -1
  33. package/@types/shared/url-utils/url-utils.d.ts +0 -5
  34. package/@types/shared/utils.d.ts +29 -6
  35. package/CHANGELOG.md +0 -72
  36. package/CONTRIBUTING.md +0 -1
  37. package/DEVELOPERS.md +0 -1
  38. package/Makefile +6 -3
  39. package/TRIAGING.md +0 -1
  40. package/dist/angular-ts.esm.js +1048 -1150
  41. package/dist/angular-ts.umd.js +1048 -1150
  42. package/dist/angular-ts.umd.min.js +1 -1
  43. package/docs/assets/scss/index.scss +23 -0
  44. package/docs/content/_index.md +9 -8
  45. package/docs/content/docs/_index.md +1 -1
  46. package/docs/content/docs/directive/app.md +1 -1
  47. package/docs/content/docs/directive/bind.md +1 -1
  48. package/docs/content/docs/directive/blur.md +1 -1
  49. package/docs/content/docs/directive/channel.md +2 -2
  50. package/docs/content/docs/directive/class-even.md +1 -1
  51. package/docs/content/docs/directive/class-odd.md +1 -1
  52. package/docs/content/docs/directive/class.md +1 -1
  53. package/docs/content/docs/directive/click.md +1 -1
  54. package/docs/content/docs/directive/copy.md +1 -1
  55. package/docs/content/docs/directive/cut.md +1 -1
  56. package/docs/content/docs/directive/dblclick.md +1 -1
  57. package/docs/content/docs/directive/focus.md +1 -1
  58. package/docs/content/docs/directive/get.md +3 -3
  59. package/docs/content/docs/directive/keydown.md +1 -1
  60. package/docs/content/docs/directive/keyup.md +1 -1
  61. package/docs/content/docs/directive/load.md +1 -1
  62. package/docs/content/docs/directive/mousedown.md +1 -1
  63. package/docs/content/docs/directive/mouseenter.md +1 -1
  64. package/docs/content/docs/directive/mouseleave.md +1 -1
  65. package/docs/content/docs/directive/mousemove.md +1 -1
  66. package/docs/content/docs/directive/mouseout.md +1 -1
  67. package/docs/content/docs/directive/mouseover.md +1 -1
  68. package/docs/content/docs/directive/mouseup.md +1 -1
  69. package/docs/content/docs/directive/non-bindable.md +28 -0
  70. package/docs/content/docs/provider/locationProvider.md +26 -0
  71. package/docs/content/docs/provider/templateCacheProvider.md +2 -2
  72. package/docs/content/docs/service/location.md +57 -0
  73. package/docs/content/docs/service/url.md +5 -0
  74. package/docs/layouts/partials/hooks/head-end.html +1 -1
  75. package/docs/layouts/shortcodes/version.html +1 -0
  76. package/docs/static/examples/counter/counter-test.html +0 -4
  77. package/docs/static/examples/eventbus/eventbus-test.html +0 -4
  78. package/docs/static/examples/ng-non-bindable/ng-non-bindable-test.html +13 -0
  79. package/docs/static/examples/ng-non-bindable/ng-non-bindable.html +3 -0
  80. package/docs/static/examples/ng-non-bindable/ng-non-bindable.test.js +11 -0
  81. package/docs/static/typedoc/assets/hierarchy.js +1 -1
  82. package/docs/static/typedoc/assets/highlight.css +6 -6
  83. package/docs/static/typedoc/assets/navigation.js +1 -1
  84. package/docs/static/typedoc/assets/search.js +1 -1
  85. package/docs/static/typedoc/classes/Location.html +55 -0
  86. package/docs/static/typedoc/classes/LocationProvider.html +20 -0
  87. package/docs/static/typedoc/classes/NgModule.html +3 -3
  88. package/docs/static/typedoc/index.html +1 -1
  89. package/docs/static/typedoc/interfaces/DefaultPorts.html +5 -0
  90. package/docs/static/typedoc/interfaces/Html5Mode.html +23 -0
  91. package/docs/static/typedoc/interfaces/Provider.html +2 -1
  92. package/docs/static/typedoc/interfaces/UrlParts.html +9 -0
  93. package/docs/static/typedoc/types/AnnotatedFactory.html +1 -1
  94. package/docs/static/typedoc/types/Expression.html +1 -1
  95. package/docs/static/typedoc/types/Injectable.html +4 -1
  96. package/docs/static/typedoc/types/InjectableFactory.html +1 -4
  97. package/docs/static/typedoc/types/UrlChangeListener.html +5 -0
  98. package/docs/static/version.js +13 -0
  99. package/docs/test-results/.last-run.json +4 -0
  100. package/docs/test-results/static-examples-counter-counter-counter-example/error-context.md +50 -0
  101. package/package.json +2 -2
  102. package/src/{loader.js → angular.js} +11 -11
  103. package/src/angular.spec.js +189 -21
  104. package/src/animations/animate-css.js +17 -18
  105. package/src/animations/animate.spec.js +1 -1
  106. package/src/animations/shared.js +2 -3
  107. package/src/binding.spec.js +1 -1
  108. package/src/core/compile/compile.js +4 -7
  109. package/src/core/compile/compile.spec.js +1 -1
  110. package/src/core/controller/controller.spec.js +1 -1
  111. package/src/core/controller/controller.test.js +1 -0
  112. package/src/core/di/injector.js +7 -8
  113. package/src/core/di/injector.spec.js +2 -2
  114. package/src/core/di/injector.test.js +2 -2
  115. package/src/core/di/internal-injector.js +3 -6
  116. package/src/core/di/ng-module.js +26 -21
  117. package/src/core/filter/filter.js +1 -1
  118. package/src/core/filter/filter.spec.js +1 -1
  119. package/src/core/filter/filter.test.js +1 -0
  120. package/src/core/interpolate/interpolate.js +4 -6
  121. package/src/core/interpolate/interpolate.spec.js +1 -1
  122. package/src/core/interpolate/interpolate.test.js +1 -0
  123. package/src/core/parse/ast/ast.spec.js +1 -1
  124. package/src/core/parse/ast/ast.test.js +1 -1
  125. package/src/core/parse/lexer/lexer.spec.js +1 -1
  126. package/src/core/parse/parse.js +150 -146
  127. package/src/core/parse/parse.spec.js +46 -46
  128. package/src/core/prop.spec.js +1 -1
  129. package/src/core/root-element.spec.js +1 -1
  130. package/src/core/scope/scope.js +10 -11
  131. package/src/core/scope/scope.spec.js +3 -4
  132. package/src/directive/aria/aria.spec.js +1 -1
  133. package/src/directive/aria/aria.test.js +1 -0
  134. package/src/directive/attrs/attrs.spec.js +1 -1
  135. package/src/directive/attrs/attrs.test.js +1 -0
  136. package/src/directive/attrs/boolean.spec.js +1 -1
  137. package/src/directive/attrs/boolean.test.js +1 -0
  138. package/src/directive/attrs/element-style.spec.js +1 -1
  139. package/src/directive/attrs/element-style.test.js +1 -0
  140. package/src/directive/attrs/src.spec.js +1 -1
  141. package/src/directive/attrs/src.test.js +1 -0
  142. package/src/directive/bind/bind-html.spec.js +1 -1
  143. package/src/directive/bind/bind.js +1 -0
  144. package/src/directive/bind/bind.spec.js +1 -1
  145. package/src/directive/bind/bind.test.js +1 -0
  146. package/src/directive/channel/channel.spec.js +1 -1
  147. package/src/directive/channel/channel.test.js +1 -0
  148. package/src/directive/class/class.spec.js +1 -1
  149. package/src/directive/class/class.test.js +1 -0
  150. package/src/directive/cloak/cloak.spec.js +1 -1
  151. package/src/directive/cloak/cloak.test.js +1 -0
  152. package/src/directive/controller/controller.spec.js +1 -1
  153. package/src/directive/controller/controller.test.js +1 -0
  154. package/src/directive/events/click.spec.js +1 -1
  155. package/src/directive/events/event.spec.js +6 -6
  156. package/src/directive/events/events.test.js +1 -0
  157. package/src/directive/form/form.js +8 -5
  158. package/src/directive/form/form.spec.js +1 -1
  159. package/src/directive/form/form.test.js +1 -0
  160. package/src/directive/http/delete.spec.js +1 -1
  161. package/src/directive/http/form-test.html +18 -0
  162. package/src/directive/http/get.spec.js +1 -1
  163. package/src/directive/http/http.js +12 -3
  164. package/src/directive/http/post.spec.js +504 -9
  165. package/src/directive/http/put.spec.js +1 -1
  166. package/src/directive/if/if.spec.js +1 -1
  167. package/src/directive/include/include.spec.js +1 -1
  168. package/src/directive/init/init.spec.js +1 -1
  169. package/src/directive/init/init.test.js +1 -0
  170. package/src/directive/input/input.js +13 -15
  171. package/src/directive/input/input.spec.js +1 -2
  172. package/src/directive/input/input.test.js +1 -0
  173. package/src/directive/messages/messages.md +0 -4
  174. package/src/directive/messages/messages.spec.js +1 -1
  175. package/src/directive/messages/messages.test.js +1 -0
  176. package/src/directive/model/model.js +13 -13
  177. package/src/directive/model/model.spec.js +1 -1
  178. package/src/directive/model/model.test.js +1 -0
  179. package/src/directive/model-options/model-option.test.js +1 -0
  180. package/src/directive/model-options/model-options.js +1 -1
  181. package/src/directive/model-options/model-options.spec.js +1 -1
  182. package/src/directive/non-bindable/non-bindable.spec.js +1 -1
  183. package/src/directive/non-bindable/non-bindable.test.js +1 -0
  184. package/src/directive/observe/observe.spec.js +1 -1
  185. package/src/directive/observe/observe.test.js +1 -0
  186. package/src/directive/on/on.spec.js +1 -1
  187. package/src/directive/on/on.test.js +1 -0
  188. package/src/directive/options/options.spec.js +1 -1
  189. package/src/directive/options/options.test.js +1 -0
  190. package/src/directive/ref/href.spec.js +1 -1
  191. package/src/directive/ref/href.test.js +2 -0
  192. package/src/directive/ref/ref.spec.js +1 -1
  193. package/src/directive/repeat/repeat.js +1 -1
  194. package/src/directive/repeat/repeat.spec.js +2 -3
  195. package/src/directive/repeat/repeat.test.js +1 -0
  196. package/src/directive/script/script.spec.js +1 -1
  197. package/src/directive/script/script.test.js +1 -0
  198. package/src/directive/select/select.js +1 -1
  199. package/src/directive/select/select.spec.js +1 -1
  200. package/src/directive/select/select.test.js +1 -0
  201. package/src/directive/setter/setter.spec.js +1 -1
  202. package/src/directive/setter/setter.test.js +1 -0
  203. package/src/directive/show-hide/show-hide.spec.js +1 -1
  204. package/src/directive/show-hide/show-hide.test.js +1 -0
  205. package/src/directive/style/style.spec.js +1 -1
  206. package/src/directive/style/style.test.js +1 -0
  207. package/src/directive/switch/switch.spec.js +1 -1
  208. package/src/directive/switch/switch.test.js +1 -0
  209. package/src/directive/validators/validators.js +82 -84
  210. package/src/directive/validators/validators.spec.js +5 -4
  211. package/src/directive/validators/validators.test.js +1 -0
  212. package/src/filters/filter.spec.js +1 -1
  213. package/src/filters/filters.spec.js +1 -1
  214. package/src/filters/limit-to.js +2 -3
  215. package/src/filters/limit-to.spec.js +1 -1
  216. package/src/filters/order-by.spec.js +1 -1
  217. package/src/index.js +1 -1
  218. package/src/injection-tokens.js +7 -3
  219. package/src/interface.ts +4 -3
  220. package/src/loader.md +0 -155
  221. package/src/{public.js → ng.js} +11 -12
  222. package/src/{public.spec.js → ng.spec.js} +2 -2
  223. package/src/router/directives/state-directives.js +5 -5
  224. package/src/router/directives/state-directives.spec.js +8 -7
  225. package/src/router/directives/view-directive.js +7 -13
  226. package/src/router/directives/view-directive.spec.js +22 -23
  227. package/src/router/{common/common.html → glob/glob.html} +2 -3
  228. package/src/router/{common/common.test.js → glob/glob.test.js} +2 -1
  229. package/src/router/params/param-type.js +0 -1
  230. package/src/router/params/param.js +1 -1
  231. package/src/router/path/path-utils.js +5 -0
  232. package/src/router/router-test-hashbang.html +45 -0
  233. package/src/router/{globals.js → router.js} +2 -2
  234. package/src/router/services.spec.js +8 -9
  235. package/src/router/state/interface.ts +1 -1
  236. package/src/router/state/state-builder.js +3 -3
  237. package/src/router/state/state-builder.spec.js +1 -1
  238. package/src/router/state/state-object.js +1 -1
  239. package/src/router/state/state-registry.js +4 -4
  240. package/src/router/state/state-service.js +14 -14
  241. package/src/router/state/state.spec.js +23 -22
  242. package/src/router/state/state.test.js +1 -0
  243. package/src/router/state/views.js +1 -1
  244. package/src/router/state-filter.spec.js +1 -1
  245. package/src/router/state-filters.js +13 -9
  246. package/src/router/template-factory.js +5 -4
  247. package/src/router/template-factory.spec.js +7 -7
  248. package/src/router/transition/hook-registry.js +1 -1
  249. package/src/router/transition/transition-service.js +7 -6
  250. package/src/router/transition/transition.js +6 -6
  251. package/src/router/url/url-matcher.js +12 -14
  252. package/src/router/url/url-rule.js +8 -2
  253. package/src/router/url/url-rules.js +8 -5
  254. package/src/router/url/url-service.js +80 -76
  255. package/src/router/url/url-service.spec.js +61 -78
  256. package/src/router/url/url.test.js +1 -0
  257. package/src/router/view/view.js +4 -5
  258. package/src/router/view/view.spec.js +10 -12
  259. package/src/router/view/view.test.js +1 -0
  260. package/src/router/view-hook.spec.js +1 -1
  261. package/src/router/view-scroll.js +3 -1
  262. package/src/router/view-scroll.spec.js +12 -12
  263. package/src/services/anchor-scroll.html +2 -2
  264. package/src/services/anchor-scroll.js +5 -4
  265. package/src/services/http/http.js +9 -4
  266. package/src/services/http/http.spec.js +2 -7
  267. package/src/services/http/template-request.spec.js +1 -1
  268. package/src/services/http-backend/http-backend.js +51 -77
  269. package/src/services/http-backend/http-backend.spec.js +1 -2
  270. package/src/services/http-backend/http-backend.test.js +1 -0
  271. package/src/services/location/interface.ts +62 -0
  272. package/src/services/location/location.js +439 -519
  273. package/src/services/location/location.spec.js +915 -530
  274. package/src/services/location/location.test.js +2 -2
  275. package/src/services/log/log.spec.js +1 -1
  276. package/src/services/log/log.test.js +1 -0
  277. package/src/services/pubsub/pubsub.spec.js +1 -1
  278. package/src/services/sce/sce.js +5 -7
  279. package/src/services/sce/sce.md +2 -2
  280. package/src/services/sce/sce.spec.js +1 -1
  281. package/src/services/template-cache/template-cache.spec.js +1 -1
  282. package/src/services/template-cache/template-cache.test.js +1 -0
  283. package/src/shared/common.js +5 -10
  284. package/src/shared/common.spec.js +1 -1
  285. package/src/shared/hof.js +0 -14
  286. package/src/shared/interface.ts +0 -4
  287. package/src/{router/common → shared}/queue.js +7 -7
  288. package/src/shared/shared.html +1 -0
  289. package/src/shared/shared.test.js +1 -0
  290. package/src/shared/url-utils/interface.ts +0 -2
  291. package/src/shared/url-utils/url-utils.js +6 -30
  292. package/src/shared/url-utils/url-utils.spec.js +10 -9
  293. package/src/shared/utils.js +32 -9
  294. package/src/shared/utils.spec.js +35 -1
  295. package/src/src.html +1 -2
  296. package/typedoc.json +0 -1
  297. package/utils/express.js +27 -1
  298. package/utils/version.cjs +23 -0
  299. package/@types/router/state-provider.d.ts +0 -123
  300. package/src/directive/non-bindable/non-bindable.md +0 -17
  301. package/src/loader.spec.js +0 -169
  302. package/src/router/state-provider.js +0 -146
  303. package/src/services/location/location.md +0 -114
  304. package/src/shared/url-utils/url-utils.md +0 -46
  305. /package/@types/router/{common → glob}/glob.d.ts +0 -0
  306. /package/src/router/{common → glob}/glob.js +0 -0
  307. /package/src/router/{common → glob}/glob.spec.js +0 -0
  308. /package/src/{router/common → shared}/queue.spec.js +0 -0
@@ -6,14 +6,15 @@
6
6
  *
7
7
  * The most commonly used methods are [[otherwise]] and [[when]].
8
8
  *
9
- * This API is found at `$urlService.rules` (see: [[UIRouter.urlService]], [[URLService.rules]])
9
+ * This API is found at `$url.rules` (see: [[UIRouter.urlService]], [[URLService.rules]])
10
10
  */
11
11
  export class UrlRules {
12
- constructor(urlRuleFactory: any);
13
- _sortFn: any;
12
+ /** @param {UrlRuleFactory} urlRuleFactory */
13
+ constructor(urlRuleFactory: UrlRuleFactory);
14
+ _sortFn: typeof defaultRuleSortFn;
14
15
  _rules: any[];
15
16
  _id: number;
16
- urlRuleFactory: any;
17
+ urlRuleFactory: UrlRuleFactory;
17
18
  /**
18
19
  * Defines the initial state, path, or behavior to use when the app starts.
19
20
  *
@@ -94,7 +95,7 @@ export class UrlRules {
94
95
  * @param handler The url path to redirect to, or a function which returns the url path (or performs custom logic).
95
96
  */
96
97
  otherwise(handler: any): void;
97
- _otherwiseFn: any;
98
+ _otherwiseFn: import("./url-rule.js").BaseUrlRule;
98
99
  _sorted: boolean;
99
100
  /**
100
101
  * Remove a rule previously registered
@@ -225,5 +226,24 @@ export class UrlRules {
225
226
  *
226
227
  * @return the registered [[UrlRule]]
227
228
  */
228
- when(matcher: any, handler: any, options: any): any;
229
+ when(
230
+ matcher: any,
231
+ handler: any,
232
+ options: any,
233
+ ): import("./url-rule.js").BaseUrlRule;
229
234
  }
235
+ /**
236
+ * Default rule priority sorting function.
237
+ *
238
+ * Sorts rules by:
239
+ *
240
+ * - Explicit priority (set rule priority using [[UrlRules.when]])
241
+ * - Rule type (STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1)
242
+ * - `UrlMatcher` specificity ([[UrlMatcher.compare]]): works for STATE and URLMATCHER types to pick the most specific rule.
243
+ * - Rule registration order (for rule types other than STATE and URLMATCHER)
244
+ * - Equally sorted State and UrlMatcher rules will each match the URL.
245
+ * Then, the *best* match is chosen based on how many parameter values were matched.
246
+ */
247
+ declare function defaultRuleSortFn(a: any, b: any): number;
248
+ import { UrlRuleFactory } from "./url-rule.js";
249
+ export {};
@@ -6,61 +6,58 @@ export class UrlService {
6
6
  /**
7
7
  * @param {import("../../services/location/location").LocationProvider} $locationProvider
8
8
  * @param {import("../../router/state/state-service.js").StateProvider} stateService
9
- * @param globals
9
+ * @param {import("../router.js").Router} globals
10
10
  * @param {import("../../router/url/url-config.js").UrlConfigProvider} urlConfigProvider
11
11
  */
12
12
  constructor(
13
13
  $locationProvider: any,
14
14
  stateService: import("../../router/state/state-service.js").StateProvider,
15
- globals: any,
15
+ globals: import("../router.js").Router,
16
16
  urlConfigProvider: import("../../router/url/url-config.js").UrlConfigProvider,
17
17
  );
18
- stateService: import("../../router/state/state-service.js").StateProvider;
18
+ /** @type {import("../../services/location/location").Location} */
19
+ $location: any;
19
20
  $locationProvider: any;
20
- $location: import("../../services/location/location.js").Location;
21
+ stateService: import("../../router/state/state-service.js").StateProvider;
21
22
  /** Provides services related to the URL */
22
23
  urlRuleFactory: UrlRuleFactory;
23
24
  /**
24
25
  * The nested [[UrlRules]] API for managing URL rules and rewrites
25
- *
26
- * See: [[UrlRules]] for details
27
26
  * @type {UrlRules}
28
27
  */
29
28
  rules: UrlRules;
30
29
  /**
31
30
  * The nested [[UrlConfig]] API to configure the URL and retrieve URL information
32
- *
33
- * See: [[UrlConfig]] for details
34
31
  * @type {import("./url-config.js").UrlConfigProvider}
35
32
  */
36
33
  config: import("./url-config.js").UrlConfigProvider;
37
34
  /** Creates a new [[Param]] for a given location (DefType) */
38
35
  paramFactory: ParamFactory;
36
+ _urlListeners: any[];
39
37
  /**
40
38
  * Gets the path part of the current url
41
39
  *
42
40
  * If the current URL is `/some/path?query=value#anchor`, this returns `/some/path`
43
41
  *
44
- * @return the path portion of the url
42
+ * @return {string} the path portion of the url
45
43
  */
46
- path: () => any;
44
+ getPath(): string;
47
45
  /**
48
46
  * Gets the search part of the current url as an object
49
47
  *
50
48
  * If the current URL is `/some/path?query=value#anchor`, this returns `{ query: 'value' }`
51
49
  *
52
- * @return the search (query) portion of the url, as an object
50
+ * @return {Object} the search (query) portion of the url, as an object
53
51
  */
54
- search: () => any;
52
+ getSearch(): any;
55
53
  /**
56
54
  * Gets the hash part of the current url
57
55
  *
58
56
  * If the current URL is `/some/path?query=value#anchor`, this returns `anchor`
59
57
  *
60
- * @return the hash (anchor) portion of the url
58
+ * @return {string} the hash (anchor) portion of the url
61
59
  */
62
- hash: () => string | import("../../services/location/location.js").Location;
63
- _urlListeners: any[];
60
+ getHash(): string;
64
61
  $get: (
65
62
  | string
66
63
  | ((
@@ -69,9 +66,8 @@ export class UrlService {
69
66
  ) => UrlService)
70
67
  )[];
71
68
  /**
72
- * @returns {boolean}
69
+ * @returns {string}
73
70
  */
74
- html5Mode(): boolean;
75
71
  baseHref(): string;
76
72
  _baseHref: string;
77
73
  /**
@@ -121,18 +117,13 @@ export class UrlService {
121
117
  * @param {string} [newUrl] The new value for the URL.
122
118
  * This url should reflect only the new internal [[path]], [[search]], and [[hash]] values.
123
119
  * It should not include the protocol, site, port, or base path of an absolute HREF.
124
- * @param {boolean} [replace] When true, replaces the current history entry (instead of appending it) with this new url
125
120
  * @param {any} [state] The history's state object, i.e., pushState (if the LocationServices implementation supports it)
126
121
  *
127
122
  * @return the url (after potentially being processed)
128
123
  */
129
- url(
130
- newUrl?: string,
131
- replace?: boolean,
132
- state?: any,
133
- ): string | import("../../services/location/location.js").Location;
124
+ url(newUrl?: string, state?: any): any;
134
125
  /**
135
- * @internal
126
+ * @private
136
127
  *
137
128
  * Registers a low level url change handler
138
129
  *
@@ -143,20 +134,19 @@ export class UrlService {
143
134
  * let deregisterFn = locationServices.onChange((evt) => console.log("url change", evt));
144
135
  * ```
145
136
  *
146
- * @param callback a function that will be called when the url is changing
147
- * @return a function that de-registers the callback
137
+ * @param {Function} callback a function that will be called when the url is changing
138
+ * @return {Function} a function that de-registers the callback
148
139
  */
149
- onChange(callback: any): () => any;
140
+ private onChange;
150
141
  /**
151
- * Gets the current URL parts
142
+ * Gets the current URL parts.
143
+ *
144
+ * Returns an object with the `path`, `search`, and `hash` components
145
+ * of the current browser location.
152
146
  *
153
- * This method returns the different parts of the current URL (the [[path]], [[search]], and [[hash]]) as a [[UrlParts]] object.
147
+ * @returns {import("../../services/location/interface.ts").UrlParts} The current URL's path, search, and hash.
154
148
  */
155
- parts(): {
156
- path: any;
157
- search: any;
158
- hash: string | import("../../services/location/location.js").Location;
159
- };
149
+ parts(): import("../../services/location/interface.ts").UrlParts;
160
150
  /**
161
151
  * Activates the best rule for the current URL
162
152
  *
@@ -196,9 +186,9 @@ export class UrlService {
196
186
  * });
197
187
  * ```
198
188
  *
199
- * @param enabled `true` or `false` to start or stop listening to URL changes
189
+ * @param {boolean} enabled `true` or `false` to start or stop listening to URL changes
200
190
  */
201
- listen(enabled: any): any;
191
+ listen(enabled: boolean): any;
202
192
  _stopListeningFn: any;
203
193
  /**
204
194
  * Matches a URL
@@ -209,7 +199,7 @@ export class UrlService {
209
199
  */
210
200
  match(url: any): any;
211
201
  update(read: any): void;
212
- location: string | import("../../services/location/location.js").Location;
202
+ location: any;
213
203
  /**
214
204
  * Internal API.
215
205
  *
@@ -228,7 +218,7 @@ export class UrlService {
228
218
  * ```js
229
219
  * matcher = $umf.compile("/about/:person");
230
220
  * params = { person: "bob" };
231
- * $bob = $urlService.href(matcher, params);
221
+ * $bob = $url.href(matcher, params);
232
222
  * // $bob == "/about/bob";
233
223
  * ```
234
224
  *
@@ -50,8 +50,55 @@ export class HttpProvider {
50
50
  * otherwise, returns the current configured value.
51
51
  */
52
52
  useApplyAsync: (value?: boolean | undefined) => boolean | any;
53
+ /**
54
+ * Array containing service factories for all synchronous or asynchronous {@link ng.$http $http}
55
+ * pre-processing of request or postprocessing of responses.
56
+ *
57
+ * These service factories are ordered by request, i.e. they are applied in the same order as the
58
+ * array, on request, but reverse order, on response.
59
+ *
60
+ * {@link ng.$http#interceptors Interceptors detailed info}
61
+ */
53
62
  interceptors: any[];
54
- xsrfTrustedOrigins: any[];
63
+ /**
64
+ * Array containing URLs whose origins are trusted to receive the XSRF token. See the
65
+ * {@link ng.$http#security-considerations Security Considerations} sections for more details on
66
+ * XSRF.
67
+ *
68
+ * **Note:** An "origin" consists of the [URI scheme](https://en.wikipedia.org/wiki/URI_scheme),
69
+ * the [hostname](https://en.wikipedia.org/wiki/Hostname) and the
70
+ * [port number](https://en.wikipedia.org/wiki/Port_(computer_networking). For `http:` and
71
+ * `https:`, the port number can be omitted if using th default ports (80 and 443 respectively).
72
+ * Examples: `http://example.com`, `https://api.example.com:9876`
73
+ *
74
+ * <div class="alert alert-warning">
75
+ * It is not possible to trust specific URLs/paths. The `path`, `query` and `fragment` parts
76
+ * of a URL will be ignored. For example, `https://foo.com/path/bar?query=baz#fragment` will be
77
+ * treated as `https://foo.com`, meaning that **all** requests to URLs starting with
78
+ * `https://foo.com/` will include the XSRF token.
79
+ * </div>
80
+ *
81
+ * @example
82
+ *
83
+ * ```js
84
+ * // App served from `https://example.com/`.
85
+ * angular.
86
+ * module('xsrfTrustedOriginsExample', []).
87
+ * config(['$httpProvider', function($httpProvider) {
88
+ * $httpProvider.xsrfTrustedOrigins.push('https://api.example.com');
89
+ * }]).
90
+ * run(['$http', function($http) {
91
+ * // The XSRF token will be sent.
92
+ * $http.get('https://api.example.com/preferences').then(...);
93
+ *
94
+ * // The XSRF token will NOT be sent.
95
+ * $http.get('https://stats.example.com/activity').then(...);
96
+ * }]);
97
+ * ```
98
+ *
99
+ * @type {string[]}
100
+ */
101
+ xsrfTrustedOrigins: string[];
55
102
  $get: (
56
103
  | string
57
104
  | ((
@@ -2,44 +2,57 @@
2
2
  * @returns
3
3
  */
4
4
  export function createHttpBackend(): (
5
- method: any,
6
- url: any,
7
- post: any,
8
- callback: any,
9
- headers: any,
10
- timeout: any,
11
- withCredentials: any,
12
- responseType: any,
13
- eventHandlers: any,
14
- uploadEventHandlers: any,
5
+ method: string,
6
+ url?: string,
7
+ post?: any,
8
+ callback?: (
9
+ arg0: number,
10
+ arg1: any,
11
+ arg2: string | null,
12
+ arg3: string,
13
+ arg4: string,
14
+ ) => void,
15
+ headers?: {
16
+ [x: string]: string;
17
+ },
18
+ timeout?: number | Promise<any>,
19
+ withCredentials?: boolean,
20
+ responseType?: XMLHttpRequestResponseType,
21
+ eventHandlers?: {
22
+ [x: string]: EventListener;
23
+ },
24
+ uploadEventHandlers?: {
25
+ [x: string]: EventListener;
26
+ },
15
27
  ) => void;
16
28
  /**
17
- * HTTP backend used by the {@link ng.$http service} that delegates to
29
+ * HTTP backend used by the `$http` that delegates to
18
30
  * XMLHttpRequest object and deals with browser incompatibilities.
19
- *
20
- * You should never need to use this service directly, instead use the higher-level abstractions:
21
- * {@link ng.$http $http}.
22
- *
23
- */
24
- /**
25
- * HTTP backend used by the {@link ng.$http service} that delegates to
26
- * XMLHttpRequest object and deals with browser incompatibilities.
27
- *
28
- * You should never need to use this service directly, instead use the higher-level abstractions:
29
- * {@link ng.$http $http}.
30
- *
31
+ * You should never need to use this service directly.
31
32
  */
32
33
  export class HttpBackendProvider {
33
- $get: (() => (
34
- method: any,
35
- url: any,
36
- post: any,
37
- callback: any,
38
- headers: any,
39
- timeout: any,
40
- withCredentials: any,
41
- responseType: any,
42
- eventHandlers: any,
43
- uploadEventHandlers: any,
44
- ) => void)[];
34
+ $get: () => (
35
+ method: string,
36
+ url?: string,
37
+ post?: any,
38
+ callback?: (
39
+ arg0: number,
40
+ arg1: any,
41
+ arg2: string | null,
42
+ arg3: string,
43
+ arg4: string,
44
+ ) => void,
45
+ headers?: {
46
+ [x: string]: string;
47
+ },
48
+ timeout?: number | Promise<any>,
49
+ withCredentials?: boolean,
50
+ responseType?: XMLHttpRequestResponseType,
51
+ eventHandlers?: {
52
+ [x: string]: EventListener;
53
+ },
54
+ uploadEventHandlers?: {
55
+ [x: string]: EventListener;
56
+ },
57
+ ) => void;
45
58
  }
@@ -6,3 +6,58 @@
6
6
  * @returns void
7
7
  */
8
8
  export type UrlChangeListener = (url: string, state: History["state"]) => void;
9
+ /**
10
+ * Represents the configuration options for HTML5 mode.
11
+ */
12
+ export interface Html5Mode {
13
+ /**
14
+ * If true, will rely on `history.pushState` to change URLs where supported.
15
+ * Falls back to hash-prefixed paths in browsers that do not support `pushState`.
16
+ * @default false
17
+ */
18
+ enabled: boolean;
19
+ /**
20
+ * When html5Mode is enabled, specifies whether or not a `<base>` tag is required to be present.
21
+ * If both `enabled` and `requireBase` are true, and a `<base>` tag is not present,
22
+ * an error will be thrown when `$location` is injected.
23
+ * @default true
24
+ */
25
+ requireBase: boolean;
26
+ /**
27
+ * When html5Mode is enabled, enables or disables URL rewriting for relative links.
28
+ * If set to a string, URL rewriting will only apply to links with an attribute that matches the given string.
29
+ * For example, if set to `'internal-link'`, URL rewriting will only occur for `<a internal-link>` links.
30
+ * Attribute name normalization does not apply here.
31
+ * @default true
32
+ */
33
+ rewriteLinks: boolean | string;
34
+ }
35
+ /**
36
+ * Represents default port numbers for various protocols.
37
+ */
38
+ export interface DefaultPorts {
39
+ http: number;
40
+ https: number;
41
+ ftp: number;
42
+ }
43
+ /**
44
+ * Represents the individual components of a URL.
45
+ */
46
+ export interface UrlParts {
47
+ /**
48
+ * The URL path (e.g. `/dashboard`, `/users/123`).
49
+ */
50
+ path: string;
51
+ /**
52
+ * The parsed query string as an object.
53
+ * Mirrors AngularJS’s `$location.setSearch()` format.
54
+ */
55
+ search: Record<
56
+ string,
57
+ string | number | boolean | (string | number | boolean)[]
58
+ >;
59
+ /**
60
+ * The fragment identifier (everything after `#`, not including the `#` itself).
61
+ */
62
+ hash: string;
63
+ }