@angular/core 7.0.0-rc.1 → 7.0.3

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 (337) hide show
  1. package/bundles/core-testing.umd.js +36 -33
  2. package/bundles/core-testing.umd.js.map +1 -1
  3. package/bundles/core-testing.umd.min.js +3 -3
  4. package/bundles/core-testing.umd.min.js.map +1 -1
  5. package/bundles/core.umd.js +1856 -1463
  6. package/bundles/core.umd.js.map +1 -1
  7. package/bundles/core.umd.min.js +155 -94
  8. package/bundles/core.umd.min.js.map +1 -1
  9. package/core.d.ts +7 -6
  10. package/core.metadata.json +1 -1
  11. package/esm2015/core.externs.js +0 -3
  12. package/esm2015/core.js +6 -6
  13. package/esm2015/index.js +2 -2
  14. package/esm2015/public_api.js +2 -2
  15. package/esm2015/src/application_init.js +5 -1
  16. package/esm2015/src/application_module.js +2 -2
  17. package/esm2015/src/application_ref.js +11 -9
  18. package/esm2015/src/application_tokens.js +7 -7
  19. package/esm2015/src/change_detection/change_detection_util.js +3 -1
  20. package/esm2015/src/change_detection/change_detector_ref.js +2 -1
  21. package/esm2015/src/change_detection/constants.js +1 -1
  22. package/esm2015/src/change_detection/differs/default_iterable_differ.js +2 -1
  23. package/esm2015/src/change_detection/differs/iterable_differs.js +8 -6
  24. package/esm2015/src/change_detection/differs/keyvalue_differs.js +6 -5
  25. package/esm2015/src/change_detection/pipe_transform.js +2 -2
  26. package/esm2015/src/core.js +2 -2
  27. package/esm2015/src/core_render3_private_export.js +5 -4
  28. package/esm2015/src/debug/debug_node.js +6 -6
  29. package/esm2015/src/di/defs.js +5 -5
  30. package/esm2015/src/di/forward_ref.js +4 -4
  31. package/esm2015/src/di/injectable.js +5 -2
  32. package/esm2015/src/di/injection_token.js +3 -1
  33. package/esm2015/src/di/injector.js +3 -3
  34. package/esm2015/src/di/metadata.js +16 -1
  35. package/esm2015/src/di/provider.js +16 -6
  36. package/esm2015/src/di/r3_injector.js +2 -2
  37. package/esm2015/src/di/reflective_injector.js +2 -2
  38. package/esm2015/src/di/reflective_key.js +3 -1
  39. package/esm2015/src/di/reflective_provider.js +3 -3
  40. package/esm2015/src/error_handler.js +3 -1
  41. package/esm2015/src/event_emitter.js +2 -1
  42. package/esm2015/src/i18n/tokens.js +4 -4
  43. package/esm2015/src/is_dev_mode.js +4 -2
  44. package/esm2015/src/ivy_switch/runtime/index.js +2 -2
  45. package/esm2015/src/ivy_switch/runtime/ivy_switch_on.js +4 -2
  46. package/esm2015/src/ivy_switch/runtime/jit.js +2 -2
  47. package/esm2015/src/ivy_switch/runtime/legacy.js +7 -1
  48. package/esm2015/src/ivy_switch/runtime/local.js +2 -2
  49. package/esm2015/src/linker/compiler.js +5 -4
  50. package/esm2015/src/linker/component_factory.js +4 -2
  51. package/esm2015/src/linker/component_factory_resolver.js +2 -1
  52. package/esm2015/src/linker/element_ref.js +2 -2
  53. package/esm2015/src/linker/ng_module_factory.js +3 -3
  54. package/esm2015/src/linker/ng_module_factory_loader.js +4 -3
  55. package/esm2015/src/linker/query_list.js +3 -1
  56. package/esm2015/src/linker/system_js_ng_module_factory_loader.js +3 -3
  57. package/esm2015/src/linker/template_ref.js +2 -1
  58. package/esm2015/src/linker/view_container_ref.js +2 -1
  59. package/esm2015/src/linker/view_ref.js +4 -2
  60. package/esm2015/src/metadata/di.js +13 -5
  61. package/esm2015/src/metadata/directives.js +20 -7
  62. package/esm2015/src/metadata/lifecycle_hooks.js +10 -5
  63. package/esm2015/src/metadata/ng_module.js +8 -6
  64. package/esm2015/src/metadata/view.js +1 -1
  65. package/esm2015/src/platform_core_providers.js +2 -2
  66. package/esm2015/src/profile/profile.js +5 -5
  67. package/esm2015/src/profile/wtf_impl.js +2 -2
  68. package/esm2015/src/r3_symbols.js +1 -1
  69. package/esm2015/src/reflection/reflection_capabilities.js +3 -3
  70. package/esm2015/src/render/api.js +20 -7
  71. package/esm2015/src/render3/component.js +52 -18
  72. package/esm2015/src/render3/component_ref.js +15 -15
  73. package/esm2015/src/render3/context_discovery.js +35 -126
  74. package/esm2015/src/render3/debug.js +33 -56
  75. package/esm2015/src/render3/definition.js +42 -37
  76. package/esm2015/src/render3/di.js +4 -28
  77. package/esm2015/src/render3/discovery_utils.js +10 -7
  78. package/esm2015/src/render3/i18n.js +60 -34
  79. package/esm2015/src/render3/index.js +3 -3
  80. package/esm2015/src/render3/instructions.js +162 -275
  81. package/esm2015/src/render3/interfaces/container.js +7 -5
  82. package/esm2015/src/render3/interfaces/context.js +60 -0
  83. package/esm2015/src/render3/interfaces/definition.js +7 -1
  84. package/esm2015/src/render3/interfaces/i18n.js +338 -0
  85. package/esm2015/src/render3/interfaces/node.js +12 -126
  86. package/esm2015/src/render3/interfaces/player.js +73 -1
  87. package/esm2015/src/render3/interfaces/styling.js +18 -22
  88. package/esm2015/src/render3/interfaces/view.js +19 -26
  89. package/esm2015/src/render3/jit/compiler_facade.js +22 -0
  90. package/esm2015/src/render3/jit/compiler_facade_interface.js +229 -0
  91. package/esm2015/src/render3/jit/directive.js +57 -93
  92. package/esm2015/src/render3/jit/environment.js +7 -3
  93. package/esm2015/src/render3/jit/injectable.js +21 -46
  94. package/esm2015/src/render3/jit/module.js +16 -43
  95. package/esm2015/src/render3/jit/pipe.js +6 -12
  96. package/esm2015/src/render3/jit/util.js +14 -17
  97. package/esm2015/src/render3/node_assert.js +1 -1
  98. package/esm2015/src/render3/node_manipulation.js +99 -109
  99. package/esm2015/src/render3/players.js +67 -0
  100. package/esm2015/src/render3/styling/class_and_style_bindings.js +347 -88
  101. package/esm2015/src/render3/styling/core_player_handler.js +2 -2
  102. package/esm2015/src/render3/styling/player_factory.js +48 -0
  103. package/esm2015/src/render3/styling/util.js +165 -17
  104. package/esm2015/src/render3/util.js +73 -20
  105. package/esm2015/src/render3/view_engine_compatibility.js +56 -40
  106. package/esm2015/src/sanitization/security.js +2 -2
  107. package/esm2015/src/testability/testability.js +5 -6
  108. package/esm2015/src/type.js +5 -2
  109. package/esm2015/src/util/decorators.js +2 -1
  110. package/esm2015/src/util.js +15 -1
  111. package/esm2015/src/version.js +6 -4
  112. package/esm2015/src/view/refs.js +3 -3
  113. package/esm2015/src/view/services.js +8 -6
  114. package/esm2015/src/zone/ng_zone.js +2 -2
  115. package/esm2015/testing/src/async.js +2 -2
  116. package/esm2015/testing/src/component_fixture.js +2 -2
  117. package/esm2015/testing/src/fake_async.js +7 -7
  118. package/esm2015/testing/src/fake_async_fallback.js +7 -7
  119. package/esm2015/testing/src/metadata_override.js +1 -1
  120. package/esm2015/testing/src/r3_test_bed.js +8 -6
  121. package/esm2015/testing/src/test_bed.js +10 -8
  122. package/esm2015/testing/src/test_bed_common.js +6 -6
  123. package/esm2015/testing/src/test_compiler.js +3 -3
  124. package/esm5/core.js +6 -6
  125. package/esm5/src/application_init.js +5 -1
  126. package/esm5/src/application_module.js +2 -2
  127. package/esm5/src/application_ref.js +11 -9
  128. package/esm5/src/application_tokens.js +7 -7
  129. package/esm5/src/change_detection/change_detection_util.js +3 -1
  130. package/esm5/src/change_detection/change_detector_ref.js +2 -1
  131. package/esm5/src/change_detection/constants.js +2 -1
  132. package/esm5/src/change_detection/differs/default_iterable_differ.js +2 -1
  133. package/esm5/src/change_detection/differs/iterable_differs.js +2 -1
  134. package/esm5/src/change_detection/differs/keyvalue_differs.js +2 -1
  135. package/esm5/src/change_detection/pipe_transform.js +1 -1
  136. package/esm5/src/core_render3_private_export.js +5 -4
  137. package/esm5/src/debug/debug_node.js +5 -5
  138. package/esm5/src/di/defs.js +3 -3
  139. package/esm5/src/di/forward_ref.js +3 -3
  140. package/esm5/src/di/injectable.js +6 -5
  141. package/esm5/src/di/injection_token.js +3 -1
  142. package/esm5/src/di/injector.js +3 -3
  143. package/esm5/src/di/metadata.js +6 -1
  144. package/esm5/src/di/provider.js +1 -1
  145. package/esm5/src/di/r3_injector.js +2 -2
  146. package/esm5/src/di/reflective_injector.js +2 -2
  147. package/esm5/src/di/reflective_key.js +3 -1
  148. package/esm5/src/di/reflective_provider.js +2 -2
  149. package/esm5/src/error_handler.js +3 -1
  150. package/esm5/src/event_emitter.js +2 -1
  151. package/esm5/src/i18n/tokens.js +5 -5
  152. package/esm5/src/is_dev_mode.js +4 -2
  153. package/esm5/src/ivy_switch/runtime/ivy_switch_on.js +3 -2
  154. package/esm5/src/ivy_switch/runtime/legacy.js +4 -1
  155. package/esm5/src/linker/compiler.js +5 -4
  156. package/esm5/src/linker/component_factory.js +5 -1
  157. package/esm5/src/linker/component_factory_resolver.js +4 -1
  158. package/esm5/src/linker/element_ref.js +2 -2
  159. package/esm5/src/linker/ng_module_factory.js +3 -3
  160. package/esm5/src/linker/ng_module_factory_loader.js +4 -3
  161. package/esm5/src/linker/query_list.js +3 -1
  162. package/esm5/src/linker/system_js_ng_module_factory_loader.js +3 -3
  163. package/esm5/src/linker/template_ref.js +2 -1
  164. package/esm5/src/linker/view_container_ref.js +2 -1
  165. package/esm5/src/linker/view_ref.js +4 -2
  166. package/esm5/src/metadata/di.js +10 -3
  167. package/esm5/src/metadata/directives.js +9 -6
  168. package/esm5/src/metadata/lifecycle_hooks.js +1 -1
  169. package/esm5/src/metadata/ng_module.js +4 -3
  170. package/esm5/src/metadata/view.js +4 -1
  171. package/esm5/src/platform_core_providers.js +2 -2
  172. package/esm5/src/profile/profile.js +5 -5
  173. package/esm5/src/profile/wtf_impl.js +1 -1
  174. package/esm5/src/r3_symbols.js +1 -1
  175. package/esm5/src/reflection/reflection_capabilities.js +3 -3
  176. package/esm5/src/render/api.js +11 -5
  177. package/esm5/src/render3/component.js +45 -16
  178. package/esm5/src/render3/component_ref.js +12 -13
  179. package/esm5/src/render3/context_discovery.js +33 -65
  180. package/esm5/src/render3/debug.js +31 -50
  181. package/esm5/src/render3/definition.js +35 -31
  182. package/esm5/src/render3/di.js +4 -20
  183. package/esm5/src/render3/discovery_utils.js +12 -7
  184. package/esm5/src/render3/i18n.js +40 -30
  185. package/esm5/src/render3/index.js +3 -3
  186. package/esm5/src/render3/instructions.js +143 -230
  187. package/esm5/src/render3/interfaces/container.js +6 -5
  188. package/esm5/src/render3/interfaces/context.js +13 -0
  189. package/esm5/src/render3/interfaces/definition.js +1 -1
  190. package/esm5/src/render3/interfaces/i18n.js +25 -0
  191. package/esm5/src/render3/interfaces/node.js +1 -1
  192. package/esm5/src/render3/interfaces/player.js +1 -1
  193. package/esm5/src/render3/interfaces/styling.js +1 -8
  194. package/esm5/src/render3/interfaces/view.js +18 -17
  195. package/esm5/src/render3/jit/compiler_facade.js +21 -0
  196. package/esm5/src/render3/jit/compiler_facade_interface.js +15 -0
  197. package/esm5/src/render3/jit/directive.js +44 -79
  198. package/esm5/src/render3/jit/environment.js +7 -3
  199. package/esm5/src/render3/jit/injectable.js +26 -46
  200. package/esm5/src/render3/jit/module.js +16 -31
  201. package/esm5/src/render3/jit/pipe.js +6 -9
  202. package/esm5/src/render3/jit/util.js +12 -17
  203. package/esm5/src/render3/node_assert.js +1 -1
  204. package/esm5/src/render3/node_manipulation.js +89 -101
  205. package/esm5/src/render3/players.js +59 -0
  206. package/esm5/src/render3/styling/class_and_style_bindings.js +248 -85
  207. package/esm5/src/render3/styling/core_player_handler.js +2 -2
  208. package/esm5/src/render3/styling/player_factory.js +29 -0
  209. package/esm5/src/render3/styling/util.js +132 -14
  210. package/esm5/src/render3/util.js +54 -21
  211. package/esm5/src/render3/view_engine_compatibility.js +46 -32
  212. package/esm5/src/sanitization/security.js +3 -3
  213. package/esm5/src/testability/testability.js +4 -4
  214. package/esm5/src/type.js +2 -2
  215. package/esm5/src/util/decorators.js +1 -1
  216. package/esm5/src/util.js +13 -1
  217. package/esm5/src/version.js +6 -3
  218. package/esm5/src/view/refs.js +1 -1
  219. package/esm5/src/view/services.js +7 -10
  220. package/esm5/src/zone/ng_zone.js +2 -2
  221. package/esm5/testing/src/async.js +2 -2
  222. package/esm5/testing/src/component_fixture.js +2 -2
  223. package/esm5/testing/src/fake_async.js +7 -7
  224. package/esm5/testing/src/fake_async_fallback.js +7 -7
  225. package/esm5/testing/src/metadata_override.js +1 -1
  226. package/esm5/testing/src/r3_test_bed.js +8 -7
  227. package/esm5/testing/src/test_bed.js +10 -8
  228. package/esm5/testing/src/test_bed_common.js +4 -4
  229. package/esm5/testing/src/test_compiler.js +3 -3
  230. package/fesm2015/core.js +2486 -1951
  231. package/fesm2015/core.js.map +1 -1
  232. package/fesm2015/testing.js +36 -32
  233. package/fesm2015/testing.js.map +1 -1
  234. package/fesm5/core.js +1830 -1439
  235. package/fesm5/core.js.map +1 -1
  236. package/fesm5/testing.js +36 -33
  237. package/fesm5/testing.js.map +1 -1
  238. package/package.json +1 -2
  239. package/src/application_init.d.ts +4 -0
  240. package/src/application_module.d.ts +1 -1
  241. package/src/application_ref.d.ts +10 -8
  242. package/src/application_tokens.d.ts +6 -6
  243. package/src/change_detection/change_detection_util.d.ts +2 -0
  244. package/src/change_detection/change_detector_ref.d.ts +1 -0
  245. package/src/change_detection/constants.d.ts +1 -0
  246. package/src/change_detection/differs/default_iterable_differ.d.ts +1 -0
  247. package/src/change_detection/differs/iterable_differs.d.ts +8 -6
  248. package/src/change_detection/differs/keyvalue_differs.d.ts +5 -4
  249. package/src/change_detection/pipe_transform.d.ts +1 -1
  250. package/src/core_render3_private_export.d.ts +7 -5
  251. package/src/debug/debug_node.d.ts +5 -5
  252. package/src/di/defs.d.ts +4 -4
  253. package/src/di/forward_ref.d.ts +3 -3
  254. package/src/di/injectable.d.ts +10 -7
  255. package/src/di/injection_token.d.ts +2 -0
  256. package/src/di/injector.d.ts +5 -3
  257. package/src/di/metadata.d.ts +24 -1
  258. package/src/di/provider.d.ts +19 -5
  259. package/src/di/r3_injector.d.ts +1 -1
  260. package/src/di/reflective_injector.d.ts +1 -1
  261. package/src/di/reflective_key.d.ts +2 -0
  262. package/src/di/reflective_provider.d.ts +2 -2
  263. package/src/error_handler.d.ts +2 -0
  264. package/src/event_emitter.d.ts +1 -0
  265. package/src/i18n/tokens.d.ts +4 -4
  266. package/src/is_dev_mode.d.ts +3 -1
  267. package/src/ivy_switch/runtime/ivy_switch_on.d.ts +2 -1
  268. package/src/ivy_switch/runtime/legacy.d.ts +3 -0
  269. package/src/linker/compiler.d.ts +5 -4
  270. package/src/linker/component_factory.d.ts +5 -1
  271. package/src/linker/component_factory_resolver.d.ts +3 -0
  272. package/src/linker/element_ref.d.ts +1 -1
  273. package/src/linker/ng_module_factory.d.ts +2 -2
  274. package/src/linker/ng_module_factory_loader.d.ts +3 -2
  275. package/src/linker/query_list.d.ts +2 -0
  276. package/src/linker/system_js_ng_module_factory_loader.d.ts +2 -2
  277. package/src/linker/template_ref.d.ts +1 -0
  278. package/src/linker/view_container_ref.d.ts +1 -0
  279. package/src/linker/view_ref.d.ts +3 -1
  280. package/src/metadata/di.d.ts +13 -5
  281. package/src/metadata/directives.d.ts +19 -6
  282. package/src/metadata/lifecycle_hooks.d.ts +9 -4
  283. package/src/metadata/ng_module.d.ts +7 -7
  284. package/src/metadata/view.d.ts +3 -0
  285. package/src/platform_core_providers.d.ts +1 -1
  286. package/src/profile/profile.d.ts +4 -4
  287. package/src/profile/wtf_impl.d.ts +1 -1
  288. package/src/r3_symbols.d.ts +1 -1
  289. package/src/render/api.d.ts +10 -7
  290. package/src/render3/component.d.ts +14 -3
  291. package/src/render3/context_discovery.d.ts +6 -58
  292. package/src/render3/definition.d.ts +0 -4
  293. package/src/render3/di.d.ts +1 -3
  294. package/src/render3/discovery_utils.d.ts +7 -1
  295. package/src/render3/i18n.d.ts +4 -0
  296. package/src/render3/index.d.ts +2 -2
  297. package/src/render3/instructions.d.ts +43 -50
  298. package/src/render3/interfaces/container.d.ts +36 -22
  299. package/src/render3/interfaces/context.d.ts +52 -0
  300. package/src/render3/interfaces/definition.d.ts +8 -3
  301. package/src/render3/interfaces/i18n.d.ts +326 -0
  302. package/src/render3/interfaces/node.d.ts +12 -89
  303. package/src/render3/interfaces/player.d.ts +58 -4
  304. package/src/render3/interfaces/styling.d.ts +17 -15
  305. package/src/render3/interfaces/view.d.ts +28 -28
  306. package/src/render3/jit/compiler_facade.d.ts +3 -0
  307. package/src/render3/jit/compiler_facade_interface.d.ts +131 -0
  308. package/src/render3/jit/directive.d.ts +3 -0
  309. package/src/render3/jit/util.d.ts +3 -3
  310. package/src/render3/node_manipulation.d.ts +21 -22
  311. package/src/render3/players.d.ts +32 -0
  312. package/src/render3/styling/class_and_style_bindings.d.ts +31 -24
  313. package/src/render3/styling/player_factory.d.ts +31 -0
  314. package/src/render3/styling/util.d.ts +31 -9
  315. package/src/render3/util.d.ts +32 -15
  316. package/src/render3/view_engine_compatibility.d.ts +3 -0
  317. package/src/sanitization/security.d.ts +2 -2
  318. package/src/testability/testability.d.ts +5 -6
  319. package/src/type.d.ts +6 -1
  320. package/src/util/decorators.d.ts +1 -0
  321. package/src/util.d.ts +10 -0
  322. package/src/version.d.ts +4 -1
  323. package/src/view/services.d.ts +2 -2
  324. package/src/zone/ng_zone.d.ts +1 -1
  325. package/testing/src/async.d.ts +1 -1
  326. package/testing/src/component_fixture.d.ts +1 -1
  327. package/testing/src/fake_async.d.ts +6 -6
  328. package/testing/src/fake_async_fallback.d.ts +6 -6
  329. package/testing/src/metadata_override.d.ts +1 -1
  330. package/testing/src/r3_test_bed.d.ts +4 -4
  331. package/testing/src/test_bed.d.ts +12 -10
  332. package/testing/src/test_bed_common.d.ts +6 -6
  333. package/testing/src/test_compiler.d.ts +2 -2
  334. package/testing/testing.metadata.json +1 -1
  335. package/esm2015/src/render3/player.js +0 -51
  336. package/esm5/src/render3/player.js +0 -39
  337. package/src/render3/player.d.ts +0 -3
