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,657 @@
1
+ declare module '@ember/runloop' {
2
+ import type { DeferredActionQueues } from 'backburner';
3
+ import Backburner, { Timer } from 'backburner';
4
+ import type { AnyFn } from '@ember/-internals/utility-types';
5
+ export { Timer };
6
+ type PartialParams<P extends any[]> = P extends [infer First, ...infer Rest] ? [] | [First] | [First, ...PartialParams<Rest>] : Required<P> extends [infer First, ...infer Rest] ? [] | [First | undefined] | [First | undefined, ...PartialParams<Partial<Rest>>] : never;
7
+ type RemainingParams<PartialParams extends any[], All extends any[]> = PartialParams extends [
8
+ infer First,
9
+ ...infer Rest
10
+ ] ? All extends [infer AllFirst, ...infer AllRest] ? First extends AllFirst ? RemainingParams<Rest, AllRest> : never : Required<All> extends [infer AllFirst, ...infer AllRest] ? First extends AllFirst | undefined ? Partial<RemainingParams<Rest, AllRest>> : never : never : PartialParams extends [] ? All : never;
11
+ export function _getCurrentRunLoop(): DeferredActionQueues | null;
12
+ export const _rsvpErrorQueue: string;
13
+ /**
14
+ Array of named queues. This array determines the order in which queues
15
+ are flushed at the end of the RunLoop. You can define your own queues by
16
+ simply adding the queue name to this array. Normally you should not need
17
+ to inspect or modify this property.
18
+
19
+ @property queues
20
+ @type Array
21
+ @default ['actions', 'destroy']
22
+ @private
23
+ */
24
+ export const _queues: string[];
25
+ export const _backburner: Backburner;
26
+ /**
27
+ @module @ember/runloop
28
+ */
29
+ /**
30
+ Runs the passed target and method inside of a RunLoop, ensuring any
31
+ deferred actions including bindings and views updates are flushed at the
32
+ end.
33
+
34
+ Normally you should not need to invoke this method yourself. However if
35
+ you are implementing raw event handlers when interfacing with other
36
+ libraries or plugins, you should probably wrap all of your code inside this
37
+ call.
38
+
39
+ ```javascript
40
+ import { run } from '@ember/runloop';
41
+
42
+ run(function() {
43
+ // code to be executed within a RunLoop
44
+ });
45
+ ```
46
+ @method run
47
+ @for @ember/runloop
48
+ @static
49
+ @param {Object} [target] target of method to call
50
+ @param {Function|String} method Method to invoke.
51
+ May be a function or a string. If you pass a string
52
+ then it will be looked up on the passed target.
53
+ @param {Object} [args*] Any additional arguments you wish to pass to the method.
54
+ @return {Object} return value from invoking the passed function.
55
+ @public
56
+ */
57
+ export function run<F extends () => any>(method: F): ReturnType<F>;
58
+ export function run<F extends AnyFn>(method: F, ...args: Parameters<F>): ReturnType<F>;
59
+ export function run<T, F extends (this: T, ...args: any[]) => any>(target: T, method: F, ...args: Parameters<F>): ReturnType<F>;
60
+ export function run<T, U extends keyof T>(target: T, method: U, ...args: T[U] extends AnyFn ? Parameters<T[U]> : []): T[U] extends AnyFn ? ReturnType<T[U]> : unknown;
61
+ /**
62
+ If no run-loop is present, it creates a new one. If a run loop is
63
+ present it will queue itself to run on the existing run-loops action
64
+ queue.
65
+
66
+ Please note: This is not for normal usage, and should be used sparingly.
67
+
68
+ If invoked when not within a run loop:
69
+
70
+ ```javascript
71
+ import { join } from '@ember/runloop';
72
+
73
+ join(function() {
74
+ // creates a new run-loop
75
+ });
76
+ ```
77
+
78
+ Alternatively, if called within an existing run loop:
79
+
80
+ ```javascript
81
+ import { run, join } from '@ember/runloop';
82
+
83
+ run(function() {
84
+ // creates a new run-loop
85
+
86
+ join(function() {
87
+ // joins with the existing run-loop, and queues for invocation on
88
+ // the existing run-loops action queue.
89
+ });
90
+ });
91
+ ```
92
+
93
+ @method join
94
+ @static
95
+ @for @ember/runloop
96
+ @param {Object} [target] target of method to call
97
+ @param {Function|String} method Method to invoke.
98
+ May be a function or a string. If you pass a string
99
+ then it will be looked up on the passed target.
100
+ @param {Object} [args*] Any additional arguments you wish to pass to the method.
101
+ @return {Object} Return value from invoking the passed function. Please note,
102
+ when called within an existing loop, no return value is possible.
103
+ @public
104
+ */
105
+ export function join<F extends AnyFn>(method: F, ...args: Parameters<F>): ReturnType<F> | void;
106
+ export function join<T, F extends (this: T, ...args: any[]) => any>(target: T, method: F, ...args: Parameters<F>): ReturnType<F> | void;
107
+ export function join<T, U extends keyof T>(target: T, method: U, ...args: T[U] extends AnyFn ? Parameters<T[U]> : []): T[U] extends AnyFn ? ReturnType<T[U]> | void : void;
108
+ /**
109
+ Allows you to specify which context to call the specified function in while
110
+ adding the execution of that function to the Ember run loop. This ability
111
+ makes this method a great way to asynchronously integrate third-party libraries
112
+ into your Ember application.
113
+
114
+ `bind` takes two main arguments, the desired context and the function to
115
+ invoke in that context. Any additional arguments will be supplied as arguments
116
+ to the function that is passed in.
117
+
118
+ Let's use the creation of a TinyMCE component as an example. Currently,
119
+ TinyMCE provides a setup configuration option we can use to do some processing
120
+ after the TinyMCE instance is initialized but before it is actually rendered.
121
+ We can use that setup option to do some additional setup for our component.
122
+ The component itself could look something like the following:
123
+
124
+ ```app/components/rich-text-editor.js
125
+ import Component from '@ember/component';
126
+ import { on } from '@ember/object/evented';
127
+ import { bind } from '@ember/runloop';
128
+
129
+ export default Component.extend({
130
+ initializeTinyMCE: on('didInsertElement', function() {
131
+ tinymce.init({
132
+ selector: '#' + this.$().prop('id'),
133
+ setup: bind(this, this.setupEditor)
134
+ });
135
+ }),
136
+
137
+ didInsertElement() {
138
+ tinymce.init({
139
+ selector: '#' + this.$().prop('id'),
140
+ setup: bind(this, this.setupEditor)
141
+ });
142
+ }
143
+
144
+ setupEditor(editor) {
145
+ this.set('editor', editor);
146
+
147
+ editor.on('change', function() {
148
+ console.log('content changed!');
149
+ });
150
+ }
151
+ });
152
+ ```
153
+
154
+ In this example, we use `bind` to bind the setupEditor method to the
155
+ context of the RichTextEditor component and to have the invocation of that
156
+ method be safely handled and executed by the Ember run loop.
157
+
158
+ @method bind
159
+ @static
160
+ @for @ember/runloop
161
+ @param {Object} [target] target of method to call
162
+ @param {Function|String} method Method to invoke.
163
+ May be a function or a string. If you pass a string
164
+ then it will be looked up on the passed target.
165
+ @param {Object} [args*] Any additional arguments you wish to pass to the method.
166
+ @return {Function} returns a new function that will always have a particular context
167
+ @since 1.4.0
168
+ @public
169
+ */
170
+ export function bind<T, F extends (this: T, ...args: any[]) => any, A extends PartialParams<Parameters<F>>>(target: T, method: F, ...args: A): (...args: RemainingParams<A, Parameters<F>>) => ReturnType<F> | void;
171
+ export function bind<F extends AnyFn, A extends PartialParams<Parameters<F>>>(method: F, ...args: A): (...args: RemainingParams<A, Parameters<F>>) => ReturnType<F> | void;
172
+ export function bind<T, U extends keyof T, A extends T[U] extends AnyFn ? PartialParams<Parameters<T[U]>> : []>(target: T, method: U, ...args: A): T[U] extends AnyFn ? (...args: RemainingParams<A, Parameters<T[U]>>) => ReturnType<T[U]> | void : never;
173
+ /**
174
+ Begins a new RunLoop. Any deferred actions invoked after the begin will
175
+ be buffered until you invoke a matching call to `end()`. This is
176
+ a lower-level way to use a RunLoop instead of using `run()`.
177
+
178
+ ```javascript
179
+ import { begin, end } from '@ember/runloop';
180
+
181
+ begin();
182
+ // code to be executed within a RunLoop
183
+ end();
184
+ ```
185
+
186
+ @method begin
187
+ @static
188
+ @for @ember/runloop
189
+ @return {void}
190
+ @public
191
+ */
192
+ export function begin(): void;
193
+ /**
194
+ Ends a RunLoop. This must be called sometime after you call
195
+ `begin()` to flush any deferred actions. This is a lower-level way
196
+ to use a RunLoop instead of using `run()`.
197
+
198
+ ```javascript
199
+ import { begin, end } from '@ember/runloop';
200
+
201
+ begin();
202
+ // code to be executed within a RunLoop
203
+ end();
204
+ ```
205
+
206
+ @method end
207
+ @static
208
+ @for @ember/runloop
209
+ @return {void}
210
+ @public
211
+ */
212
+ export function end(): void;
213
+ /**
214
+ Adds the passed target/method and any optional arguments to the named
215
+ queue to be executed at the end of the RunLoop. If you have not already
216
+ started a RunLoop when calling this method one will be started for you
217
+ automatically.
218
+
219
+ At the end of a RunLoop, any methods scheduled in this way will be invoked.
220
+ Methods will be invoked in an order matching the named queues defined in
221
+ the `queues` property.
222
+
223
+ ```javascript
224
+ import { schedule } from '@ember/runloop';
225
+
226
+ schedule('afterRender', this, function() {
227
+ // this will be executed in the 'afterRender' queue
228
+ console.log('scheduled on afterRender queue');
229
+ });
230
+
231
+ schedule('actions', this, function() {
232
+ // this will be executed in the 'actions' queue
233
+ console.log('scheduled on actions queue');
234
+ });
235
+
236
+ // Note the functions will be run in order based on the run queues order.
237
+ // Output would be:
238
+ // scheduled on actions queue
239
+ // scheduled on afterRender queue
240
+ ```
241
+
242
+ @method schedule
243
+ @static
244
+ @for @ember/runloop
245
+ @param {String} queue The name of the queue to schedule against. Default queues is 'actions'
246
+ @param {Object} [target] target object to use as the context when invoking a method.
247
+ @param {String|Function} method The method to invoke. If you pass a string it
248
+ will be resolved on the target object at the time the scheduled item is
249
+ invoked allowing you to change the target function.
250
+ @param {Object} [arguments*] Optional arguments to be passed to the queued method.
251
+ @return {*} Timer information for use in canceling, see `cancel`.
252
+ @public
253
+ */
254
+ export function schedule<F extends AnyFn>(queueName: string, method: F, ...args: Parameters<F>): Timer;
255
+ export function schedule<T, F extends (this: T, ...args: any[]) => any>(queueName: string, target: T, method: F, ...args: Parameters<F>): Timer;
256
+ export function schedule<T, U extends keyof T>(queueName: string, target: T, method: U, ...args: T[U] extends AnyFn ? Parameters<T[U]> : []): Timer;
257
+ export function _hasScheduledTimers(): boolean;
258
+ export function _cancelTimers(): void;
259
+ /**
260
+ Invokes the passed target/method and optional arguments after a specified
261
+ period of time. The last parameter of this method must always be a number
262
+ of milliseconds.
263
+
264
+ You should use this method whenever you need to run some action after a
265
+ period of time instead of using `setTimeout()`. This method will ensure that
266
+ items that expire during the same script execution cycle all execute
267
+ together, which is often more efficient than using a real setTimeout.
268
+
269
+ ```javascript
270
+ import { later } from '@ember/runloop';
271
+
272
+ later(myContext, function() {
273
+ // code here will execute within a RunLoop in about 500ms with this == myContext
274
+ }, 500);
275
+ ```
276
+
277
+ @method later
278
+ @static
279
+ @for @ember/runloop
280
+ @param {Object} [target] target of method to invoke
281
+ @param {Function|String} method The method to invoke.
282
+ If you pass a string it will be resolved on the
283
+ target at the time the method is invoked.
284
+ @param {Object} [args*] Optional arguments to pass to the timeout.
285
+ @param {Number} wait Number of milliseconds to wait.
286
+ @return {*} Timer information for use in canceling, see `cancel`.
287
+ @public
288
+ */
289
+ export function later<T, F extends (this: T, ...args: any[]) => any>(target: T, method: F, ...args: [...args: Parameters<F>, wait: string | number]): Timer;
290
+ export function later<F extends AnyFn>(method: F, ...args: [...args: Parameters<F>, wait: string | number]): Timer;
291
+ export function later<T, U extends keyof T>(target: T, method: U, ...args: [...args: T[U] extends AnyFn ? Parameters<T[U]> : [], wait: string | number]): Timer;
292
+ /**
293
+ Schedule a function to run one time during the current RunLoop. This is equivalent
294
+ to calling `scheduleOnce` with the "actions" queue.
295
+
296
+ @method once
297
+ @static
298
+ @for @ember/runloop
299
+ @param {Object} [target] The target of the method to invoke.
300
+ @param {Function|String} method The method to invoke.
301
+ If you pass a string it will be resolved on the
302
+ target at the time the method is invoked.
303
+ @param {Object} [args*] Optional arguments to pass to the timeout.
304
+ @return {Object} Timer information for use in canceling, see `cancel`.
305
+ @public
306
+ */
307
+ export function once<F extends AnyFn>(method: F, ...args: Parameters<F>): Timer;
308
+ export function once<T, F extends (this: T, ...args: any[]) => any>(target: T, method: F, ...args: Parameters<F>): Timer;
309
+ export function once<T, U extends keyof T>(target: T, method: U, ...args: T[U] extends AnyFn ? Parameters<T[U]> : []): Timer;
310
+ /**
311
+ Schedules a function to run one time in a given queue of the current RunLoop.
312
+ Calling this method with the same queue/target/method combination will have
313
+ no effect (past the initial call).
314
+
315
+ Note that although you can pass optional arguments these will not be
316
+ considered when looking for duplicates. New arguments will replace previous
317
+ calls.
318
+
319
+ ```javascript
320
+ import { run, scheduleOnce } from '@ember/runloop';
321
+
322
+ function sayHi() {
323
+ console.log('hi');
324
+ }
325
+
326
+ run(function() {
327
+ scheduleOnce('afterRender', myContext, sayHi);
328
+ scheduleOnce('afterRender', myContext, sayHi);
329
+ // sayHi will only be executed once, in the afterRender queue of the RunLoop
330
+ });
331
+ ```
332
+
333
+ Also note that for `scheduleOnce` to prevent additional calls, you need to
334
+ pass the same function instance. The following case works as expected:
335
+
336
+ ```javascript
337
+ function log() {
338
+ console.log('Logging only once');
339
+ }
340
+
341
+ function scheduleIt() {
342
+ scheduleOnce('actions', myContext, log);
343
+ }
344
+
345
+ scheduleIt();
346
+ scheduleIt();
347
+ ```
348
+
349
+ But this other case will schedule the function multiple times:
350
+
351
+ ```javascript
352
+ import { scheduleOnce } from '@ember/runloop';
353
+
354
+ function scheduleIt() {
355
+ scheduleOnce('actions', myContext, function() {
356
+ console.log('Closure');
357
+ });
358
+ }
359
+
360
+ scheduleIt();
361
+ scheduleIt();
362
+
363
+ // "Closure" will print twice, even though we're using `scheduleOnce`,
364
+ // because the function we pass to it won't match the
365
+ // previously scheduled operation.
366
+ ```
367
+
368
+ Available queues, and their order, can be found at `queues`
369
+
370
+ @method scheduleOnce
371
+ @static
372
+ @for @ember/runloop
373
+ @param {String} [queue] The name of the queue to schedule against. Default queues is 'actions'.
374
+ @param {Object} [target] The target of the method to invoke.
375
+ @param {Function|String} method The method to invoke.
376
+ If you pass a string it will be resolved on the
377
+ target at the time the method is invoked.
378
+ @param {Object} [args*] Optional arguments to pass to the timeout.
379
+ @return {Object} Timer information for use in canceling, see `cancel`.
380
+ @public
381
+ */
382
+ export function scheduleOnce<F extends AnyFn>(queueName: string, method: F, ...args: Parameters<F>): Timer;
383
+ export function scheduleOnce<T, F extends (this: T, ...args: any[]) => any>(queueName: string, target: T, method: F, ...args: Parameters<F>): Timer;
384
+ export function scheduleOnce<T, U extends keyof T>(queueName: string, target: T, method: U, ...args: T[U] extends AnyFn ? Parameters<T[U]> : []): Timer;
385
+ /**
386
+ Schedules an item to run from within a separate run loop, after
387
+ control has been returned to the system. This is equivalent to calling
388
+ `later` with a wait time of 1ms.
389
+
390
+ ```javascript
391
+ import { next } from '@ember/runloop';
392
+
393
+ next(myContext, function() {
394
+ // code to be executed in the next run loop,
395
+ // which will be scheduled after the current one
396
+ });
397
+ ```
398
+
399
+ Multiple operations scheduled with `next` will coalesce
400
+ into the same later run loop, along with any other operations
401
+ scheduled by `later` that expire right around the same
402
+ time that `next` operations will fire.
403
+
404
+ Note that there are often alternatives to using `next`.
405
+ For instance, if you'd like to schedule an operation to happen
406
+ after all DOM element operations have completed within the current
407
+ run loop, you can make use of the `afterRender` run loop queue (added
408
+ by the `ember-views` package, along with the preceding `render` queue
409
+ where all the DOM element operations happen).
410
+
411
+ Example:
412
+
413
+ ```app/components/my-component.js
414
+ import Component from '@ember/component';
415
+ import { scheduleOnce } from '@ember/runloop';
416
+
417
+ export Component.extend({
418
+ didInsertElement() {
419
+ this._super(...arguments);
420
+ scheduleOnce('afterRender', this, 'processChildElements');
421
+ },
422
+
423
+ processChildElements() {
424
+ // ... do something with component's child component
425
+ // elements after they've finished rendering, which
426
+ // can't be done within this component's
427
+ // `didInsertElement` hook because that gets run
428
+ // before the child elements have been added to the DOM.
429
+ }
430
+ });
431
+ ```
432
+
433
+ One benefit of the above approach compared to using `next` is
434
+ that you will be able to perform DOM/CSS operations before unprocessed
435
+ elements are rendered to the screen, which may prevent flickering or
436
+ other artifacts caused by delaying processing until after rendering.
437
+
438
+ The other major benefit to the above approach is that `next`
439
+ introduces an element of non-determinism, which can make things much
440
+ harder to test, due to its reliance on `setTimeout`; it's much harder
441
+ to guarantee the order of scheduled operations when they are scheduled
442
+ outside of the current run loop, i.e. with `next`.
443
+
444
+ @method next
445
+ @static
446
+ @for @ember/runloop
447
+ @param {Object} [target] target of method to invoke
448
+ @param {Function|String} method The method to invoke.
449
+ If you pass a string it will be resolved on the
450
+ target at the time the method is invoked.
451
+ @param {Object} [args*] Optional arguments to pass to the timeout.
452
+ @return {Object} Timer information for use in canceling, see `cancel`.
453
+ @public
454
+ */
455
+ export function next<F extends AnyFn>(method: F, ...args: Parameters<F>): Timer;
456
+ export function next<T, F extends (this: T, ...args: any[]) => any>(target: T, method: F, ...args: Parameters<F>): Timer;
457
+ export function next<T, U extends keyof T>(target: T, method: U, ...args: T[U] extends AnyFn ? Parameters<T[U]> : []): Timer;
458
+ /**
459
+ Cancels a scheduled item. Must be a value returned by `later()`,
460
+ `once()`, `scheduleOnce()`, `next()`, `debounce()`, or
461
+ `throttle()`.
462
+
463
+ ```javascript
464
+ import {
465
+ next,
466
+ cancel,
467
+ later,
468
+ scheduleOnce,
469
+ once,
470
+ throttle,
471
+ debounce
472
+ } from '@ember/runloop';
473
+
474
+ let runNext = next(myContext, function() {
475
+ // will not be executed
476
+ });
477
+
478
+ cancel(runNext);
479
+
480
+ let runLater = later(myContext, function() {
481
+ // will not be executed
482
+ }, 500);
483
+
484
+ cancel(runLater);
485
+
486
+ let runScheduleOnce = scheduleOnce('afterRender', myContext, function() {
487
+ // will not be executed
488
+ });
489
+
490
+ cancel(runScheduleOnce);
491
+
492
+ let runOnce = once(myContext, function() {
493
+ // will not be executed
494
+ });
495
+
496
+ cancel(runOnce);
497
+
498
+ let throttle = throttle(myContext, function() {
499
+ // will not be executed
500
+ }, 1, false);
501
+
502
+ cancel(throttle);
503
+
504
+ let debounce = debounce(myContext, function() {
505
+ // will not be executed
506
+ }, 1);
507
+
508
+ cancel(debounce);
509
+
510
+ let debounceImmediate = debounce(myContext, function() {
511
+ // will be executed since we passed in true (immediate)
512
+ }, 100, true);
513
+
514
+ // the 100ms delay until this method can be called again will be canceled
515
+ cancel(debounceImmediate);
516
+ ```
517
+
518
+ @method cancel
519
+ @static
520
+ @for @ember/runloop
521
+ @param {Object} timer Timer object to cancel
522
+ @return {Boolean} true if canceled or false/undefined if it wasn't found
523
+ @public
524
+ */
525
+ export function cancel(timer: Timer): boolean;
526
+ /**
527
+ Delay calling the target method until the debounce period has elapsed
528
+ with no additional debounce calls. If `debounce` is called again before
529
+ the specified time has elapsed, the timer is reset and the entire period
530
+ must pass again before the target method is called.
531
+
532
+ This method should be used when an event may be called multiple times
533
+ but the action should only be called once when the event is done firing.
534
+ A common example is for scroll events where you only want updates to
535
+ happen once scrolling has ceased.
536
+
537
+ ```javascript
538
+ import { debounce } from '@ember/runloop';
539
+
540
+ function whoRan() {
541
+ console.log(this.name + ' ran.');
542
+ }
543
+
544
+ let myContext = { name: 'debounce' };
545
+
546
+ debounce(myContext, whoRan, 150);
547
+
548
+ // less than 150ms passes
549
+ debounce(myContext, whoRan, 150);
550
+
551
+ // 150ms passes
552
+ // whoRan is invoked with context myContext
553
+ // console logs 'debounce ran.' one time.
554
+ ```
555
+
556
+ Immediate allows you to run the function immediately, but debounce
557
+ other calls for this function until the wait time has elapsed. If
558
+ `debounce` is called again before the specified time has elapsed,
559
+ the timer is reset and the entire period must pass again before
560
+ the method can be called again.
561
+
562
+ ```javascript
563
+ import { debounce } from '@ember/runloop';
564
+
565
+ function whoRan() {
566
+ console.log(this.name + ' ran.');
567
+ }
568
+
569
+ let myContext = { name: 'debounce' };
570
+
571
+ debounce(myContext, whoRan, 150, true);
572
+
573
+ // console logs 'debounce ran.' one time immediately.
574
+ // 100ms passes
575
+ debounce(myContext, whoRan, 150, true);
576
+
577
+ // 150ms passes and nothing else is logged to the console and
578
+ // the debouncee is no longer being watched
579
+ debounce(myContext, whoRan, 150, true);
580
+
581
+ // console logs 'debounce ran.' one time immediately.
582
+ // 150ms passes and nothing else is logged to the console and
583
+ // the debouncee is no longer being watched
584
+ ```
585
+
586
+ @method debounce
587
+ @static
588
+ @for @ember/runloop
589
+ @param {Object} [target] target of method to invoke
590
+ @param {Function|String} method The method to invoke.
591
+ May be a function or a string. If you pass a string
592
+ then it will be looked up on the passed target.
593
+ @param {Object} [args*] Optional arguments to pass to the timeout.
594
+ @param {Number} wait Number of milliseconds to wait.
595
+ @param {Boolean} immediate Trigger the function on the leading instead
596
+ of the trailing edge of the wait interval. Defaults to false.
597
+ @return {Array} Timer information for use in canceling, see `cancel`.
598
+ @public
599
+ */
600
+ export function debounce<F extends AnyFn>(method: F, ...args: [...args: Parameters<F>, wait: string | number, immediate?: boolean]): Timer;
601
+ export function debounce<T, F extends (this: T, ...args: any[]) => any>(target: T, method: F, ...args: [...args: Parameters<F>, wait: string | number, immediate?: boolean]): Timer;
602
+ export function debounce<T, U extends keyof T>(target: T, method: U, ...args: [
603
+ ...args: T[U] extends AnyFn ? Parameters<T[U]> : [],
604
+ wait: string | number,
605
+ immediate?: boolean
606
+ ]): Timer;
607
+ /**
608
+ Ensure that the target method is never called more frequently than
609
+ the specified spacing period. The target method is called immediately.
610
+
611
+ ```javascript
612
+ import { throttle } from '@ember/runloop';
613
+
614
+ function whoRan() {
615
+ console.log(this.name + ' ran.');
616
+ }
617
+
618
+ let myContext = { name: 'throttle' };
619
+
620
+ throttle(myContext, whoRan, 150);
621
+ // whoRan is invoked with context myContext
622
+ // console logs 'throttle ran.'
623
+
624
+ // 50ms passes
625
+ throttle(myContext, whoRan, 150);
626
+
627
+ // 50ms passes
628
+ throttle(myContext, whoRan, 150);
629
+
630
+ // 150ms passes
631
+ throttle(myContext, whoRan, 150);
632
+ // whoRan is invoked with context myContext
633
+ // console logs 'throttle ran.'
634
+ ```
635
+
636
+ @method throttle
637
+ @static
638
+ @for @ember/runloop
639
+ @param {Object} [target] target of method to invoke
640
+ @param {Function|String} method The method to invoke.
641
+ May be a function or a string. If you pass a string
642
+ then it will be looked up on the passed target.
643
+ @param {Object} [args*] Optional arguments to pass to the timeout.
644
+ @param {Number} spacing Number of milliseconds to space out requests.
645
+ @param {Boolean} immediate Trigger the function on the leading instead
646
+ of the trailing edge of the wait interval. Defaults to true.
647
+ @return {Array} Timer information for use in canceling, see `cancel`.
648
+ @public
649
+ */
650
+ export function throttle<F extends AnyFn>(method: F, ...args: [...args: Parameters<F>, wait?: string | number, immediate?: boolean]): Timer;
651
+ export function throttle<T, F extends (this: T, ...args: any[]) => any>(target: T, method: F, ...args: [...args: Parameters<F>, wait?: string | number, immediate?: boolean]): Timer;
652
+ export function throttle<T, U extends keyof T>(target: T, method: U, ...args: [
653
+ ...args: T[U] extends AnyFn ? Parameters<T[U]> : [],
654
+ wait?: string | number,
655
+ immediate?: boolean
656
+ ]): Timer;
657
+ }