@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
@@ -1,188 +1,256 @@
1
1
  /**
2
+ * ///////////////////////////
3
+ * PRIVATE HELPERS
4
+ * ///////////////////////////
5
+ */
6
+ /**
7
+ * @ignore
8
+ * Encodes a URL path by encoding each path segment individually using `encodeUriSegment`,
9
+ * while preserving forward slashes (`/`) as segment separators.
10
+ *
11
+ * This function first decodes any existing percent-encodings (such as `%20` or `%2F`)
12
+ * in each segment to prevent double encoding, except for encoded forward slashes (`%2F`),
13
+ * which are replaced with literal slashes before decoding to keep path boundaries intact.
14
+ *
15
+ * After decoding, each segment is re-encoded with `encodeUriSegment` according to RFC 3986,
16
+ * encoding only characters that must be encoded in a path segment.
17
+ *
18
+ * The encoded segments are then rejoined with `/` to form the encoded path.
19
+ *
20
+ * @param {string} path - The URL path string to encode. May contain multiple segments separated by `/`.
21
+ * @returns {string} The encoded path, where each segment is encoded, but forward slashes are preserved.
22
+ *
23
+ * @example
24
+ * encodePath("user profile/images/pic 1.jpg")
25
+ * // returns "user%20profile/images/pic%201.jpg"
26
+ *
27
+ * @example
28
+ * encodePath("folder1%2Fsub/folder2")
29
+ * // returns "folder1%2Fsub/folder2"
30
+ */
31
+ export function encodePath(path: string): string;
32
+ /**
33
+ * @ignore
34
+ * Decodes each segment of a URL path.
35
+ *
36
+ * Splits the input path by "/", decodes each segment using decodeURIComponent,
37
+ * and if html5Mode is enabled, re-encodes any forward slashes inside segments
38
+ * as "%2F" to avoid confusion with path separators.
39
+ *
40
+ * @param {string} path - The URL path to decode.
41
+ * @param {boolean} html5Mode - If true, encodes forward slashes in segments as "%2F".
42
+ * @returns {string} The decoded path with segments optionally encoding slashes.
43
+ */
44
+ export function decodePath(path: string, html5Mode: boolean): string;
45
+ /**
46
+ * @ignore
47
+ * Normalizes a URL path by encoding the path segments, query parameters, and hash fragment.
48
+ *
49
+ * - Path segments are encoded using `encodePath`, which encodes each segment individually.
50
+ * - Query parameters (`searchValue`) are converted to a query string using `toKeyValue`.
51
+ * - Hash fragment (`hashValue`) is encoded using `encodeUriSegment` and prefixed with `#`.
52
+ *
53
+ * This function returns a fully constructed URL path with optional query and hash components.
54
+ *
55
+ * @param {string} pathValue - The base URL path (e.g., "folder/item name").
56
+ * @param {Object.<string, any> | string | null} searchValue - An object or string representing query parameters.
57
+ * - If an object, it can contain strings, numbers, booleans, or arrays of values.
58
+ * - If a string, it is assumed to be a raw query string.
59
+ * - If null or undefined, no query string is added.
60
+ * @param {string | null} hashValue - The URL fragment (everything after `#`). If null or undefined, no hash is added.
61
+ *
62
+ * @returns {string} The normalized URL path including encoded path, optional query string, and optional hash.
2
63
  *
64
+ * @example
65
+ * normalizePath("products/list", { category: "books", page: 2 }, "section1")
66
+ * // returns "products/list?category=books&page=2#section1"
67
+ *
68
+ * @example
69
+ * normalizePath("user profile/images", null, null)
70
+ * // returns "user%20profile/images"
71
+ */
72
+ export function normalizePath(
73
+ pathValue: string,
74
+ searchValue:
75
+ | {
76
+ [x: string]: any;
77
+ }
78
+ | string
79
+ | null,
80
+ hashValue: string | null,
81
+ ): string;
82
+ /**
83
+ * @ignore
84
+ * Parses the application URL and updates the location object with path, search, and hash.
85
+ *
86
+ * @param {string} url - The URL string to parse.
87
+ * @param {boolean} html5Mode - Whether HTML5 mode is enabled (affects decoding).
88
+ * @throws Will throw an error if the URL starts with invalid slashes.
89
+ */
90
+ export function parseAppUrl(url: string, html5Mode: boolean): void;
91
+ /**
92
+ * @ignore
93
+ * Returns the substring of `url` after the `base` string if `url` starts with `base`.
94
+ * Returns `undefined` if `url` does not start with `base`.
3
95
  * @param {string} base
4
96
  * @param {string} url
5
97
  * @returns {string} returns text from `url` after `base` or `undefined` if it does not begin with
6
98
  * the expected string.
7
99
  */