@@ -8,30 +8,32 @@
8
8
  import { Injector } from '../../di/injector';
9
9
  import { QueryList } from '../../linker';
10
10
  import { Sanitizer } from '../../sanitization/security';
11
- import { PlayerHandler } from '../interfaces/player';
12
11
  import { LContainer } from './container';
13
12
  import { ComponentDef, ComponentQuery, ComponentTemplate, DirectiveDef, DirectiveDefList, HostBindingsFunction, PipeDef, PipeDefList } from './definition';
14
13
  import { TElementNode, TNode, TViewNode } from './node';
14
+ import { PlayerHandler } from './player';
15
15
  import { LQueries } from './query';
16
- import { Renderer3 } from './renderer';
16
+ import { RElement, Renderer3 } from './renderer';
17
+ import { StylingContext } from './styling';
17
18
  /** Size of LViewData's header. Necessary to adjust for it when setting slots. */
18
- export declare const HEADER_OFFSET = 16;
19
+ export declare const HEADER_OFFSET = 17;
19
20
  export declare const TVIEW = 0;
20
- export declare const PARENT = 1;
21
- export declare const NEXT = 2;
22
- export declare const QUERIES = 3;
23
- export declare const FLAGS = 4;
24
- export declare const HOST_NODE = 5;
25
- export declare const BINDING_INDEX = 6;
26
- export declare const CLEANUP = 7;
27
- export declare const CONTEXT = 8;
28
- export declare const INJECTOR = 9;
29
- export declare const RENDERER = 10;
30
- export declare const SANITIZER = 11;
31
- export declare const TAIL = 12;
32
- export declare const CONTAINER_INDEX = 13;
33
- export declare const CONTENT_QUERIES = 14;
34
- export declare const DECLARATION_VIEW = 15;
21
+ export declare const FLAGS = 1;
22
+ export declare const PARENT = 2;
23
+ export declare const NEXT = 3;
24
+ export declare const QUERIES = 4;
25
+ export declare const HOST = 5;
26
+ export declare const HOST_NODE = 6;
27
+ export declare const BINDING_INDEX = 7;
28
+ export declare const CLEANUP = 8;
29
+ export declare const CONTEXT = 9;
30
+ export declare const INJECTOR = 10;
31
+ export declare const RENDERER = 11;
32
+ export declare const SANITIZER = 12;
33
+ export declare const TAIL = 13;
34
+ export declare const CONTAINER_INDEX = 14;
35
+ export declare const CONTENT_QUERIES = 15;
36
+ export declare const DECLARATION_VIEW = 16;
35
37
  export interface OpaqueViewState {
36
38
  '__brand__': 'Brand for OpaqueViewState that nothing will match';
37
39
  }
