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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-source",
3
- "version": "4.8.0-alpha.5",
3
+ "version": "4.8.0-beta.2",
4
4
  "description": "A JavaScript framework for creating ambitious web applications",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -25,7 +25,8 @@
25
25
  "dist/ember-testing.js",
26
26
  "dist/ember-testing.map",
27
27
  "docs/data.json",
28
- "lib"
28
+ "lib",
29
+ "types"
29
30
  ],
30
31
  "repository": {
31
32
  "type": "git",
@@ -40,7 +41,9 @@
40
41
  "lint:docs": "qunit tests/docs/coverage-test.js",
41
42
  "lint:eslint": "eslint --report-unused-disable-directives --cache .",
42
43
  "lint:eslint:fix": "npm-run-all \"lint:eslint --fix\"",
43
- "lint:tsc": "tsc --noEmit",
44
+ "lint:tsc:stable": "tsc --noEmit",
45
+ "lint:tsc:preview": "tsc --noEmit --project type-tests/preview",
46
+ "lint:tsc": "npm-run-all lint:tsc:*",
44
47
  "lint:fix": "npm-run-all lint:*:fix",
45
48
  "test": "node bin/run-tests.js",
46
49
  "test:blueprints:js": "mocha node-tests/blueprints/**/*-test.js",
@@ -80,6 +83,7 @@
80
83
  "devDependencies": {
81
84
  "@babel/preset-env": "^7.16.11",
82
85
  "@glimmer/compiler": "0.84.2",
86
+ "@glimmer/component": "^1.1.2",
83
87
  "@glimmer/destroyable": "0.84.2",
84
88
  "@glimmer/env": "^0.1.7",
85
89
  "@glimmer/global-context": "0.84.2",
@@ -93,7 +97,8 @@
93
97
  "@glimmer/runtime": "0.84.2",
94
98
  "@glimmer/validator": "0.84.2",
95
99
  "@simple-dom/document": "^1.4.0",
96
- "@types/qunit": "^2.11.3",
100
+ "@tsconfig/ember": "^1.0.1",
101
+ "@types/qunit": "^2.19.2",
97
102
  "@types/rsvp": "^4.0.4",
98
103
  "@typescript-eslint/eslint-plugin": "^5.22.0",
99
104
  "@typescript-eslint/parser": "^5.15.0",
@@ -142,11 +147,11 @@
142
147
  "npm-run-all": "^4.1.5",
143
148
  "prettier": "^2.7.1",
144
149
  "puppeteer": "^13.5.1",
145
- "qunit": "^2.18.1",
150
+ "qunit": "^2.19.1",
146
151
  "rollup-plugin-commonjs": "^9.3.4",
147
152
  "rollup-plugin-node-resolve": "^4.2.4",
148
153
  "route-recognizer": "^0.3.4",
149
- "router_js": "^8.0.2",
154
+ "router_js": "^8.0.3",
150
155
  "rsvp": "^4.8.5",
151
156
  "serve-static": "^1.14.2",
152
157
  "simple-dom": "^1.4.0",
@@ -154,15 +159,25 @@
154
159
  "testem-failure-only-reporter": "^1.0.0",
155
160
  "typescript": "~4.6.4"
156
161
  },
162
+ "peerDependencies": {
163
+ "@glimmer/component": "^1.1.2"
164
+ },
157
165
  "engines": {
158
166
  "node": ">= 12.*"
159
167
  },
160
168
  "ember-addon": {
161
169
  "after": "ember-cli-legacy-blueprints"
162
170
  },
163
- "_originalVersion": "4.8.0-alpha.5",
171
+ "typesVersions": {
172
+ "*": {
173
+ "preview": [
174
+ "./types/preview"
175
+ ]
176
+ }
177
+ },
178
+ "_originalVersion": "4.8.0-beta.2",
164
179
  "_versionPreviouslyCalculated": true,
165
180
  "publishConfig": {
166
- "tag": "alpha"
181
+ "tag": "beta"
167
182
  }
168
183
  }
