@angular-wave/angular.ts 0.0.35 → 0.0.37

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 (480) hide show
  1. package/.eslintrc.cjs +1 -1
  2. package/Makefile +4 -0
  3. package/dist/angular-ts.esm.js +1 -1
  4. package/dist/angular-ts.umd.js +1 -1
  5. package/index.html +3 -102
  6. package/package.json +2 -2
  7. package/playwright.config.ts +4 -3
  8. package/public/public/my_other_directive.html +1 -0
  9. package/{test → src}/angular.spec.js +6 -6
  10. package/src/animations/animate-css-driver.js +1 -1
  11. package/src/animations/animate-queue.js +1 -1
  12. package/src/animations/animation.js +1 -1
  13. package/src/animations/shared.js +1 -1
  14. package/{test → src}/binding.spec.js +3 -3
  15. package/src/core/{animate-runner.js → animate/animate-runner.js} +1 -1
  16. package/src/core/animate/animate.html +18 -0
  17. package/src/core/{animate.js → animate/animate.js} +4 -5
  18. package/{test/core → src/core/animate}/animate.spec.js +1 -1
  19. package/src/core/cache/cache-factor.html +18 -0
  20. package/{test/core → src/core/cache}/cache-factor.spec.js +2 -2
  21. package/src/core/cache/cache-factor.test.js +11 -0
  22. package/src/core/compile/compile.html +18 -0
  23. package/src/core/{compile.js → compile/compile.js} +25 -21
  24. package/{test/core → src/core/compile}/compile.spec.js +65 -68
  25. package/src/core/compile/compile.test.js +12 -0
  26. package/src/core/controller/controller.html +21 -0
  27. package/src/core/{controller.js → controller/controller.js} +1 -1
  28. package/{test/core/controller-provider.spec.js → src/core/controller/controller.spec.js} +2 -2
  29. package/src/core/controller/controller.test.js +11 -0
  30. package/{test → src}/core/cookie-reader.spec.js +2 -2
  31. package/{test → src}/core/document.spec.js +3 -3
  32. package/src/core/filter/filter.html +18 -0
  33. package/src/core/{filter.js → filter/filter.js} +5 -5
  34. package/{test/core → src/core/filter}/filter.spec.js +2 -2
  35. package/src/core/filter/filter.test.js +11 -0
  36. package/src/core/interpolate/interpolate.html +21 -0
  37. package/src/core/{interpolate.js → interpolate/interpolate.js} +1 -1
  38. package/{test/core → src/core/interpolate}/interpolate.spec.js +2 -2
  39. package/src/core/interpolate/interpolate.test.js +11 -0
  40. package/src/core/{interval-factory.js → interval/interval-factory.js} +2 -1
  41. package/src/core/interval/interval.html +18 -0
  42. package/src/core/{interval.js → interval/interval.js} +3 -2
  43. package/{test/core → src/core/interval}/interval.spec.js +6 -10
  44. package/src/core/interval/interval.test.js +12 -0
  45. package/src/core/{location.js → location/location.js} +4 -3
  46. package/{test/core → src/core/location}/location.spec.js +3 -3
  47. package/{test → src}/core/on.spec.js +3 -3
  48. package/src/core/parser/parse.js +2 -3
  49. package/{test/core → src/core/parser}/parse.spec.js +4 -4
  50. package/{test → src}/core/prop.spec.js +4 -4
  51. package/{test/core → src/core/pubsub}/pubsub.spec.js +1 -1
  52. package/src/core/{q.js → q/q.js} +1 -1
  53. package/{test/core → src/core/q}/q.spec.js +3 -3
  54. package/{test → src}/core/root-element.spec.js +3 -3
  55. package/src/core/{sanitize-uri.js → sanitize/sanitize-uri.js} +2 -2
  56. package/{test/core → src/core/sanitize}/sanitize-uri.spec.js +1 -1
  57. package/src/core/{sce.js → sce/sce.js} +3 -3
  58. package/{test/core → src/core/sce}/sce.spec.js +3 -3
  59. package/src/core/{root-scope.js → scope/scope.js} +33 -35
  60. package/{test/core → src/core/scope}/scope.spec.js +5 -5
  61. package/src/core/{timeout.js → timeout/timeout.js} +2 -2
  62. package/{test/core → src/core/timeout}/timeout.spec.js +2 -2
  63. package/src/core/{urlUtils.js → url-utils/url-utils.js} +1 -1
  64. package/{test/core → src/core/url-utils}/url-utils.spec.js +1 -1
  65. package/src/directive/attrs/attrs.html +18 -0
  66. package/src/directive/{attrs.js → attrs/attrs.js} +3 -3
  67. package/{test/directive/scrset.spec.js → src/directive/attrs/attrs.spec.js} +3 -3
  68. package/{test/directive → src/directive/attrs}/boolean.spec.js +3 -3
  69. package/{test/directive → src/directive/attrs}/element-style.spec.js +3 -3
  70. package/src/directive/attrs/src.html +18 -0
  71. package/{test/directive → src/directive/attrs}/src.spec.js +3 -3
  72. package/src/directive/attrs/src.test.js +11 -0
  73. package/src/directive/bind/bind.html +18 -0
  74. package/src/directive/{bind.js → bind/bind.js} +1 -1
  75. package/{test/directive → src/directive/bind}/bind.spec.js +3 -3
  76. package/src/directive/bind/bind.test.js +11 -0
  77. package/{test/sanitize → src/directive/bind}/bing-html.spec.js +3 -3
  78. package/src/directive/change/change.html +18 -0
  79. package/{test/directive → src/directive/change}/change.spec.js +3 -3
  80. package/src/directive/change/change.test.js +11 -0
  81. package/src/directive/class/class.html +18 -0
  82. package/src/directive/{class.js → class/class.js} +3 -3
  83. package/{test/directive → src/directive/class}/class.spec.js +5 -5
  84. package/src/directive/class/class.test.js +11 -0
  85. package/src/directive/cloak/cloak.html +18 -0
  86. package/{test/directive → src/directive/cloak}/cloak.spec.js +3 -3
  87. package/src/directive/cloak/cloak.test.js +11 -0
  88. package/src/directive/controller/controller.html +21 -0
  89. package/{test/directive → src/directive/controller}/controller.spec.js +5 -5
  90. package/src/directive/controller/controller.test.js +11 -0
  91. package/{test/directive → src/directive/events}/click.spec.js +3 -3
  92. package/{test/directive → src/directive/events}/event.spec.js +4 -4
  93. package/src/directive/events/events.html +18 -0
  94. package/src/directive/{events.js → events/events.js} +2 -2
  95. package/src/directive/events/events.test.js +11 -0
  96. package/src/directive/form/form.html +18 -0
  97. package/src/directive/{form.js → form/form.js} +2 -2
  98. package/{test/directive → src/directive/form}/form.spec.js +5 -5
  99. package/src/directive/form/form.test.js +11 -0
  100. package/src/directive/if/if.html +18 -0
  101. package/src/directive/{if.js → if/if.js} +2 -1
  102. package/src/directive/if/if.md +77 -0
  103. package/{test/directive → src/directive/if}/if.spec.js +16 -16
  104. package/src/directive/if/if.test.js +12 -0
  105. package/src/directive/include/include.html +18 -0
  106. package/src/directive/{include.js → include/include.js} +2 -2
  107. package/{test/directive → src/directive/include}/include.spec.js +52 -71
  108. package/src/directive/include/include.test.js +12 -0
  109. package/src/directive/init/init.html +18 -0
  110. package/{test/directive → src/directive/init}/init.spec.js +4 -4
  111. package/src/directive/init/init.test.js +11 -0
  112. package/src/directive/input/input.html +18 -0
  113. package/src/directive/{input.js → input/input.js} +2 -2
  114. package/{test/directive → src/directive/input}/input.spec.js +5 -9
  115. package/src/directive/input/input.test.js +11 -0
  116. package/src/directive/list/list.html +18 -0
  117. package/src/directive/{list.js → list/list.js} +1 -1
  118. package/{test/directive → src/directive/list}/list.spec.js +3 -3
  119. package/src/directive/list/list.test.js +11 -0
  120. package/src/directive/model/model.html +18 -0
  121. package/src/directive/{model.js → model/model.js} +10 -6
  122. package/{test/directive → src/directive/model}/model.spec.js +8 -8
  123. package/src/directive/model/model.test.js +11 -0
  124. package/src/directive/model-options/model-option.test.js +11 -0
  125. package/src/directive/model-options/model-options.html +21 -0
  126. package/src/directive/{model-options.js → model-options/model-options.js} +1 -1
  127. package/{test/directive → src/directive/model-options}/model-options.spec.js +7 -7
  128. package/src/directive/non-bindable/non-bindable.html +21 -0
  129. package/{test/directive → src/directive/non-bindable}/non-bindable.spec.js +3 -3
  130. package/src/directive/non-bindable/non-bindable.test.js +11 -0
  131. package/src/directive/options/options.html +21 -0
  132. package/src/directive/{options.js → options/options.js} +8 -6
  133. package/{test/directive → src/directive/options}/options.spec.js +5 -5
  134. package/src/directive/options/options.test.js +11 -0
  135. package/src/directive/ref/href.html +18 -0
  136. package/{test/directive → src/directive/ref}/href.spec.js +4 -4
  137. package/src/directive/ref/href.test.js +17 -0
  138. package/src/directive/ref/ref.html +18 -0
  139. package/src/directive/{ref.js → ref/ref.js} +1 -1
  140. package/{test/directive → src/directive/ref}/ref.spec.js +2 -2
  141. package/src/directive/repeat/repeat.html +18 -0
  142. package/src/directive/{repeat.js → repeat/repeat.js} +13 -13
  143. package/{test/directive → src/directive/repeat}/repeat.spec.js +8 -9
  144. package/src/directive/repeat/repeat.test.js +11 -0
  145. package/src/directive/script/script.html +18 -0
  146. package/{test/directive → src/directive/script}/script.spec.js +3 -3
  147. package/src/directive/script/script.test.js +11 -0
  148. package/src/directive/select/select.html +18 -0
  149. package/src/directive/{select.js → select/select.js} +2 -2
  150. package/{test/directive → src/directive/select}/select.spec.js +5 -5
  151. package/src/directive/select/select.test.js +11 -0
  152. package/src/directive/show-hide/show-hide.html +21 -0
  153. package/{test/directive → src/directive/show-hide}/show-hide.spec.js +3 -3
  154. package/src/directive/show-hide/show-hide.test.js +11 -0
  155. package/src/directive/style/style.html +18 -0
  156. package/{test/directive → src/directive/style}/style.spec.js +3 -3
  157. package/src/directive/style/style.test.js +11 -0
  158. package/src/directive/switch/switch.html +18 -0
  159. package/src/directive/{switch.js → switch/switch.js} +3 -3
  160. package/{test/directive → src/directive/switch}/switch.spec.js +3 -3
  161. package/src/directive/switch/switch.test.js +11 -0
  162. package/src/directive/{transclude.js → transclude/transclude.js} +2 -2
  163. package/src/directive/validators/validators.html +21 -0
  164. package/src/directive/{validators.js → validators/validators.js} +3 -3
  165. package/{test/directive → src/directive/validators}/validators.spec.js +3 -3
  166. package/src/directive/validators/validators.test.js +11 -0
  167. package/src/exts/aria/aria.html +21 -0
  168. package/src/exts/{aria.js → aria/aria.js} +1 -1
  169. package/{test → src/exts}/aria/aria.spec.js +3 -3
  170. package/src/exts/aria/aria.test.js +11 -0
  171. package/src/exts/messages/messages.html +21 -0
  172. package/src/exts/{messages.js → messages/messages.js} +1 -1
  173. package/{test → src/exts}/messages/messages.spec.js +5 -5
  174. package/src/exts/messages/messages.test.js +11 -0
  175. package/{test/filter → src/filters}/filter.spec.js +10 -5
  176. package/{test/filter → src/filters}/filters.spec.js +3 -3
  177. package/{test/filter → src/filters}/limit-to.spec.js +3 -3
  178. package/{test/filter → src/filters}/order-by.spec.js +2 -2
  179. package/src/injector.js +1 -2
  180. package/{test → src}/injector.spec.js +4 -4
  181. package/src/loader.js +2 -2
  182. package/{test → src}/loader.spec.js +2 -2
  183. package/src/public.js +48 -45
  184. package/{test → src}/public.spec.js +2 -2
  185. package/src/router/common/glob.html +18 -0
  186. package/{test/router → src/router/common}/glob.spec.js +1 -1
  187. package/src/router/common/glob.test.js +11 -0
  188. package/src/router/directives/view-directive.js +1 -1
  189. package/{test → src}/router/services.spec.js +2 -2
  190. package/src/router/state/state-service.js +1 -1
  191. package/{test/router/ng-state-builder.spec.js → src/router/state-builder.spec.js} +1 -1
  192. package/{test → src}/router/state-directives.spec.js +3 -3
  193. package/{test → src}/router/state-filter.spec.js +2 -2
  194. package/{test → src}/router/state.spec.js +5 -5
  195. package/{test → src}/router/template-factory.spec.js +3 -3
  196. package/src/router/transition/transition-hook.js +1 -1
  197. package/{test → src}/router/url-service.spec.js +4 -4
  198. package/{test → src}/router/view-directive.spec.js +3 -3
  199. package/{test → src}/router/view-hook.spec.js +3 -3
  200. package/{test → src}/router/view-scroll.spec.js +3 -3
  201. package/{test → src}/router/view.spec.js +12 -12
  202. package/src/services/browser.js +2 -2
  203. package/src/services/cache-factory.js +5 -11
  204. package/src/services/document.js +1 -1
  205. package/src/services/{http.js → http/http.js} +5 -6
  206. package/{test/core → src/services/http}/http.spec.js +3 -3
  207. package/{test/core → src/services/http}/template-request.spec.js +2 -2
  208. package/src/services/{http-backend.js → http-backend/http-backend.js} +2 -2
  209. package/{test/core → src/services/http-backend}/http-backend.spec.js +3 -3
  210. package/src/services/template-request.js +1 -1
  211. package/{test → src}/shared/common.spec.js +4 -4
  212. package/{test → src}/shared/hof.spec.js +1 -1
  213. package/src/shared/jqlite/jqlite.html +18 -0
  214. package/src/{jqLite.js → shared/jqlite/jqlite.js} +2 -2
  215. package/{test → src/shared/jqlite}/jqlite.spec.js +7 -7
  216. package/src/shared/jqlite/jqlite.test.js +11 -0
  217. package/{test → src/shared}/min-err.spec.js +2 -2
  218. package/{test → src}/shared/strings.spec.js +1 -1
  219. package/{test → src/shared}/test-utils.js +1 -1
  220. package/src/shared/utils.js +3 -18
  221. package/{test → src}/shared/utils.spec.js +1 -1
  222. package/tsconfig.json +1 -1
  223. package/types/animations/animate-cache.d.ts +12 -0
  224. package/types/animations/animate-children-directive.d.ts +84 -0
  225. package/types/animations/animate-swap.d.ts +103 -0
  226. package/types/animations/animation.d.ts +14 -0
  227. package/types/animations/module.d.ts +750 -0
  228. package/types/animations/raf-scheduler.d.ts +5 -0
  229. package/types/animations/shared.d.ts +65 -0
  230. package/types/constants.d.ts +18 -0
  231. package/types/core/animate-css.d.ts +25 -0
  232. package/types/core/cache.d.ts +25 -0
  233. package/types/core/compile.d.ts +206 -0
  234. package/types/core/controller.d.ts +42 -0
  235. package/types/core/exception-handler.d.ts +46 -0
  236. package/types/core/filter.d.ts +9 -0
  237. package/types/core/interpolate.d.ts +83 -0
  238. package/types/core/interval-factory.d.ts +21 -0
  239. package/types/core/interval.d.ts +4 -0
  240. package/types/core/location.d.ts +234 -0
  241. package/types/core/pubsub.d.ts +164 -0
  242. package/types/core/q.d.ts +33 -0
  243. package/types/core/root-scope.d.ts +754 -0
  244. package/types/core/sanitize-uri.d.ts +57 -0
  245. package/types/core/sce.d.ts +432 -0
  246. package/types/core/task-tracker-factory.d.ts +50 -0
  247. package/types/core/timeout.d.ts +31 -0
  248. package/types/core/urlUtils.d.ts +98 -0
  249. package/types/directive/attrs.d.ts +176 -0
  250. package/types/directive/bind.d.ts +21 -0
  251. package/types/directive/change.d.ts +4 -0
  252. package/types/directive/class.d.ts +125 -0
  253. package/types/directive/cloak.d.ts +4 -0
  254. package/types/directive/controller.d.ts +6 -0
  255. package/types/directive/events.d.ts +12 -0
  256. package/types/directive/form.d.ts +230 -0
  257. package/types/directive/if.d.ts +17 -0
  258. package/types/directive/include.d.ts +33 -0
  259. package/types/directive/init.d.ts +4 -0
  260. package/types/directive/input.d.ts +192 -0
  261. package/types/directive/list.d.ts +4 -0
  262. package/types/directive/model.d.ts +672 -0
  263. package/types/directive/non-bindable.d.ts +5 -0
  264. package/types/directive/options.d.ts +16 -0
  265. package/types/directive/ref.d.ts +11 -0
  266. package/types/directive/repeat.d.ts +23 -0
  267. package/types/directive/script.d.ts +23 -0
  268. package/types/directive/show-hide.d.ts +234 -0
  269. package/types/directive/style.d.ts +4 -0
  270. package/types/directive/switch.d.ts +23 -0
  271. package/types/directive/transclude.d.ts +15 -0
  272. package/types/directive/validators.d.ts +173 -0
  273. package/types/exts/aria.d.ts +1 -0
  274. package/types/exts/messages.d.ts +1 -0
  275. package/types/filters/filter.d.ts +4 -0
  276. package/types/filters/filters.d.ts +38 -0
  277. package/types/filters/limit-to.d.ts +4 -0
  278. package/types/filters/order-by.d.ts +11 -0
  279. package/types/jqLite.d.ts +57 -0
  280. package/types/router/common/coreservices.d.ts +4 -0
  281. package/types/router/common/glob.d.ts +60 -0
  282. package/types/router/common/queue.d.ts +15 -0
  283. package/types/router/common/trace.d.ts +72 -0
  284. package/types/router/directives/view-directive.d.ts +160 -0
  285. package/types/router/globals.d.ts +30 -0
  286. package/types/router/hooks/core-resolvables.d.ts +2 -0
  287. package/types/router/hooks/ignored-transition.d.ts +1 -0
  288. package/types/router/hooks/invalid-transition.d.ts +1 -0
  289. package/types/router/hooks/lazy-load.d.ts +42 -0
  290. package/types/router/hooks/on-enter-exit-retain.d.ts +3 -0
  291. package/types/router/hooks/redirect-to.d.ts +4 -0
  292. package/types/router/hooks/resolve.d.ts +4 -0
  293. package/types/router/hooks/update-globals.d.ts +1 -0
  294. package/types/router/hooks/url.d.ts +5 -0
  295. package/types/router/hooks/views.d.ts +5 -0
  296. package/types/router/index.d.ts +1 -17
  297. package/types/router/injectables.d.ts +1 -0
  298. package/types/router/params/param-factory.d.ts +8 -0
  299. package/types/router/params/param-type.d.ts +65 -0
  300. package/types/router/params/param-types.d.ts +36 -0
  301. package/types/router/params/param.d.ts +41 -0
  302. package/types/router/params/state-params.d.ts +12 -0
  303. package/types/router/path/path-node.d.ts +45 -0
  304. package/types/router/path/path-utils.d.ts +83 -0
  305. package/types/router/resolve/resolvable.d.ts +50 -0
  306. package/types/router/resolve/resolve-context.d.ts +102 -0
  307. package/types/router/services.d.ts +12 -13
  308. package/types/router/state/state-builder.d.ts +89 -0
  309. package/types/router/state/state-matcher.d.ts +7 -0
  310. package/types/router/state/state-object.d.ts +72 -0
  311. package/types/router/state/state-queue-manager.d.ts +19 -0
  312. package/types/router/state/state-registry.d.ts +118 -0
  313. package/types/router/state/state-service.d.ts +419 -0
  314. package/types/router/state/target-state.d.ts +102 -0
  315. package/types/router/state/views.d.ts +50 -0
  316. package/types/router/state-filters.d.ts +15 -0
  317. package/types/router/state-provider.d.ts +123 -0
  318. package/types/router/template-factory.d.ts +124 -0
  319. package/types/router/transition/hook-builder.d.ts +40 -0
  320. package/types/router/transition/hook-registry.d.ts +102 -0
  321. package/types/router/transition/interface.d.ts +11 -0
  322. package/types/router/transition/reject-factory.d.ts +42 -0
  323. package/types/router/transition/transition-event-type.d.ts +24 -0
  324. package/types/router/transition/transition-hook.d.ts +86 -0
  325. package/types/router/transition/transition-service.d.ts +115 -0
  326. package/types/router/transition/transition.d.ts +390 -0
  327. package/types/router/url/url-config.d.ts +100 -0
  328. package/types/router/url/url-matcher.d.ts +175 -0
  329. package/types/router/url/url-rule.d.ts +146 -0
  330. package/types/router/url/url-rules.d.ts +229 -0
  331. package/types/router/url/url-service.d.ts +278 -0
  332. package/types/router/view/view.d.ts +137 -0
  333. package/types/router/view-scroll.d.ts +5 -0
  334. package/types/services/anchor-scroll.d.ts +11 -0
  335. package/types/services/browser.d.ts +150 -0
  336. package/types/services/cache-factory.d.ts +143 -0
  337. package/types/services/cookie-reader.d.ts +17 -0
  338. package/types/services/document.d.ts +38 -0
  339. package/types/services/http-backend.d.ts +78 -0
  340. package/types/services/http.d.ts +157 -0
  341. package/types/services/log.d.ts +63 -0
  342. package/types/services/template-request.d.ts +69 -0
  343. package/types/shared/common.d.ts +216 -0
  344. package/types/shared/hof.d.ts +131 -0
  345. package/types/shared/predicates.d.ts +15 -0
  346. package/types/shared/strings.d.ts +55 -0
  347. package/types/shared/utils.d.ts +630 -0
  348. package/types-back/README.md +2 -0
  349. package/{types → types-back}/index.d.ts +17 -12
  350. package/types-back/router/index.d.ts +17 -0
  351. package/types-back/router/services.d.ts +15 -0
  352. package/e2e/unit.spec.ts +0 -16
  353. package/public/my_other_directive.html +0 -1
  354. package/src/directive/if.md +0 -80
  355. package/test/build-test.html +0 -14
  356. package/test/mock-test.html +0 -13
  357. package/test/module-test.html +0 -58
  358. /package/{test → public}/jasmine/jasmine-5.1.2/boot0.js +0 -0
  359. /package/{test → public}/jasmine/jasmine-5.1.2/boot1.js +0 -0
  360. /package/{test → public}/jasmine/jasmine-5.1.2/jasmine-html.js +0 -0
  361. /package/{test → public}/jasmine/jasmine-5.1.2/jasmine.css +0 -0
  362. /package/{test → public}/jasmine/jasmine-5.1.2/jasmine.js +0 -0
  363. /package/{test → public}/jasmine/jasmine-5.1.2/jasmine_favicon.png +0 -0
  364. /package/{test → public}/jasmine/jasmine-browser.json +0 -0
  365. /package/{test → public}/jasmine/jasmine.json +0 -0
  366. /package/public/{README.md → public/README.md} +0 -0
  367. /package/public/{circle.html → public/circle.html} +0 -0
  368. /package/public/{my_child_directive.html → public/my_child_directive.html} +0 -0
  369. /package/public/{my_directive.html → public/my_directive.html} +0 -0
  370. /package/public/{test.html → public/test.html} +0 -0
  371. /package/src/core/{animate-css.js → animate/animate-css.js} +0 -0
  372. /package/src/core/{cache.js → cache/cache.js} +0 -0
  373. /package/src/core/{compile.md → compile/compile.md} +0 -0
  374. /package/src/core/{filter.md → filter/filter.md} +0 -0
  375. /package/src/core/{interval.md → interval/interval.md} +0 -0
  376. /package/src/core/{pubsub.js → pubsub/pubsub.js} +0 -0
  377. /package/src/directive/{bind.md → bind/bind.md} +0 -0
  378. /package/src/directive/{change.js → change/change.js} +0 -0
  379. /package/src/directive/{change.md → change/change.md} +0 -0
  380. /package/src/directive/{cloak.js → cloak/cloak.js} +0 -0
  381. /package/src/directive/{cloak.md → cloak/cloak.md} +0 -0
  382. /package/src/directive/{controller.js → controller/controller.js} +0 -0
  383. /package/src/directive/{controller.md → controller/controller.md} +0 -0
  384. /package/src/directive/{events.md → events/events.md} +0 -0
  385. /package/src/directive/{include.md → include/include.md} +0 -0
  386. /package/src/directive/{init.js → init/init.js} +0 -0
  387. /package/src/directive/{init.md → init/init.md} +0 -0
  388. /package/src/directive/{list.md → list/list.md} +0 -0
  389. /package/src/directive/{non-bindable.js → non-bindable/non-bindable.js} +0 -0
  390. /package/src/directive/{non-bindable.md → non-bindable/non-bindable.md} +0 -0
  391. /package/src/directive/{repeat.md → repeat/repeat.md} +0 -0
  392. /package/src/directive/{script.js → script/script.js} +0 -0
  393. /package/src/directive/{show-hide.js → show-hide/show-hide.js} +0 -0
  394. /package/src/directive/{style.js → style/style.js} +0 -0
  395. /package/src/directive/{style.md → style/style.md} +0 -0
  396. /package/src/directive/{switch.md → switch/switch.md} +0 -0
  397. /package/src/exts/{messages.md → messages/messages.md} +0 -0
  398. /package/{test/module-test.js → src/services/http/http.html} +0 -0
  399. /package/src/{constants.js → shared/constants.js} +0 -0
  400. /package/{types → types-back}/angular.d.ts +0 -0
  401. /package/{types → types-back}/global.d.ts +0 -0
  402. /package/{types → types-back}/jqlite.d.ts +0 -0
  403. /package/{types → types-back}/router/core/common/common.d.ts +0 -0
  404. /package/{types → types-back}/router/core/common/coreservices.d.ts +0 -0
  405. /package/{types → types-back}/router/core/common/glob.d.ts +0 -0
  406. /package/{types → types-back}/router/core/common/hof.d.ts +0 -0
  407. /package/{types → types-back}/router/core/common/index.d.ts +0 -0
  408. /package/{types → types-back}/router/core/common/predicates.d.ts +0 -0
  409. /package/{types → types-back}/router/core/common/queue.d.ts +0 -0
  410. /package/{types → types-back}/router/core/common/safeConsole.d.ts +0 -0
  411. /package/{types → types-back}/router/core/common/strings.d.ts +0 -0
  412. /package/{types → types-back}/router/core/common/trace.d.ts +0 -0
  413. /package/{types → types-back}/router/core/globals.d.ts +0 -0
  414. /package/{types → types-back}/router/core/hooks/coreResolvables.d.ts +0 -0
  415. /package/{types → types-back}/router/core/hooks/ignoredTransition.d.ts +0 -0
  416. /package/{types → types-back}/router/core/hooks/invalidTransition.d.ts +0 -0
  417. /package/{types → types-back}/router/core/hooks/lazyLoad.d.ts +0 -0
  418. /package/{types → types-back}/router/core/hooks/onEnterExitRetain.d.ts +0 -0
  419. /package/{types → types-back}/router/core/hooks/redirectTo.d.ts +0 -0
  420. /package/{types → types-back}/router/core/hooks/resolve.d.ts +0 -0
  421. /package/{types → types-back}/router/core/hooks/updateGlobals.d.ts +0 -0
  422. /package/{types → types-back}/router/core/hooks/url.d.ts +0 -0
  423. /package/{types → types-back}/router/core/hooks/views.d.ts +0 -0
  424. /package/{types → types-back}/router/core/index.d.ts +0 -0
  425. /package/{types → types-back}/router/core/interface.d.ts +0 -0
  426. /package/{types → types-back}/router/core/params/index.d.ts +0 -0
  427. /package/{types → types-back}/router/core/params/interface.d.ts +0 -0
  428. /package/{types → types-back}/router/core/params/param.d.ts +0 -0
  429. /package/{types → types-back}/router/core/params/paramType.d.ts +0 -0
  430. /package/{types → types-back}/router/core/params/paramTypes.d.ts +0 -0
  431. /package/{types → types-back}/router/core/params/stateParams.d.ts +0 -0
  432. /package/{types → types-back}/router/core/path/index.d.ts +0 -0
  433. /package/{types → types-back}/router/core/path/pathNode.d.ts +0 -0
  434. /package/{types → types-back}/router/core/path/pathUtils.d.ts +0 -0
  435. /package/{types → types-back}/router/core/resolve/index.d.ts +0 -0
  436. /package/{types → types-back}/router/core/resolve/interface.d.ts +0 -0
  437. /package/{types → types-back}/router/core/resolve/resolvable.d.ts +0 -0
  438. /package/{types → types-back}/router/core/resolve/resolveContext.d.ts +0 -0
  439. /package/{types → types-back}/router/core/router.d.ts +0 -0
  440. /package/{types → types-back}/router/core/state/index.d.ts +0 -0
  441. /package/{types → types-back}/router/core/state/interface.d.ts +0 -0
  442. /package/{types → types-back}/router/core/state/stateBuilder.d.ts +0 -0
  443. /package/{types → types-back}/router/core/state/stateMatcher.d.ts +0 -0
  444. /package/{types → types-back}/router/core/state/stateObject.d.ts +0 -0
  445. /package/{types → types-back}/router/core/state/stateQueueManager.d.ts +0 -0
  446. /package/{types → types-back}/router/core/state/stateRegistry.d.ts +0 -0
  447. /package/{types → types-back}/router/core/state/stateService.d.ts +0 -0
  448. /package/{types → types-back}/router/core/state/targetState.d.ts +0 -0
  449. /package/{types → types-back}/router/core/transition/hookBuilder.d.ts +0 -0
  450. /package/{types → types-back}/router/core/transition/hookRegistry.d.ts +0 -0
  451. /package/{types → types-back}/router/core/transition/index.d.ts +0 -0
  452. /package/{types → types-back}/router/core/transition/interface.d.ts +0 -0
  453. /package/{types → types-back}/router/core/transition/rejectFactory.d.ts +0 -0
  454. /package/{types → types-back}/router/core/transition/transition.d.ts +0 -0
  455. /package/{types → types-back}/router/core/transition/transitionEventType.d.ts +0 -0
  456. /package/{types → types-back}/router/core/transition/transitionHook.d.ts +0 -0
  457. /package/{types → types-back}/router/core/transition/transitionService.d.ts +0 -0
  458. /package/{types → types-back}/router/core/url/index.d.ts +0 -0
  459. /package/{types → types-back}/router/core/url/interface.d.ts +0 -0
  460. /package/{types → types-back}/router/core/url/urlConfig.d.ts +0 -0
  461. /package/{types → types-back}/router/core/url/urlMatcher.d.ts +0 -0
  462. /package/{types → types-back}/router/core/url/urlMatcherFactory.d.ts +0 -0
  463. /package/{types → types-back}/router/core/url/urlRouter.d.ts +0 -0
  464. /package/{types → types-back}/router/core/url/urlRule.d.ts +0 -0
  465. /package/{types → types-back}/router/core/url/urlRules.d.ts +0 -0
  466. /package/{types → types-back}/router/core/url/urlService.d.ts +0 -0
  467. /package/{types → types-back}/router/core/view/index.d.ts +0 -0
  468. /package/{types → types-back}/router/core/view/interface.d.ts +0 -0
  469. /package/{types → types-back}/router/core/view/view.d.ts +0 -0
  470. /package/{types → types-back}/router/directives/viewDirective.d.ts +0 -0
  471. /package/{types → types-back}/router/interface.d.ts +0 -0
  472. /package/{types → types-back}/router/legacy/resolveService.d.ts +0 -0
  473. /package/{types → types-back}/router/legacy/stateEvents.d.ts +0 -0
  474. /package/{types → types-back}/router/stateFilters.d.ts +0 -0
  475. /package/{types → types-back}/router/stateProvider.d.ts +0 -0
  476. /package/{types → types-back}/router/statebuilders/onEnterExitRetain.d.ts +0 -0
  477. /package/{types → types-back}/router/statebuilders/views.d.ts +0 -0
  478. /package/{types → types-back}/router/templateFactory.d.ts +0 -0
  479. /package/{types → types-back}/router/viewScroll.d.ts +0 -0
  480. /package/{test/server → utils}/express.js +0 -0