@@ -52,6 +54,8 @@ export interface LViewData extends Array<any> {
52
54
  * directive defs are stored).
53
55
  */
54
56
  [TVIEW]: TView;
57
+ /** Flags for this view. See LViewFlags for more info. */
58
+ [FLAGS]: LViewFlags;
55
59
  /**
56
60
  * The parent view is needed when we exit the view and must restore the previous
57
61
  * `LViewData`. Without this, the render method would have to keep a stack of
@@ -73,8 +77,12 @@ export interface LViewData extends Array<any> {
73
77
  [NEXT]: LViewData | LContainer | null;
74
78
  /** Queries active for this view - nodes from a view are reported to those queries. */
75
79
  [QUERIES]: LQueries | null;
76
- /** Flags for this view. See LViewFlags for more info. */
77
- [FLAGS]: LViewFlags;
80
+ /**
81
+ * The host node for this LViewData instance, if this is a component view.
82
+ *
83
+ * If this is an embedded view, HOST will be null.
84
+ */
85
+ [HOST]: RElement | StylingContext | null;
78
86
  /**
79
87
  * Pointer to the `TViewNode` or `TElementNode` which represents the root of the view.
80
88
  *
@@ -294,14 +302,6 @@ export interface TView {
294
302
  * - String, temporary 'CIRCULAR' token set while dependencies are being resolved
295
303
  */