@@ -0,0 +1,35 @@
1
+ declare module '@ember/-internals/resolver' {
2
+ /**
3
+ * @module
4
+ * @private This is not a public API module, and in fact ***there is no such
5
+ * module at runtime***. This module exists only to provide a public API for
6
+ * `Resolver`, which will get a dedicated home as part of Ember's public API
7
+ * via a future RFC. As an end user, if you need access to `Resolver` for now
8
+ * you should ordinarily get it via `ember-resolver`.
9
+ */
10
+
11
+ import EmberObject from '@ember/object';
12
+ import type { Factory, FullName } from '@ember/owner';
13
+
14
+ export type KnownForTypeResult<Type extends string> = {
15
+ [fullName in `${Type}:${string}`]: boolean | undefined;
16
+ };
17
+
18
+ /**
19
+ * A `Resolver` is the mechanism responsible for looking up code in your
20
+ * application and converting its naming conventions into the actual classes,
21
+ * functions, and templates that Ember needs to resolve its dependencies, for
22
+ * example, what template to render for a given route. It is a system that helps
23
+ * the app resolve the lookup of JavaScript modules agnostic of what kind of
24
+ * module system is used, which can be AMD, CommonJS or just plain globals. It
25
+ * is used to lookup routes, models, components, templates, or anything that is
26
+ * used in your Ember app.
27
+ */
28
+ export interface Resolver extends EmberObject {
29
+ knownForType?: <TypeName extends string>(type: TypeName) => KnownForTypeResult<TypeName>;
30
+ lookupDescription?: (fullName: FullName) => string;
31
+ makeToString?: (factory: Factory<object>, fullName: FullName) => string;
32
+ normalize?: (fullName: FullName) => string;
33
+ resolve(name: string): Factory<object> | object | undefined;
34
+ }
35
+ }
@@ -0,0 +1,18 @@
1
+ declare module '@ember/application/-private/event-dispatcher' {
2
+ import { EventDispatcherEvents } from '@ember/application/types';
3
+
4
+ /**
5
+ * `Ember.EventDispatcher` handles delegating browser events to their
6
+ * corresponding `Ember.Views.` For example, when you click on a view,
7
+ * `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets
8
+ * called.
9
+ */
10
+ export default class EventDispatcher extends Object {
11
+ /**
12
+ * The set of events names (and associated handler function names) to be setup
13
+ * and dispatched by the `EventDispatcher`. Modifications to this list can be done
14
+ * at setup time, generally via the `Ember.Application.customEvents` hash.
15
+ */
16
+ events: EventDispatcherEvents;
17
+ }
18
+ }
@@ -0,0 +1,15 @@
1
+ declare module '@ember/application/-private/registry' {
2
+ import { EmberClassConstructor } from '@ember/object/-private/types';
3
+
4
+ /**
5
+ * A registry used to store factory and option information keyed
6
+ * by type.
7
+ */
8
+ export default class Registry {
9
+ register(
10
+ fullName: string,
11
+ factory: EmberClassConstructor<unknown>,
12
+ options?: { singleton?: boolean | undefined }
13
+ ): void;
14
+ }
15
+ }
@@ -0,0 +1,24 @@
1
+ declare module '@ember/application/deprecations' {
2
+ import { AnyFn } from 'ember/-private/type-utils';
3
+
4
+ interface DeprecationOptions {
5
+ id: string;
6
+ until: string;
7
+ url?: string | undefined;
8
+ }
9
+
10
+ /**
11
+ * Display a deprecation warning with the provided message and a stack trace
12
+ * (Chrome and Firefox only).
13
+ */
14
+ export function deprecate(message: string, test: boolean, options: DeprecationOptions): void;
15
+
16
+ /**
17
+ * Alias an old, deprecated method with its new counterpart.
18
+ */
19
+ export function deprecateFunc<Func extends AnyFn>(
20
+ message: string,
21
+ options: DeprecationOptions,
22
+ func: Func
23
+ ): Func;
24
+ }
@@ -0,0 +1,153 @@
1
+ declare module '@ember/application' {
2
+ import Engine from '@ember/engine';
3
+ import ApplicationInstance from '@ember/application/instance';
4
+ import EventDispatcher from '@ember/application/-private/event-dispatcher';
5
+ import { EventDispatcherEvents } from '@ember/application/types';
6
+ import { Router } from '@ember/routing';
7
+ import Registry from '@ember/application/-private/registry';
8
+ import type { Resolver } from '@ember/-internals/resolver';
9
+ import { AnyFn } from 'ember/-private/type-utils';
10
+ import Owner from '@ember/owner';
11
+ import type GlimmerComponent from '@glimmer/component';
12
+ import EmberObject from '@ember/object';
13
+
14
+ // Shut off default exporting; we don't want anything but the *intended*
15
+ // public API present.
16
+ export {};
17
+
18
+ /**
19
+ * An instance of Ember.Application is the starting point for every Ember application. It helps to
20
+ * instantiate, initialize and coordinate the many objects that make up your app.
21
+ */
22
+ export default class Application extends Engine {
23
+ /**
24
+ * Call advanceReadiness after any asynchronous setup logic has completed.
25
+ * Each call to deferReadiness must be matched by a call to advanceReadiness
26
+ * or the application will never become ready and routing will not begin.
27
+ */
28
+ advanceReadiness(): void;
29
+ /**
30
+ * Use this to defer readiness until some condition is true.
31
+ *
32
+ * This allows you to perform asynchronous setup logic and defer
33
+ * booting your application until the setup has finished.
34
+ *
35
+ * However, if the setup requires a loading UI, it might be better
36
+ * to use the router for this purpose.
37
+ */
38
+ deferReadiness(): void;
39
+ /**
40
+ * defines an injection or typeInjection
41
+ */
42
+ inject(factoryNameOrType: string, property: string, injectionName: string): void;
43
+ /**
44
+ * This injects the test helpers into the window's scope. If a function of the
45
+ * same name has already been defined it will be cached (so that it can be reset
46
+ * if the helper is removed with `unregisterHelper` or `removeTestHelpers`).
47
+ * Any callbacks registered with `onInjectHelpers` will be called once the
48
+ * helpers have been injected.
49
+ */
50
+ injectTestHelpers(): void;
51
+ /**
52
+ * registers a factory for later injection
53
+ * @param fullName type:name (e.g., 'model:user')
54
+ * @param factory (e.g., App.Person)
55
+ */
56
+ register(
57
+ fullName: string,
58
+ factory: unknown,
59
+ options?: { singleton?: boolean | undefined; instantiate?: boolean | undefined }
60
+ ): void;
61
+ /**
62
+ * This removes all helpers that have been registered, and resets and functions
63
+ * that were overridden by the helpers.
64
+ */
65
+ removeTestHelpers(): void;
66
+ /**
67
+ * Reset the application. This is typically used only in tests.
68
+ */
69
+ reset(): void;
70
+ /**
71
+ * This hook defers the readiness of the application, so that you can start
72
+ * the app when your tests are ready to run. It also sets the router's
73
+ * location to 'none', so that the window's location will not be modified
74
+ * (preventing both accidental leaking of state between tests and interference
75
+ * with your testing framework).
76
+ */
77
+ setupForTesting(): void;
78
+ /**
79
+ * The DOM events for which the event dispatcher should listen.
80
+ */
81
+ customEvents: EventDispatcherEvents;
82
+ /**
83
+ * The Ember.EventDispatcher responsible for delegating events to this application's views.
84
+ */
85
+ eventDispatcher: EventDispatcher;
86
+ /**
87
+ * Set this to provide an alternate class to `DefaultResolver`
88
+ */
89
+ resolver: Resolver | null;
90
+ /**
91
+ * The root DOM element of the Application. This can be specified as an
92
+ * element or a jQuery-compatible selector string.
93
+ *
94
+ * This is the element that will be passed to the Application's, eventDispatcher,
95
+ * which sets up the listeners for event delegation. Every view in your application
96
+ * should be a child of the element you specify here.
97
+ */
98
+ rootElement: HTMLElement | string;
99
+ /**
100
+ * Called when the Application has become ready.
101
+ * The call will be delayed until the DOM has become ready.
102
+ */
103
+ ready: AnyFn;
104
+ /**
105
+ * Application's router.
106
+ */
107
+ Router: Router;
108
+ registry: Registry;
109
+ /**
110
+ * Initialize the application and return a promise that resolves with the `Application`
111
+ * object when the boot process is complete.
112
+ */
113
+ boot(): Promise<Application>;
114
+ /**
115
+ * Create an ApplicationInstance for this Application.
116
+ */
117
+ buildInstance(options?: object): ApplicationInstance;
118
+ }
119
+
120
+ // Known framework objects, so that `getOwner` can always, accurately, return
121
+ // `Owner` when working with one of these classes, which the framework *does*
122
+ // guarantee will always have an `Owner`. NOTE: this must be kept up to date
123
+ // whenever we add new base classes to the framework. For example, if we
124
+ // introduce a standalone `Service` or `Route` base class which *does not*
125
+ // extend from `EmberObject`, it will need to be added here.
126
+ type FrameworkObject = EmberObject | GlimmerComponent;
127
+
128
+ /**
129
+ * Framework objects in an Ember application (components, services, routes, etc.)
130
+ * are created via a factory and dependency injection system. Each of these
131
+ * objects is the responsibility of an "owner", which handled its
132
+ * instantiation and manages its lifetime.
133
+ */
134
+ export function getOwner(object: FrameworkObject): Owner;
135
+ export function getOwner(object: unknown): Owner | undefined;
136
+ /**
137
+ * `setOwner` forces a new owner on a given object instance. This is primarily
138
+ * useful in some testing cases.
139
+ */
140
+ export function setOwner(object: unknown, owner: Owner): void;
141
+
142
+ /**
143
+ * Detects when a specific package of Ember (e.g. 'Ember.Application')
144
+ * has fully loaded and is available for extension.
145
+ */
146
+ export function onLoad(name: string, callback: AnyFn): unknown;
147
+
148
+ /**
149
+ * Called when an Ember.js package (e.g Ember.Application) has finished
150
+ * loading. Triggers any callbacks registered for this event.
151
+ */
152
+ export function runLoadHooks(name: string, object?: {}): unknown;
153
+ }
@@ -0,0 +1,9 @@
1
+ declare module '@ember/application/instance' {
2
+ import EngineInstance from '@ember/engine/instance';
3
+
4
+ /**
5
+ * The `ApplicationInstance` encapsulates all of the stateful aspects of a
6
+ * running `Application`.
7
+ */
8
+ export default class ApplicationInstance extends EngineInstance {}
9
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../../tsconfig.json"
3
+ }
@@ -0,0 +1,29 @@
1
+ declare module '@ember/application/types' {
2
+ export interface EventDispatcherEvents {
3
+ touchstart?: string | null | undefined;
4
+ touchmove?: string | null | undefined;
5
+ touchend?: string | null | undefined;
6
+ touchcancel?: string | null | undefined;
7
+ keydown?: string | null | undefined;
8
+ keyup?: string | null | undefined;
9
+ keypress?: string | null | undefined;
10
+ mousedown?: string | null | undefined;
11
+ mouseup?: string | null | undefined;
12
+ contextmenu?: string | null | undefined;
13
+ click?: string | null | undefined;
14
+ dblclick?: string | null | undefined;
15
+ focusin?: string | null | undefined;
16
+ focusout?: string | null | undefined;
17
+ submit?: string | null | undefined;
18
+ input?: string | null | undefined;
19
+ change?: string | null | undefined;
20
+ dragstart?: string | null | undefined;
21
+ drag?: string | null | undefined;
22
+ dragenter?: string | null | undefined;
23
+ dragleave?: string | null | undefined;
24
+ dragover?: string | null | undefined;
25
+ drop?: string | null | undefined;
26
+ dragend?: string | null | undefined;
27
+ [event: string]: string | null | undefined;
28
+ }
29
+ }
@@ -0,0 +1,13 @@
1
+ declare module '@ember/array/-private/enumerable' {
2
+ import Mixin from '@ember/object/mixin';
3
+
4
+ /**
5
+ * The methods in this mixin have been moved to `MutableArray`. This mixin has
6
+ * been intentionally preserved to avoid breaking `Enumerable.detect` checks
7
+ * until the community migrates away from them.
8
+ */
9
+ interface Enumerable {}
10
+
11
+ const Enumerable: Mixin;
12
+ export default Enumerable;
13
+ }
@@ -0,0 +1,13 @@
1
+ declare module '@ember/array/-private/mutable-enumerable' {
2
+ import Mixin from '@ember/object/mixin';
3
+ import Enumerable from '@ember/array/-private/enumerable';
4
+
5
+ /**
6
+ * This Mixin exists for historical purposes only, and so that someone walking
7
+ * the types for Ember's arrays sees the same types as those which appear in
8
+ * the runtime hierarchy.
9
+ */
10
+ interface MutableEnumerable extends Enumerable {}
11
+ const MutableEnumerable: Mixin;
12
+ export default MutableEnumerable;
13
+ }
@@ -0,0 +1,23 @@
1
+ declare module '@ember/array/-private/native-array' {
2
+ import Observable from '@ember/object/observable';
3
+ import MutableArray from '@ember/array/mutable';
4
+ import Mixin from '@ember/object/mixin';
5
+
6
+ // Get an alias to the global Array type to use in inner scope below.
7
+ type Array<T> = T[];
8
+
9
+ /**
10
+ * The NativeArray mixin contains the properties needed to make the native
11
+ * Array support Ember.MutableArray and all of its dependent APIs. Unless you
12
+ * have `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Array` set to
13
+ * false, this will be applied automatically. Otherwise you can apply the mixin
14
+ * at anytime by calling `Ember.NativeArray.apply(Array.prototype)`.
15
+ */
16
+ interface NativeArray<T>
17
+ extends Omit<Array<T>, 'every' | 'filter' | 'find' | 'forEach' | 'map' | 'reduce' | 'slice'>,
18
+ Observable,
19
+ MutableArray<T> {}
20
+
21
+ const NativeArray: Mixin;
22
+ export default NativeArray;
23
+ }
@@ -0,0 +1,243 @@
1
+ declare module '@ember/array' {
2
+ import { MethodNamesOf, MethodParams, MethodReturns } from 'ember/-private/type-utils';
3
+ import Mixin from '@ember/object/mixin';
4
+ import Enumerable from '@ember/array/-private/enumerable';
5
+ import NativeArray from '@ember/array/-private/native-array';
6
+
7
+ /**
8
+ * This module implements Observer-friendly Array-like behavior. This mixin is picked up by the
9
+ * Array class as well as other controllers, etc. that want to appear to be arrays.
10
+ */
11
+ interface Array<T> extends Enumerable {
12
+ /**
13
+ * __Required.__ You must implement this method to apply this mixin.
14
+ */
15
+ length: number;
16
+ /**
17
+ * Returns the object at the given `index`. If the given `index` is negative
18
+ * or is greater or equal than the array length, returns `undefined`.
19
+ */
20
+ objectAt(idx: number): T | undefined;
21
+ /**
22
+ * This returns the objects at the specified indexes, using `objectAt`.
23
+ */
24
+ objectsAt(indexes: number[]): Array<T | undefined>;
25
+ /**
26
+ * Helper method returns the first object from a collection. This is usually
27
+ * used by bindings and other parts of the framework to extract a single
28
+ * object if the enumerable contains only one item.
29
+ */
30
+ firstObject: T | undefined;
31
+ /**
32
+ * Helper method returns the last object from a collection. If your enumerable
33
+ * contains only one object, this method should always return that object.
34
+ * If your enumerable is empty, this method should return `undefined`.
35
+ */
36
+ lastObject: T | undefined;
37
+ /**
38
+ * Returns a new array that is a slice of the receiver. This implementation
39
+ * uses the observable array methods to retrieve the objects for the new
40
+ * slice.
41
+ */
42
+ slice(beginIndex?: number, endIndex?: number): NativeArray<T>;
43
+ /**
44
+ * Returns the index of the given object's first occurrence.
45
+ * If no `startAt` argument is given, the starting location to
46
+ * search is 0. If it's negative, will count backward from
47
+ * the end of the array. Returns -1 if no match is found.
48
+ */
49
+ indexOf(searchElement: T, fromIndex?: number): number;
50
+ /**
51
+ * Returns the index of the given object's last occurrence.
52
+ * If no `startAt` argument is given, the search starts from
53
+ * the last position. If it's negative, will count backward
54
+ * from the end of the array. Returns -1 if no match is found.
55
+ */
56
+ lastIndexOf(searchElement: T, fromIndex?: number): number;
57
+ /**
58
+ * Iterates through the enumerable, calling the passed function on each
59
+ * item. This method corresponds to the `forEach()` method defined in
60
+ * JavaScript 1.6.
61
+ */
62
+ forEach<Target>(
63
+ callback: (this: Target, item: T, index: number, arr: this) => void,
64
+ target?: Target
65
+ ): this;
66
+ /**
67
+ * Alias for `mapBy`
68
+ */
69
+ getEach<K extends keyof T>(key: K): NativeArray<T[K]>;
70
+ /**
71
+ * Sets the value on the named property for each member. This is more
72
+ * ergonomic than using other methods defined on this helper. If the object
73
+ * implements Ember.Observable, the value will be changed to `set(),` otherwise
74
+ * it will be set directly. `null` objects are skipped.
75
+ */
76
+ setEach<K extends keyof T>(key: K, value: T[K]): void;
77
+ /**
78
+ * Maps all of the items in the enumeration to another value, returning
79
+ * a new array. This method corresponds to `map()` defined in JavaScript 1.6.
80
+ */
81
+ map<U, Target>(
82
+ callback: (this: Target, item: T, index: number, arr: this) => U,
83
+ target?: Target
84
+ ): NativeArray<U>;
85
+ /**
86
+ * Similar to map, this specialized function returns the value of the named
87
+ * property on all items in the enumeration.
88
+ */
89
+ mapBy<K extends keyof T>(key: K): NativeArray<T[K]>;
90
+ mapBy(key: string): NativeArray<unknown>;
91
+ /**
92
+ * Returns an array with all of the items in the enumeration that the passed
93
+ * function returns true for. This method corresponds to `filter()` defined in
94
+ * JavaScript 1.6.
95
+ */
96
+ filter<Target>(
97
+ callback: (this: Target, item: T, index: number, arr: this) => unknown,
98
+ target?: Target
99
+ ): NativeArray<T>;
100
+ /**
101
+ * Returns an array with all of the items in the enumeration where the passed
102
+ * function returns false. This method is the inverse of filter().
103
+ */
104
+ reject<Target>(
105
+ callback: (this: Target, item: T, index: number, arr: this) => unknown,
106
+ target?: Target
107
+ ): NativeArray<T>;
108
+ /**
109
+ * Returns an array with just the items with the matched property. You
110
+ * can pass an optional second argument with the target value. Otherwise
111
+ * this will match any property that evaluates to `true`.
112
+ */
113
+ filterBy<K extends keyof T>(key: K, value?: T[K]): NativeArray<T>;
114
+ /**
115
+ * Returns an array with the items that do not have truthy values for
116
+ * key. You can pass an optional second argument with the target value. Otherwise
117
+ * this will match any property that evaluates to false.
118
+ */
119
+ rejectBy<K extends keyof T>(key: K, value?: T[K]): NativeArray<T>;
120
+ /**
121
+ * Returns the first item in the array for which the callback returns true.
122
+ * This method works similar to the `filter()` method defined in JavaScript 1.6
123
+ * except that it will stop working on the array once a match is found.
124
+ */
125
+ find<S extends T, Target = void>(
126
+ predicate: (this: void, value: T, index: number, obj: T[]) => value is S,
127
+ thisArg?: Target
128
+ ): S | undefined;
129
+ find<Target = void>(
130
+ callback: (this: Target, item: T, index: number, arr: this) => unknown,
131
+ target?: Target
132
+ ): T | undefined;
133
+ /**
134
+ * Returns the first item with a property matching the passed value. You
135
+ * can pass an optional second argument with the target value. Otherwise
136
+ * this will match any property that evaluates to `true`.
137
+ */
138
+ findBy<K extends keyof T>(key: K, value?: T[K]): T | undefined;
139
+ /**
140
+ * Returns `true` if the passed function returns true for every item in the
141
+ * enumeration. This corresponds with the `every()` method in JavaScript 1.6.
142
+ */
143
+ every<Target = void>(
144
+ callback: (this: Target, item: T, index: number, arr: this) => unknown,
145
+ target?: Target
146
+ ): boolean;
147
+ /**
148
+ * Returns `true` if the passed property resolves to the value of the second
149
+ * argument for all items in the enumerable. This method is often simpler/faster
150
+ * than using a callback.
151
+ */
152
+ isEvery<K extends keyof T>(key: K, value?: T[K]): boolean;
153
+ /**
154
+ * Returns `true` if the passed function returns true for any item in the
155
+ * enumeration.
156
+ */
157
+ any<Target = void>(
158
+ callback: (this: Target, item: T, index: number, arr: this) => unknown,
159
+ target?: Target
160
+ ): boolean;
161
+ /**
162
+ * Returns `true` if the passed property resolves to the value of the second
163
+ * argument for any item in the enumerable. This method is often simpler/faster
164
+ * than using a callback.
165
+ */
166
+ isAny<K extends keyof T>(key: K, value?: T[K]): boolean;
167
+ /**
168
+ * This will combine the values of the enumerator into a single value. It
169
+ * is a useful way to collect a summary value from an enumeration. This
170
+ * corresponds to the `reduce()` method defined in JavaScript 1.8.
171
+ */
172
+ reduce: T[]['reduce'];
173
+ /**
174
+ * Invokes the named method on every object in the receiver that
175
+ * implements it. This method corresponds to the implementation in
176
+ * Prototype 1.6.
177
+ */
178
+ invoke<M extends MethodNamesOf<T>>(
179
+ methodName: M,
180
+ ...args: MethodParams<T, M>
181
+ ): Array<MethodReturns<T, M>>;
182
+ /**
183
+ * Simply converts the enumerable into a genuine array. The order is not
184
+ * guaranteed. Corresponds to the method implemented by Prototype.
185
+ */
186
+ toArray(): T[];
187
+ /**
188
+ * Returns a copy of the array with all `null` and `undefined` elements removed.
189
+ */
190
+ compact(): NativeArray<NonNullable<T>>;
191
+ /**
192
+ * Returns `true` if the passed object can be found in the enumerable.
193
+ */
194
+ includes(searchElement: T, fromIndex?: number): boolean;
195
+ /**
196
+ * Converts the enumerable into an array and sorts by the keys
197
+ * specified in the argument.
198
+ */
199
+ sortBy(...properties: string[]): NativeArray<T>;
200
+ /**
201
+ * Returns a new enumerable that excludes the passed value. The default
202
+ * implementation returns an array regardless of the receiver type.
203
+ * If the receiver does not contain the value it returns the original enumerable.
204
+ */
205
+ without(value: T): NativeArray<T>;
206
+ /**
207
+ * Returns a new enumerable that contains only unique values. The default
208
+ * implementation returns an array regardless of the receiver type.
209
+ */
210
+ uniq(): NativeArray<T>;
211
+ /**
212
+ * Returns a new enumerable that contains only items containing a unique property value.
213
+ * The default implementation returns an array regardless of the receiver type.
214
+ */
215
+ uniqBy(property: string): NativeArray<T>;
216
+ uniqBy(callback: (value: T) => unknown): NativeArray<T>;
217
+ /**
218
+ * This is the handler for the special array content property. If you get
219
+ * this property, it will return this. If you set this property to a new
220
+ * array, it will replace the current content.
221
+ */
222
+ get '[]'(): NativeArray<T>;
223
+ set '[]'(newValue: NativeArray<T>);
224
+ }
225
+ // Ember.Array rather than Array because the `array-type` lint rule doesn't realize the global is shadowed
226
+ const Array: Mixin;
227
+ export default Array;
228
+
229
+ /**
230
+ * Creates an `Ember.NativeArray` from an Array like object.
231
+ * Does not modify the original object's contents. Ember.A is not needed if
232
+ * `EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However,
233
+ * it is recommended that you use Ember.A when creating addons for
234
+ * ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES`
235
+ * will be `true`.
236
+ */
237
+ export function A<T>(arr?: T[]): NativeArray<T>;
238
+
239
+ /**
240
+ * Returns true if the passed object is an array or Array-like.
241
+ */
242
+ export function isArray(obj: unknown): obj is ArrayLike<unknown>;
243
+ }