ember-source 4.8.0-alpha.5 → 4.8.0-beta.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 (244) hide show
  1. package/CHANGELOG.md +11 -2
  2. package/blueprints/helper/files/__root__/{__collection__ → helpers}/__name__.ts +0 -0
  3. package/blueprints/helper/index.js +0 -15
  4. package/blueprints/helper-test/index.js +0 -3
  5. package/blueprints/helper-test/mocha-0.12-files/__root__/__testType__/{__collection__ → helpers}/__name__-test.js +0 -0
  6. package/blueprints/helper-test/mocha-files/__root__/__testType__/{__collection__ → helpers}/__name__-test.js +0 -0
  7. package/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/{__collection__ → helpers}/__name__-test.ts +0 -0
  8. package/blueprints/helper-test/qunit-files/__root__/__testType__/{__collection__ → helpers}/__name__-test.js +0 -0
  9. package/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/{__collection__ → helpers}/__name__-test.ts +0 -0
  10. package/blueprints-js/helper/files/__root__/{__collection__ → helpers}/__name__.js +0 -0
  11. package/blueprints-js/helper-test/mocha-0.12-files/__root__/__testType__/{__collection__ → helpers}/__name__-test.js +0 -0
  12. package/blueprints-js/helper-test/mocha-files/__root__/__testType__/{__collection__ → helpers}/__name__-test.js +0 -0
  13. package/blueprints-js/helper-test/mocha-rfc-232-files/__root__/__testType__/{__collection__ → helpers}/__name__-test.js +0 -0
  14. package/blueprints-js/helper-test/qunit-files/__root__/__testType__/{__collection__ → helpers}/__name__-test.js +0 -0
  15. package/blueprints-js/helper-test/qunit-rfc-232-files/__root__/__testType__/{__collection__ → helpers}/__name__-test.js +0 -0
  16. package/build-metadata.json +3 -3
  17. package/dist/dependencies/router_js.js +1 -1
  18. package/dist/ember-template-compiler.js +675 -18
  19. package/dist/ember-template-compiler.map +1 -1
  20. package/dist/ember-testing.js +11 -11
  21. package/dist/ember-testing.map +1 -1
  22. package/dist/ember.debug.js +19576 -20510
  23. package/dist/ember.debug.map +1 -1
  24. package/dist/header/license.js +1 -1
  25. package/dist/packages/@ember/-internals/glimmer/index.js +4 -2
  26. package/dist/packages/@ember/-internals/metal/index.js +214 -1094
  27. package/dist/packages/@ember/-internals/routing/index.js +1 -17
  28. package/dist/packages/@ember/-internals/runtime/index.js +3 -16
  29. package/dist/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +2 -1
  30. package/dist/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +4 -3
  31. package/dist/packages/@ember/-internals/runtime/lib/mixins/comparable.js +1 -1
  32. package/dist/packages/@ember/-internals/runtime/lib/mixins/container_proxy.js +1 -1
  33. package/dist/packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js +1 -8
  34. package/dist/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +2 -1
  35. package/dist/packages/@ember/-internals/utils/index.js +3 -3
  36. package/dist/packages/@ember/-internals/views/lib/component_lookup.js +1 -1
  37. package/dist/packages/@ember/-internals/views/lib/mixins/action_support.js +2 -1
  38. package/dist/packages/@ember/-internals/views/lib/mixins/child_views_support.js +2 -1
  39. package/dist/packages/@ember/-internals/views/lib/mixins/class_names_support.js +2 -1
  40. package/dist/packages/@ember/-internals/views/lib/mixins/view_state_support.js +1 -1
  41. package/dist/packages/@ember/-internals/views/lib/mixins/view_support.js +2 -1
  42. package/dist/packages/@ember/-internals/views/lib/system/event_dispatcher.js +1 -1
  43. package/dist/packages/@ember/-internals/views/lib/views/core_view.js +3 -1
  44. package/dist/packages/@ember/application/index.js +876 -2
  45. package/dist/packages/@ember/application/instance.js +2 -2
  46. package/dist/packages/@ember/application/namespace.js +70 -1
  47. package/dist/packages/@ember/array/index.js +1503 -2
  48. package/dist/packages/@ember/array/mutable.js +1 -1
  49. package/dist/packages/@ember/array/proxy.js +307 -1
  50. package/dist/packages/@ember/canary-features/index.js +2 -2
  51. package/dist/packages/@ember/controller/index.js +260 -3
  52. package/dist/packages/@ember/debug/container-debug-adapter.js +99 -1
  53. package/dist/packages/@ember/debug/data-adapter.js +574 -1
  54. package/dist/packages/@ember/engine/index.js +5 -5
  55. package/dist/packages/@ember/engine/instance.js +4 -4
  56. package/dist/packages/@ember/enumerable/index.js +3 -1
  57. package/dist/packages/@ember/enumerable/mutable.js +4 -0
  58. package/dist/packages/@ember/{-internals/runtime/lib/system/object.js → object/-internals.js} +4 -17
  59. package/dist/packages/@ember/object/core.js +731 -1
  60. package/dist/packages/@ember/object/evented.js +93 -2
  61. package/dist/packages/@ember/object/index.js +76 -4
  62. package/dist/packages/@ember/object/internals.js +3 -2
  63. package/dist/packages/@ember/object/lib/computed/computed_macros.js +3 -1
  64. package/dist/packages/@ember/object/lib/computed/reduce_computed_macros.js +4 -3
  65. package/dist/packages/@ember/object/mixin.js +659 -1
  66. package/dist/packages/@ember/object/observable.js +341 -1
  67. package/dist/packages/@ember/object/promise-proxy-mixin.js +150 -1
  68. package/dist/packages/@ember/object/proxy.js +10 -1
  69. package/dist/packages/@ember/routing/-internals.js +7 -0
  70. package/dist/packages/@ember/routing/auto-location.js +249 -1
  71. package/dist/packages/@ember/routing/hash-location.js +169 -1
  72. package/dist/packages/@ember/routing/history-location.js +289 -1
  73. package/dist/packages/@ember/{-internals/routing/lib/system → routing/lib}/cache.js +0 -0
  74. package/dist/packages/@ember/{-internals/routing/lib/system → routing/lib}/controller_for.js +0 -0
  75. package/dist/packages/@ember/{-internals/routing/lib/system → routing/lib}/dsl.js +0 -0
  76. package/dist/packages/@ember/{-internals/routing/lib/system → routing/lib}/engines.js +0 -0
  77. package/dist/packages/@ember/{-internals/routing/lib/system → routing/lib}/generate_controller.js +0 -0
  78. package/dist/packages/@ember/{-internals/routing/lib/location/util.js → routing/lib/location-utils.js} +0 -0
  79. package/dist/packages/@ember/{-internals/routing/lib/system → routing/lib}/query_params.js +0 -0
  80. package/dist/packages/@ember/{-internals/routing/lib/system → routing/lib}/route-info.js +0 -0
  81. package/dist/packages/@ember/{-internals/routing/lib/system → routing/lib}/router_state.js +1 -1
  82. package/dist/packages/@ember/{-internals/routing/lib/services/routing.js → routing/lib/routing-service.js} +2 -2
  83. package/dist/packages/@ember/{-internals/routing/lib/system → routing/lib}/transition.js +0 -0
  84. package/dist/packages/@ember/{-internals/routing → routing}/lib/utils.js +0 -0
  85. package/dist/packages/@ember/routing/location.js +104 -1
  86. package/dist/packages/@ember/routing/none-location.js +123 -1
  87. package/dist/packages/@ember/routing/route.js +1700 -1
  88. package/dist/packages/@ember/routing/router-service.js +510 -1
  89. package/dist/packages/@ember/routing/router.js +1666 -1
  90. package/dist/packages/@ember/service/index.js +1 -1
  91. package/dist/packages/@ember/utils/index.js +7 -2
  92. package/dist/packages/@ember/{-internals/runtime → utils}/lib/compare.js +2 -2
  93. package/dist/packages/@ember/{-internals/runtime → utils}/lib/is-equal.js +0 -0
  94. package/dist/packages/@ember/utils/lib/is_blank.js +35 -0
  95. package/dist/packages/@ember/utils/lib/is_empty.js +68 -0
  96. package/dist/packages/@ember/utils/lib/is_none.js +27 -0
  97. package/dist/packages/@ember/utils/lib/is_present.js +38 -0
  98. package/dist/packages/@ember/{-internals/runtime → utils}/lib/type-of.js +2 -2
  99. package/dist/packages/ember/index.js +47 -28
  100. package/dist/packages/ember/version.js +1 -1
  101. package/dist/packages/ember-testing/lib/adapters/adapter.js +1 -1
  102. package/dist/packages/ember-testing/lib/helpers/current_path.js +2 -2
  103. package/dist/packages/ember-testing/lib/helpers/current_route_name.js +2 -2
  104. package/dist/packages/ember-testing/lib/helpers/current_url.js +1 -1
  105. package/docs/data.json +9428 -9189
  106. package/package.json +23 -8
  107. package/types/preview/@ember/-internals/resolver.d.ts +35 -0
  108. package/types/preview/@ember/application/-private/event-dispatcher.d.ts +18 -0
  109. package/types/preview/@ember/application/-private/registry.d.ts +15 -0
  110. package/types/preview/@ember/application/deprecations.d.ts +24 -0
  111. package/types/preview/@ember/application/index.d.ts +153 -0
  112. package/types/preview/@ember/application/instance.d.ts +9 -0
  113. package/types/preview/@ember/application/tsconfig.json +3 -0
  114. package/types/preview/@ember/application/types.d.ts +29 -0
  115. package/types/preview/@ember/array/-private/enumerable.d.ts +13 -0
  116. package/types/preview/@ember/array/-private/mutable-enumerable.d.ts +13 -0
  117. package/types/preview/@ember/array/-private/native-array.d.ts +23 -0
  118. package/types/preview/@ember/array/index.d.ts +243 -0
  119. package/types/preview/@ember/array/mutable.d.ts +94 -0
  120. package/types/preview/@ember/array/proxy.d.ts +29 -0
  121. package/types/preview/@ember/array/tsconfig.json +3 -0
  122. package/types/preview/@ember/component/-private/class-names-support.d.ts +27 -0
  123. package/types/preview/@ember/component/-private/core-view.d.ts +14 -0
  124. package/types/preview/@ember/component/-private/glimmer-interfaces.d.ts +45 -0
  125. package/types/preview/@ember/component/-private/signature-utils.d.ts +107 -0
  126. package/types/preview/@ember/component/-private/view-mixin.d.ts +59 -0
  127. package/types/preview/@ember/component/helper.d.ts +122 -0
  128. package/types/preview/@ember/component/index.d.ts +132 -0
  129. package/types/preview/@ember/component/template-only.d.ts +47 -0
  130. package/types/preview/@ember/component/tsconfig.json +3 -0
  131. package/types/preview/@ember/controller/index.d.ts +48 -0
  132. package/types/preview/@ember/controller/tsconfig.json +3 -0
  133. package/types/preview/@ember/debug/container-debug-adapter.d.ts +13 -0
  134. package/types/preview/@ember/debug/data-adapter.d.ts +64 -0
  135. package/types/preview/@ember/debug/index.d.ts +98 -0
  136. package/types/preview/@ember/debug/tsconfig.json +3 -0
  137. package/types/preview/@ember/destroyable/index.d.ts +23 -0
  138. package/types/preview/@ember/destroyable/tsconfig.json +3 -0
  139. package/types/preview/@ember/engine/-private/container-proxy-mixin.d.ts +17 -0
  140. package/types/preview/@ember/engine/-private/registry-proxy-mixin.d.ts +54 -0
  141. package/types/preview/@ember/engine/-private/types/initializer.d.ts +8 -0
  142. package/types/preview/@ember/engine/index.d.ts +45 -0
  143. package/types/preview/@ember/engine/instance.d.ts +24 -0
  144. package/types/preview/@ember/engine/tsconfig.json +3 -0
  145. package/types/preview/@ember/error/index.d.ts +6 -0
  146. package/types/preview/@ember/error/tsconfig.json +3 -0
  147. package/types/preview/@ember/helper/index.d.ts +49 -0
  148. package/types/preview/@ember/helper/tsconfig.json +3 -0
  149. package/types/preview/@ember/modifier/index.d.ts +33 -0
  150. package/types/preview/@ember/modifier/tsconfig.json +3 -0
  151. package/types/preview/@ember/object/-private/action-handler.d.ts +31 -0
  152. package/types/preview/@ember/object/-private/types.d.ts +63 -0
  153. package/types/preview/@ember/object/compat.d.ts +9 -0
  154. package/types/preview/@ember/object/computed.d.ts +263 -0
  155. package/types/preview/@ember/object/core.d.ts +89 -0
  156. package/types/preview/@ember/object/evented.d.ts +45 -0
  157. package/types/preview/@ember/object/events.d.ts +47 -0
  158. package/types/preview/@ember/object/index.d.ts +126 -0
  159. package/types/preview/@ember/object/internals.d.ts +17 -0
  160. package/types/preview/@ember/object/mixin.d.ts +19 -0
  161. package/types/preview/@ember/object/observable.d.ts +89 -0
  162. package/types/preview/@ember/object/observers.d.ts +34 -0
  163. package/types/preview/@ember/object/promise-proxy-mixin.d.ts +37 -0
  164. package/types/preview/@ember/object/proxy.d.ts +27 -0
  165. package/types/preview/@ember/object/tsconfig.json +3 -0
  166. package/types/preview/@ember/owner/index.d.ts +102 -0
  167. package/types/preview/@ember/owner/tsconfig.json +3 -0
  168. package/types/preview/@ember/polyfills/index.d.ts +23 -0
  169. package/types/preview/@ember/polyfills/tsconfig.json +3 -0
  170. package/types/preview/@ember/polyfills/types.d.ts +6 -0
  171. package/types/preview/@ember/routing/-private/router-dsl.d.ts +20 -0
  172. package/types/preview/@ember/routing/auto-location.d.ts +8 -0
  173. package/types/preview/@ember/routing/hash-location.d.ts +10 -0
  174. package/types/preview/@ember/routing/history-location.d.ts +9 -0
  175. package/types/preview/@ember/routing/index.d.ts +20 -0
  176. package/types/preview/@ember/routing/none-location.d.ts +11 -0
  177. package/types/preview/@ember/routing/route-info.d.ts +74 -0
  178. package/types/preview/@ember/routing/route.d.ts +533 -0
  179. package/types/preview/@ember/routing/router-service.d.ts +351 -0
  180. package/types/preview/@ember/routing/router.d.ts +49 -0
  181. package/types/preview/@ember/routing/transition.d.ts +126 -0
  182. package/types/preview/@ember/routing/tsconfig.json +3 -0
  183. package/types/preview/@ember/routing/types.d.ts +15 -0
  184. package/types/preview/@ember/runloop/-private/backburner.d.ts +43 -0
  185. package/types/preview/@ember/runloop/-private/types.d.ts +9 -0
  186. package/types/preview/@ember/runloop/index.d.ts +175 -0
  187. package/types/preview/@ember/runloop/tsconfig.json +3 -0
  188. package/types/preview/@ember/runloop/types.d.ts +5 -0
  189. package/types/preview/@ember/service/index.d.ts +25 -0
  190. package/types/preview/@ember/service/tsconfig.json +3 -0
  191. package/types/preview/@ember/string/index.d.ts +9 -0
  192. package/types/preview/@ember/string/tsconfig.json +3 -0
  193. package/types/preview/@ember/template/-private/handlebars.d.ts +7 -0
  194. package/types/preview/@ember/template/index.d.ts +5 -0
  195. package/types/preview/@ember/template/tsconfig.json +3 -0
  196. package/types/preview/@ember/test/adapter.d.ts +22 -0
  197. package/types/preview/@ember/test/index.d.ts +49 -0
  198. package/types/preview/@ember/test/tsconfig.json +3 -0
  199. package/types/preview/@ember/utils/-private/types.d.ts +39 -0
  200. package/types/preview/@ember/utils/index.d.ts +42 -0
  201. package/types/preview/@ember/utils/tsconfig.json +3 -0
  202. package/types/preview/ember/-private/type-utils.d.ts +54 -0
  203. package/types/preview/ember/index.d.ts +381 -0
  204. package/types/preview/ember/tsconfig.json +3 -0
  205. package/types/preview/index.d.ts +120 -0
  206. package/types/preview/tsconfig.json +6 -0
  207. package/blueprints/helper/mu-files/__root__/__collection__/__name__.js +0 -7
  208. package/blueprints-js/helper/mu-files/__root__/__collection__/__name__.js +0 -7
  209. package/dist/packages/@ember/-internals/extension-support/index.js +0 -2
  210. package/dist/packages/@ember/-internals/extension-support/lib/container_debug_adapter.js +0 -96
  211. package/dist/packages/@ember/-internals/extension-support/lib/data_adapter.js +0 -576
  212. package/dist/packages/@ember/-internals/routing/lib/ext/controller.js +0 -224
  213. package/dist/packages/@ember/-internals/routing/lib/location/api.js +0 -104
  214. package/dist/packages/@ember/-internals/routing/lib/location/auto_location.js +0 -250
  215. package/dist/packages/@ember/-internals/routing/lib/location/hash_location.js +0 -170
  216. package/dist/packages/@ember/-internals/routing/lib/location/history_location.js +0 -290
  217. package/dist/packages/@ember/-internals/routing/lib/location/none_location.js +0 -124
  218. package/dist/packages/@ember/-internals/routing/lib/services/router.js +0 -506
  219. package/dist/packages/@ember/-internals/routing/lib/system/route.js +0 -1696
  220. package/dist/packages/@ember/-internals/routing/lib/system/router.js +0 -1662
  221. package/dist/packages/@ember/-internals/runtime/lib/mixins/array.js +0 -1501
  222. package/dist/packages/@ember/-internals/runtime/lib/mixins/enumerable.js +0 -3
  223. package/dist/packages/@ember/-internals/runtime/lib/mixins/evented.js +0 -91
  224. package/dist/packages/@ember/-internals/runtime/lib/mixins/mutable_enumerable.js +0 -4
  225. package/dist/packages/@ember/-internals/runtime/lib/mixins/observable.js +0 -339
  226. package/dist/packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js +0 -149
  227. package/dist/packages/@ember/-internals/runtime/lib/system/array_proxy.js +0 -305
  228. package/dist/packages/@ember/-internals/runtime/lib/system/core_object.js +0 -730
  229. package/dist/packages/@ember/-internals/runtime/lib/system/namespace.js +0 -69
  230. package/dist/packages/@ember/-internals/runtime/lib/system/object_proxy.js +0 -7
  231. package/dist/packages/@ember/application/lib/application.js +0 -870
  232. package/dist/packages/@ember/controller/lib/controller_mixin.js +0 -42
  233. package/dist/packages/@ember/runloop/type-tests.ts/begin-end.test.js +0 -5
  234. package/dist/packages/@ember/runloop/type-tests.ts/bind.test.js +0 -59
  235. package/dist/packages/@ember/runloop/type-tests.ts/cancel.test.js +0 -5
  236. package/dist/packages/@ember/runloop/type-tests.ts/debounce.test.js +0 -77
  237. package/dist/packages/@ember/runloop/type-tests.ts/join.test.js +0 -38
  238. package/dist/packages/@ember/runloop/type-tests.ts/later.test.js +0 -38
  239. package/dist/packages/@ember/runloop/type-tests.ts/next.test.js +0 -38
  240. package/dist/packages/@ember/runloop/type-tests.ts/once.test.js +0 -38
  241. package/dist/packages/@ember/runloop/type-tests.ts/run.test.js +0 -38
  242. package/dist/packages/@ember/runloop/type-tests.ts/schedule-once.test.js +0 -39
  243. package/dist/packages/@ember/runloop/type-tests.ts/schedule.test.js +0 -39
  244. package/dist/packages/@ember/runloop/type-tests.ts/throttle.test.js +0 -77