296
304
  currentMatches: CurrentMatchesList | null;
297
- /**
298
- * Directive and component defs that have already been matched to nodes on
299
- * this view.
300
- *
301
- * Defs are stored at the same index in TView.directives[] as their instances
302
- * are stored in LView.directives[]. This simplifies lookup in DI.
303
- */
304
- directives: DirectiveDefList | null;
305
305
  /**
306
306
  * Set of instructions used to process host bindings efficiently.
307
307
  *
@@ -0,0 +1,3 @@
1
+ import { CompilerFacade } from './compiler_facade_interface';
2
+ export * from './compiler_facade_interface';
3
+ export declare function getCompilerFacade(): CompilerFacade;
@@ -0,0 +1,131 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ /**
9
+ * A set of interfaces which are shared between `@angular/core` and `@angular/compiler` to allow
10
+ * for late binding of `@angular/compiler` for JIT purposes.
11
+ *
12
+ * This file has two copies. Please ensure that they are in sync:
13
+ * - packages/compiler/src/compiler_facade_interface.ts (master)
14
+ * - packages/core/src/render3/jit/compiler_facade_interface.ts (copy)
15
+ *
16
+ * Please ensure that the two files are in sync using this command:
17
+ * ```
18
+ * cp packages/compiler/src/compiler_facade_interface.ts \
19
+ * packages/core/src/render3/jit/compiler_facade_interface.ts
20
+ * ```
21
+ */
22
+ export interface ExportedCompilerFacade {
23
+ ɵcompilerFacade: CompilerFacade;
24
+ }
25
+ export interface CompilerFacade {
26
+ compilePipe(angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3PipeMetadataFacade): any;
27
+ compileInjectable(angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3InjectableMetadataFacade): any;
28
+ compileInjector(angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3InjectorMetadataFacade): any;
29
+ compileNgModule(angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3NgModuleMetadataFacade): any;
30
+ compileDirective(angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3DirectiveMetadataFacade): any;
31
+ compileComponent(angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3ComponentMetadataFacade): any;
32
+ R3ResolvedDependencyType: typeof R3ResolvedDependencyType;
33
+ }
34
+ export interface CoreEnvironment {
35
+ [name: string]: Function;
36
+ }
37
+ export declare type StringMap = {
38
+ [key: string]: string;
39
+ };
40
+ export declare type StringMapWithRename = {
41
+ [key: string]: string | [string, string];
42
+ };
43
+ export declare type Provider = any;
44
+ export declare enum R3ResolvedDependencyType {
45
+ Token = 0,
46
+ Attribute = 1,
47
+ Injector = 2
48
+ }
49
+ export interface R3DependencyMetadataFacade {
50
+ token: any;
51
+ resolved: R3ResolvedDependencyType;
52
+ host: boolean;
53
+ optional: boolean;
54
+ self: boolean;
55
+ skipSelf: boolean;
56
+ }
57
+ export interface R3PipeMetadataFacade {
58
+ name: string;
59
+ type: any;
60
+ pipeName: string;
61
+ deps: R3DependencyMetadataFacade[] | null;
62
+ pure: boolean;
63
+ }
64
+ export interface R3InjectableMetadataFacade {
65
+ name: string;
66
+ type: any;
67
+ ctorDeps: R3DependencyMetadataFacade[] | null;
68
+ providedIn: any;
69
+ useClass?: any;
70
+ useFactory?: any;
71
+ useExisting?: any;
72
+ useValue?: any;
73
+ userDeps?: R3DependencyMetadataFacade[];
74
+ }
75
+ export interface R3NgModuleMetadataFacade {
76
+ type: any;
77
+ bootstrap: Function[];
78
+ declarations: Function[];
79
+ imports: Function[];
80
+ exports: Function[];
81
+ emitInline: boolean;
82
+ }
83
+ export interface R3InjectorMetadataFacade {
84
+ name: string;
85
+ type: any;
86
+ deps: R3DependencyMetadataFacade[] | null;
87
+ providers: any;
88
+ imports: any;
89
+ }
90
+ export interface R3DirectiveMetadataFacade {
91
+ name: string;
92
+ type: any;
93
+ typeArgumentCount: number;
94
+ typeSourceSpan: null;
95
+ deps: R3DependencyMetadataFacade[] | null;
96
+ selector: string | null;
97
+ queries: R3QueryMetadataFacade[];
98
+ host: {
99
+ [key: string]: string;
100
+ };
101
+ propMetadata: {
102
+ [key: string]: any[];
103
+ };
104
+ lifecycle: {
105
+ usesOnChanges: boolean;
106
+ };
107
+ inputs: string[];
108
+ outputs: string[];
109
+ usesInheritance: boolean;
110
+ exportAs: string | null;
111
+ providers: Provider[] | null;
112
+ }
113
+ export interface R3ComponentMetadataFacade extends R3DirectiveMetadataFacade {
114
+ template: string;
115
+ preserveWhitespaces: boolean;
116
+ animations: any[] | undefined;
117
+ viewQueries: R3QueryMetadataFacade[];
118
+ pipes: Map<string, any>;
119
+ directives: Map<string, any>;
120
+ styles: string[];
121
+ encapsulation: ViewEncapsulation;
122
+ viewProviders: Provider[] | null;
123
+ }
124
+ export declare type ViewEncapsulation = number;
125
+ export interface R3QueryMetadataFacade {
126
+ propertyName: string;
127
+ first: boolean;
128
+ predicate: any | string[];
129
+ descendants: boolean;
130
+ read: any | null;
131
+ }
@@ -5,8 +5,10 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
+ import { Query } from '../../metadata/di';
8
9
  import { Component, Directive } from '../../metadata/directives';