8
100
  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
101
  /**
13
- * @abstract
102
+ * @ignore
103
+ * Removes the hash fragment (including the '#') from the given URL string.
104
+ *
105
+ * @param {string} url - The URL string to process.
106
+ * @returns {string} The URL without the hash fragment.
107
+ */
108
+ export function stripHash(url: string): string;
109
+ /**
110
+ * @ignore
111
+ * Removes the file name (and any hash) from a URL, returning the base directory path.
112
+ *
113
+ * For example:
114
+ * - Input: "https://example.com/path/to/file.js"
115
+ * Output: "https://example.com/path/to/"
116
+ *
117
+ * - Input: "https://example.com/path/to/file.js#section"
118
+ * Output: "https://example.com/path/to/"
119
+ *
120
+ * @param {string} url - The URL from which to strip the file name and hash.
121
+ * @returns {string} The base path of the URL, ending with a slash.
14
122
  */
123
+ export function stripFile(url: string): string;
124
+ /**
125
+ * @ignore
126
+ * Extracts the base server URL (scheme, host, and optional port) from a full URL.
127
+ *
128
+ * If no path is present, returns the full URL.
129
+ *
130
+ * For example:
131
+ * - Input: "https://example.com/path/to/file"
132
+ * Output: "https://example.com"
133
+ *
134
+ * - Input: "http://localhost:3000/api/data"
135
+ * Output: "http://localhost:3000"
136
+ *
137
+ * @param {string} url - The full URL to extract the server base from.
138
+ * @returns {string} The server base, including scheme and host (and port if present).
139
+ */
140
+ export function serverBase(url: string): string;
141
+ /**
142
+ * @ignore
143
+ * Determine if two URLs are equal despite potential differences in encoding,
144
+ * trailing slashes, or empty hash fragments, such as between $location.absUrl() and $browser.url().
145
+ *
146
+ * @param {string} a - First URL to compare.
147
+ * @param {string} b - Second URL to compare.
148
+ * @returns {boolean} True if URLs are equivalent after normalization.
149
+ */
150
+ export function urlsEqual(a: string, b: string): boolean;
15
151
  export class Location {
16
152
  /**
17
153
  * @param {string} appBase application base URL
18
154
  * @param {string} appBaseNoFile application base URL stripped of any filename
19
- */
20
- constructor(appBase: string, appBaseNoFile: string);
155
+ * @param {boolean} [html5] Defaults to true
156
+ * @param {string} [prefix] URL path prefix for html5 mode or hash prefix for hashbang mode
157
+ */
158
+ constructor(
159
+ appBase: string,
160
+ appBaseNoFile: string,
161
+ html5?: boolean,
162
+ prefix?: string,
163
+ );
21
164
  /** @type {string} */
22
165
  appBase: string;
23
166
  /** @type {string} */
24
167
  appBaseNoFile: string;
25
- /**
26
- * An absolute URL is the full URL, including protocol (http/https ), the optional subdomain (e.g. www ), domain (example.com), and path (which includes the directory and slug).
27
- * @type {string}
28
- */
29
- $$absUrl: string;
30
- /**
31
- * If html5 mode is enabled
32
- * @type {boolean}
33
- */
34
- $$html5: boolean;
35
- /**
36
- * Has any change been replacing?
37
- * @type {boolean}
38
- */
39
- $$replace: boolean;
40
- /** @type {string} */
41
- $$protocol: string;
42
- /** @type {string} */
43
- $$host: string;
44
- /**
45
- * The port, without ":"
46
- * @type {number}
47
- */
48
- $$port: number;
49
- /**
50
- * The pathname, beginning with "/"
168
+ /** @type {boolean} */
169
+ html5: boolean;
170
+ /** @type {string | undefined} */
171
+ basePrefix: string | undefined;
172
+ /** @type {string | undefined} */
173
+ hashPrefix: string | undefined;
174
+ /**
175
+ * An absolute URL is the full URL, including protocol (http/https ), the optional subdomain (e.g. www ), domain (example.com), and path (which includes the directory and slug)
176
+ * with all segments encoded according to rules specified in [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt).
51
177
  * @type {string}
52
178
  */
53
- $$path: string;
179
+ absUrl: string;
54
180
  /**
55
- * The hash string, minus the hash symbol
181
+ * @ignore
182
+ * Current url
56
183
  * @type {string}
57
184
  */
58
- $$hash: string;
59
- /**
60
- * Helper property for scope watch changes
61
- * @type {boolean}
62
- */
63
- $$urlUpdatedByLocation: boolean;
185
+ $$url: string;
64
186
  /**
65
- * Return full URL representation with all segments encoded according to rules specified in
66
- * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt).
67
- *
68
- * @return {string} full URL
187
+ * @ignore
188
+ * Callback to update browser url
189
+ * @type {Function}
69
190
  */
70
- absUrl(): string;
191
+ $$updateBrowser: Function;
71
192
  /**
72
- * This method is getter / setter.
73
- *
74
- * Return URL (e.g. `/path?a=b#hash`) when called without any parameter.
75
193
  * Change path, search and hash, when called with parameter and return `$location`.
76
194
  *
77
- * @param {string=} url New URL without base prefix (e.g. `/path?a=b#hash`)
78
- * @return {Location|string} url
195
+ * @param {string} url New URL without base prefix (e.g. `/path?a=b#hash`)
196
+ * @return {Location} url
79
197
  */
80
- url(url?: string | undefined): Location | string;
198
+ setUrl(url: string): Location;
81
199
  /**
200
+ * Return URL (e.g. `/path?a=b#hash`) when called without any parameter.
82
201
  *
83
- * Return protocol of current URL.
84
- * @return {string} protocol of current URL
85
- */
86
- protocol(): string;
87
- /**
88
- * This method is getter only.
89
- *
90
- * Return host of current URL.
91
- *
92
- * Note: compared to the non-AngularTS version `location.host` which returns `hostname:port`, this returns the `hostname` portion only.
93
- *
94
- *
95
- * @return {string} host of current URL.
202
+ * @return {string} url
96
203
  */
97
- host(): string;
204
+ getUrl(): string;
98
205
  /**
99
- * This method is getter only.
206
+ * Change path parameter and return `$location`.
100
207
  *
101
- * Return port of current URL.
102
- *
103
- *
104
- * ```js
105
- * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo
106
- * let port = $location.port();
107
- * // => 80
108
- * ```
109
- *
110
- * @return {number} port
208
+ * @param {(string|number)} path New path
209
+ * @return {Location}
111
210
  */
112
- port(): number;
211
+ setPath(path: string | number): Location;
113
212
  /**
114
- * This method is getter / setter.
115
- *
116
- * Return path of current URL when called without any parameter.
117
213
  *
118
- * Change path when called with parameter and return `$location`.
214
+ * Return path of current URL
119
215
  *
120
- * Note: Path should always begin with forward slash (/), this method will add the forward slash
121
- * if it is missing.
122
- *
123
- *
124
- * ```js
125
- * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo
126
- * let path = $location.path();
127
- * // => "/some/path"
128
- * ```
129
- *
130
- * @param {(string|number)=} path New path
131
- * @return {(string|object)} path if called with no parameters, or `$location` if called with a parameter
216
+ * @return {string}
132
217
  */
133
- path(path?: (string | number) | undefined): string | object;
218
+ getPath(): string;
134
219
  /**
135
- * This method is getter / setter.
136
- *
137
- * Returns the hash fragment when called without any parameters.
138
- *
139
220
  * Changes the hash fragment when called with a parameter and returns `$location`.
140
- *
141
- *
142
- * ```js
143
- * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue
144
- * let hash = $location.hash();
145
- * // => "hashValue"
146
- * ```
147
- *
148
- * @param {(string|number)=} hash New hash fragment
149
- * @return {string|Location} hash
221
+ * @param {(string|number)} hash New hash fragment
222
+ * @return {Location} hash
150
223
  */
151
- hash(hash?: (string | number) | undefined): string | Location;
224
+ setHash(hash: string | number): Location;
152
225
  /**
153
- * If called, all changes to $location during the current `$digest` will replace the current history
154
- * record, instead of adding a new one.
226
+ * Returns the hash fragment when called without any parameters.
227
+ * @return {string} hash
155
228
  */
156
- replace(): this;
229
+ getHash(): string;
157
230
  /**
158
- * Returns or sets the search part (as object) of current URL when called without any parameter
231
+ * Sets the search part (as object) of current URL
159
232
  *
160
- * @param {string|Object=} search New search params - string or hash object.
233
+ * @param {string|Object} search New search params - string or hash object.
161
234
  * @param {(string|number|Array<string>|boolean)=} paramValue If search is a string or number, then paramValue will override only a single search property.
162
- * @returns {Object|Location} Search object or Location object
235
+ * @returns {Object} Search object or Location object
163
236
  */
164
- search(
165
- search?: (string | any) | undefined,
237
+ setSearch(
238
+ search: string | any,
166
239
  paramValue?: (string | number | Array<string> | boolean) | undefined,
167
240
  ...args: any[]
168
- ): any | Location;
169
- $$search: any;
241
+ ): any;
170
242
  /**
171
- * Compose url and update `url` and `absUrl` property
172
- * @returns {void}
243
+ * Returns the search part (as object) of current URL
244
+ *
245
+ * @returns {Object} Search object or Location object
173
246
  */
174
- $$compose(): void;
175
- $$url: string;
247
+ getSearch(): any;
176
248
  /**
177
- * @param {string} _url
178
- * @returns {string}
249
+ * @private
250
+ * Compose url and update `url` and `absUrl` property
179
251
  */
180
- $$normalizeUrl(_url: string): string;
252
+ private $$compose;
181
253
  /**
182
- * This method is getter / setter.
183
- *
184
- * Return the history state object when called without any parameter.
185
- *
186
254
  * Change the history state object when called with one parameter and return `$location`.
187
255
  * The state object is later passed to `pushState` or `replaceState`.
188
256
  * See {@link https://developer.mozilla.org/en-US/docs/Web/API/History/pushState#state|History.state}
@@ -190,84 +258,55 @@ export class Location {
190
258
  * NOTE: This method is supported only in HTML5 mode and only in browsers supporting
191
259
  * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support
192
260
  * older browsers (like IE9 or Android < 4.0), don't use this method.
193
- *
194
- * @param {any} state State object for pushState or replaceState
195
- * @return {any} state
261
+ * @param {any} state
262
+ * @returns {Location}
196
263
  */
197
- state(state: any, ...args: any[]): any;
264
+ setState(state: any): Location;
198
265
  $$state: any;
199
266
  /**
200
- * @param {string} _url
201
- * @param {string} _url2
202
- * @returns {boolean}
267
+ * Return the history state object
268
+ * @returns {any}
203
269
  */
204
- $$parseLinkUrl(_url: string, _url2: string): boolean;
205
- $$parse(_url: any): void;
206
- }
207
- /**
208
- * This object is exposed as $location service when HTML5 mode is enabled and supported
209
- */
210
- export class LocationHtml5Url extends Location {
270
+ getState(): any;
211
271
  /**
212
- * @param {string} appBase application base URL
213
- * @param {string} appBaseNoFile application base URL stripped of any filename
214
- * @param {string} basePrefix URL path prefix
272
+ * @param {string} url
273
+ * @param {string} relHref
274
+ * @returns {boolean}
215
275
  */
216
- constructor(appBase: string, appBaseNoFile: string, basePrefix: string);
217
- basePrefix: string;
276
+ parseLinkUrl(url: string, relHref: string): boolean;
218
277
  /**
219
278
  * Parse given HTML5 (regular) URL string into properties
220
279
  * @param {string} url HTML5 URL
221
280
  */
222
- $$parse(url: string): void;
223
- $$normalizeUrl(url: any): string;
224
- }
225
- /**
226
- * LocationHashbangUrl represents URL
227
- * This object is exposed as $location service when developer doesn't opt into html5 mode.
228
- * It also serves as the base class for html5 mode fallback on legacy browsers.
229
- *
230
- */
231
- export class LocationHashbangUrl extends Location {
232
- /**
233
- * @param {string} appBase application base URL
234
- * @param {string} appBaseNoFile application base URL stripped of any filename
235
- * @param {string} hashPrefix hashbang prefix
236
- */
237
- constructor(appBase: string, appBaseNoFile: string, hashPrefix: string);
238
- hashPrefix: string;
239
- /**
240
- * Parse given hashbang URL into properties
241
- * @param {string} url Hashbang URL
242
- */
243
- $$parse(url: string): void;
244
- $$normalizeUrl(url: any): string;
245
- /**
246
- * @param {string} url
247
- * @returns {boolean}
248
- */
249
- $$parseLinkUrl(url: string): boolean;
281
+ parse(url: string): void;
250
282
  }