@@ -0,0 +1,89 @@
1
+ declare module '@ember/object/observable' {
2
+ import { ObserverMethod } from '@ember/object/-private/types';
3
+ import Mixin from '@ember/object/mixin';
4
+ import CoreObject from '@ember/object/core';
5
+
6
+ /**
7
+ * This mixin provides properties and property observing functionality, core features of the Ember object model.
8
+ */
9
+ interface Observable extends CoreObject {
10
+ /**
11
+ * Retrieves the value of a property from the object.
12
+ */
13
+ get<K extends keyof this>(key: K): this[K];
14
+ get(key: string): unknown;
15
+ /**
16
+ * To get the values of multiple properties at once, call `getProperties`
17
+ * with a list of strings or an array:
18
+ */
19
+ getProperties<K extends keyof this>(list: K[]): Pick<this, K>;
20
+ getProperties<K extends keyof this>(...list: K[]): Pick<this, K>;
21
+ getProperties(list: string[]): Record<string, unknown>;
22
+ getProperties(...list: string[]): Record<string, unknown>;
23
+ /**
24
+ * Sets the provided key or path to the value.
25
+ */
26
+ set<K extends keyof this>(key: K, value: this[K]): this[K];
27
+ set<T>(key: keyof this, value: T): T;
28
+ set<T>(key: string, value: T): T;
29
+ /**
30
+ * Sets a list of properties at once. These properties are set inside
31
+ * a single `beginPropertyChanges` and `endPropertyChanges` batch, so
32
+ * observers will be buffered.
33
+ */
34
+ setProperties<K extends keyof this>(hash: Pick<this, K>): Pick<this, K>;
35
+ setProperties<K extends keyof this>(hash: Record<K, unknown>): Pick<this, K>;
36
+ setProperties<R extends Record<string, unknown>>(hash: R): R;
37
+ /**
38
+ * Notify the observer system that a property has just changed.
39
+ *
40
+ * Sometimes you need to change a value directly or indirectly without
41
+ * actually calling `get()` or `set()` on it. In this case, you can use this
42
+ * method instead. Calling this method will notify all observers that the
43
+ * property has potentially changed value.
44
+ */
45
+ notifyPropertyChange(keyName: string): this;
46
+ /**
47
+ * Adds an observer on a property.
48
+ */
49
+ addObserver<Target>(
50
+ key: keyof this,
51
+ target: Target,
52
+ method: ObserverMethod<Target, this>
53
+ ): this;
54
+ addObserver(key: keyof this, method: ObserverMethod<this, this>): this;
55
+ /**
56
+ * Remove an observer you have previously registered on this object. Pass
57
+ * the same key, target, and method you passed to `addObserver()` and your
58
+ * target will no longer receive notifications.
59
+ */
60
+ removeObserver<Target>(
61
+ key: keyof this,
62
+ target: Target,
63
+ method: ObserverMethod<Target, this>
64
+ ): this;
65
+ removeObserver(key: keyof this, method: ObserverMethod<this, this>): this;
66
+ /**
67
+ * Set the value of a property to the current value plus some amount.
68
+ */
69
+ incrementProperty(keyName: keyof this, increment?: number): number;
70
+ /**
71
+ * Set the value of a property to the current value minus some amount.
72
+ */
73
+ decrementProperty(keyName: keyof this, decrement?: number): number;
74
+ /**
75
+ * Set the value of a boolean property to the opposite of its
76
+ * current value.
77
+ */
78
+ toggleProperty(keyName: keyof this): boolean;
79
+ /**
80
+ * Returns the cached value of a computed property, if it exists.
81
+ * This allows you to inspect the value of a computed property
82
+ * without accidentally invoking it if it is intended to be
83
+ * generated lazily.
84
+ */
85
+ cacheFor<K extends keyof this>(key: K): this[K] | undefined;
86
+ }
87
+ const Observable: Mixin;
88
+ export default Observable;
89
+ }
@@ -0,0 +1,34 @@
1
+ declare module '@ember/object/observers' {
2
+ import { ObserverMethod } from '@ember/object/-private/types';
3
+
4
+ /**
5
+ * Adds an observer on a property.
6
+ */
7
+ export function addObserver<Context, Target>(
8
+ obj: Context,
9
+ key: keyof Context,
10
+ target: Target,
11
+ method: ObserverMethod<Target, Context>
12
+ ): void;
13
+ export function addObserver<Context>(
14
+ obj: Context,
15
+ key: keyof Context,
16
+ method: ObserverMethod<Context, Context>
17
+ ): void;
18
+ /**
19
+ * Remove an observer you have previously registered on this object. Pass
20
+ * the same key, target, and method you passed to `addObserver()` and your
21
+ * target will no longer receive notifications.
22
+ */
23
+ export function removeObserver<Context, Target>(
24
+ obj: Context,
25
+ key: keyof Context,
26
+ target: Target,
27
+ method: ObserverMethod<Target, Context>
28
+ ): any;
29
+ export function removeObserver<Context>(
30
+ obj: Context,
31
+ key: keyof Context,
32
+ method: ObserverMethod<Context, Context>
33
+ ): any;
34
+ }
@@ -0,0 +1,37 @@
1
+ declare module '@ember/object/promise-proxy-mixin' {
2
+ import Mixin from '@ember/object/mixin';
3
+ import RSVP from 'rsvp';
4
+
5
+ /**
6
+ * A low level mixin making ObjectProxy promise-aware.
7
+ */
8
+ interface PromiseProxyMixin<T> extends RSVP.Promise<T> {
9
+ /**
10
+ * If the proxied promise is rejected this will contain the reason
11
+ * provided.
12
+ */
13
+ reason: unknown;
14
+ /**
15
+ * Once the proxied promise has settled this will become `false`.
16
+ */
17
+ isPending: boolean;
18
+ /**
19
+ * Once the proxied promise has settled this will become `true`.
20
+ */
21
+ isSettled: boolean;
22
+ /**
23
+ * Will become `true` if the proxied promise is rejected.
24
+ */
25
+ isRejected: boolean;
26
+ /**
27
+ * Will become `true` if the proxied promise is fulfilled.
28
+ */
29
+ isFulfilled: boolean;
30
+ /**
31
+ * The promise whose fulfillment value is being proxied by this object.
32
+ */
33
+ promise: RSVP.Promise<T>;
34
+ }
35
+ const PromiseProxyMixin: Mixin;
36
+ export default PromiseProxyMixin;
37
+ }
@@ -0,0 +1,27 @@
1
+ declare module '@ember/object/proxy' {
2
+ import EmberObject from '@ember/object';
3
+
4
+ /**
5
+ * `Ember.ObjectProxy` forwards all properties not defined by the proxy itself
6
+ * to a proxied `content` object.
7
+ */
8
+ export default class ObjectProxy<T extends object = object> extends EmberObject {
9
+ /**
10
+ * The object whose properties will be forwarded.
11
+ */
12
+ content: T | undefined;
13
+
14
+ get<K extends keyof this>(key: K): this[K];
15
+ get<K extends keyof T>(key: K): T[K] | undefined;
16
+
17
+ getProperties<K extends keyof this>(list: K[]): Pick<this, K>;
18
+ getProperties<K extends keyof this>(...list: K[]): Pick<this, K>;
19
+ getProperties<K extends keyof T>(list: K[]): Pick<Partial<T>, K>;
20
+ getProperties<K extends keyof T>(...list: K[]): Pick<Partial<T>, K>;
21
+
22
+ set<K extends keyof this>(key: K, value: this[K]): this[K];
23
+ set<K extends keyof T>(key: K, value: T[K]): T[K];
24
+
25
+ setProperties<K extends keyof this | keyof T>(hash: Pick<this & T, K>): Pick<this & T, K>;
26
+ }
27
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../../tsconfig.json"
3
+ }
@@ -0,0 +1,102 @@
1
+ declare module '@ember/owner' {
2
+ /**
3
+ * The name for a factory consists of a namespace and the name of a specific
4
+ * type within that namespace, like `'service:session'`.
5
+ */
6
+ export type FullName = `${string}:${string}`;
7
+
8
+ // TODO: when migrating into Ember proper, evaluate whether we should introduce
9
+ // a registry which users can provide to resolve known types, so e.g.
10
+ // `owner.lookup('service:session')` can return the right thing.
11
+ /**
12
+ * Framework objects in an Ember application (components, services, routes,
13
+ * etc.) are created via a factory and dependency injection system. Each of
14
+ * these objects is the responsibility of an "owner", which handled its
15
+ * instantiation and manages its lifetime.
16
+ */
17
+ export default interface Owner {
18
+ /**
19
+ * Given a {@linkcode FullName} return a corresponding instance.
20
+ */
21
+ lookup(fullName: FullName): unknown;
22
+
23
+ /**
24
+ * Registers a factory or value that can be used for dependency injection
25
+ * (with `inject`) or for service lookup. Each factory is registered with a
26
+ * full name including two parts: `'type:name'`.
27
+ *
28
+ * - To override the default of instantiating the class on the `Factory`,
29
+ * pass the `{ instantiate: false }` option. This is useful when you have
30
+ * already instantiated the class to use with this factory.
31
+ * - To override the default singleton behavior and instead create multiple
32
+ * instances, pass the `{ singleton: false }` option.
33
+ */
34
+ // Dear future maintainer: yes, I know that `Factory<unknown> | object` is
35
+ // an exceedingly weird type here. This is how we type it internally in
36
+ // Ember itself. We actually allow more or less *anything* to be passed
37
+ // here. In the future, we may possibly be able to update this to actually
38
+ // take advantage of the `FullName` here to require that the registered
39
+ // factory and corresponding options do the right thing (passing an *actual*
40
+ // factory, not needing `create` if `options.instantiate` is `false`, etc.)
41
+ // but doing so will require rationalizing Ember's own internals and may
42
+ // need a full Ember RFC.
43
+ register(
44
+ fullName: FullName,
45
+ factory: Factory<unknown> | object,
46
+ options?: RegisterOptions
47
+ ): void;
48
+
49
+ /**
50
+ * Given a fullName of the form `'type:name'`, like `'route:application'`,
51
+ * return a corresponding factory manager.
52
+ *
53
+ * Any instances created via the factory's `.create()` method must be
54
+ * destroyed manually by the caller of `.create()`. Typically, this is done
55
+ * during the creating objects own `destroy` or `willDestroy` methods.
56
+ */
57
+ factoryFor(fullName: FullName): FactoryManager<unknown> | undefined;
58
+ }
59
+
60
+ export interface RegisterOptions {
61
+ instantiate?: boolean | undefined;
62
+ singleton?: boolean | undefined;
63
+ }
64
+
65
+ /**
66
+ * Registered factories are instantiated by having create called on them.
67
+ * Additionally they are singletons by default, so each time they are looked up
68
+ * they return the same instance.
69
+ *
70
+ * However, that behavior can be modified with the `instantiate` and `singleton`
71
+ * options to the {@linkcode Owner.register} method.
72
+ */
73
+ export interface Factory<T> {
74
+ /**
75
+ * A function that will create an instance of the class with any
76
+ * dependencies injected.
77
+ *
78
+ * @param initialValues Any values to set on an instance of the class
79
+ */
80
+ create(initialValues?: Partial<T>): T;
81
+ }
82
+
83
+ /**
84
+ * A manager which can be used for introspection of the factory's class or for
85
+ * the creation of factory instances with initial properties. The manager is an
86
+ * object with the following properties:
87
+ *
88
+ * - `class` - The registered or resolved class.
89
+ * - `create` - A function that will create an instance of the class with any
90
+ * dependencies injected.
91
+ *
92
+ * @note `FactoryManager` is *not* user-constructible; the only legal way to get
93
+ * a `FactoryManager` is via {@linkcode Owner.factoryFor}.
94
+ */
95
+ export interface FactoryManager<T> extends Factory<T> {
96
+ /** The registered or resolved class. */
97
+ readonly class: Factory<T>;
98
+ }
99
+
100
+ // Don't export things unless we *intend* to.
101
+ export {};
102
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../../tsconfig.json"
3
+ }
@@ -0,0 +1,23 @@
1
+ declare module '@ember/polyfills' {
2
+ import type { Mix, Mix3, Mix4 } from '@ember/polyfills/types';
3
+
4
+ /**
5
+ * Copy properties from a source object to a target object.
6
+ * @deprecated until v5.0. You should replace any calls to `Ember.assign` with
7
+ * `Object.assign` or use the object spread operator.
8
+ */
9
+ export function assign<T extends object, U extends object>(target: T, source: U): Mix<T, U>;
10
+ export function assign<T extends object, U extends object, V extends object>(
11
+ target: T,
12
+ source1: U,
13
+ source2: V
14
+ ): Mix3<T, U, V>;
15
+ export function assign<T extends object, U extends object, V extends object, W extends object>(
16
+ target: T,
17
+ source1: U,
18
+ source2: V,
19
+ source3: W
20
+ ): Mix4<T, U, V, W>;
21
+ export function assign(target: object, ...sources: object[]): unknown;
22
+ export function assign(target: object, final: undefined | null): never;
23
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../../tsconfig.json"
3
+ }
@@ -0,0 +1,6 @@
1
+ declare module '@ember/polyfills/types' {
2
+ export type Mix<A, B> = B & Pick<A, Exclude<keyof A, keyof B>>;
3
+ export type Mix3<A, B, C> = Mix<Mix<A, B>, C>;
4
+ export type Mix4<A, B, C, D> = Mix3<Mix<A, B>, C, D>;
5
+ export default Mix;
6
+ }
@@ -0,0 +1,20 @@
1
+ declare module '@ember/routing/-private/router-dsl' {
2
+ export default class RouterDSL {
3
+ constructor(name: string | null, options: object);
4
+ route(name: string, callback: (this: RouterDSL) => void): void;
5
+ route(
6
+ name: string,
7
+ options?: { path?: string | undefined; resetNamespace?: boolean | undefined },
8
+ callback?: (this: RouterDSL) => void
9
+ ): void;
10
+ mount(
11
+ name: string,
12
+ options?: {
13
+ as?: string | undefined;
14
+ path?: string | undefined;
15
+ resetNamespace?: boolean | undefined;
16
+ engineInfo?: unknown;
17
+ }
18
+ ): void;
19
+ }
20
+ }
@@ -0,0 +1,8 @@
1
+ declare module '@ember/routing/auto-location' {
2
+ import EmberObject from '@ember/object';
3
+
4
+ /**
5
+ * AutoLocation will select the best location option based off browser support with the priority order: history, hash, none.
6
+ */
7
+ export default class AutoLocation extends EmberObject {}
8
+ }
@@ -0,0 +1,10 @@
1
+ declare module '@ember/routing/hash-location' {
2
+ import EmberObject from '@ember/object';
3
+
4
+ /**
5
+ * `Ember.HashLocation` implements the location API using the browser's
6
+ * hash. At present, it relies on a `hashchange` event existing in the
7
+ * browser.
8
+ */
9
+ export default class HashLocation extends EmberObject {}
10
+ }
@@ -0,0 +1,9 @@
1
+ declare module '@ember/routing/history-location' {
2
+ import EmberObject from '@ember/object';
3
+
4
+ /**
5
+ * Ember.HistoryLocation implements the location API using the browser's
6
+ * history.pushState API.
7
+ */
8
+ export default class HistoryLocation extends EmberObject {}
9
+ }
@@ -0,0 +1,20 @@
1
+ declare module '@ember/routing' {
2
+ export { default as Route } from '@ember/routing/route';
3
+ export { default as Router } from '@ember/routing/router';
4
+
5
+ import { Opaque } from 'ember/-private/type-utils';
6
+
7
+ // In normal TypeScript, this component is essentially an opaque token
8
+ // that just needs to be importable. Declaring it with a unique interface
9
+ // like this, however, gives tools like Glint (that DO have a richer
10
+ // notion of what it is) a place to install more detailed type information.
11
+ export interface LinkTo extends Opaque<'component:link-to'> {}
12
+
13
+ /**
14
+ * The `LinkTo` component renders a link to the supplied `route` passing
15
+ * an optionally supplied model to the route as its `model` context of the route.
16
+ *
17
+ * @see https://api.emberjs.com/ember/4.1/classes/Ember.Templates.components/methods/LinkTo?anchor=LinkTo
18
+ */
19
+ export const LinkTo: LinkTo;
20
+ }
@@ -0,0 +1,11 @@
1
+ declare module '@ember/routing/none-location' {
2
+ import EmberObject from '@ember/object';
3
+
4
+ /**
5
+ * Ember.NoneLocation does not interact with the browser. It is useful for
6
+ * testing, or when you need to manage state with your Router, but temporarily
7
+ * don't want it to muck with the URL (for example when you embed your
8
+ * application in a larger page).
9
+ */
10
+ export default class NoneLocation extends EmberObject {}
11
+ }
@@ -0,0 +1,74 @@
1
+ declare module '@ember/routing/route-info' {
2
+ // https://api.emberjs.com/ember/4.0/classes/RouteInfo
3
+ /**
4
+ * A `RouteInfo` is an object that contains metadata about a specific route within a `Transition`.
5
+ * It is read-only and internally immutable.
6
+ * It is also not observable, because a `Transition` instance is never changed after creation.
7
+ */
8
+ export default interface RouteInfo {
9
+ /**
10
+ * A reference to the childe route's `RouteInfo`.
11
+ * This can be used to traverse downward to the leafmost `RouteInfo`.
12
+ */
13
+ readonly child: RouteInfo | null;
14
+ /**
15
+ * The final segment of the fully-qualified name of the route, like "index".
16
+ */
17
+ readonly localName: string;
18
+ /**
19
+ * The dot-separated, fully-qualified name of the route, like "people.index".
20
+ */
21
+ readonly name: string;
22
+ /**
23
+ * The ordered list of the names of the params required for this route.
24
+ * It will contain the same strings as `Object.keys(params)`, but here the order is significant.
25
+ * This allows users to correctly pass params into routes programmatically.
26
+ */
27
+ readonly paramNames: string[];
28
+ /**
29
+ * The values of the route's parameters.
30
+ * These are the same params that are received as arguments to the route's `model` hook.
31
+ * Contains only the parameters valid for this route, if any (params for parent or child routes are not merged).
32
+ */
33
+ readonly params: { [key: string]: string | undefined };
34
+ /**
35
+ * A reference to the parent route's `RouteInfo`.
36
+ * This can be used to traverse upward to the topmost `RouteInfo`.
37
+ */
38
+ readonly parent: RouteInfo | null;
39
+ /**
40
+ * The values of any query params on this route.
41
+ */
42
+ readonly queryParams: { [key: string]: string | undefined };
43
+ /**
44
+ * Will contain the result `Route#buildRouteInfoMetadata`
45
+ * for the corresponding Route.
46
+ */
47
+ readonly metadata: unknown;
48
+ /**
49
+ * Allows you to traverse through the linked list of `RouteInfo`s from the topmost to leafmost.
50
+ * Returns the first `RouteInfo` in the linked list for which the callback returns true.
51
+ *
52
+ * @param callback the callback to execute.
53
+ */
54
+ find(callback: (item: RouteInfo) => boolean): RouteInfo | undefined;
55
+ }
56
+
57
+ // https://api.emberjs.com/ember/4.0/classes/RouteInfoWithAttributes
58
+ /**
59
+ * A `RouteInfoWithAttributes` is an object that contains
60
+ * metadata, including the resolved value from the routes
61
+ * `model` hook. Like `RouteInfo`, a `RouteInfoWithAttributes`
62
+ * represents a specific route within a Transition.
63
+ * It is read-only and internally immutable. It is also not
64
+ * observable, because a Transition instance is never
65
+ * changed after creation.
66
+ */
67
+ export interface RouteInfoWithAttributes extends RouteInfo {
68
+ /**
69
+ * This is the resolved return value from the
70
+ * route's model hook.
71
+ */
72
+ readonly attributes: unknown;
73
+ }
74
+ }