9
10
  import { Type } from '../../type';
11
+ import { R3QueryMetadataFacade } from './compiler_facade_interface';
10
12
  /**
11
13
  * Compile an Angular component according to its decorator metadata, and patch the resulting
12
14
  * ngComponentDef onto the component type.
@@ -26,3 +28,4 @@ export declare function compileComponent(type: Type<any>, metadata: Component):
26
28
  */
27
29
  export declare function compileDirective(type: Type<any>, directive: Directive): void;
28
30
  export declare function extendsDirectlyFromObject(type: Type<any>): boolean;
31
+ export declare function convertToR3QueryMetadata(propertyName: string, ann: Query): R3QueryMetadataFacade;
@@ -5,9 +5,9 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- import { R3DependencyMetadata } from '@angular/compiler';
9
8
  import { ReflectionCapabilities } from '../../reflection/reflection_capabilities';
10
9
  import { Type } from '../../type';
10
+ import { R3DependencyMetadataFacade } from './compiler_facade';
11
11
  export declare function getReflect(): ReflectionCapabilities;
12
- export declare function reflectDependencies(type: Type<any>): R3DependencyMetadata[];
13
- export declare function convertDependencies(deps: any[]): R3DependencyMetadata[];
12
+ export declare function reflectDependencies(type: Type<any>): R3DependencyMetadataFacade[];
13
+ export declare function convertDependencies(deps: any[]): R3DependencyMetadataFacade[];
@@ -6,22 +6,22 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  import { LContainer } from './interfaces/container';
9
- import { LContainerNode, LElementContainerNode, LElementNode, LTextNode, TContainerNode, TNode, TViewNode } from './interfaces/node';
10
- import { RComment, RNode, RText, Renderer3 } from './interfaces/renderer';
9
+ import { TContainerNode, TElementContainerNode, TElementNode, TNode, TViewNode } from './interfaces/node';
10
+ import { RComment, RElement, RNode, RText, Renderer3 } from './interfaces/renderer';
11
11
  import { LViewData } from './interfaces/view';
12
- /** Retrieves the parent LNode of a given node. */
13
- export declare function getParentLNode(tNode: TNode, currentView: LViewData): LElementNode | LElementContainerNode | LContainerNode | null;
12
+ /** Retrieves the parent element of a given node. */
13
+ export declare function getParentNative(tNode: TNode, currentView: LViewData): RElement | RComment | null;
14
14
  /**
15
- * Gets the host LElementNode given a view. Will return null if the host element is an
16
- * LViewNode, since they are being phased out.
15
+ * Gets the host element given a view. Will return null if the current view is an embedded view,
16
+ * which does not have a host element.
17
17
  */
18
- export declare function getHostElementNode(currentView: LViewData): LElementNode | null;
19
- export declare function getContainerNode(tNode: TNode, embeddedView: LViewData): LContainerNode | null;
18
+ export declare function getHostNative(currentView: LViewData): RElement | null;
19
+ export declare function getLContainer(tNode: TViewNode, embeddedView: LViewData): LContainer | null;
20
20
  /**
21
- * Retrieves render parent LElementNode for a given view.
21
+ * Retrieves render parent for a given view.
22
22
  * Might be null if a view is not yet attached to any container.
23
23
  */