251
283
  export class LocationProvider {
252
284
  /** @type {string} */
253
285
  hashPrefixConf: string;
254
- /** @type {Html5Mode} */
255
- html5ModeConf: Html5Mode;
256
- /** @type {Array<import("./interface.js").UrlChangeListener>} */
257
- urlChangeListeners: Array<import("./interface.js").UrlChangeListener>;
286
+ /** @type {import("./interface.ts").Html5Mode} */
287
+ html5ModeConf: import("./interface.ts").Html5Mode;
288
+ /** @type {Array<import("./interface.ts").UrlChangeListener>} */
289
+ urlChangeListeners: Array<import("./interface.ts").UrlChangeListener>;
258
290
  urlChangeInit: boolean;
259
291
  /** @type {History['state']} */
260
292
  cachedState: History["state"];
261
- /** @typeof {History.state} */
262
- lastHistoryState: any;
293
+ /** @type {History['state']} */
294
+ lastHistoryState: History["state"];
263
295
  /** @type {string} */
264
296
  lastBrowserUrl: string;
265
- setUrl(url: any, state: any): this;
297
+ /**
298
+ * Updates the browser's current URL and history state.
299
+ *
300
+ * @param {string|undefined} url - The target URL to navigate to.
301
+ * @param {*} [state=null] - Optional history state object to associate with the new URL.
302
+ * @returns {LocationProvider}
303
+ */
304
+ setUrl(url: string | undefined, state?: any): LocationProvider;
266
305
  /**
267
306
  * Returns the current URL with any empty hash (`#`) removed.
268
307
  * @return {string}
269
308
  */
270
- getUrl(): string;
309
+ getBrowserUrl(): string;
271
310
  /**
272
311
  * Returns the cached state.
273
312
  * @returns {History['state']} The cached state.
@@ -280,42 +319,6 @@ export class LocationProvider {
280
319
  */
281
320
  private cacheState;
282
321
  lastCachedState: any;
283
- /**
284
- * Fires the state or URL change event.
285
- *
286
- * @private
287
- */
288
- private fireStateOrUrlChange;
289
- /**
290
- * Registers a callback to be called when the URL changes.
291
- *
292
- * @param {import("./interface.js").UrlChangeListener} callback - The callback function to register.
293
- * @returns void
294
- */
295
- onUrlChange(callback: import("./interface.js").UrlChangeListener): void;
296
- /**
297
- * The default value for the prefix is `'!'`.
298
- * @param {string=} prefix Prefix for hash part (containing path and search)
299
- * @returns {void}
300
- */
301
- setHashPrefix(prefix?: string | undefined): void;
302
- /**
303
- * Current hash prefix
304
- * @returns {string}
305
- */
306
- getHashPrefix(): string;
307
- /**
308
- * Configures html5 mode
309
- * @param {(boolean|Html5Mode)=} mode If boolean, sets `html5Mode.enabled` to value. Otherwise, accepts html5Mode object
310
- *
311
- * @returns {void}
312
- */
313
- setHtml5Mode(mode?: (boolean | Html5Mode) | undefined): void;
314
- /**
315
- * Returns html5 mode cofiguration
316
- * @returns {Html5Mode}
317
- */
318
- getHtml5Mode(): Html5Mode;
319
322
  $get: (
320
323
  | string
321
324
  | ((
@@ -323,35 +326,5 @@ export class LocationProvider {
323
326
  $rootElement: Element,
324
327
  ) => Location)
325
328
  )[];
329
+ #private;
326
330
  }
327
- export type DefaultPorts = {
328
- http: number;
329
- https: number;
330
- ftp: number;
331
- };
332
- /**
333
- * Represents the configuration options for HTML5 mode.
334
- */
335
- export type Html5Mode = {
336
- /**
337
- * - (default: false) If true, will rely on `history.pushState` to
338
- * change URLs where supported. Falls back to hash-prefixed paths in browsers that do not
339
- * support `pushState`.
340
- */
341
- enabled: boolean;
342
- /**
343
- * - (default: `true`) When html5Mode is enabled, specifies
344
- * whether or not a `<base>` tag is required to be present. If both `enabled` and `requireBase`
345
- * are true, and a `<base>` tag is not present, an error will be thrown when `$location` is injected.
346
- * See the {@link guide /$location $location guide} for more information.
347
- */
348
- requireBase: boolean;
349
- /**
350
- * - (default: `true`) When html5Mode is enabled, enables or
351
- * disables URL rewriting for relative links. If set to a string, URL rewriting will only apply to links
352
- * with an attribute that matches the given string. For example, if set to `'internal-link'`, URL rewriting
353
- * will only occur for `<a internal-link>` links. Note that [attribute name normalization](guide/directive#normalization)
354
- * does not apply here, so `'internalLink'` will **not** match `'internal-link'`.
355
- */
356
- rewriteLinks: boolean | string;
357
- };
@@ -182,8 +182,6 @@ export function copy(src: any, dest: any): any;
182
182
  * The same array is returned
183
183
  */
184
184
  export const removeFrom: any;
185
- /** pushes a values to an array and returns the value */
186
- export const pushTo: any;
187
185
  export function allTrueR(memo: any, elem: any): any;
188
186
  export function anyTrueR(memo: any, elem: any): any;
189
187
  export function unnestR(memo: any, elem: any): any;
@@ -54,11 +54,6 @@ export function compose(...args: any[]): () => any;
54
54
  * then, piped is: h(g(f(x)))
55
55
  */
56
56
  export function pipe(...args: any[]): any;
57
- /**
58
- * Given two functions that return truthy or falsey values, returns a function that returns truthy
59
- * if at least one of the functions returns truthy for the given arguments
60
- */
61
- export function or(fn1: any, fn2: any): (...args: any[]) => any;
62
57
  /**
63
58
  * Sorta like Pattern Matching (a functional programming conditional construct)
64
59
  *
@@ -109,6 +104,5 @@ export function pattern(struct: any): (arg0: any) => any;
109
104
  */
110
105
  export const propEq: any;
111
106
  export function parse(name: any): any;
112
- export function all(fn1: any): (arr: any) => any;
113
107
  export function is(ctor: any): (obj: any) => boolean;
114
108
  export function val(v: any): () => any;
@@ -1,6 +1,2 @@
1
- export type Mapper<X, T> = (x: X, key?: string | number) => T;
2
- export interface TypedMap<T> {
3
- [key: string]: T;
4
- }
5
1
  export type Predicate<X> = (x?: X) => boolean;
6
2
  export type PredicateBinary<X, Y> = (x?: X, y?: Y) => boolean;
@@ -16,9 +16,9 @@ export class Queue<T> {
16
16
  _evictListeners: Array<(item: T) => void>;
17
17
  /**
18
18
  * Register a listener that will be called with the evicted item.
19
- * @type {(listener: (item: T) => void) => void}
19
+ * @param {(item: T) => void} listener
20
20
  */
21
- onEvict: (listener: (item: T) => void) => void;
21
+ onEvict(listener: (item: T) => void): void;
22
22
  /**
23
23
  * Adds an item to the end of the queue, evicting the head if over limit.
24
24
  * @param {T} item
@@ -1,4 +1,3 @@
1
- export type HttpProtocol = "http" | "https";
2
1
  /**
3
2
  * A normalized representation of a parsed URL.
4
3
  */
@@ -55,11 +55,6 @@ export function urlsAreSameOrigin(
55
55
  url1: import("./interface.js").ResolvableUrl,
56
56
  url2: import("./interface.js").ResolvableUrl,
57
57
  ): boolean;
58
- /**
59
- * Returns the current document base URL.
60
- * @returns {string}
61
- */
62
- export function getBaseUrl(): string;
63
58
  /**
64
59
  * Removes a trailing hash ('#') from the given URL if it exists.
65
60
  *