ember-source 4.10.0-beta.2 → 4.11.0-alpha.2

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 (361) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/build-metadata.json +3 -3
  3. package/dist/ember-template-compiler.js +147 -172
  4. package/dist/ember-template-compiler.map +1 -1
  5. package/dist/ember-testing.js +129 -6
  6. package/dist/ember-testing.map +1 -1
  7. package/dist/ember.debug.js +334 -314
  8. package/dist/ember.debug.map +1 -1
  9. package/dist/header/license.js +1 -1
  10. package/dist/packages/@ember/-internals/glimmer/index.js +60 -59
  11. package/dist/packages/@ember/-internals/metal/index.js +6 -6
  12. package/dist/packages/@ember/-internals/{utils/types.js → utility-types/index.js} +0 -0
  13. package/dist/packages/@ember/-internals/utils/index.js +3 -137
  14. package/dist/packages/@ember/-internals/views/lib/mixins/action_support.js +1 -2
  15. package/dist/packages/@ember/-internals/views/lib/views/states/default.js +1 -2
  16. package/dist/packages/@ember/-internals/views/lib/views/states/destroying.js +2 -3
  17. package/dist/packages/@ember/-internals/views/lib/views/states/in_dom.js +1 -2
  18. package/dist/packages/@ember/array/-internals.js +8 -0
  19. package/dist/packages/@ember/array/index.js +2 -2
  20. package/dist/packages/@ember/array/lib/make-array.js +10 -0
  21. package/dist/packages/@ember/canary-features/index.js +0 -4
  22. package/dist/packages/@ember/debug/data-adapter.js +16 -16
  23. package/dist/packages/@ember/debug/index.js +2 -3
  24. package/dist/packages/@ember/debug/lib/inspect.js +117 -0
  25. package/dist/packages/@ember/engine/instance.js +1 -2
  26. package/dist/packages/@ember/instrumentation/index.js +2 -8
  27. package/dist/packages/@ember/object/core.js +2 -1
  28. package/dist/packages/@ember/object/mixin.js +11 -2
  29. package/dist/packages/@ember/object/promise-proxy-mixin.js +1 -2
  30. package/dist/packages/@ember/owner/index.js +2 -2
  31. package/dist/packages/@ember/routing/lib/utils.js +1 -2
  32. package/dist/packages/@ember/routing/router.js +36 -37
  33. package/dist/packages/ember/index.js +3 -3
  34. package/dist/packages/ember/version.js +1 -1
  35. package/dist/packages/ember-testing/lib/adapters/qunit.js +1 -1
  36. package/docs/data.json +252 -253
  37. package/package.json +19 -19
  38. package/types/preview/@ember/controller/index.d.ts +1 -1
  39. package/types/preview/@ember/engine/-private/container-proxy-mixin.d.ts +1 -1
  40. package/types/preview/@ember/engine/-private/registry-proxy-mixin.d.ts +1 -1
  41. package/types/preview/@ember/error/index.d.ts +2 -2
  42. package/types/preview/ember/index.d.ts +1 -1
  43. package/types/preview/index.d.ts +0 -2
  44. package/types/publish.mjs +314 -294
  45. package/types/stable/@ember/-internals/bootstrap/index.d.ts +3 -0
  46. package/types/stable/@ember/-internals/browser-environment/index.d.ts +9 -0
  47. package/types/stable/@ember/-internals/browser-environment/lib/has-dom.d.ts +4 -0
  48. package/types/stable/@ember/-internals/container/index.d.ts +4 -0
  49. package/types/stable/@ember/-internals/container/lib/container.d.ts +164 -0
  50. package/types/stable/@ember/-internals/container/lib/registry.d.ts +292 -0
  51. package/types/stable/@ember/-internals/environment/index.d.ts +5 -0
  52. package/types/stable/@ember/-internals/environment/lib/context.d.ts +10 -0
  53. package/types/stable/@ember/-internals/environment/lib/env.d.ts +153 -0
  54. package/types/stable/@ember/-internals/environment/lib/global.d.ts +4 -0
  55. package/types/stable/@ember/-internals/error-handling/index.d.ts +9 -0
  56. package/types/stable/@ember/-internals/glimmer/index.d.ts +456 -0
  57. package/types/stable/@ember/-internals/glimmer/lib/component-managers/curly.d.ts +47 -0
  58. package/types/stable/@ember/-internals/glimmer/lib/component-managers/mount.d.ts +41 -0
  59. package/types/stable/@ember/-internals/glimmer/lib/component-managers/outlet.d.ts +51 -0
  60. package/types/stable/@ember/-internals/glimmer/lib/component-managers/root.d.ts +23 -0
  61. package/types/stable/@ember/-internals/glimmer/lib/component.d.ts +840 -0
  62. package/types/stable/@ember/-internals/glimmer/lib/components/abstract-input.d.ts +37 -0
  63. package/types/stable/@ember/-internals/glimmer/lib/components/input.d.ts +4 -0
  64. package/types/stable/@ember/-internals/glimmer/lib/components/internal.d.ts +48 -0
  65. package/types/stable/@ember/-internals/glimmer/lib/components/link-to.d.ts +4 -0
  66. package/types/stable/@ember/-internals/glimmer/lib/components/textarea.d.ts +4 -0
  67. package/types/stable/@ember/-internals/glimmer/lib/dom.d.ts +4 -0
  68. package/types/stable/@ember/-internals/glimmer/lib/environment.d.ts +11 -0
  69. package/types/stable/@ember/-internals/glimmer/lib/glimmer-component-docs.d.ts +387 -0
  70. package/types/stable/@ember/-internals/glimmer/lib/glimmer-tracking-docs.d.ts +249 -0
  71. package/types/stable/@ember/-internals/glimmer/lib/helper.d.ts +160 -0
  72. package/types/stable/@ember/-internals/glimmer/lib/helpers/-disallow-dynamic-resolution.d.ts +4 -0
  73. package/types/stable/@ember/-internals/glimmer/lib/helpers/-in-element-null-check.d.ts +4 -0
  74. package/types/stable/@ember/-internals/glimmer/lib/helpers/-normalize-class.d.ts +4 -0
  75. package/types/stable/@ember/-internals/glimmer/lib/helpers/-resolve.d.ts +4 -0
  76. package/types/stable/@ember/-internals/glimmer/lib/helpers/-track-array.d.ts +9 -0
  77. package/types/stable/@ember/-internals/glimmer/lib/helpers/action.d.ts +268 -0
  78. package/types/stable/@ember/-internals/glimmer/lib/helpers/array.d.ts +40 -0
  79. package/types/stable/@ember/-internals/glimmer/lib/helpers/component.d.ts +148 -0
  80. package/types/stable/@ember/-internals/glimmer/lib/helpers/concat.d.ts +27 -0
  81. package/types/stable/@ember/-internals/glimmer/lib/helpers/each-in.d.ts +160 -0
  82. package/types/stable/@ember/-internals/glimmer/lib/helpers/fn.d.ts +72 -0
  83. package/types/stable/@ember/-internals/glimmer/lib/helpers/get.d.ts +99 -0
  84. package/types/stable/@ember/-internals/glimmer/lib/helpers/hash.d.ts +43 -0
  85. package/types/stable/@ember/-internals/glimmer/lib/helpers/helper.d.ts +42 -0
  86. package/types/stable/@ember/-internals/glimmer/lib/helpers/if-unless.d.ts +181 -0
  87. package/types/stable/@ember/-internals/glimmer/lib/helpers/internal-helper.d.ts +5 -0
  88. package/types/stable/@ember/-internals/glimmer/lib/helpers/log.d.ts +18 -0
  89. package/types/stable/@ember/-internals/glimmer/lib/helpers/modifier.d.ts +41 -0
  90. package/types/stable/@ember/-internals/glimmer/lib/helpers/mut.d.ts +77 -0
  91. package/types/stable/@ember/-internals/glimmer/lib/helpers/page-title.d.ts +19 -0
  92. package/types/stable/@ember/-internals/glimmer/lib/helpers/readonly.d.ts +119 -0
  93. package/types/stable/@ember/-internals/glimmer/lib/helpers/unbound.d.ts +34 -0
  94. package/types/stable/@ember/-internals/glimmer/lib/helpers/unique-id.d.ts +7 -0
  95. package/types/stable/@ember/-internals/glimmer/lib/modifiers/action.d.ts +30 -0
  96. package/types/stable/@ember/-internals/glimmer/lib/modifiers/internal.d.ts +33 -0
  97. package/types/stable/@ember/-internals/glimmer/lib/modifiers/on.d.ts +94 -0
  98. package/types/stable/@ember/-internals/glimmer/lib/renderer.d.ts +96 -0
  99. package/types/stable/@ember/-internals/glimmer/lib/resolver.d.ts +16 -0
  100. package/types/stable/@ember/-internals/glimmer/lib/setup-registry.d.ts +5 -0
  101. package/types/stable/@ember/-internals/glimmer/lib/syntax/in-element.d.ts +46 -0
  102. package/types/stable/@ember/-internals/glimmer/lib/syntax/let.d.ts +54 -0
  103. package/types/stable/@ember/-internals/glimmer/lib/syntax/mount.d.ts +43 -0
  104. package/types/stable/@ember/-internals/glimmer/lib/syntax/outlet.d.ts +27 -0
  105. package/types/stable/@ember/-internals/glimmer/lib/syntax/utils.d.ts +4 -0
  106. package/types/stable/@ember/-internals/glimmer/lib/template.d.ts +6 -0
  107. package/types/stable/@ember/-internals/glimmer/lib/template_registry.d.ts +11 -0
  108. package/types/stable/@ember/-internals/glimmer/lib/utils/bindings.d.ts +10 -0
  109. package/types/stable/@ember/-internals/glimmer/lib/utils/curly-component-state-bucket.d.ts +31 -0
  110. package/types/stable/@ember/-internals/glimmer/lib/utils/debug-render-message.d.ts +4 -0
  111. package/types/stable/@ember/-internals/glimmer/lib/utils/iterator.d.ts +5 -0
  112. package/types/stable/@ember/-internals/glimmer/lib/utils/managers.d.ts +19 -0
  113. package/types/stable/@ember/-internals/glimmer/lib/utils/outlet.d.ts +51 -0
  114. package/types/stable/@ember/-internals/glimmer/lib/utils/process-args.d.ts +4 -0
  115. package/types/stable/@ember/-internals/glimmer/lib/utils/serialization-first-node-helpers.d.ts +3 -0
  116. package/types/stable/@ember/-internals/glimmer/lib/utils/string.d.ts +61 -0
  117. package/types/stable/@ember/-internals/glimmer/lib/utils/to-bool.d.ts +3 -0
  118. package/types/stable/@ember/-internals/glimmer/lib/views/outlet.d.ts +34 -0
  119. package/types/stable/@ember/-internals/meta/index.d.ts +3 -0
  120. package/types/stable/@ember/-internals/meta/lib/meta.d.ts +174 -0
  121. package/types/stable/@ember/-internals/metal/index.d.ts +26 -0
  122. package/types/stable/@ember/-internals/metal/lib/alias.d.ts +22 -0
  123. package/types/stable/@ember/-internals/metal/lib/array.d.ts +18 -0
  124. package/types/stable/@ember/-internals/metal/lib/array_events.d.ts +6 -0
  125. package/types/stable/@ember/-internals/metal/lib/cache.d.ts +121 -0
  126. package/types/stable/@ember/-internals/metal/lib/cached.d.ts +3 -0
  127. package/types/stable/@ember/-internals/metal/lib/chain-tags.d.ts +8 -0
  128. package/types/stable/@ember/-internals/metal/lib/change_event.d.ts +3 -0
  129. package/types/stable/@ember/-internals/metal/lib/computed.d.ts +484 -0
  130. package/types/stable/@ember/-internals/metal/lib/computed_cache.d.ts +3 -0
  131. package/types/stable/@ember/-internals/metal/lib/decorator.d.ts +64 -0
  132. package/types/stable/@ember/-internals/metal/lib/dependent_keys.d.ts +2 -0
  133. package/types/stable/@ember/-internals/metal/lib/deprecate_property.d.ts +18 -0
  134. package/types/stable/@ember/-internals/metal/lib/each_proxy_events.d.ts +5 -0
  135. package/types/stable/@ember/-internals/metal/lib/events.d.ts +91 -0
  136. package/types/stable/@ember/-internals/metal/lib/expand_properties.d.ts +33 -0
  137. package/types/stable/@ember/-internals/metal/lib/get_properties.d.ts +36 -0
  138. package/types/stable/@ember/-internals/metal/lib/injected_property.d.ts +25 -0
  139. package/types/stable/@ember/-internals/metal/lib/libraries.d.ts +31 -0
  140. package/types/stable/@ember/-internals/metal/lib/namespace_search.d.ts +19 -0
  141. package/types/stable/@ember/-internals/metal/lib/observer.d.ts +54 -0
  142. package/types/stable/@ember/-internals/metal/lib/path_cache.d.ts +3 -0
  143. package/types/stable/@ember/-internals/metal/lib/properties.d.ts +58 -0
  144. package/types/stable/@ember/-internals/metal/lib/property_events.d.ts +59 -0
  145. package/types/stable/@ember/-internals/metal/lib/property_get.d.ts +44 -0
  146. package/types/stable/@ember/-internals/metal/lib/property_set.d.ts +52 -0
  147. package/types/stable/@ember/-internals/metal/lib/set_properties.d.ts +32 -0
  148. package/types/stable/@ember/-internals/metal/lib/tags.d.ts +7 -0
  149. package/types/stable/@ember/-internals/metal/lib/tracked.d.ts +78 -0
  150. package/types/stable/@ember/-internals/overrides/index.d.ts +3 -0
  151. package/types/stable/@ember/-internals/owner/index.d.ts +646 -0
  152. package/types/stable/@ember/-internals/routing/index.d.ts +3 -0
  153. package/types/stable/@ember/-internals/runtime/index.d.ts +11 -0
  154. package/types/stable/@ember/-internals/runtime/lib/ext/rsvp.d.ts +5 -0
  155. package/types/stable/@ember/-internals/runtime/lib/mixins/-proxy.d.ts +34 -0
  156. package/types/stable/@ember/-internals/runtime/lib/mixins/action_handler.d.ts +23 -0
  157. package/types/stable/@ember/-internals/runtime/lib/mixins/comparable.d.ts +22 -0
  158. package/types/stable/@ember/-internals/runtime/lib/mixins/container_proxy.d.ts +22 -0
  159. package/types/stable/@ember/-internals/runtime/lib/mixins/registry_proxy.d.ts +22 -0
  160. package/types/stable/@ember/-internals/runtime/lib/mixins/target_action_support.d.ts +29 -0
  161. package/types/stable/@ember/-internals/utility-types/index.d.ts +10 -0
  162. package/types/stable/@ember/-internals/utils/index.d.ts +16 -0
  163. package/types/stable/@ember/-internals/utils/lib/cache.d.ts +14 -0
  164. package/types/stable/@ember/-internals/utils/lib/dictionary.d.ts +7 -0
  165. package/types/stable/@ember/-internals/utils/lib/get-debug-name.d.ts +4 -0
  166. package/types/stable/@ember/-internals/utils/lib/guid.d.ts +60 -0
  167. package/types/stable/@ember/-internals/utils/lib/intern.d.ts +42 -0
  168. package/types/stable/@ember/-internals/utils/lib/invoke.d.ts +24 -0
  169. package/types/stable/@ember/-internals/utils/lib/is_proxy.d.ts +5 -0
  170. package/types/stable/@ember/-internals/utils/lib/lookup-descriptor.d.ts +3 -0
  171. package/types/stable/@ember/-internals/utils/lib/mandatory-setter.d.ts +6 -0
  172. package/types/stable/@ember/-internals/utils/lib/name.d.ts +4 -0
  173. package/types/stable/@ember/-internals/utils/lib/spec.d.ts +14 -0
  174. package/types/stable/@ember/-internals/utils/lib/super.d.ts +31 -0
  175. package/types/stable/@ember/-internals/utils/lib/symbol.d.ts +5 -0
  176. package/types/stable/@ember/-internals/utils/lib/to-string.d.ts +3 -0
  177. package/types/stable/@ember/-internals/views/index.d.ts +13 -0
  178. package/types/stable/@ember/-internals/views/lib/compat/attrs.d.ts +3 -0
  179. package/types/stable/@ember/-internals/views/lib/compat/fallback-view-registry.d.ts +6 -0
  180. package/types/stable/@ember/-internals/views/lib/component_lookup.d.ts +5 -0
  181. package/types/stable/@ember/-internals/views/lib/mixins/action_support.d.ts +13 -0
  182. package/types/stable/@ember/-internals/views/lib/mixins/child_views_support.d.ts +13 -0
  183. package/types/stable/@ember/-internals/views/lib/mixins/class_names_support.d.ts +14 -0
  184. package/types/stable/@ember/-internals/views/lib/mixins/view_state_support.d.ts +13 -0
  185. package/types/stable/@ember/-internals/views/lib/mixins/view_support.d.ts +25 -0
  186. package/types/stable/@ember/-internals/views/lib/system/action_manager.d.ts +11 -0
  187. package/types/stable/@ember/-internals/views/lib/system/event_dispatcher.d.ts +117 -0
  188. package/types/stable/@ember/-internals/views/lib/system/utils.d.ts +94 -0
  189. package/types/stable/@ember/-internals/views/lib/views/core_view.d.ts +60 -0
  190. package/types/stable/@ember/-internals/views/lib/views/states/default.d.ts +5 -0
  191. package/types/stable/@ember/-internals/views/lib/views/states/destroying.d.ts +5 -0
  192. package/types/stable/@ember/-internals/views/lib/views/states/has_element.d.ts +5 -0
  193. package/types/stable/@ember/-internals/views/lib/views/states/in_dom.d.ts +5 -0
  194. package/types/stable/@ember/-internals/views/lib/views/states/pre_render.d.ts +11 -0
  195. package/types/stable/@ember/-internals/views/lib/views/states.d.ts +25 -0
  196. package/types/stable/@ember/application/index.d.ts +814 -0
  197. package/types/stable/@ember/application/instance.d.ts +288 -0
  198. package/types/stable/@ember/application/lib/lazy_load.d.ts +38 -0
  199. package/types/stable/@ember/application/namespace.d.ts +38 -0
  200. package/types/stable/@ember/array/-internals.d.ts +5 -0
  201. package/types/stable/@ember/array/index.d.ts +1457 -0
  202. package/types/stable/@ember/array/lib/make-array.d.ts +34 -0
  203. package/types/stable/@ember/array/mutable.d.ts +3 -0
  204. package/types/stable/@ember/array/proxy.d.ts +158 -0
  205. package/types/stable/@ember/canary-features/index.d.ts +49 -0
  206. package/types/stable/@ember/component/helper.d.ts +3 -0
  207. package/types/stable/@ember/component/index.d.ts +5 -0
  208. package/types/stable/@ember/component/template-only.d.ts +33 -0
  209. package/types/stable/@ember/controller/index.d.ts +277 -0
  210. package/types/stable/@ember/debug/container-debug-adapter.d.ts +73 -0
  211. package/types/stable/@ember/debug/data-adapter.d.ts +325 -0
  212. package/types/stable/@ember/debug/index.d.ts +52 -0
  213. package/types/stable/@ember/debug/lib/capture-render-tree.d.ts +21 -0
  214. package/types/stable/@ember/debug/lib/deprecate.d.ts +72 -0
  215. package/types/stable/@ember/debug/lib/handlers.d.ts +14 -0
  216. package/types/stable/@ember/debug/lib/inspect.d.ts +20 -0
  217. package/types/stable/@ember/debug/lib/testing.d.ts +4 -0
  218. package/types/stable/@ember/debug/lib/warn.d.ts +14 -0
  219. package/types/stable/@ember/deprecated-features/index.d.ts +3 -0
  220. package/types/stable/@ember/destroyable/index.d.ts +237 -0
  221. package/types/stable/@ember/engine/index.d.ts +347 -0
  222. package/types/stable/@ember/engine/instance.d.ts +127 -0
  223. package/types/stable/@ember/engine/lib/engine-parent.d.ts +27 -0
  224. package/types/stable/@ember/enumerable/index.d.ts +19 -0
  225. package/types/stable/@ember/enumerable/mutable.d.ts +21 -0
  226. package/types/stable/@ember/error/index.d.ts +15 -0
  227. package/types/stable/@ember/helper/index.d.ts +314 -0
  228. package/types/stable/@ember/instrumentation/index.d.ts +127 -0
  229. package/types/stable/@ember/modifier/index.d.ts +5 -0
  230. package/types/stable/@ember/object/-internals.d.ts +9 -0
  231. package/types/stable/@ember/object/compat.d.ts +90 -0
  232. package/types/stable/@ember/object/computed.d.ts +5 -0
  233. package/types/stable/@ember/object/core.d.ts +638 -0
  234. package/types/stable/@ember/object/evented.d.ts +134 -0
  235. package/types/stable/@ember/object/events.d.ts +3 -0
  236. package/types/stable/@ember/object/index.d.ts +60 -0
  237. package/types/stable/@ember/object/internals.d.ts +3 -0
  238. package/types/stable/@ember/object/lib/computed/computed_macros.d.ts +644 -0
  239. package/types/stable/@ember/object/lib/computed/reduce_computed_macros.d.ts +791 -0
  240. package/types/stable/@ember/object/mixin.d.ts +157 -0
  241. package/types/stable/@ember/object/observable.d.ts +383 -0
  242. package/types/stable/@ember/object/observers.d.ts +3 -0
  243. package/types/stable/@ember/object/promise-proxy-mixin.d.ts +167 -0
  244. package/types/stable/@ember/object/proxy.d.ts +88 -0
  245. package/types/stable/@ember/owner/index.d.ts +80 -0
  246. package/types/stable/@ember/polyfills/index.d.ts +4 -0
  247. package/types/stable/@ember/polyfills/lib/assign.d.ts +9 -0
  248. package/types/stable/@ember/renderer/index.d.ts +28 -0
  249. package/types/stable/@ember/routing/-internals.d.ts +11 -0
  250. package/types/stable/@ember/routing/auto-location.d.ts +149 -0
  251. package/types/stable/@ember/routing/hash-location.d.ts +113 -0
  252. package/types/stable/@ember/routing/history-location.d.ts +143 -0
  253. package/types/stable/@ember/routing/index.d.ts +3 -0
  254. package/types/stable/@ember/routing/lib/cache.d.ts +16 -0
  255. package/types/stable/@ember/routing/lib/controller_for.d.ts +15 -0
  256. package/types/stable/@ember/routing/lib/dsl.d.ts +52 -0
  257. package/types/stable/@ember/routing/lib/engines.d.ts +14 -0
  258. package/types/stable/@ember/routing/lib/generate_controller.d.ts +25 -0
  259. package/types/stable/@ember/routing/lib/location-utils.d.ts +31 -0
  260. package/types/stable/@ember/routing/lib/query_params.d.ts +7 -0
  261. package/types/stable/@ember/routing/lib/route-info.d.ts +3 -0
  262. package/types/stable/@ember/routing/lib/router_state.d.ts +13 -0
  263. package/types/stable/@ember/routing/lib/routing-service.d.ts +35 -0
  264. package/types/stable/@ember/routing/lib/utils.d.ts +36 -0
  265. package/types/stable/@ember/routing/location.d.ts +108 -0
  266. package/types/stable/@ember/routing/none-location.d.ts +83 -0
  267. package/types/stable/@ember/routing/route-info.d.ts +125 -0
  268. package/types/stable/@ember/routing/route.d.ts +1456 -0
  269. package/types/stable/@ember/routing/router-service.d.ts +588 -0
  270. package/types/stable/@ember/routing/router.d.ts +431 -0
  271. package/types/stable/@ember/routing/transition.d.ts +180 -0
  272. package/types/stable/@ember/runloop/index.d.ts +657 -0
  273. package/types/stable/@ember/service/index.d.ts +82 -0
  274. package/types/stable/@ember/string/index.d.ts +152 -0
  275. package/types/stable/@ember/string/lib/string_registry.d.ts +9 -0
  276. package/types/stable/@ember/template/index.d.ts +3 -0
  277. package/types/stable/@ember/template-compilation/index.d.ts +4 -0
  278. package/types/stable/@ember/template-factory/index.d.ts +3 -0
  279. package/types/stable/@ember/test/adapter.d.ts +4 -0
  280. package/types/stable/@ember/test/index.d.ts +8 -0
  281. package/types/stable/@ember/utils/index.d.ts +9 -0
  282. package/types/stable/@ember/utils/lib/compare.d.ts +54 -0
  283. package/types/stable/@ember/utils/lib/is-equal.d.ts +52 -0
  284. package/types/stable/@ember/utils/lib/is_blank.d.ts +32 -0
  285. package/types/stable/@ember/utils/lib/is_empty.d.ts +38 -0
  286. package/types/stable/@ember/utils/lib/is_none.d.ts +26 -0
  287. package/types/stable/@ember/utils/lib/is_present.d.ts +35 -0
  288. package/types/stable/@ember/utils/lib/type-of.d.ts +68 -0
  289. package/types/stable/@ember/version/index.d.ts +3 -0
  290. package/types/stable/@glimmer/tracking/index.d.ts +203 -0
  291. package/types/stable/@glimmer/tracking/primitives/cache.d.ts +3 -0
  292. package/types/stable/ember/index.d.ts +376 -0
  293. package/types/stable/ember-template-compiler/index.d.ts +21 -0
  294. package/types/stable/ember-template-compiler/lib/plugins/assert-against-attrs.d.ts +20 -0
  295. package/types/stable/ember-template-compiler/lib/plugins/assert-against-named-outlets.d.ts +14 -0
  296. package/types/stable/ember-template-compiler/lib/plugins/assert-input-helper-without-block.d.ts +5 -0
  297. package/types/stable/ember-template-compiler/lib/plugins/assert-reserved-named-arguments.d.ts +5 -0
  298. package/types/stable/ember-template-compiler/lib/plugins/assert-splattribute-expression.d.ts +5 -0
  299. package/types/stable/ember-template-compiler/lib/plugins/index.d.ts +5 -0
  300. package/types/stable/ember-template-compiler/lib/plugins/transform-action-syntax.d.ts +28 -0
  301. package/types/stable/ember-template-compiler/lib/plugins/transform-each-in-into-each.d.ts +24 -0
  302. package/types/stable/ember-template-compiler/lib/plugins/transform-each-track-array.d.ts +24 -0
  303. package/types/stable/ember-template-compiler/lib/plugins/transform-in-element.d.ts +22 -0
  304. package/types/stable/ember-template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings.d.ts +4 -0
  305. package/types/stable/ember-template-compiler/lib/plugins/transform-resolutions.d.ts +5 -0
  306. package/types/stable/ember-template-compiler/lib/plugins/transform-wrap-mount-and-outlet.d.ts +36 -0
  307. package/types/stable/ember-template-compiler/lib/plugins/utils.d.ts +13 -0
  308. package/types/stable/ember-template-compiler/lib/system/bootstrap.d.ts +26 -0
  309. package/types/stable/ember-template-compiler/lib/system/calculate-location-display.d.ts +4 -0
  310. package/types/stable/ember-template-compiler/lib/system/compile-options.d.ts +6 -0
  311. package/types/stable/ember-template-compiler/lib/system/compile.d.ts +13 -0
  312. package/types/stable/ember-template-compiler/lib/system/dasherize-component-name.d.ts +5 -0
  313. package/types/stable/ember-template-compiler/lib/system/initializer.d.ts +3 -0
  314. package/types/stable/ember-template-compiler/lib/system/precompile.d.ts +17 -0
  315. package/types/stable/ember-testing/index.d.ts +10 -0
  316. package/types/stable/ember-testing/lib/adapters/adapter.d.ts +20 -0
  317. package/types/stable/ember-testing/lib/adapters/qunit.d.ts +19 -0
  318. package/types/stable/ember-testing/lib/ext/application.d.ts +12 -0
  319. package/types/stable/ember-testing/lib/ext/rsvp.d.ts +4 -0
  320. package/types/stable/ember-testing/lib/helpers/and_then.d.ts +4 -0
  321. package/types/stable/ember-testing/lib/helpers/current_path.d.ts +22 -0
  322. package/types/stable/ember-testing/lib/helpers/current_route_name.d.ts +21 -0
  323. package/types/stable/ember-testing/lib/helpers/current_url.d.ts +22 -0
  324. package/types/stable/ember-testing/lib/helpers/pause_test.d.ts +53 -0
  325. package/types/stable/ember-testing/lib/helpers/visit.d.ts +22 -0
  326. package/types/stable/ember-testing/lib/helpers/wait.d.ts +34 -0
  327. package/types/stable/ember-testing/lib/helpers.d.ts +3 -0
  328. package/types/stable/ember-testing/lib/initializers.d.ts +3 -0
  329. package/types/stable/ember-testing/lib/setup_for_testing.d.ts +15 -0
  330. package/types/stable/ember-testing/lib/test/adapter.d.ts +7 -0
  331. package/types/stable/ember-testing/lib/test/helpers.d.ts +115 -0
  332. package/types/stable/ember-testing/lib/test/on_inject_helpers.d.ts +33 -0
  333. package/types/stable/ember-testing/lib/test/pending_requests.d.ts +6 -0
  334. package/types/stable/ember-testing/lib/test/promise.d.ts +38 -0
  335. package/types/stable/ember-testing/lib/test/run.d.ts +3 -0
  336. package/types/stable/ember-testing/lib/test/waiters.d.ts +67 -0
  337. package/types/stable/ember-testing/lib/test.d.ts +47 -0
  338. package/types/stable/index.d.ts +47 -0
  339. package/types/preview/@ember/application/tsconfig.json +0 -3
  340. package/types/preview/@ember/array/tsconfig.json +0 -3
  341. package/types/preview/@ember/component/tsconfig.json +0 -3
  342. package/types/preview/@ember/controller/tsconfig.json +0 -3
  343. package/types/preview/@ember/debug/tsconfig.json +0 -3
  344. package/types/preview/@ember/destroyable/tsconfig.json +0 -3
  345. package/types/preview/@ember/engine/tsconfig.json +0 -3
  346. package/types/preview/@ember/error/tsconfig.json +0 -3
  347. package/types/preview/@ember/helper/tsconfig.json +0 -3
  348. package/types/preview/@ember/modifier/tsconfig.json +0 -3
  349. package/types/preview/@ember/object/tsconfig.json +0 -3
  350. package/types/preview/@ember/owner/index.d.ts +0 -423
  351. package/types/preview/@ember/owner/tsconfig.json +0 -3
  352. package/types/preview/@ember/polyfills/tsconfig.json +0 -3
  353. package/types/preview/@ember/routing/tsconfig.json +0 -3
  354. package/types/preview/@ember/runloop/tsconfig.json +0 -3
  355. package/types/preview/@ember/service/tsconfig.json +0 -3
  356. package/types/preview/@ember/string/tsconfig.json +0 -3
  357. package/types/preview/@ember/template/tsconfig.json +0 -3
  358. package/types/preview/@ember/test/tsconfig.json +0 -3
  359. package/types/preview/@ember/utils/tsconfig.json +0 -3
  360. package/types/preview/ember/tsconfig.json +0 -3
  361. package/types/preview/tsconfig.json +0 -6