24
- export declare function getContainerRenderParent(tViewNode: TViewNode, view: LViewData): LElementNode | null;
24
+ export declare function getContainerRenderParent(tViewNode: TViewNode, view: LViewData): RElement | null;
25
25
  /**
26
26
  * Given a current view, finds the nearest component's host (LElement).
27
27
  *
@@ -90,7 +90,7 @@ export declare function detachView(lContainer: LContainer, removeIndex: number,
90
90
  * @param tContainer The TContainer node associated with the LContainer
91
91
  * @param removeIndex The index of the view to remove
92
92
  */
93
- export declare function removeView(lContainer: LContainer, tContainer: TContainerNode, removeIndex: number): void;
93
+ export declare function removeView(lContainer: LContainer, containerHost: TElementNode | TContainerNode | TElementContainerNode, removeIndex: number): void;
94
94
  /** Gets the child of the given LViewData */
95
95
  export declare function getLViewChild(viewData: LViewData): LViewData | LContainer | null;
96
96
  /**
@@ -113,7 +113,7 @@ export declare function destroyLView(view: LViewData): void;
113
113
  * @returns The correct parent LViewOrLContainer
114
114
  */
115
115
  export declare function getParentState(state: LViewData | LContainer, rootView: LViewData): LViewData | LContainer | null;
116
- export declare function getRenderParent(tNode: TNode, currentView: LViewData): LElementNode | null;
116
+ export declare function getRenderParent(tNode: TNode, currentView: LViewData): RElement | null;
117
117
  /**
118
118
  * Returns whether a native element can be inserted into the given parent.
119
119
  *
@@ -144,24 +144,23 @@ export declare function canInsertNativeNode(tNode: TNode, currentView: LViewData
144
144
  * @returns Whether or not the child was appended
145
145
  */
146
146
  export declare function appendChild(childEl: RNode | null, childTNode: TNode, currentView: LViewData): boolean;
147
- export declare function getBeforeNodeForView(index: number, views: LViewData[], container: LContainerNode): RComment;
147
+ export declare function getBeforeNodeForView(index: number, views: LViewData[], containerNative: RComment): RComment;
148
148
  /**
149
- * Removes the `child` element of the `parent` from the DOM.
149
+ * Removes the `child` element from the DOM if not in view and not projected.
150
150
  *
151
- * @param parentEl The parent element from which to remove the child
152
- * @param child The child that should be removed
151
+ * @param childTNode The TNode of the child to remove
152
+ * @param childEl The child that should be removed
153
153
  * @param currentView The current LView
154
154
  * @returns Whether or not the child was removed
155
155
  */
156
- export declare function removeChild(tNode: TNode, child: RNode | null, currentView: LViewData): boolean;
156
+ export declare function removeChild(childTNode: TNode, childEl: RNode | null, currentView: LViewData): boolean;
157
157
  /**
158
158
  * Appends a projected node to the DOM, or in the case of a projected container,
159
159
  * appends the nodes from all of the container's active views to the DOM.
160
160
  *
161
- * @param projectedLNode The node to process
162
- * @param parentNode The last parent element to be processed
163
- * @param tProjectionNode
161
+ * @param projectedTNode The TNode to be projected
162
+ * @param tProjectionNode The projection (ng-content) TNode
164
163
  * @param currentView Current LView
165
- * @param projectionView Projection view
164
+ * @param projectionView Projection view (view above current)
166
165
  */
167
- export declare function appendProjectedNode(projectedLNode: LElementNode | LElementContainerNode | LTextNode | LContainerNode, projectedTNode: TNode, tProjectionNode: TNode, currentView: LViewData, projectionView: LViewData): void;
166
+ export declare function appendProjectedNode(projectedTNode: TNode, tProjectionNode: TNode, currentView: LViewData, projectionView: LViewData): void;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import './ng_dev_mode';
9
+ import { ComponentInstance, DirectiveInstance, Player } from './interfaces/player';
10
+ /**
11
+ * Adds a player to an element, directive or component instance that will later be
12
+ * animated once change detection has passed.
13
+ *
14
+ * When a player is added to a reference it will stay active until `player.destroy()`
15
+ * is called. Once called then the player will be removed from the active players
16
+ * present on the associated ref instance.
17
+ *
18
+ * To get a list of all the active players on an element see [getPlayers].
19
+ *
20
+ * @param ref The element, directive or component that the player will be placed on.
21
+ * @param player The player that will be triggered to play once change detection has run.
22
+ */
23
+ export declare function addPlayer(ref: ComponentInstance | DirectiveInstance | HTMLElement, player: Player): void;
24
+ /**
25
+ * Returns a list of all the active players present on the provided ref instance (which can
26
+ * be an instance of a directive, component or element).
27
+ *
28
+ * This function will only return players that have been added to the ref instance using
29
+ * `addPlayer` or any players that are active through any template styling bindings
30
+ * (`[style]`, `[style.prop]`, `[class]` and `[class.name]`).
31
+ */
32
+ export declare function getPlayers(ref: ComponentInstance | DirectiveInstance | HTMLElement): Player[];
@@ -7,16 +7,11 @@
7
7
  */
8
8
  import { StyleSanitizeFn } from '../../sanitization/style_sanitizer';
9
9
  import { InitialStylingFlags } from '../interfaces/definition';
10
- import { LElementNode } from '../interfaces/node';
10
+ import { BindingStore, BindingType, Player, PlayerBuilder, PlayerFactory } from '../interfaces/player';
11
11
  import { Renderer3 } from '../interfaces/renderer';
12
12
  import { StylingContext } from '../interfaces/styling';
13
- /**
14
- * Used clone a copy of a pre-computed template of a styling context.
15
- *
16
- * A pre-computed template is designed to be computed once for a given element
17
- * (instructions.ts has logic for caching this).
18
- */
19
- export declare function allocStylingContext(lElement: LElementNode | null, templateStyleContext: StylingContext): StylingContext;
13
+ import { LViewData, RootContext } from '../interfaces/view';
14
+ import { BoundPlayerFactory } from './player_factory';
20
15
  /**
21
16
  * Creates a styling context template where styling information is stored.
22
17
  * Any styles that are later referenced using `updateStyleProp` must be
@@ -42,7 +37,7 @@ export declare function allocStylingContext(lElement: LElementNode | null, templ
42
37
  export declare function createStylingContextTemplate(initialClassDeclarations?: (string | boolean | InitialStylingFlags)[] | null, initialStyleDeclarations?: (string | boolean | InitialStylingFlags)[] | null, styleSanitizer?: StyleSanitizeFn | null): StylingContext;
43
38
  /**
44
39
  * Sets and resolves all `multi` styling on an `StylingContext` so that they can be
45
- * applied to the element once `renderStyling` is called.
40
+ * applied to the element once `renderStyleAndClassBindings` is called.
46
41
  *
47
42
  * All missing styles/class (any values that are not provided in the new `styles`
48
43
  * or `classes` params) will resolve to `null` within their respective positions
@@ -50,17 +45,21 @@ export declare function createStylingContextTemplate(initialClassDeclarations?:
50
45
  *
51
46
  * @param context The styling context that will be updated with the
52
47
  * newly provided style values.
53
- * @param classes The key/value map of CSS class names that will be used for the update.
54
- * @param styles The key/value map of CSS styles that will be used for the update.
48
+ * @param classesInput The key/value map of CSS class names that will be used for the update.
49
+ * @param stylesInput The key/value map of CSS styles that will be used for the update.
55
50
  */