@@ -0,0 +1,390 @@
1
+ /**
2
+ * Represents a transition between two states.
3
+ *
4
+ * When navigating to a state, we are transitioning **from** the current state **to** the new state.
5
+ *
6
+ * This object contains all contextual information about the to/from states, parameters, resolves.
7
+ * It has information about all states being entered and exited as a result of the transition.
8
+ */
9
+ export class Transition {
10
+ /**
11
+ * Creates a new Transition object.
12
+ *
13
+ * If the target state is not valid, an error is thrown.
14
+ *
15
+ * @internal
16
+ *
17
+ * @param fromPath The path of [[PathNode]]s from which the transition is leaving. The last node in the `fromPath`
18
+ * encapsulates the "from state".
19
+ * @param targetState The target state and parameters being transitioned to (also, the transition options)
20
+ * @param {import('../transition/transition-service').TransitionService} transitionService The [[TransitionService]] instance
21
+ * @internal
22
+ */
23
+ constructor(
24
+ fromPath: any,
25
+ targetState: any,
26
+ transitionService: import("../transition/transition-service").TransitionService,
27
+ globals: any,
28
+ );
29
+ globals: any;
30
+ transitionService: import("../transition/transition-service").TransitionService;
31
+ _deferred: any;
32
+ /**
33
+ * This promise is resolved or rejected based on the outcome of the Transition.
34
+ *
35
+ * When the transition is successful, the promise is resolved
36
+ * When the transition is unsuccessful, the promise is rejected with the [[Rejection]] or javascript error
37
+ */
38
+ promise: any;
39
+ /** @internal Holds the hook registration functions such as those passed to Transition.onStart() */
40
+ _registeredHooks: {};
41
+ _hookBuilder: HookBuilder;
42
+ /** Checks if this transition is currently active/running. */
43
+ isActive: () => boolean;
44
+ _targetState: any;
45
+ _options: any;
46
+ $id: number;
47
+ _treeChanges: {
48
+ from: any;
49
+ to: any;
50
+ retained: any;
51
+ retainedWithToParams: any;
52
+ exiting: any;
53
+ entering: any;
54
+ };
55
+ /**
56
+ * Creates the transition-level hook registration functions
57
+ * (which can then be used to register hooks)
58
+ */
59
+ createTransitionHookRegFns(): void;
60
+ getHooks(hookName: any): any;
61
+ applyViewConfigs(): void;
62
+ /**
63
+ * @internal
64
+ * @returns the internal from [State] object
65
+ */
66
+ $from(): any;
67
+ /**
68
+ * @internal
69
+ * @returns the internal to [State] object
70
+ */
71
+ $to(): any;
72
+ /**
73
+ * Returns the "from state"
74
+ *
75
+ * Returns the state that the transition is coming *from*.
76
+ *
77
+ * @returns The state declaration object for the Transition's ("from state").
78
+ */
79
+ from(): any;
80
+ /**
81
+ * Returns the "to state"
82
+ *
83
+ * Returns the state that the transition is going *to*.
84
+ *
85
+ * @returns The state declaration object for the Transition's target state ("to state").
86
+ */
87
+ to(): any;
88
+ /**
89
+ * Gets the Target State
90
+ *
91
+ * A transition's [[TargetState]] encapsulates the [[to]] state, the [[params]], and the [[options]] as a single object.
92
+ *
93
+ * @returns the [[TargetState]] of this Transition
94
+ */
95
+ targetState(): any;
96
+ /**
97
+ * Determines whether two transitions are equivalent.
98
+ * @deprecated
99
+ */
100
+ is(compare: any): any;
101
+ params(pathname?: string): any;
102
+ paramsChanged(): any;
103
+ /**
104
+ * Creates a [[UIInjector]] Dependency Injector
105
+ *
106
+ * Returns a Dependency Injector for the Transition's target state (to state).
107
+ * The injector provides resolve values which the target state has access to.
108
+ *
109
+ * The `UIInjector` can also provide values from the native root/global injector (ng1/ng2).
110
+ *
111
+ * #### Example:
112
+ * ```js
113
+ * .onEnter({ entering: 'myState' }, trans => {
114
+ * var myResolveValue = trans.injector().get('myResolve');
115
+ * // Inject a global service from the global/native injector (if it exists)
116
+ * var MyService = trans.injector().get('MyService');
117
+ * })
118
+ * ```
119
+ *
120
+ * In some cases (such as `onBefore`), you may need access to some resolve data but it has not yet been fetched.
121
+ * You can use [[UIInjector.getAsync]] to get a promise for the data.
122
+ * #### Example:
123
+ * ```js
124
+ * .onBefore({}, trans => {
125
+ * return trans.injector().getAsync('myResolve').then(myResolveValue =>
126
+ * return myResolveValue !== 'ABORT';
127
+ * });
128
+ * });
129
+ * ```
130
+ *
131
+ * If a `state` is provided, the injector that is returned will be limited to resolve values that the provided state has access to.
132
+ * This can be useful if both a parent state `foo` and a child state `foo.bar` have both defined a resolve such as `data`.
133
+ * #### Example:
134
+ * ```js
135
+ * .onEnter({ to: 'foo.bar' }, trans => {
136
+ * // returns result of `foo` state's `myResolve` resolve
137
+ * // even though `foo.bar` also has a `myResolve` resolve
138
+ * var fooData = trans.injector('foo').get('myResolve');
139
+ * });
140
+ * ```
141
+ *
142
+ * If you need resolve data from the exiting states, pass `'from'` as `pathName`.
143
+ * The resolve data from the `from` path will be returned.
144
+ * #### Example:
145
+ * ```js
146
+ * .onExit({ exiting: 'foo.bar' }, trans => {
147
+ * // Gets the resolve value of `myResolve` from the state being exited
148
+ * var fooData = trans.injector(null, 'from').get('myResolve');
149
+ * });
150
+ * ```
151
+ *
152
+ *
153
+ * @param state Limits the resolves provided to only the resolves the provided state has access to.
154
+ * @param pathName Default: `'to'`: Chooses the path for which to create the injector. Use this to access resolves for `exiting` states.
155
+ *
156
+ * @returns a [[UIInjector]]
157
+ */
158
+ injector(
159
+ state: any,
160
+ pathName?: string,
161
+ ): {
162
+ context: any;
163
+ native: any;
164
+ get(token: any): any;
165
+ getAsync(token: any): any;
166
+ getNative(token: any): any;
167
+ };
168
+ /**
169
+ * Gets all available resolve tokens (keys)
170
+ *
171
+ * This method can be used in conjunction with [[injector]] to inspect the resolve values
172
+ * available to the Transition.
173
+ *
174
+ * This returns all the tokens defined on [[StateDeclaration.resolve]] blocks, for the states
175
+ * in the Transition's [[TreeChanges.to]] path.
176
+ *
177
+ * #### Example:
178
+ * This example logs all resolve values
179
+ * ```js
180
+ * let tokens = trans.getResolveTokens();
181
+ * tokens.forEach(token => console.log(token + " = " + trans.injector().get(token)));
182
+ * ```
183
+ *
184
+ * #### Example:
185
+ * This example creates promises for each resolve value.
186
+ * This triggers fetches of resolves (if any have not yet been fetched).
187
+ * When all promises have all settled, it logs the resolve values.
188
+ * ```js
189
+ * let tokens = trans.getResolveTokens();
190
+ * let promise = tokens.map(token => trans.injector().getAsync(token));
191
+ * Promise.all(promises).then(values => console.log("Resolved values: " + values));
192
+ * ```
193
+ *
194
+ * Note: Angular 1 users whould use `$q.all()`
195
+ *
196
+ * @param pathname resolve context's path name (e.g., `to` or `from`)
197
+ *
198
+ * @returns an array of resolve tokens (keys)
199
+ */
200
+ getResolveTokens(pathname?: string): any;
201
+ /**
202
+ * Dynamically adds a new [[Resolvable]] (i.e., [[StateDeclaration.resolve]]) to this transition.
203
+ *
204
+ * Allows a transition hook to dynamically add a Resolvable to this Transition.
205
+ *
206
+ * Use the [[Transition.injector]] to retrieve the resolved data in subsequent hooks ([[UIInjector.get]]).
207
+ *
208
+ * If a `state` argument is provided, the Resolvable is processed when that state is being entered.
209
+ * If no `state` is provided then the root state is used.
210
+ * If the given `state` has already been entered, the Resolvable is processed when any child state is entered.
211
+ * If no child states will be entered, the Resolvable is processed during the `onFinish` phase of the Transition.
212
+ *
213
+ * The `state` argument also scopes the resolved data.
214
+ * The resolved data is available from the injector for that `state` and any children states.
215
+ *
216
+ * #### Example:
217
+ * ```js
218
+ * transitionService.onBefore({}, transition => {
219
+ * transition.addResolvable({
220
+ * token: 'myResolve',
221
+ * deps: ['MyService'],
222
+ * resolveFn: myService => myService.getData()
223
+ * });
224
+ * });
225
+ * ```
226
+ *
227
+ * @param resolvable a [[ResolvableLiteral]] object (or a [[Resolvable]])
228
+ * @param state the state in the "to path" which should receive the new resolve (otherwise, the root state)
229
+ */
230
+ addResolvable(resolvable: any, state?: string): void;
231
+ /**
232
+ * Gets the transition from which this transition was redirected.
233
+ *
234
+ * If the current transition is a redirect, this method returns the transition that was redirected.
235
+ *
236
+ * #### Example:
237
+ * ```js
238
+ * let transitionA = $state.go('A').transition
239
+ * transitionA.onStart({}, () => $state.target('B'));
240
+ * $transitions.onSuccess({ to: 'B' }, (trans) => {
241
+ * trans.to().name === 'B'; // true
242
+ * trans.redirectedFrom() === transitionA; // true
243
+ * });
244
+ * ```
245
+ *
246
+ * @returns The previous Transition, or null if this Transition is not the result of a redirection
247
+ */
248
+ redirectedFrom(): any;
249
+ /**
250
+ * Gets the original transition in a redirect chain
251
+ *
252
+ * A transition might belong to a long chain of multiple redirects.
253
+ * This method walks the [[redirectedFrom]] chain back to the original (first) transition in the chain.
254
+ *
255
+ * #### Example:
256
+ * ```js
257
+ * // states
258
+ * registry.register({ name: 'A', redirectTo: 'B' });
259
+ * registry.register({ name: 'B', redirectTo: 'C' });
260
+ * registry.register({ name: 'C', redirectTo: 'D' });
261
+ * registry.register({ name: 'D' });
262
+ *
263
+ * let transitionA = $state.go('A').transition
264
+ *
265
+ * $transitions.onSuccess({ to: 'D' }, (trans) => {
266
+ * trans.to().name === 'D'; // true
267
+ * trans.redirectedFrom().to().name === 'C'; // true
268
+ * trans.originalTransition() === transitionA; // true
269
+ * trans.originalTransition().to().name === 'A'; // true
270
+ * });
271
+ * ```
272
+ *
273
+ * @returns The original Transition that started a redirect chain
274
+ */
275
+ originalTransition(): any;
276
+ /**
277
+ * Get the transition options
278
+ *
279
+ * @returns the options for this Transition.
280
+ */
281
+ options(): any;
282
+ /**
283
+ * Gets the states being entered.
284
+ *
285
+ * @returns an array of states that will be entered during this transition.
286
+ */
287
+ entering(): any;
288
+ /**
289
+ * Gets the states being exited.
290
+ *
291
+ * @returns an array of states that will be exited during this transition.
292
+ */
293
+ exiting(): any;
294
+ /**
295
+ * Gets the states being retained.
296
+ *
297
+ * @returns an array of states that are already entered from a previous Transition, that will not be
298
+ * exited during this Transition
299
+ */
300
+ retained(): any;
301
+ /**
302
+ * Get the [[ViewConfig]]s associated with this Transition
303
+ *
304
+ * Each state can define one or more views (template/controller), which are encapsulated as `ViewConfig` objects.
305
+ * This method fetches the `ViewConfigs` for a given path in the Transition (e.g., "to" or "entering").
306
+ *
307
+ * @param pathname the name of the path to fetch views for:
308
+ * (`'to'`, `'from'`, `'entering'`, `'exiting'`, `'retained'`)
309
+ * @param state If provided, only returns the `ViewConfig`s for a single state in the path
310
+ *
311
+ * @returns a list of ViewConfig objects for the given path.
312
+ */
313
+ views(pathname: string, state: any): any;
314
+ treeChanges(pathname: any): any;
315
+ /**
316
+ * Creates a new transition that is a redirection of the current one.
317
+ *
318
+ * This transition can be returned from a [[TransitionService]] hook to
319
+ * redirect a transition to a new state and/or set of parameters.
320
+ *
321
+ * @internal
322
+ *
323
+ * @returns Returns a new [[Transition]] instance.
324
+ */
325
+ redirect(targetState: any): Transition;
326
+ /** @internal If a transition doesn't exit/enter any states, returns any [[Param]] whose value changed */
327
+ _changedParams(): any;
328
+ /**
329
+ * Returns true if the transition is dynamic.
330
+ *
331
+ * A transition is dynamic if no states are entered nor exited, but at least one dynamic parameter has changed.
332
+ *
333
+ * @returns true if the Transition is dynamic
334
+ */
335
+ dynamic(): any;
336
+ /**
337
+ * Returns true if the transition is ignored.
338
+ *
339
+ * A transition is ignored if no states are entered nor exited, and no parameter values have changed.
340
+ *
341
+ * @returns true if the Transition is ignored.
342
+ */
343
+ ignored(): boolean;
344
+ _ignoredReason(): "SameAsPending" | "SameAsCurrent";
345
+ /**
346
+ * Runs the transition
347
+ *
348
+ * This method is generally called from the [[StateService.transitionTo]]
349
+ *
350
+ * @internal
351
+ *
352
+ * @returns a promise for a successful transition.
353
+ */
354
+ run(): any;
355
+ success: boolean;
356
+ _error: any;
357
+ /**
358
+ * Checks if the Transition is valid
359
+ *
360
+ * @returns true if the Transition is valid
361
+ */
362
+ valid(): boolean;
363
+ /**
364
+ * Aborts this transition
365
+ *
366
+ * Imperative API to abort a Transition.
367
+ * This only applies to Transitions that are not yet complete.
368
+ */
369
+ abort(): void;
370
+ _aborted: boolean;
371
+ /**
372
+ * The Transition error reason.
373
+ *
374
+ * If the transition is invalid (and could not be run), returns the reason the transition is invalid.
375
+ * If the transition was valid and ran, but was not successful, returns the reason the transition failed.
376
+ *
377
+ * @returns a transition rejection explaining why the transition is invalid, or the reason the transition failed.
378
+ */
379
+ error(): any;
380
+ /**
381
+ * A string representation of the Transition
382
+ *
383
+ * @returns A string representation of the Transition
384
+ */
385
+ toString(): string;
386
+ }
387
+ export namespace Transition {
388
+ export { Transition as diToken };
389
+ }
390
+ import { HookBuilder } from "./hook-builder";
@@ -0,0 +1,100 @@
1
+ /**
2
+ * An API to customize the URL behavior and retrieve URL configuration
3
+ *
4
+ * This API is used to customize the behavior of the URL.
5
+ * This includes optional trailing slashes ([[strictMode]]), case sensitivity ([[caseInsensitive]]),
6
+ * and custom parameter encoding (custom [[type]]).
7
+ *
8
+ * It also has information about the location (url) configuration such as [[port]] and [[baseHref]].
9
+ * This information can be used to build absolute URLs, such as
10
+ * `https://example.com:443/basepath/state/substate?param1=a#hashvalue`;
11
+ *
12
+ * This API is found at `router.urlService.config` (see: [[UIRouter.urlService]], [[URLService.config]])
13
+ */
14
+ export class UrlConfigProvider {
15
+ /** @type {ParamTypes} */
16
+ paramTypes: ParamTypes;
17
+ /** @type {boolean} */
18
+ _isCaseInsensitive: boolean;
19
+ /** @type {boolean} */
20
+ _isStrictMode: boolean;
21
+ /** @type {boolean} */
22
+ _defaultSquashPolicy: boolean;
23
+ $get: (() => any)[];
24
+ /**
25
+ * Defines whether URL matching should be case sensitive (the default behavior), or not.
26
+ *
27
+ * #### Example:
28
+ * ```js
29
+ * // Allow case insensitive url matches
30
+ * urlService.config.caseInsensitive(true);
31
+ * ```
32
+ *
33
+ * @param value `false` to match URL in a case sensitive manner; otherwise `true`;
34
+ * @returns the current value of caseInsensitive
35
+ */
36
+ caseInsensitive(value: any): any;
37
+ /**
38
+ * Sets the default behavior when generating or matching URLs with default parameter values.
39
+ *
40
+ * #### Example:
41
+ * ```js
42
+ * // Remove default parameter values from the url
43
+ * urlService.config.defaultSquashPolicy(true);
44
+ * ```
45
+ *
46
+ * @param value A string that defines the default parameter URL squashing behavior.
47
+ * - `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL
48
+ * - `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the
49
+ * parameter is surrounded by slashes, squash (remove) one slash from the URL
50
+ * - any other string, e.g. "~": When generating an href with a default parameter value, squash (remove)
51
+ * the parameter value from the URL and replace it with this string.
52
+ * @returns the current value of defaultSquashPolicy
53
+ */
54
+ defaultSquashPolicy(value: any): any;
55
+ /**
56
+ * Defines whether URLs should match trailing slashes, or not (the default behavior).
57
+ *
58
+ * #### Example:
59
+ * ```js
60
+ * // Allow optional trailing slashes
61
+ * urlService.config.strictMode(false);
62
+ * ```
63
+ *
64
+ * @param value `false` to match trailing slashes in URLs, otherwise `true`.
65
+ * @returns the current value of strictMode
66
+ */
67
+ strictMode(value: any): any;
68
+ /**
69
+ * Creates and registers a custom [[ParamType]] object
70
+ *
71
+ * A custom parameter type can be used to generate URLs with typed parameters or custom encoding/decoding.
72
+ *
73
+ * #### Note: Register custom types *before using them* in a state definition.
74
+ *
75
+ * #### Example:
76
+ * ```js
77
+ * // Encode object parameter as JSON string
78
+ * urlService.config.type('myjson', {
79
+ * encode: (obj) => JSON.stringify(obj),
80
+ * decode: (str) => JSON.parse(str),
81
+ * is: (val) => typeof(val) === 'object',
82
+ * pattern: /[^/]+/,
83
+ * equals: (a, b) => _.isEqual(a, b),
84
+ * });
85
+ * ```
86
+ *
87
+ * See [[ParamTypeDefinition]] for more examples
88
+ *
89
+ * @param name The type name.
90
+ * @param definition The type definition. See [[ParamTypeDefinition]] for information on the values accepted.
91
+ * @param definitionFn A function that is injected before the app runtime starts.
92
+ * The result of this function should be a [[ParamTypeDefinition]].
93
+ * The result is merged into the existing `definition`.
94
+ * See [[ParamType]] for information on the values accepted.
95
+ *
96
+ * @returns if only the `name` parameter was specified: the currently registered [[ParamType]] object, or undefined
97
+ */
98
+ type(name: any, definition: any, definitionFn: any): any;
99
+ }
100
+ import { ParamTypes } from "../params/param-types";
@@ -0,0 +1,175 @@
1
+ /**
2
+ * Matches URLs against patterns.
3
+ *
4
+ * Matches URLs against patterns and extracts named parameters from the path or the search
5
+ * part of the URL.
6
+ *
7
+ * A URL pattern consists of a path pattern, optionally followed by '?' and a list of search (query)
8
+ * parameters. Multiple search parameter names are separated by '&'. Search parameters
9
+ * do not influence whether or not a URL is matched, but their values are passed through into
10
+ * the matched parameters returned by [[UrlMatcher.exec]].
11
+ *
12
+ * - *Path parameters* are defined using curly brace placeholders (`/somepath/{param}`)
13
+ * or colon placeholders (`/somePath/:param`).
14
+ *
15
+ * - *A parameter RegExp* may be defined for a param after a colon
16
+ * (`/somePath/{param:[a-zA-Z0-9]+}`) in a curly brace placeholder.
17
+ * The regexp must match for the url to be matched.
18
+ * Should the regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.
19
+ *
20
+ * Note: a RegExp parameter will encode its value using either [[ParamTypes.path]] or [[ParamTypes.query]].
21
+ *
22
+ * - *Custom parameter types* may also be specified after a colon (`/somePath/{param:int}`) in curly brace parameters.
23
+ * See [[UrlMatcherFactory.type]] for more information.
24
+ *
25
+ * - *Catch-all parameters* are defined using an asterisk placeholder (`/somepath/*catchallparam`).
26
+ * A catch-all * parameter value will contain the remainder of the URL.
27
+ *
28
+ * ---
29
+ *
30
+ * Parameter names may contain only word characters (latin letters, digits, and underscore) and
31
+ * must be unique within the pattern (across both path and search parameters).
32
+ * A path parameter matches any number of characters other than '/'. For catch-all
33
+ * placeholders the path parameter matches any number of characters.
34
+ *
35
+ * Examples:
36
+ *
37
+ * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for
38
+ * trailing slashes, and patterns have to match the entire path, not just a prefix.
39
+ * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or
40
+ * '/user/bob/details'. The second path segment will be captured as the parameter 'id'.
41
+ * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax.
42
+ * * `'/user/{id:[^/]*}'` - Same as the previous example.
43
+ * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id
44
+ * parameter consists of 1 to 8 hex digits.
45
+ * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the
46
+ * path into the parameter 'path'.
47
+ * * `'/files/*path'` - ditto.
48
+ * * `'/calendar/{start:date}'` - Matches "/calendar/2014-11-12" (because the pattern defined
49
+ * in the built-in `date` ParamType matches `2014-11-12`) and provides a Date object in $stateParams.start
50
+ *
51
+ */
52
+ export class UrlMatcher {
53
+ static encodeDashes(str: any): string;
54
+ /** @internal Given a matcher, return an array with the matcher's path segments and path params, in order */
55
+ static pathSegmentsAndParams(matcher: any): any;
56
+ /** @internal Given a matcher, return an array with the matcher's query params */
57
+ static queryParams(matcher: any): any;
58
+ /**
59
+ * Compare two UrlMatchers
60
+ *
61
+ * This comparison function converts a UrlMatcher into static and dynamic path segments.
62
+ * Each static path segment is a static string between a path separator (slash character).
63
+ * Each dynamic segment is a path parameter.
64
+ *
65
+ * The comparison function sorts static segments before dynamic ones.
66
+ */
67
+ static compare(a: any, b: any): number;
68
+ /**
69
+ * @param pattern The pattern to compile into a matcher.
70
+ * @param paramTypes The [[ParamTypes]] registry
71
+ * @param paramFactory A [[ParamFactory]] object
72
+ * @param config A [[UrlMatcherCompileConfig]] configuration object
73
+ */
74
+ constructor(pattern: any, paramTypes: any, paramFactory: any, config: any);
75
+ _cache: {
76
+ path: this[];
77
+ };
78
+ _children: any[];
79
+ _params: any[];
80
+ _segments: any[];
81
+ _compiled: any[];
82
+ config: any;
83
+ pattern: any;
84
+ /**
85
+ * Creates a new concatenated UrlMatcher
86
+ *
87
+ * Builds a new UrlMatcher by appending another UrlMatcher to this one.
88
+ *
89
+ * @param url A `UrlMatcher` instance to append as a child of the current `UrlMatcher`.
90
+ */
91
+ append(url: any): any;
92
+ isRoot(): boolean;
93
+ /** Returns the input pattern string */
94
+ toString(): any;
95
+ _getDecodedParamValue(value: any, param: any): any;
96
+ /**
97
+ * Tests the specified url/path against this matcher.
98
+ *
99
+ * Tests if the given url matches this matcher's pattern, and returns an object containing the captured
100
+ * parameter values. Returns null if the path does not match.
101
+ *
102
+ * The returned object contains the values
103
+ * of any search parameters that are mentioned in the pattern, but their value may be null if
104
+ * they are not present in `search`. This means that search parameters are always treated
105
+ * as optional.
106
+ *
107
+ * #### Example:
108
+ * ```js
109
+ * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {
110
+ * x: '1', q: 'hello'
111
+ * });
112
+ * // returns { id: 'bob', q: 'hello', r: null }
113
+ * ```
114
+ *
115
+ * @param path The URL path to match, e.g. `$location.path()`.
116
+ * @param search URL search parameters, e.g. `$location.search()`.
117
+ * @param hash URL hash e.g. `$location.hash()`.
118
+ *
119
+ * @returns The captured parameter values.
120
+ */
121
+ exec(
122
+ path: any,
123
+ search: {},
124
+ hash: any,
125
+ ): {
126
+ "#": any;
127
+ };
128
+ /**
129
+ * @internal
130
+ * Returns all the [[Param]] objects of all path and search parameters of this pattern in order of appearance.
131
+ *
132
+ * @returns {Array.<Param>} An array of [[Param]] objects. Must be treated as read-only. If the
133
+ * pattern has no parameters, an empty array is returned.
134
+ */
135
+ parameters(opts?: {}): Array<Param>;
136
+ /**
137
+ * @internal
138
+ * Returns a single parameter from this UrlMatcher by id
139
+ *
140
+ * @param id
141
+ * @param opts
142
+ * @returns {T|Param|any|boolean|UrlMatcher|null}
143
+ */
144
+ parameter(id: any, opts?: {}): T | Param | any | boolean | UrlMatcher | null;
145
+ /**
146
+ * Validates the input parameter values against this UrlMatcher
147
+ *
148
+ * Checks an object hash of parameters to validate their correctness according to the parameter
149
+ * types of this `UrlMatcher`.
150
+ *
151
+ * @param params The object hash of parameters to validate.
152
+ * @returns Returns `true` if `params` validates, otherwise `false`.
153
+ */
154
+ validates(params: any): any;
155
+ /**
156
+ * Given a set of parameter values, creates a URL from this UrlMatcher.
157
+ *
158
+ * Creates a URL that matches this pattern by substituting the specified values
159
+ * for the path and search parameters.
160
+ *
161
+ * #### Example:
162
+ * ```js
163
+ * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });
164
+ * // returns '/user/bob?q=yes'
165
+ * ```
166
+ *
167
+ * @param values the values to substitute for the parameters in this pattern.
168
+ * @returns the formatted URL (path and optionally search part).
169
+ */
170
+ format(values?: {}): string;
171
+ }
172
+ export namespace UrlMatcher {
173
+ let nameValidator: RegExp;
174
+ }
175
+ import { Param } from "../params/param";