@@ -0,0 +1,1456 @@
1
+ declare module '@ember/routing/route.d.ts' {
2
+ import type Owner from '@ember/owner';
3
+ import { BucketCache } from '@ember/routing/-internals';
4
+ import EmberObject from '@ember/object';
5
+ import Evented from '@ember/object/evented';
6
+ import type { AnyFn } from '@ember/-internals/utility-types';
7
+ import Controller from '@ember/controller';
8
+ import type { Template } from '@glimmer/interfaces';
9
+ import type { InternalRouteInfo, Route as IRoute, Transition, TransitionState } from 'router_js';
10
+ import type { QueryParam } from '@ember/routing/router';
11
+ import EmberRouter from '@ember/routing/router';
12
+ import type { NamedRouteArgs, RouteArgs } from './lib/utils';
13
+ export interface ExtendedInternalRouteInfo<R extends Route> extends InternalRouteInfo<R> {
14
+ _names?: unknown[];
15
+ }
16
+ export type QueryParamMeta = {
17
+ qps: QueryParam[];
18
+ map: Record<string, QueryParam>;
19
+ propertyNames: string[];
20
+ states: {
21
+ inactive(prop: string, value: unknown): void;
22
+ active(prop: string, value: unknown): any;
23
+ allowOverrides(prop: string, value: unknown): any;
24
+ };
25
+ };
26
+ type RouteTransitionState<R extends Route> = TransitionState<R> & {
27
+ fullQueryParams?: Record<string, unknown>;
28
+ queryParamsFor?: Record<string, Record<string, unknown>>;
29
+ };
30
+ type MaybeParameters<T> = T extends AnyFn ? Parameters<T> : unknown[];
31
+ type MaybeReturnType<T> = T extends AnyFn ? ReturnType<T> : unknown;
32
+ export const ROUTE_CONNECTIONS: WeakMap<object, any>;
33
+ const RENDER: unique symbol;
34
+ /**
35
+ @module @ember/routing/route
36
+ */
37
+ /**
38
+ The `Route` class is used to define individual routes. Refer to
39
+ the [routing guide](https://guides.emberjs.com/release/routing/) for documentation.
40
+
41
+ @class Route
42
+ @extends EmberObject
43
+ @uses ActionHandler
44
+ @uses Evented
45
+ @since 1.0.0
46
+ @public
47
+ */
48
+ interface Route<T = unknown> extends IRoute<T> {
49
+ /**
50
+ The `willTransition` action is fired at the beginning of any
51
+ attempted transition with a `Transition` object as the sole
52
+ argument. This action can be used for aborting, redirecting,
53
+ or decorating the transition from the currently active routes.
54
+
55
+ A good example is preventing navigation when a form is
56
+ half-filled out:
57
+
58
+ ```app/routes/contact-form.js
59
+ import Route from '@ember/routing/route';
60
+ import { action } from '@ember/object';
61
+
62
+ export default class ContactFormRoute extends Route {
63
+ @action
64
+ willTransition(transition) {
65
+ if (this.controller.get('userHasEnteredData')) {
66
+ this.controller.displayNavigationConfirm();
67
+ transition.abort();
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+ You can also redirect elsewhere by calling
74
+ `this.transitionTo('elsewhere')` from within `willTransition`.
75
+ Note that `willTransition` will not be fired for the
76
+ redirecting `transitionTo`, since `willTransition` doesn't
77
+ fire when there is already a transition underway. If you want
78
+ subsequent `willTransition` actions to fire for the redirecting
79
+ transition, you must first explicitly call
80
+ `transition.abort()`.
81
+
82
+ To allow the `willTransition` event to continue bubbling to the parent
83
+ route, use `return true;`. When the `willTransition` method has a
84
+ return value of `true` then the parent route's `willTransition` method
85
+ will be fired, enabling "bubbling" behavior for the event.
86
+
87
+ @event willTransition
88
+ @param {Transition} transition
89
+ @since 1.0.0
90
+ @public
91
+ */
92
+ willTransition?(transition: Transition): boolean | void;
93
+ /**
94
+ The `didTransition` action is fired after a transition has
95
+ successfully been completed. This occurs after the normal model
96
+ hooks (`beforeModel`, `model`, `afterModel`, `setupController`)
97
+ have resolved. The `didTransition` action has no arguments,
98
+ however, it can be useful for tracking page views or resetting
99
+ state on the controller.
100
+
101
+ ```app/routes/login.js
102
+ import Route from '@ember/routing/route';
103
+ import { action } from '@ember/object';
104
+
105
+ export default class LoginRoute extends Route {
106
+ @action
107
+ didTransition() {
108
+ this.controller.get('errors.base').clear();
109
+ return true; // Bubble the didTransition event
110
+ }
111
+ }
112
+ ```
113
+
114
+ @event didTransition
115
+ @since 1.2.0
116
+ @public
117
+ */
118
+ didTransition?(): boolean | void;
119
+ /**
120
+ The `loading` action is fired on the route when a route's `model`
121
+ hook returns a promise that is not already resolved. The current
122
+ `Transition` object is the first parameter and the route that
123
+ triggered the loading event is the second parameter.
124
+
125
+ ```app/routes/application.js
126
+ import Route from '@ember/routing/route';
127
+ import { action } from '@ember/object';
128
+
129
+ export default class ApplicationRoute extends Route {
130
+ @action
131
+ loading(transition, route) {
132
+ let controller = this.controllerFor('foo');
133
+
134
+ // The controller may not be instantiated when initially loading
135
+ if (controller) {
136
+ controller.currentlyLoading = true;
137
+
138
+ transition.finally(function() {
139
+ controller.currentlyLoading = false;
140
+ });
141
+ }
142
+ }
143
+ }
144
+ ```
145
+
146
+ @event loading
147
+ @param {Transition} transition
148
+ @param {Route} route The route that triggered the loading event
149
+ @since 1.2.0
150
+ @public
151
+ */
152
+ loading?(transition: Transition, route: Route): boolean | void;
153
+ /**
154
+ When attempting to transition into a route, any of the hooks
155
+ may return a promise that rejects, at which point an `error`
156
+ action will be fired on the partially-entered routes, allowing
157
+ for per-route error handling logic, or shared error handling
158
+ logic defined on a parent route.
159
+
160
+ Here is an example of an error handler that will be invoked
161
+ for rejected promises from the various hooks on the route,
162
+ as well as any unhandled errors from child routes:
163
+
164
+ ```app/routes/admin.js
165
+ import { reject } from 'rsvp';
166
+ import Route from '@ember/routing/route';
167
+ import { action } from '@ember/object';
168
+
169
+ export default class AdminRoute extends Route {
170
+ beforeModel() {
171
+ return reject('bad things!');
172
+ }
173
+
174
+ @action
175
+ error(error, transition) {
176
+ // Assuming we got here due to the error in `beforeModel`,
177
+ // we can expect that error === "bad things!",
178
+ // but a promise model rejecting would also
179
+ // call this hook, as would any errors encountered
180
+ // in `afterModel`.
181
+
182
+ // The `error` hook is also provided the failed
183
+ // `transition`, which can be stored and later
184
+ // `.retry()`d if desired.
185
+
186
+ this.transitionTo('login');
187
+ }
188
+ }
189
+ ```
190
+
191
+ `error` actions that bubble up all the way to `ApplicationRoute`
192
+ will fire a default error handler that logs the error. You can
193
+ specify your own global default error handler by overriding the
194
+ `error` handler on `ApplicationRoute`:
195
+
196
+ ```app/routes/application.js
197
+ import Route from '@ember/routing/route';
198
+ import { action } from '@ember/object';
199
+
200
+ export default class ApplicationRoute extends Route {
201
+ @action
202
+ error(error, transition) {
203
+ this.controllerFor('banner').displayError(error.message);
204
+ }
205
+ }
206
+ ```
207
+ @event error
208
+ @param {Error} error
209
+ @param {Transition} transition
210
+ @since 1.0.0
211
+ @public
212
+ */
213
+ error?(error: Error, transition: Transition): boolean | void;
214
+ }
215
+ const Route_base: Readonly<typeof EmberObject> & (new (owner?: Owner | undefined) => EmberObject);
216
+ class Route<T = unknown> extends Route_base implements IRoute, Evented {
217
+ static isRouteFactory: boolean;
218
+ context: T;
219
+ currentModel: T;
220
+ _bucketCache: BucketCache;
221
+ _internalName: string;
222
+ private _names;
223
+ _router: EmberRouter;
224
+ _topLevelViewTemplate: any;
225
+ _environment: any;
226
+ constructor(owner: Owner);
227
+ on: (name: string, method: ((...args: any[]) => void) | string) => this;
228
+ one: (name: string, method: string | ((...args: any[]) => void)) => this;
229
+ trigger: (name: string, ...args: any[]) => any;
230
+ off: (name: string, method: string | ((...args: any[]) => void)) => this;
231
+ has: (name: string) => boolean;
232
+ /**
233
+ A hook you can implement to convert the route's model into parameters
234
+ for the URL.
235
+
236
+ ```app/router.js
237
+ // ...
238
+
239
+ Router.map(function() {
240
+ this.route('post', { path: '/posts/:post_id' });
241
+ });
242
+
243
+ ```
244
+
245
+ ```app/routes/post.js
246
+ import Route from '@ember/routing/route';
247
+
248
+ export default class PostRoute extends Route {
249
+ model({ post_id }) {
250
+ // the server returns `{ id: 12 }`
251
+ return fetch(`/posts/${post_id}`;
252
+ }
253
+
254
+ serialize(model) {
255
+ // this will make the URL `/posts/12`
256
+ return { post_id: model.id };
257
+ }
258
+ }
259
+ ```
260
+
261
+ The default `serialize` method will insert the model's `id` into the
262
+ route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'.
263
+ If the route has multiple dynamic segments or does not contain '_id', `serialize`
264
+ will return `getProperties(model, params)`
265
+
266
+ This method is called when `transitionTo` is called with a context
267
+ in order to populate the URL.
268
+
269
+ @method serialize
270
+ @param {Object} model the routes model
271
+ @param {Array} params an Array of parameter names for the current
272
+ route (in the example, `['post_id']`.
273
+ @return {Object} the serialized parameters
274
+ @since 1.0.0
275
+ @public
276
+ */
277
+ serialize(model: T | undefined, params: string[]): {
278
+ [key: string]: unknown;
279
+ } | undefined;
280
+ /**
281
+ Configuration hash for this route's queryParams. The possible
282
+ configuration options and their defaults are as follows
283
+ (assuming a query param whose controller property is `page`):
284
+
285
+ ```javascript
286
+ queryParams = {
287
+ page: {
288
+ // By default, controller query param properties don't
289
+ // cause a full transition when they are changed, but
290
+ // rather only cause the URL to update. Setting
291
+ // `refreshModel` to true will cause an "in-place"
292
+ // transition to occur, whereby the model hooks for
293
+ // this route (and any child routes) will re-fire, allowing
294
+ // you to reload models (e.g., from the server) using the
295
+ // updated query param values.
296
+ refreshModel: false,
297
+
298
+ // By default, changes to controller query param properties
299
+ // cause the URL to update via `pushState`, which means an
300
+ // item will be added to the browser's history, allowing
301
+ // you to use the back button to restore the app to the
302
+ // previous state before the query param property was changed.
303
+ // Setting `replace` to true will use `replaceState` (or its
304
+ // hash location equivalent), which causes no browser history
305
+ // item to be added. This options name and default value are
306
+ // the same as the `link-to` helper's `replace` option.
307
+ replace: false,
308
+
309
+ // By default, the query param URL key is the same name as
310
+ // the controller property name. Use `as` to specify a
311
+ // different URL key.
312
+ as: 'page'
313
+ }
314
+ };
315
+ ```
316
+
317
+ @property queryParams
318
+ @for Route
319
+ @type Object
320
+ @since 1.6.0
321
+ @public
322
+ */
323
+ queryParams: Record<string, {
324
+ refreshModel?: boolean;
325
+ replace?: boolean;
326
+ as?: string;
327
+ }>;
328
+ /**
329
+ The name of the template to use by default when rendering this route's
330
+ template.
331
+
332
+ ```app/routes/posts/list.js
333
+ import Route from '@ember/routing/route';
334
+
335
+ export default class PostsListRoute extends Route {
336
+ templateName = 'posts/list';
337
+ }
338
+ ```
339
+
340
+ ```app/routes/posts/index.js
341
+ import PostsListRoute from '../posts/list';
342
+
343
+ export default class PostsIndexRoute extends PostsListRoute {};
344
+ ```
345
+
346
+ ```app/routes/posts/archived.js
347
+ import PostsListRoute from '../posts/list';
348
+
349
+ export default class PostsArchivedRoute extends PostsListRoute {};
350
+ ```
351
+
352
+ @property templateName
353
+ @type String
354
+ @default null
355
+ @since 1.4.0
356
+ @public
357
+ */
358
+ templateName: string | null;
359
+ /**
360
+ The name of the controller to associate with this route.
361
+
362
+ By default, Ember will lookup a route's controller that matches the name
363
+ of the route (i.e. `posts.new`). However,
364
+ if you would like to define a specific controller to use, you can do so
365
+ using this property.
366
+
367
+ This is useful in many ways, as the controller specified will be:
368
+
369
+ * passed to the `setupController` method.
370
+ * used as the controller for the template being rendered by the route.
371
+ * returned from a call to `controllerFor` for the route.
372
+
373
+ @property controllerName
374
+ @type String
375
+ @default null
376
+ @since 1.4.0
377
+ @public
378
+ */
379
+ controllerName: string | null;
380
+ /**
381
+ The controller associated with this route.
382
+
383
+ Example
384
+
385
+ ```app/routes/form.js
386
+ import Route from '@ember/routing/route';
387
+ import { action } from '@ember/object';
388
+
389
+ export default class FormRoute extends Route {
390
+ @action
391
+ willTransition(transition) {
392
+ if (this.controller.get('userHasEnteredData') &&
393
+ !confirm('Are you sure you want to abandon progress?')) {
394
+ transition.abort();
395
+ } else {
396
+ // Bubble the `willTransition` action so that
397
+ // parent routes can decide whether or not to abort.
398
+ return true;
399
+ }
400
+ }
401
+ }
402
+ ```
403
+
404
+ @property controller
405
+ @type Controller
406
+ @since 1.6.0
407
+ @public
408
+ */
409
+ controller: Controller;
410
+ /**
411
+ The name of the route, dot-delimited.
412
+
413
+ For example, a route found at `app/routes/posts/post.js` will have
414
+ a `routeName` of `posts.post`.
415
+
416
+ @property routeName
417
+ @for Route
418
+ @type String
419
+ @since 1.0.0
420
+ @public
421
+ */
422
+ routeName: string;
423
+ /**
424
+ The name of the route, dot-delimited, including the engine prefix
425
+ if applicable.
426
+
427
+ For example, a route found at `addon/routes/posts/post.js` within an
428
+ engine named `admin` will have a `fullRouteName` of `admin.posts.post`.
429
+
430
+ @property fullRouteName
431
+ @for Route
432
+ @type String
433
+ @since 2.10.0
434
+ @public
435
+ */
436
+ fullRouteName: string;
437
+ /**
438
+ Sets the name for this route, including a fully resolved name for routes
439
+ inside engines.
440
+
441
+ @private
442
+ @method _setRouteName
443
+ @param {String} name
444
+ */
445
+ _setRouteName(name: string): void;
446
+ /**
447
+ @private
448
+
449
+ @method _stashNames
450
+ */
451
+ _stashNames(routeInfo: ExtendedInternalRouteInfo<this>, dynamicParent: ExtendedInternalRouteInfo<this>): void;
452
+ /**
453
+ @private
454
+
455
+ @property _activeQPChanged
456
+ */
457
+ _activeQPChanged(qp: QueryParam, value: unknown): void;
458
+ /**
459
+ @private
460
+ @method _updatingQPChanged
461
+ */
462
+ _updatingQPChanged(qp: QueryParam): void;
463
+ /**
464
+ Returns a hash containing the parameters of an ancestor route.
465
+
466
+ You may notice that `this.paramsFor` sometimes works when referring to a
467
+ child route, but this behavior should not be relied upon as only ancestor
468
+ routes are certain to be loaded in time.
469
+
470
+ Example
471
+
472
+ ```app/router.js
473
+ // ...
474
+
475
+ Router.map(function() {
476
+ this.route('member', { path: ':name' }, function() {
477
+ this.route('interest', { path: ':interest' });
478
+ });
479
+ });
480
+ ```
481
+
482
+ ```app/routes/member.js
483
+ import Route from '@ember/routing/route';
484
+
485
+ export default class MemberRoute extends Route {
486
+ queryParams = {
487
+ memberQp: { refreshModel: true }
488
+ }
489
+ }
490
+ ```
491
+
492
+ ```app/routes/member/interest.js
493
+ import Route from '@ember/routing/route';
494
+
495
+ export default class MemberInterestRoute extends Route {
496
+ queryParams = {
497
+ interestQp: { refreshModel: true }
498
+ }
499
+
500
+ model() {
501
+ return this.paramsFor('member');
502
+ }
503
+ }
504
+ ```
505
+
506
+ If we visit `/turing/maths?memberQp=member&interestQp=interest` the model for
507
+ the `member.interest` route is a hash with:
508
+
509
+ * `name`: `turing`
510
+ * `memberQp`: `member`
511
+
512
+ @method paramsFor
513
+ @param {String} name
514
+ @return {Object} hash containing the parameters of the route `name`
515
+ @since 1.4.0
516
+ @public
517
+ */
518
+ paramsFor(name: string): Record<string, unknown>;
519
+ /**
520
+ Serializes the query parameter key
521
+
522
+ @method serializeQueryParamKey
523
+ @param {String} controllerPropertyName
524
+ @private
525
+ */
526
+ serializeQueryParamKey(controllerPropertyName: string): string;
527
+ /**
528
+ Serializes value of the query parameter based on defaultValueType
529
+
530
+ @method serializeQueryParam
531
+ @param {Object} value
532
+ @param {String} urlKey
533
+ @param {String} defaultValueType
534
+ @private
535
+ */
536
+ serializeQueryParam(value: unknown, _urlKey: string, defaultValueType: string): string | null | undefined;
537
+ /**
538
+ Deserializes value of the query parameter based on defaultValueType
539
+
540
+ @method deserializeQueryParam
541
+ @param {Object} value
542
+ @param {String} urlKey
543
+ @param {String} defaultValueType
544
+ @private
545
+ */
546
+ deserializeQueryParam(value: unknown, _urlKey: string, defaultValueType: string): {} | null | undefined;
547
+ /**
548
+ @private
549
+
550
+ @property _optionsForQueryParam
551
+ */
552
+ _optionsForQueryParam(qp: QueryParam): {};
553
+ /**
554
+ A hook you can use to reset controller values either when the model
555
+ changes or the route is exiting.
556
+
557
+ ```app/routes/articles.js
558
+ import Route from '@ember/routing/route';
559
+
560
+ export default class ArticlesRoute extends Route {
561
+ resetController(controller, isExiting, transition) {
562
+ if (isExiting && transition.targetName !== 'error') {
563
+ controller.set('page', 1);
564
+ }
565
+ }
566
+ }
567
+ ```
568
+
569
+ @method resetController
570
+ @param {Controller} controller instance
571
+ @param {Boolean} isExiting
572
+ @param {Object} transition
573
+ @since 1.7.0
574
+ @public
575
+ */
576
+ resetController(_controller: Controller, _isExiting: boolean, _transition: Transition): this;
577
+ /**
578
+ @private
579
+
580
+ @method exit
581
+ */
582
+ exit(transition?: Transition): void;
583
+ /**
584
+ @private
585
+
586
+ @method _internalReset
587
+ @since 3.6.0
588
+ */
589
+ _internalReset(isExiting: boolean, transition: Transition): void;
590
+ /**
591
+ @private
592
+
593
+ @method enter
594
+ */
595
+ enter(transition: Transition): void;
596
+ /**
597
+ This event is triggered when the router enters the route. It is
598
+ not executed when the model for the route changes.
599
+
600
+ ```app/routes/application.js
601
+ import { on } from '@ember/object/evented';
602
+ import Route from '@ember/routing/route';
603
+
604
+ export default Route.extend({
605
+ collectAnalytics: on('activate', function(){
606
+ collectAnalytics();
607
+ })
608
+ });
609
+ ```
610
+
611
+ @event activate
612
+ @since 1.9.0
613
+ @public
614
+ */
615
+ /**
616
+ This event is triggered when the router completely exits this
617
+ route. It is not executed when the model for the route changes.
618
+
619
+ ```app/routes/index.js
620
+ import { on } from '@ember/object/evented';
621
+ import Route from '@ember/routing/route';
622
+
623
+ export default Route.extend({
624
+ trackPageLeaveAnalytics: on('deactivate', function(){
625
+ trackPageLeaveAnalytics();
626
+ })
627
+ });
628
+ ```
629
+
630
+ @event deactivate
631
+ @since 1.9.0
632
+ @public
633
+ */
634
+ /**
635
+ This hook is executed when the router completely exits this route. It is
636
+ not executed when the model for the route changes.
637
+
638
+ @method deactivate
639
+ @param {Transition} transition
640
+ @since 1.0.0
641
+ @public
642
+ */
643
+ deactivate(_transition?: Transition): void;
644
+ /**
645
+ This hook is executed when the router enters the route. It is not executed
646
+ when the model for the route changes.
647
+
648
+ @method activate
649
+ @param {Transition} transition
650
+ @since 1.0.0
651
+ @public
652
+ */
653
+ activate(_transition: Transition): void;
654
+ /**
655
+ Transition the application into another route. The route may
656
+ be either a single route or route path:
657
+
658
+ ```javascript
659
+ this.transitionTo('blogPosts');
660
+ this.transitionTo('blogPosts.recentEntries');
661
+ ```
662
+
663
+ Optionally supply a model for the route in question. The model
664
+ will be serialized into the URL using the `serialize` hook of
665
+ the route:
666
+
667
+ ```javascript
668
+ this.transitionTo('blogPost', aPost);
669
+ ```
670
+
671
+ If a literal is passed (such as a number or a string), it will
672
+ be treated as an identifier instead. In this case, the `model`
673
+ hook of the route will be triggered:
674
+
675
+ ```javascript
676
+ this.transitionTo('blogPost', 1);
677
+ ```
678
+
679
+ Multiple models will be applied last to first recursively up the
680
+ route tree.
681
+
682
+ ```app/routes.js
683
+ // ...
684
+
685
+ Router.map(function() {
686
+ this.route('blogPost', { path:':blogPostId' }, function() {
687
+ this.route('blogComment', { path: ':blogCommentId' });
688
+ });
689
+ });
690
+
691
+ export default Router;
692
+ ```
693
+
694
+ ```javascript
695
+ this.transitionTo('blogComment', aPost, aComment);
696
+ this.transitionTo('blogComment', 1, 13);
697
+ ```
698
+
699
+ It is also possible to pass a URL (a string that starts with a
700
+ `/`).
701
+
702
+ ```javascript
703
+ this.transitionTo('/');
704
+ this.transitionTo('/blog/post/1/comment/13');
705
+ this.transitionTo('/blog/posts?sort=title');
706
+ ```
707
+
708
+ An options hash with a `queryParams` property may be provided as
709
+ the final argument to add query parameters to the destination URL.
710
+
711
+ ```javascript
712
+ this.transitionTo('blogPost', 1, {
713
+ queryParams: { showComments: 'true' }
714
+ });
715
+
716
+ // if you just want to transition the query parameters without changing the route
717
+ this.transitionTo({ queryParams: { sort: 'date' } });
718
+ ```
719
+
720
+ See also [replaceWith](#method_replaceWith).
721
+
722
+ Simple Transition Example
723
+
724
+ ```app/routes.js
725
+ // ...
726
+
727
+ Router.map(function() {
728
+ this.route('index');
729
+ this.route('secret');
730
+ this.route('fourOhFour', { path: '*:' });
731
+ });
732
+
733
+ export default Router;
734
+ ```
735
+
736
+ ```app/routes/index.js
737
+ import Route from '@ember/routing/route';
738
+ import { action } from '@ember/object';
739
+
740
+ export default class IndexRoute extends Route {
741
+ @action
742
+ moveToSecret(context) {
743
+ if (authorized()) {
744
+ this.transitionTo('secret', context);
745
+ } else {
746
+ this.transitionTo('fourOhFour');
747
+ }
748
+ }
749
+ }
750
+ ```
751
+
752
+ Transition to a nested route
753
+
754
+ ```app/router.js
755
+ // ...
756
+
757
+ Router.map(function() {
758
+ this.route('articles', { path: '/articles' }, function() {
759
+ this.route('new');
760
+ });
761
+ });
762
+
763
+ export default Router;
764
+ ```
765
+
766
+ ```app/routes/index.js
767
+ import Route from '@ember/routing/route';
768
+ import { action } from '@ember/object';
769
+
770
+ export default class IndexRoute extends Route {
771
+ @action
772
+ transitionToNewArticle() {
773
+ this.transitionTo('articles.new');
774
+ }
775
+ }
776
+ ```
777
+
778
+ Multiple Models Example
779
+
780
+ ```app/router.js
781
+ // ...
782
+
783
+ Router.map(function() {
784
+ this.route('index');
785
+
786
+ this.route('breakfast', { path: ':breakfastId' }, function() {
787
+ this.route('cereal', { path: ':cerealId' });
788
+ });
789
+ });
790
+
791
+ export default Router;
792
+ ```
793
+
794
+ ```app/routes/index.js
795
+ import Route from '@ember/routing/route';
796
+ import { action } from '@ember/object';
797
+
798
+ export default class IndexRoute extends Route {
799
+ @action
800
+ moveToChocolateCereal() {
801
+ let cereal = { cerealId: 'ChocolateYumminess' };
802
+ let breakfast = { breakfastId: 'CerealAndMilk' };
803
+
804
+ this.transitionTo('breakfast.cereal', breakfast, cereal);
805
+ }
806
+ }
807
+ ```
808
+
809
+ Nested Route with Query String Example
810
+
811
+ ```app/routes.js
812
+ // ...
813
+
814
+ Router.map(function() {
815
+ this.route('fruits', function() {
816
+ this.route('apples');
817
+ });
818
+ });
819
+
820
+ export default Router;
821
+ ```
822
+
823
+ ```app/routes/index.js
824
+ import Route from '@ember/routing/route';
825
+
826
+ export default class IndexRoute extends Route {
827
+ @action
828
+ transitionToApples() {
829
+ this.transitionTo('fruits.apples', { queryParams: { color: 'red' } });
830
+ }
831
+ }
832
+ ```
833
+
834
+ @method transitionTo
835
+ @param {String} [name] the name of the route or a URL.
836
+ @param {...Object} [models] the model(s) or identifier(s) to be used while
837
+ transitioning to the route.
838
+ @param {Object} [options] optional hash with a queryParams property
839
+ containing a mapping of query parameters. May be supplied as the only
840
+ parameter to trigger a query-parameter-only transition.
841
+ @return {Transition} the transition object associated with this
842
+ attempted transition
843
+ @since 1.0.0
844
+ @deprecated Use transitionTo from the Router service instead.
845
+ @public
846
+ */
847
+ transitionTo(...args: RouteArgs<this>): Transition;
848
+ /**
849
+ Perform a synchronous transition into another route without attempting
850
+ to resolve promises, update the URL, or abort any currently active
851
+ asynchronous transitions (i.e. regular transitions caused by
852
+ `transitionTo` or URL changes).
853
+
854
+ This method is handy for performing intermediate transitions on the
855
+ way to a final destination route, and is called internally by the
856
+ default implementations of the `error` and `loading` handlers.
857
+
858
+ @method intermediateTransitionTo
859
+ @param {String} name the name of the route
860
+ @param {...Object} models the model(s) to be used while transitioning
861
+ to the route.
862
+ @since 1.2.0
863
+ @public
864
+ */
865
+ intermediateTransitionTo(...args: NamedRouteArgs<this>): void;
866
+ /**
867
+ Refresh the model on this route and any child routes, firing the
868
+ `beforeModel`, `model`, and `afterModel` hooks in a similar fashion
869
+ to how routes are entered when transitioning in from other route.
870
+ The current route params (e.g. `article_id`) will be passed in
871
+ to the respective model hooks, and if a different model is returned,
872
+ `setupController` and associated route hooks will re-fire as well.
873
+
874
+ An example usage of this method is re-querying the server for the
875
+ latest information using the same parameters as when the route
876
+ was first entered.
877
+
878
+ Note that this will cause `model` hooks to fire even on routes
879
+ that were provided a model object when the route was initially
880
+ entered.
881
+
882
+ @method refresh
883
+ @return {Transition} the transition object associated with this
884
+ attempted transition
885
+ @since 1.4.0
886
+ @public
887
+ */
888
+ refresh(): Transition;
889
+ /**
890
+ Transition into another route while replacing the current URL, if possible.
891
+ This will replace the current history entry instead of adding a new one.
892
+ Beside that, it is identical to `transitionTo` in all other respects. See
893
+ 'transitionTo' for additional information regarding multiple models.
894
+
895
+ Example
896
+
897
+ ```app/router.js
898
+ // ...
899
+
900
+ Router.map(function() {
901
+ this.route('index');
902
+ this.route('secret');
903
+ });
904
+
905
+ export default Router;
906
+ ```
907
+
908
+ ```app/routes/secret.js
909
+ import Route from '@ember/routing/route';
910
+
911
+ export default class SecretRoute Route {
912
+ afterModel() {
913
+ if (!authorized()){
914
+ this.replaceWith('index');
915
+ }
916
+ }
917
+ }
918
+ ```
919
+
920
+ @method replaceWith
921
+ @param {String} name the name of the route or a URL
922
+ @param {...Object} models the model(s) or identifier(s) to be used while
923
+ transitioning to the route.
924
+ @param {Object} [options] optional hash with a queryParams property
925
+ containing a mapping of query parameters
926
+ @return {Transition} the transition object associated with this
927
+ attempted transition
928
+ @since 1.0.0
929
+ @deprecated Use replaceWith from the Router service instead.
930
+ @public
931
+ */
932
+ replaceWith(...args: any[]): Transition;
933
+ /**
934
+ This hook is the entry point for router.js
935
+
936
+ @private
937
+ @method setup
938
+ */
939
+ setup(context: T | undefined, transition: Transition): void;
940
+ _qpChanged(prop: string, value: unknown, qp: QueryParam): void;
941
+ /**
942
+ This hook is the first of the route entry validation hooks
943
+ called when an attempt is made to transition into a route
944
+ or one of its children. It is called before `model` and
945
+ `afterModel`, and is appropriate for cases when:
946
+
947
+ 1) A decision can be made to redirect elsewhere without
948
+ needing to resolve the model first.
949
+ 2) Any async operations need to occur first before the
950
+ model is attempted to be resolved.
951
+
952
+ This hook is provided the current `transition` attempt
953
+ as a parameter, which can be used to `.abort()` the transition,
954
+ save it for a later `.retry()`, or retrieve values set
955
+ on it from a previous hook. You can also just call
956
+ `this.transitionTo` to another route to implicitly
957
+ abort the `transition`.
958
+
959
+ You can return a promise from this hook to pause the
960
+ transition until the promise resolves (or rejects). This could
961
+ be useful, for instance, for retrieving async code from
962
+ the server that is required to enter a route.
963
+
964
+ @method beforeModel
965
+ @param {Transition} transition
966
+ @return {any | Promise<any>} if the value returned from this hook is
967
+ a promise, the transition will pause until the transition
968
+ resolves. Otherwise, non-promise return values are not
969
+ utilized in any way.
970
+ @since 1.0.0
971
+ @public
972
+ */
973
+ beforeModel(_transition: Transition): unknown | Promise<unknown>;
974
+ /**
975
+ This hook is called after this route's model has resolved.
976
+ It follows identical async/promise semantics to `beforeModel`
977
+ but is provided the route's resolved model in addition to
978
+ the `transition`, and is therefore suited to performing
979
+ logic that can only take place after the model has already
980
+ resolved.
981
+
982
+ ```app/routes/posts.js
983
+ import Route from '@ember/routing/route';
984
+
985
+ export default class PostsRoute extends Route {
986
+ afterModel(posts, transition) {
987
+ if (posts.get('length') === 1) {
988
+ this.transitionTo('post.show', posts.get('firstObject'));
989
+ }
990
+ }
991
+ }
992
+ ```
993
+
994
+ Refer to documentation for `beforeModel` for a description
995
+ of transition-pausing semantics when a promise is returned
996
+ from this hook.
997
+
998
+ @method afterModel
999
+ @param {Object} resolvedModel the value returned from `model`,
1000
+ or its resolved value if it was a promise
1001
+ @param {Transition} transition
1002
+ @return {any | Promise<any>} if the value returned from this hook is
1003
+ a promise, the transition will pause until the transition
1004
+ resolves. Otherwise, non-promise return values are not
1005
+ utilized in any way.
1006
+ @since 1.0.0
1007
+ @public
1008
+ */
1009
+ afterModel(_resolvedModel: T | undefined, _transition: Transition): unknown | Promise<unknown>;
1010
+ /**
1011
+ A hook you can implement to optionally redirect to another route.
1012
+
1013
+ Calling `this.transitionTo` from inside of the `redirect` hook will
1014
+ abort the current transition (into the route that has implemented `redirect`).
1015
+
1016
+ `redirect` and `afterModel` behave very similarly and are
1017
+ called almost at the same time, but they have an important
1018
+ distinction when calling `this.transitionTo` to a child route
1019
+ of the current route. From `afterModel`, this new transition
1020
+ invalidates the current transition, causing `beforeModel`,
1021
+ `model`, and `afterModel` hooks to be called again. But the
1022
+ same transition started from `redirect` does _not_ invalidate
1023
+ the current transition. In other words, by the time the `redirect`
1024
+ hook has been called, both the resolved model and the attempted
1025
+ entry into this route are considered fully validated.
1026
+
1027
+ @method redirect
1028
+ @param {Object} model the model for this route
1029
+ @param {Transition} transition the transition object associated with the current transition
1030
+ @since 1.0.0
1031
+ @public
1032
+ */
1033
+ redirect(_model: T, _transition: Transition): void;
1034
+ /**
1035
+ Called when the context is changed by router.js.
1036
+
1037
+ @private
1038
+ @method contextDidChange
1039
+ */
1040
+ contextDidChange(): void;
1041
+ /**
1042
+ A hook you can implement to convert the URL into the model for
1043
+ this route.
1044
+
1045
+ ```app/router.js
1046
+ // ...
1047
+
1048
+ Router.map(function() {
1049
+ this.route('post', { path: '/posts/:post_id' });
1050
+ });
1051
+
1052
+ export default Router;
1053
+ ```
1054
+
1055
+ The model for the `post` route is `store.findRecord('post', params.post_id)`.
1056
+
1057
+ By default, if your route has a dynamic segment ending in `_id`:
1058
+
1059
+ * The model class is determined from the segment (`post_id`'s
1060
+ class is `App.Post`)
1061
+ * The find method is called on the model class with the value of
1062
+ the dynamic segment.
1063
+
1064
+ Note that for routes with dynamic segments, this hook is not always
1065
+ executed. If the route is entered through a transition (e.g. when
1066
+ using the `link-to` Handlebars helper or the `transitionTo` method
1067
+ of routes), and a model context is already provided this hook
1068
+ is not called.
1069
+
1070
+ A model context does not include a primitive string or number,
1071
+ which does cause the model hook to be called.
1072
+
1073
+ Routes without dynamic segments will always execute the model hook.
1074
+
1075
+ ```javascript
1076
+ // no dynamic segment, model hook always called
1077
+ this.transitionTo('posts');
1078
+
1079
+ // model passed in, so model hook not called
1080
+ thePost = store.findRecord('post', 1);
1081
+ this.transitionTo('post', thePost);
1082
+
1083
+ // integer passed in, model hook is called
1084
+ this.transitionTo('post', 1);
1085
+
1086
+ // model id passed in, model hook is called
1087
+ // useful for forcing the hook to execute
1088
+ thePost = store.findRecord('post', 1);
1089
+ this.transitionTo('post', thePost.id);
1090
+ ```
1091
+
1092
+ This hook follows the asynchronous/promise semantics
1093
+ described in the documentation for `beforeModel`. In particular,
1094
+ if a promise returned from `model` fails, the error will be
1095
+ handled by the `error` hook on `Route`.
1096
+
1097
+ Example
1098
+
1099
+ ```app/routes/post.js
1100
+ import Route from '@ember/routing/route';
1101
+
1102
+ export default class PostRoute extends Route {
1103
+ model(params) {
1104
+ return this.store.findRecord('post', params.post_id);
1105
+ }
1106
+ }
1107
+ ```
1108
+
1109
+ @method model
1110
+ @param {Object} params the parameters extracted from the URL
1111
+ @param {Transition} transition
1112
+ @return {any | Promise<any>} the model for this route. If
1113
+ a promise is returned, the transition will pause until
1114
+ the promise resolves, and the resolved value of the promise
1115
+ will be used as the model for this route.
1116
+ @since 1.0.0
1117
+ @public
1118
+ */
1119
+ model(params: Record<string, unknown>, transition: Transition): T | PromiseLike<T> | undefined;
1120
+ /**
1121
+ @private
1122
+ @method deserialize
1123
+ @param {Object} params the parameters extracted from the URL
1124
+ @param {Transition} transition
1125
+ @return {any | Promise<any>} the model for this route.
1126
+
1127
+ Router.js hook.
1128
+ */
1129
+ deserialize(_params: {}, transition: Transition): T | PromiseLike<T> | undefined;
1130
+ /**
1131
+
1132
+ @method findModel
1133
+ @param {String} type the model type
1134
+ @param {Object} value the value passed to find
1135
+ @private
1136
+ */
1137
+ findModel(...args: any[]): any;
1138
+ /**
1139
+ A hook you can use to setup the controller for the current route.
1140
+
1141
+ This method is called with the controller for the current route and the
1142
+ model supplied by the `model` hook.
1143
+
1144
+ By default, the `setupController` hook sets the `model` property of
1145
+ the controller to the specified `model` when it is not `undefined`.
1146
+
1147
+ If you implement the `setupController` hook in your Route, it will
1148
+ prevent this default behavior. If you want to preserve that behavior
1149
+ when implementing your `setupController` function, make sure to call
1150
+ `super`:
1151
+
1152
+ ```app/routes/photos.js
1153
+ import Route from '@ember/routing/route';
1154
+
1155
+ export default class PhotosRoute extends Route {
1156
+ model() {
1157
+ return this.store.findAll('photo');
1158
+ }
1159
+
1160
+ setupController(controller, model) {
1161
+ super.setupController(controller, model);
1162
+
1163
+ this.controllerFor('application').set('showingPhotos', true);
1164
+ }
1165
+ }
1166
+ ```
1167
+
1168
+ The provided controller will be one resolved based on the name
1169
+ of this route.
1170
+
1171
+ If no explicit controller is defined, Ember will automatically create one.
1172
+
1173
+ As an example, consider the router:
1174
+
1175
+ ```app/router.js
1176
+ // ...
1177
+
1178
+ Router.map(function() {
1179
+ this.route('post', { path: '/posts/:post_id' });
1180
+ });
1181
+
1182
+ export default Router;
1183
+ ```
1184
+
1185
+ If you have defined a file for the post controller,
1186
+ the framework will use it.
1187
+ If it is not defined, a basic `Controller` instance would be used.
1188
+
1189
+ @example Behavior of a basic Controller
1190
+
1191
+ ```app/routes/post.js
1192
+ import Route from '@ember/routing/route';
1193
+
1194
+ export default class PostRoute extends Route {
1195
+ setupController(controller, model) {
1196
+ controller.set('model', model);
1197
+ }
1198
+ });
1199
+ ```
1200
+
1201
+ @method setupController
1202
+ @param {Controller} controller instance
1203
+ @param {Object} model
1204
+ @param {Transition} [transition]
1205
+ @since 1.0.0
1206
+ @public
1207
+ */
1208
+ setupController(controller: Controller, context: T | undefined, _transition?: Transition): void;
1209
+ /**
1210
+ Returns the controller of the current route, or a parent (or any ancestor)
1211
+ route in a route hierarchy.
1212
+
1213
+ The controller instance must already have been created, either through entering the
1214
+ associated route or using `generateController`.
1215
+
1216
+ ```app/routes/post.js
1217
+ import Route from '@ember/routing/route';
1218
+
1219
+ export default class PostRoute extends Route {
1220
+ setupController(controller, post) {
1221
+ super.setupController(controller, post);
1222
+
1223
+ this.controllerFor('posts').set('currentPost', post);
1224
+ }
1225
+ }
1226
+ ```
1227
+
1228
+ @method controllerFor
1229
+ @param {String} name the name of the route or controller
1230
+ @return {Controller | undefined}
1231
+ @since 1.0.0
1232
+ @public
1233
+ */
1234
+ controllerFor(name: string, _skipAssert: true): Controller | undefined;
1235
+ controllerFor(name: string, _skipAssert?: false): Controller;
1236
+ /**
1237
+ Generates a controller for a route.
1238
+
1239
+ Example
1240
+
1241
+ ```app/routes/post.js
1242
+ import Route from '@ember/routing/route';
1243
+
1244
+ export default class Post extends Route {
1245
+ setupController(controller, post) {
1246
+ super.setupController(controller, post);
1247
+
1248
+ this.generateController('posts');
1249
+ }
1250
+ }
1251
+ ```
1252
+
1253
+ @method generateController
1254
+ @param {String} name the name of the controller
1255
+ @private
1256
+ */
1257
+ generateController(name: string): Controller<unknown>;
1258
+ /**
1259
+ Returns the resolved model of a parent (or any ancestor) route
1260
+ in a route hierarchy. During a transition, all routes
1261
+ must resolve a model object, and if a route
1262
+ needs access to a parent route's model in order to
1263
+ resolve a model (or just reuse the model from a parent),
1264
+ it can call `this.modelFor(theNameOfParentRoute)` to
1265
+ retrieve it. If the ancestor route's model was a promise,
1266
+ its resolved result is returned.
1267
+
1268
+ Example
1269
+
1270
+ ```app/router.js
1271
+ // ...
1272
+
1273
+ Router.map(function() {
1274
+ this.route('post', { path: '/posts/:post_id' }, function() {
1275
+ this.route('comments');
1276
+ });
1277
+ });
1278
+
1279
+ export default Router;
1280
+ ```
1281
+
1282
+ ```app/routes/post/comments.js
1283
+ import Route from '@ember/routing/route';
1284
+
1285
+ export default class PostCommentsRoute extends Route {
1286
+ model() {
1287
+ let post = this.modelFor('post');
1288
+
1289
+ return post.comments;
1290
+ }
1291
+ }
1292
+ ```
1293
+
1294
+ @method modelFor
1295
+ @param {String} name the name of the route
1296
+ @return {Object} the model object
1297
+ @since 1.0.0
1298
+ @public
1299
+ */
1300
+ modelFor(_name: string): unknown | undefined;
1301
+ /**
1302
+ `this[RENDER]` is used to render a template into a region of another template
1303
+ (indicated by an `{{outlet}}`).
1304
+
1305
+ @method this[RENDER]
1306
+ @param {String} name the name of the template to render
1307
+ @param {Object} [options] the options
1308
+ @param {String} [options.into] the template to render into,
1309
+ referenced by name. Defaults to the parent template
1310
+ @param {String} [options.outlet] the outlet inside `options.into` to render into.
1311
+ Defaults to 'main'
1312
+ @param {String|Object} [options.controller] the controller to use for this template,
1313
+ referenced by name or as a controller instance. Defaults to the Route's paired controller
1314
+ @param {Object} [options.model] the model object to set on `options.controller`.
1315
+ Defaults to the return value of the Route's model hook
1316
+ @private
1317
+ */
1318
+ [RENDER](name?: string, options?: PartialRenderOptions): void;
1319
+ willDestroy(): void;
1320
+ /**
1321
+ @private
1322
+
1323
+ @method teardownViews
1324
+ */
1325
+ teardownViews(): void;
1326
+ /**
1327
+ Allows you to produce custom metadata for the route.
1328
+ The return value of this method will be attached to
1329
+ its corresponding RouteInfoWithAttributes object.
1330
+
1331
+ Example
1332
+
1333
+ ```app/routes/posts/index.js
1334
+ import Route from '@ember/routing/route';
1335
+
1336
+ export default class PostsIndexRoute extends Route {
1337
+ buildRouteInfoMetadata() {
1338
+ return { title: 'Posts Page' }
1339
+ }
1340
+ }
1341
+ ```
1342
+
1343
+ ```app/routes/application.js
1344
+ import Route from '@ember/routing/route';
1345
+ import { service } from '@ember/service';
1346
+
1347
+ export default class ApplicationRoute extends Route {
1348
+ @service router
1349
+
1350
+ constructor() {
1351
+ super(...arguments);
1352
+
1353
+ this.router.on('routeDidChange', transition => {
1354
+ document.title = transition.to.metadata.title;
1355
+ // would update document's title to "Posts Page"
1356
+ });
1357
+ }
1358
+ }
1359
+ ```
1360
+ @method buildRouteInfoMetadata
1361
+ @return any
1362
+ @since 3.10.0
1363
+ @public
1364
+ */
1365
+ buildRouteInfoMetadata(): unknown;
1366
+ private _paramsFor;
1367
+ /**
1368
+ Store property provides a hook for data persistence libraries to inject themselves.
1369
+
1370
+ By default, this store property provides the exact same functionality previously
1371
+ in the model hook.
1372
+
1373
+ Currently, the required interface is:
1374
+
1375
+ `store.find(modelName, findArguments)`
1376
+
1377
+ @property store
1378
+ @type {Object}
1379
+ @private
1380
+ */
1381
+ protected get store(): any;
1382
+ protected set store(value: any);
1383
+ /**
1384
+ @private
1385
+ @property _qp
1386
+ */
1387
+ protected get _qp(): QueryParamMeta;
1388
+ actions: Record<string, AnyFn>;
1389
+ /**
1390
+ Sends an action to the router, which will delegate it to the currently
1391
+ active route hierarchy per the bubbling rules explained under `actions`.
1392
+
1393
+ Example
1394
+
1395
+ ```app/router.js
1396
+ // ...
1397
+
1398
+ Router.map(function() {
1399
+ this.route('index');
1400
+ });
1401
+
1402
+ export default Router;
1403
+ ```
1404
+
1405
+ ```app/routes/application.js
1406
+ import Route from '@ember/routing/route';
1407
+ import { action } from '@ember/object';
1408
+
1409
+ export default class ApplicationRoute extends Route {
1410
+ @action
1411
+ track(arg) {
1412
+ console.log(arg, 'was clicked');
1413
+ }
1414
+ }
1415
+ ```
1416
+
1417
+ ```app/routes/index.js
1418
+ import Route from '@ember/routing/route';
1419
+ import { action } from '@ember/object';
1420
+
1421
+ export default class IndexRoute extends Route {
1422
+ @action
1423
+ trackIfDebug(arg) {
1424
+ if (debug) {
1425
+ this.send('track', arg);
1426
+ }
1427
+ }
1428
+ }
1429
+ ```
1430
+
1431
+ @method send
1432
+ @param {String} name the name of the action to trigger
1433
+ @param {...*} args
1434
+ @since 1.0.0
1435
+ @public
1436
+ */
1437
+ send: <K extends keyof this | keyof this['actions']>(name: K, ...args: MaybeParameters<K extends keyof this ? this[K] : K extends keyof this['actions'] ? this['actions'][K] : never>) => MaybeReturnType<K extends keyof this ? this[K] : K extends keyof this['actions'] ? this['actions'][K] : never>;
1438
+ }
1439
+ export interface RenderOptions {
1440
+ owner: Owner;
1441
+ into?: string;
1442
+ outlet: string;
1443
+ name: string;
1444
+ controller: Controller | string | undefined;
1445
+ model: unknown;
1446
+ template: Template;
1447
+ }
1448
+ type PartialRenderOptions = Partial<Pick<RenderOptions, 'into' | 'outlet' | 'controller' | 'model'>>;
1449
+ export function getFullQueryParams<R extends Route>(router: EmberRouter<R>, state: RouteTransitionState<R>): Record<string, unknown>;
1450
+ const defaultSerialize: (model: any, params: string[]) => {
1451
+ [key: string]: unknown;
1452
+ } | undefined;
1453
+ export { defaultSerialize };
1454
+ export function hasDefaultSerialize(route: Route): boolean;
1455
+ export default Route;
1456
+ }