56
- export declare function updateStylingMap(context: StylingContext, classes: {
51
+ export declare function updateStylingMap(context: StylingContext, classesInput: {
57
52
  [key: string]: any;
58
- } | string | null, styles?: {
53
+ } | string | BoundPlayerFactory<null | string | {
59
54
  [key: string]: any;
60
- } | null): void;
55
+ }> | null, stylesInput?: {
56
+ [key: string]: any;
57
+ } | BoundPlayerFactory<null | {
58
+ [key: string]: any;
59
+ }> | null): void;
61
60
  /**
62
61
  * Sets and resolves a single styling property/value on the provided `StylingContext` so
63
- * that they can be applied to the element once `renderStyling` is called.
62
+ * that they can be applied to the element once `renderStyleAndClassBindings` is called.
64
63
  *
65
64
  * Note that prop-level styling values are considered higher priority than any styling that
66
65
  * has been applied using `updateStylingMap`, therefore, when styling values are rendered
@@ -72,7 +71,7 @@ export declare function updateStylingMap(context: StylingContext, classes: {
72
71
  * @param index The index of the property which is being updated.
73
72
  * @param value The CSS style value that will be assigned
74
73
  */
75
- export declare function updateStyleProp(context: StylingContext, index: number, value: string | boolean | null): void;
74
+ export declare function updateStyleProp(context: StylingContext, index: number, input: string | boolean | null | BoundPlayerFactory<string | boolean | null>): void;
76
75
  /**
77
76
  * This method will toggle the referenced CSS class (by the provided index)
78
77
  * within the given context.
@@ -82,7 +81,7 @@ export declare function updateStyleProp(context: StylingContext, index: number,
82
81
  * @param index The index of the CSS class which is being updated.
83
82
  * @param addOrRemove Whether or not to add or remove the CSS class
84
83
  */
85
- export declare function updateClassProp(context: StylingContext, index: number, addOrRemove: boolean): void;
84
+ export declare function updateClassProp(context: StylingContext, index: number, addOrRemove: boolean | BoundPlayerFactory<boolean>): void;
86
85
  /**
87
86
  * Renders all queued styling using a renderer onto the given element.
88
87
  *
@@ -96,15 +95,23 @@ export declare function updateClassProp(context: StylingContext, index: number,
96
95
  * @param context The styling context that will be used to determine
97
96
  * what styles will be rendered
98
97
  * @param renderer the renderer that will be used to apply the styling
99
- * @param styleStore if provided, the updated style values will be applied
98
+ * @param classesStore if provided, the updated class values will be applied
100
99
  * to this key/value map instead of being renderered via the renderer.
101
- * @param classStore if provided, the updated class values will be applied
100
+ * @param stylesStore if provided, the updated style values will be applied
102
101
  * to this key/value map instead of being renderered via the renderer.
102
+ * @returns number the total amount of players that got queued for animation (if any)
103
103
  */
104
- export declare function renderStyling(context: StylingContext, renderer: Renderer3, styleStore?: {
105
- [key: string]: any;
106
- }, classStore?: {
107
- [key: string]: boolean;
108
- }): void;
104
+ export declare function renderStyleAndClassBindings(context: StylingContext, renderer: Renderer3, rootOrView: RootContext | LViewData, classesStore?: BindingStore | null, stylesStore?: BindingStore | null): number;
109
105
  export declare function isContextDirty(context: StylingContext): boolean;
110
106
  export declare function setContextDirty(context: StylingContext, isDirtyYes: boolean): void;
107
+ export declare function setContextPlayersDirty(context: StylingContext, isDirtyYes: boolean): void;
108
+ export declare class ClassAndStylePlayerBuilder<T> implements PlayerBuilder {
109
+ private _element;
110
+ private _type;
111
+ private _values;
112
+ private _dirty;
113
+ private _factory;
114
+ constructor(factory: PlayerFactory, _element: HTMLElement, _type: BindingType);
115
+ setValue(prop: string, value: any): void;
116
+ buildPlayer(currentPlayer?: Player | null): Player | undefined | null;
117
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { PlayerFactory, PlayerFactoryBuildFn } from '../interfaces/player';
9
+ /**
10
+ * Combines the binding value and a factory for an animation player.
11
+ *
12
+ * Used to bind a player to an element template binding (currently only
13
+ * `[style]`, `[style.prop]`, `[class]` and `[class.name]` bindings
14
+ * supported). The provided `factoryFn` function will be run once all
15
+ * the associated bindings have been evaluated on the element and is
16
+ * designed to return a player which will then be placed on the element.
17
+ *
18
+ * @param factoryFn The function that is used to create a player
19
+ * once all the rendering-related (styling values) have been
20
+ * processed for the element binding.
21
+ * @param value The raw value that will be exposed to the binding
22
+ * so that the binding can update its internal values when
23
+ * any changes are evaluated.
24
+ */
25
+ export declare function bindPlayerFactory<T>(factoryFn: PlayerFactoryBuildFn, value: T): PlayerFactory;
26
+ export declare class BoundPlayerFactory<T> {
27
+ fn: PlayerFactoryBuildFn;
28
+ value: T;
29
+ '__brand__': 'Brand for PlayerFactory that nothing will match';
30
+ constructor(fn: PlayerFactoryBuildFn, value: T);
31
+ }
@@ -5,14 +5,36 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
+ import '../ng_dev_mode';
8
9
  import { StyleSanitizeFn } from '../../sanitization/style_sanitizer';
9
- import { LContext } from '../context_discovery';
10
- import { LElementNode } from '../interfaces/node';
11
- import { PlayerContext } from '../interfaces/player';
10
+ import { LContext } from '../interfaces/context';
11
+ import { Player, PlayerContext } from '../interfaces/player';
12
+ import { RElement } from '../interfaces/renderer';
12
13
  import { InitialStyles, StylingContext } from '../interfaces/styling';
13
- export declare const EMPTY_ARR: any[];
14
- export declare const EMPTY_OBJ: {
15
- [key: string]: any;
16
- };
17
- export declare function createEmptyStylingContext(element?: LElementNode | null, sanitizer?: StyleSanitizeFn | null, initialStylingValues?: InitialStyles): StylingContext;
18
- export declare function getOrCreatePlayerContext(target: {}, context?: LContext | null): PlayerContext;
14
+ import { LViewData, RootContext } from '../interfaces/view';
15
+ export declare function createEmptyStylingContext(element?: RElement | null, sanitizer?: StyleSanitizeFn | null, initialStylingValues?: InitialStyles): StylingContext;
16
+ /**
17
+ * Used clone a copy of a pre-computed template of a styling context.
18
+ *
19
+ * A pre-computed template is designed to be computed once for a given element
20
+ * (instructions.ts has logic for caching this).
21
+ */
22
+ export declare function allocStylingContext(element: RElement | null, templateStyleContext: StylingContext): StylingContext;
23
+ /**
24
+ * Retrieve the `StylingContext` at a given index.
25
+ *
26
+ * This method lazily creates the `StylingContext`. This is because in most cases
27
+ * we have styling without any bindings. Creating `StylingContext` eagerly would mean that
28
+ * every style declaration such as `<div style="color: red">` would result `StyleContext`
29
+ * which would create unnecessary memory pressure.
30
+ *
31
+ * @param index Index of the style allocation. See: `elementStyling`.
32
+ * @param viewData The view to search for the styling context
33
+ */
34
+ export declare function getStylingContext(index: number, viewData: LViewData): StylingContext;
35
+ export declare function addPlayerInternal(playerContext: PlayerContext, rootContext: RootContext, element: HTMLElement, player: Player | null, playerContextIndex: number, ref?: any): boolean;
36
+ export declare function getPlayersInternal(playerContext: PlayerContext): Player[];
37
+ export declare function getOrCreatePlayerContext(target: {}, context?: LContext | null): PlayerContext | null;
38
+ export declare function getPlayerContext(stylingContext: StylingContext): PlayerContext | null;
39
+ export declare function allocPlayerContext(data: StylingContext): PlayerContext;
40
+ export declare function throwInvalidRefError(): void;
@@ -5,7 +5,11 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- import { LContainerNode, LElementContainerNode, LElementNode, TNode } from './interfaces/node';
8
+ import { LContainer } from './interfaces/container';
9
+ import { LContext } from './interfaces/context';
10
+ import { TNode } from './interfaces/node';
11
+ import { RComment, RElement, RText } from './interfaces/renderer';
12
+ import { StylingContext } from './interfaces/styling';
9
13
  import { LViewData, RootContext, TData } from './interfaces/view';
10
14
  /**
11
15
  * Returns whether the values are different from a change detection stand point.
@@ -14,13 +18,6 @@ import { LViewData, RootContext, TData } from './interfaces/view';
14
18
  */
15
19
  export declare function isDifferent(a: any, b: any, checkNoChangesMode: boolean): boolean;
16
20
  export declare function stringify(value: any): string;
17
- /**
18
- * Function that throws a "not implemented" error so it's clear certain
19
- * behaviors/methods aren't yet ready.
20
- *
21
- * @returns Not implemented error
22
- */
23
- export declare function notImplemented(): Error;
24
21
  /**
25
22
  * Flattens an array in non-recursive way. Input arrays are not modified.
26
23
  */
@@ -28,15 +25,29 @@ export declare function flatten(list: any[]): any[];
28
25
  /** Retrieves a value from any `LViewData` or `TData`. */
29
26
  export declare function loadInternal<T>(index: number, arr: LViewData | TData): T;
30
27
  export declare function assertDataInRangeInternal(index: number, arr: any[]): void;
31
- /** Retrieves an element value from the provided `viewData`.
32
- *
33
- * Elements that are read may be wrapped in a style context,
34
- * therefore reading the value may involve unwrapping that.
35
- */
36
- export declare function loadElementInternal(index: number, arr: LViewData): LElementNode;
37
- export declare function getLNode(tNode: TNode, hostView: LViewData): LElementNode | LContainerNode | LElementContainerNode;
28
+ /**
29
+ * Takes the value of a slot in `LViewData` and returns the element node.
30
+ *
31
+ * Normally, element nodes are stored flat, but if the node has styles/classes on it,
32
+ * it might be wrapped in a styling context. Or if that node has a directive that injects
33
+ * ViewContainerRef, it may be wrapped in an LContainer. Or if that node is a component,
34
+ * it will be wrapped in LViewData. It could even have all three, so we keep looping
35
+ * until we find something that isn't an array.
36
+ *
37
+ * @param value The initial value in `LViewData`
38
+ */
39
+ export declare function readElementValue(value: RElement | StylingContext | LContainer | LViewData): RElement;
40
+ /**
41
+ * Retrieves an element value from the provided `viewData`, by unwrapping
42
+ * from any containers, component views, or style contexts.
43
+ */
44
+ export declare function getNativeByIndex(index: number, arr: LViewData): RElement;
45
+ export declare function getNativeByTNode(tNode: TNode, hostView: LViewData): RElement | RText | RComment;
46
+ export declare function getTNode(index: number, view: LViewData): TNode;
47
+ export declare function getComponentViewByIndex(nodeIndex: number, hostView: LViewData): LViewData;
38
48
  export declare function isContentQueryHost(tNode: TNode): boolean;
39
49
  export declare function isComponent(tNode: TNode): boolean;
50
+ export declare function isLContainer(value: RElement | RComment | LContainer | StylingContext): boolean;
40
51
  /**
41
52
  * Retrieve the root view from any component by walking the parent `LViewData` until
42
53
  * reaching the root `LViewData`.
@@ -45,3 +56,9 @@ export declare function isComponent(tNode: TNode): boolean;
45
56
  */
46
57
  export declare function getRootView(target: LViewData | {}): LViewData;
47
58
  export declare function getRootContext(viewOrComponent: LViewData | {}): RootContext;
59
+ /**
60
+ * Returns the monkey-patch value data present on the target (which could be
61
+ * a component, directive or a DOM node).
62
+ */
63
+ export declare function readPatchedData(target: any): LViewData | LContext | null;
64
+ export declare function readPatchedLViewData(target: any): LViewData | null;
@@ -9,6 +9,7 @@ import { ChangeDetectorRef as ViewEngine_ChangeDetectorRef } from '../change_det
9
9
  import { ElementRef as ViewEngine_ElementRef } from '../linker/element_ref';
10
10
  import { TemplateRef as ViewEngine_TemplateRef } from '../linker/template_ref';
11
11
  import { ViewContainerRef as ViewEngine_ViewContainerRef } from '../linker/view_container_ref';
12
+ import { Renderer2 } from '../render/api';
12
13
  import { TContainerNode, TElementContainerNode, TElementNode, TNode } from './interfaces/node';
13
14
  import { LViewData } from './interfaces/view';
14
15
  /**
@@ -70,3 +71,5 @@ export declare function injectChangeDetectorRef(): ViewEngine_ChangeDetectorRef;
70
71
  * @returns The ChangeDetectorRef to use
71
72
  */
72
73
  export declare function createViewRef(hostTNode: TNode, hostView: LViewData, context: any): ViewEngine_ChangeDetectorRef;
74
+ /** Returns a Renderer2 (or throws when application was bootstrapped with Renderer3) */
75
+ export declare function injectRenderer2(): Renderer2;