@stencil/core 4.43.1 → 5.0.0-next.0

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 (368) hide show
  1. package/bin/stencil.mjs +2 -0
  2. package/dist/chunk-ClPoSABd.mjs +21 -0
  3. package/dist/client-DR9zhmKG.mjs +4449 -0
  4. package/dist/compiler/index.d.mts +187 -0
  5. package/dist/compiler/index.mjs +9 -0
  6. package/dist/compiler/utils/index.d.mts +3 -0
  7. package/dist/compiler/utils/index.mjs +5 -0
  8. package/dist/declarations/stencil-public-compiler.d.ts +4401 -0
  9. package/dist/declarations/stencil-public-compiler.js +53 -0
  10. package/dist/declarations/stencil-public-runtime.d.ts +1857 -0
  11. package/dist/index-Bxo2jCf6.d.mts +77 -0
  12. package/dist/index-szczUd2l.d.mts +6851 -0
  13. package/{internal/stencil-core/index.d.ts → dist/index.d.mts} +7 -3
  14. package/dist/index.mjs +4 -0
  15. package/dist/mock-doc.d.mts +1 -0
  16. package/dist/mock-doc.mjs +3 -0
  17. package/dist/node-sys-BGURUNOZ.mjs +1954 -0
  18. package/{internal → dist/runtime}/app-data/index.d.ts +11 -7
  19. package/dist/runtime/app-data/index.js +100 -0
  20. package/dist/runtime/app-globals/index.d.ts +5 -0
  21. package/dist/runtime/app-globals/index.js +6 -0
  22. package/dist/runtime/client/index.d.ts +2286 -0
  23. package/dist/runtime/client/index.js +4839 -0
  24. package/dist/runtime/index.d.ts +221 -0
  25. package/dist/runtime/index.js +4819 -0
  26. package/dist/runtime/server/index.d.mts +1277 -0
  27. package/dist/runtime/server/index.mjs +5376 -0
  28. package/dist/runtime/server/runner.d.mts +298 -0
  29. package/dist/runtime/server/runner.mjs +1976 -0
  30. package/dist/serialize-BJvhE9aQ.mjs +775 -0
  31. package/dist/stencil-private-Cgcr414u.d.ts +1893 -0
  32. package/dist/sys/node/index.d.mts +33 -0
  33. package/dist/sys/node/index.mjs +7 -0
  34. package/dist/sys/node/worker.d.mts +1 -0
  35. package/dist/sys/node/worker.mjs +60 -0
  36. package/dist/testing/index.d.mts +207 -0
  37. package/dist/testing/index.mjs +1188 -0
  38. package/dist/transpile-CJQcQEVa.mjs +21854 -0
  39. package/dist/validation-BdcPruW_.mjs +1451 -0
  40. package/package.json +88 -232
  41. package/bin/stencil +0 -57
  42. package/cli/config-flags.d.ts +0 -132
  43. package/cli/index.cjs +0 -5816
  44. package/cli/index.d.ts +0 -19
  45. package/cli/index.js +0 -5809
  46. package/cli/package.json +0 -14
  47. package/compiler/lib.d.ts +0 -22
  48. package/compiler/lib.decorators.d.ts +0 -384
  49. package/compiler/lib.decorators.legacy.d.ts +0 -22
  50. package/compiler/lib.dom.asynciterable.d.ts +0 -41
  51. package/compiler/lib.dom.d.ts +0 -29610
  52. package/compiler/lib.dom.iterable.d.ts +0 -493
  53. package/compiler/lib.es2015.collection.d.ts +0 -147
  54. package/compiler/lib.es2015.core.d.ts +0 -597
  55. package/compiler/lib.es2015.d.ts +0 -28
  56. package/compiler/lib.es2015.generator.d.ts +0 -77
  57. package/compiler/lib.es2015.iterable.d.ts +0 -605
  58. package/compiler/lib.es2015.promise.d.ts +0 -81
  59. package/compiler/lib.es2015.proxy.d.ts +0 -128
  60. package/compiler/lib.es2015.reflect.d.ts +0 -144
  61. package/compiler/lib.es2015.symbol.d.ts +0 -46
  62. package/compiler/lib.es2015.symbol.wellknown.d.ts +0 -326
  63. package/compiler/lib.es2016.array.include.d.ts +0 -116
  64. package/compiler/lib.es2016.d.ts +0 -21
  65. package/compiler/lib.es2016.full.d.ts +0 -23
  66. package/compiler/lib.es2016.intl.d.ts +0 -31
  67. package/compiler/lib.es2017.arraybuffer.d.ts +0 -21
  68. package/compiler/lib.es2017.d.ts +0 -26
  69. package/compiler/lib.es2017.date.d.ts +0 -31
  70. package/compiler/lib.es2017.full.d.ts +0 -23
  71. package/compiler/lib.es2017.intl.d.ts +0 -44
  72. package/compiler/lib.es2017.object.d.ts +0 -49
  73. package/compiler/lib.es2017.sharedmemory.d.ts +0 -135
  74. package/compiler/lib.es2017.string.d.ts +0 -45
  75. package/compiler/lib.es2017.typedarrays.d.ts +0 -53
  76. package/compiler/lib.es2018.asyncgenerator.d.ts +0 -77
  77. package/compiler/lib.es2018.asynciterable.d.ts +0 -53
  78. package/compiler/lib.es2018.d.ts +0 -24
  79. package/compiler/lib.es2018.full.d.ts +0 -24
  80. package/compiler/lib.es2018.intl.d.ts +0 -83
  81. package/compiler/lib.es2018.promise.d.ts +0 -30
  82. package/compiler/lib.es2018.regexp.d.ts +0 -37
  83. package/compiler/lib.es2019.array.d.ts +0 -79
  84. package/compiler/lib.es2019.d.ts +0 -24
  85. package/compiler/lib.es2019.full.d.ts +0 -24
  86. package/compiler/lib.es2019.intl.d.ts +0 -23
  87. package/compiler/lib.es2019.object.d.ts +0 -33
  88. package/compiler/lib.es2019.string.d.ts +0 -37
  89. package/compiler/lib.es2019.symbol.d.ts +0 -24
  90. package/compiler/lib.es2020.bigint.d.ts +0 -765
  91. package/compiler/lib.es2020.d.ts +0 -27
  92. package/compiler/lib.es2020.date.d.ts +0 -42
  93. package/compiler/lib.es2020.full.d.ts +0 -24
  94. package/compiler/lib.es2020.intl.d.ts +0 -474
  95. package/compiler/lib.es2020.number.d.ts +0 -28
  96. package/compiler/lib.es2020.promise.d.ts +0 -47
  97. package/compiler/lib.es2020.sharedmemory.d.ts +0 -99
  98. package/compiler/lib.es2020.string.d.ts +0 -44
  99. package/compiler/lib.es2020.symbol.wellknown.d.ts +0 -41
  100. package/compiler/lib.es2021.d.ts +0 -23
  101. package/compiler/lib.es2021.full.d.ts +0 -24
  102. package/compiler/lib.es2021.intl.d.ts +0 -166
  103. package/compiler/lib.es2021.promise.d.ts +0 -48
  104. package/compiler/lib.es2021.string.d.ts +0 -33
  105. package/compiler/lib.es2021.weakref.d.ts +0 -78
  106. package/compiler/lib.es2022.array.d.ts +0 -121
  107. package/compiler/lib.es2022.d.ts +0 -25
  108. package/compiler/lib.es2022.error.d.ts +0 -75
  109. package/compiler/lib.es2022.full.d.ts +0 -24
  110. package/compiler/lib.es2022.intl.d.ts +0 -121
  111. package/compiler/lib.es2022.object.d.ts +0 -26
  112. package/compiler/lib.es2022.regexp.d.ts +0 -39
  113. package/compiler/lib.es2022.string.d.ts +0 -25
  114. package/compiler/lib.es2023.array.d.ts +0 -924
  115. package/compiler/lib.es2023.collection.d.ts +0 -21
  116. package/compiler/lib.es2023.d.ts +0 -22
  117. package/compiler/lib.es2023.full.d.ts +0 -24
  118. package/compiler/lib.es2023.intl.d.ts +0 -56
  119. package/compiler/lib.es2024.arraybuffer.d.ts +0 -65
  120. package/compiler/lib.es2024.collection.d.ts +0 -29
  121. package/compiler/lib.es2024.d.ts +0 -26
  122. package/compiler/lib.es2024.full.d.ts +0 -24
  123. package/compiler/lib.es2024.object.d.ts +0 -29
  124. package/compiler/lib.es2024.promise.d.ts +0 -35
  125. package/compiler/lib.es2024.regexp.d.ts +0 -25
  126. package/compiler/lib.es2024.sharedmemory.d.ts +0 -68
  127. package/compiler/lib.es2024.string.d.ts +0 -29
  128. package/compiler/lib.es5.d.ts +0 -4594
  129. package/compiler/lib.es6.d.ts +0 -23
  130. package/compiler/lib.esnext.array.d.ts +0 -35
  131. package/compiler/lib.esnext.collection.d.ts +0 -96
  132. package/compiler/lib.esnext.d.ts +0 -27
  133. package/compiler/lib.esnext.decorators.d.ts +0 -28
  134. package/compiler/lib.esnext.disposable.d.ts +0 -193
  135. package/compiler/lib.esnext.float16.d.ts +0 -443
  136. package/compiler/lib.esnext.full.d.ts +0 -24
  137. package/compiler/lib.esnext.intl.d.ts +0 -21
  138. package/compiler/lib.esnext.iterator.d.ts +0 -148
  139. package/compiler/lib.esnext.promise.d.ts +0 -34
  140. package/compiler/lib.scripthost.d.ts +0 -322
  141. package/compiler/lib.webworker.asynciterable.d.ts +0 -41
  142. package/compiler/lib.webworker.d.ts +0 -9894
  143. package/compiler/lib.webworker.importscripts.d.ts +0 -23
  144. package/compiler/lib.webworker.iterable.d.ts +0 -287
  145. package/compiler/package.json +0 -8
  146. package/compiler/stencil.d.ts +0 -73
  147. package/compiler/stencil.js +0 -287696
  148. package/compiler/sys/in-memory-fs.d.ts +0 -227
  149. package/compiler/transpile.d.ts +0 -32
  150. package/dev-server/client/app-error.d.ts +0 -20
  151. package/dev-server/client/events.d.ts +0 -6
  152. package/dev-server/client/hmr-components.d.ts +0 -12
  153. package/dev-server/client/hmr-external-styles.d.ts +0 -1
  154. package/dev-server/client/hmr-images.d.ts +0 -1
  155. package/dev-server/client/hmr-inline-styles.d.ts +0 -1
  156. package/dev-server/client/hmr-util.d.ts +0 -39
  157. package/dev-server/client/hmr-window.d.ts +0 -10
  158. package/dev-server/client/index.d.ts +0 -6
  159. package/dev-server/client/index.js +0 -793
  160. package/dev-server/client/logger.d.ts +0 -6
  161. package/dev-server/client/package.json +0 -8
  162. package/dev-server/client/progress.d.ts +0 -3
  163. package/dev-server/client/status.d.ts +0 -4
  164. package/dev-server/client/test/hmr-util.spec.d.ts +0 -1
  165. package/dev-server/client/test/status.spec.d.ts +0 -1
  166. package/dev-server/connector.html +0 -6
  167. package/dev-server/index.d.ts +0 -3
  168. package/dev-server/index.js +0 -247
  169. package/dev-server/package.json +0 -8
  170. package/dev-server/server-process.js +0 -12095
  171. package/dev-server/server-worker-thread.js +0 -39
  172. package/dev-server/static/favicon.ico +0 -0
  173. package/dev-server/templates/directory-index.html +0 -176
  174. package/dev-server/templates/initial-load.html +0 -168
  175. package/dev-server/visualstudio.vbs +0 -82
  176. package/dev-server/xdg-open +0 -1066
  177. package/internal/app-data/index.cjs +0 -119
  178. package/internal/app-data/index.js +0 -92
  179. package/internal/app-data/package.json +0 -15
  180. package/internal/app-globals/index.d.ts +0 -2
  181. package/internal/app-globals/index.js +0 -14
  182. package/internal/app-globals/package.json +0 -14
  183. package/internal/child_process.d.ts +0 -7
  184. package/internal/client/index.js +0 -4727
  185. package/internal/client/package.json +0 -10
  186. package/internal/client/patch-browser.js +0 -45
  187. package/internal/client/polyfills/core-js.js +0 -11
  188. package/internal/client/polyfills/dom.js +0 -79
  189. package/internal/client/polyfills/es5-html-element.js +0 -1
  190. package/internal/client/polyfills/index.js +0 -34
  191. package/internal/client/polyfills/system.js +0 -6
  192. package/internal/client/shadow-css.js +0 -414
  193. package/internal/hydrate/index.js +0 -6664
  194. package/internal/hydrate/package.json +0 -7
  195. package/internal/hydrate/runner.d.ts +0 -287
  196. package/internal/hydrate/runner.js +0 -17947
  197. package/internal/index.d.ts +0 -4
  198. package/internal/index.js +0 -2
  199. package/internal/package.json +0 -9
  200. package/internal/stencil-core/index.cjs +0 -1
  201. package/internal/stencil-core/index.js +0 -18
  202. package/internal/stencil-core/jsx-dev-runtime.cjs +0 -7
  203. package/internal/stencil-core/jsx-dev-runtime.d.ts +0 -41
  204. package/internal/stencil-core/jsx-dev-runtime.js +0 -2
  205. package/internal/stencil-core/jsx-runtime.cjs +0 -8
  206. package/internal/stencil-core/jsx-runtime.d.ts +0 -40
  207. package/internal/stencil-core/jsx-runtime.js +0 -2
  208. package/internal/stencil-private.d.ts +0 -2538
  209. package/internal/stencil-public-compiler.d.ts +0 -2867
  210. package/internal/stencil-public-runtime.d.ts +0 -1860
  211. package/internal/testing/index.js +0 -6517
  212. package/internal/testing/jsx-dev-runtime.d.ts +0 -2
  213. package/internal/testing/jsx-dev-runtime.js +0 -8
  214. package/internal/testing/jsx-runtime.d.ts +0 -2
  215. package/internal/testing/jsx-runtime.js +0 -9
  216. package/internal/testing/package.json +0 -7
  217. package/internal/utils/index.d.ts +0 -1
  218. package/internal/utils/result.d.ts +0 -112
  219. package/mock-doc/index.cjs +0 -10162
  220. package/mock-doc/index.d.ts +0 -1171
  221. package/mock-doc/index.js +0 -10141
  222. package/mock-doc/package.json +0 -15
  223. package/readme.md +0 -94
  224. package/screenshot/compare/assets/favicon.ico +0 -0
  225. package/screenshot/compare/assets/logo.png +0 -0
  226. package/screenshot/compare/build/app.css +0 -1
  227. package/screenshot/compare/build/app.esm.js +0 -1
  228. package/screenshot/compare/build/app.js +0 -33
  229. package/screenshot/compare/build/p-081b0641.js +0 -1
  230. package/screenshot/compare/build/p-227a1e18.entry.js +0 -1
  231. package/screenshot/compare/build/p-2c298727.entry.js +0 -1
  232. package/screenshot/compare/build/p-5479268c.entry.js +0 -1
  233. package/screenshot/compare/build/p-573ec8a4.entry.js +0 -1
  234. package/screenshot/compare/build/p-6ba08604.entry.js +0 -1
  235. package/screenshot/compare/build/p-6bc63295.entry.js +0 -1
  236. package/screenshot/compare/build/p-7a3759fd.entry.js +0 -1
  237. package/screenshot/compare/build/p-7b4e3ba7.js +0 -1
  238. package/screenshot/compare/build/p-988eb362.css +0 -1
  239. package/screenshot/compare/build/p-9b6a9315.js +0 -1
  240. package/screenshot/compare/build/p-b4cc611c.entry.js +0 -1
  241. package/screenshot/compare/build/p-d1bf53f5.entry.js +0 -1
  242. package/screenshot/compare/build/p-e2efe0df.js +0 -1
  243. package/screenshot/compare/build/p-e8ca6d97.entry.js +0 -1
  244. package/screenshot/compare/build/p-ec2f13e0.entry.js +0 -1
  245. package/screenshot/compare/build/p-f0b99977.entry.js +0 -1
  246. package/screenshot/compare/build/p-f4745c2f.entry.js +0 -1
  247. package/screenshot/compare/build/p-fbbae598.js +0 -1
  248. package/screenshot/compare/host.config.json +0 -15
  249. package/screenshot/compare/index.html +0 -1
  250. package/screenshot/compare/manifest.json +0 -13
  251. package/screenshot/connector-base.d.ts +0 -42
  252. package/screenshot/connector-local.d.ts +0 -7
  253. package/screenshot/connector.js +0 -2
  254. package/screenshot/index.d.ts +0 -3
  255. package/screenshot/index.js +0 -2433
  256. package/screenshot/local-connector.js +0 -2
  257. package/screenshot/package.json +0 -15
  258. package/screenshot/pixel-match.d.ts +0 -1
  259. package/screenshot/pixel-match.js +0 -2315
  260. package/screenshot/screenshot-compare.d.ts +0 -20
  261. package/screenshot/screenshot-fs.d.ts +0 -14
  262. package/sys/node/460.node-fetch.js +0 -451
  263. package/sys/node/autoprefixer.js +0 -9
  264. package/sys/node/glob.js +0 -1
  265. package/sys/node/graceful-fs.js +0 -1
  266. package/sys/node/index.d.ts +0 -39
  267. package/sys/node/index.js +0 -64
  268. package/sys/node/node-fetch.js +0 -12
  269. package/sys/node/package.json +0 -8
  270. package/sys/node/prompts.js +0 -1
  271. package/sys/node/worker.js +0 -4
  272. package/testing/index.d.ts +0 -9
  273. package/testing/index.js +0 -13063
  274. package/testing/jest/jest-27-and-under/jest-config.d.ts +0 -16
  275. package/testing/jest/jest-27-and-under/jest-environment.d.ts +0 -2
  276. package/testing/jest/jest-27-and-under/jest-facade.d.ts +0 -155
  277. package/testing/jest/jest-27-and-under/jest-preprocessor.d.ts +0 -59
  278. package/testing/jest/jest-27-and-under/jest-preset.d.ts +0 -3
  279. package/testing/jest/jest-27-and-under/jest-runner.d.ts +0 -11
  280. package/testing/jest/jest-27-and-under/jest-screenshot.d.ts +0 -2
  281. package/testing/jest/jest-27-and-under/jest-serializer.d.ts +0 -4
  282. package/testing/jest/jest-27-and-under/jest-setup-test-framework.d.ts +0 -9
  283. package/testing/jest/jest-27-and-under/matchers/attributes.d.ts +0 -14
  284. package/testing/jest/jest-27-and-under/matchers/class-list.d.ts +0 -12
  285. package/testing/jest/jest-27-and-under/matchers/events.d.ts +0 -25
  286. package/testing/jest/jest-27-and-under/matchers/html.d.ts +0 -13
  287. package/testing/jest/jest-27-and-under/matchers/index.d.ts +0 -24
  288. package/testing/jest/jest-27-and-under/matchers/screenshot.d.ts +0 -5
  289. package/testing/jest/jest-27-and-under/matchers/text.d.ts +0 -4
  290. package/testing/jest/jest-27-and-under/test/jest-config.spec.d.ts +0 -1
  291. package/testing/jest/jest-27-and-under/test/jest-preprocessor.spec.d.ts +0 -1
  292. package/testing/jest/jest-27-and-under/test/jest-runner.spec.d.ts +0 -1
  293. package/testing/jest/jest-27-and-under/test/jest-serializer.spec.d.ts +0 -1
  294. package/testing/jest/jest-27-and-under/test/jest-setup-test-framework.spec.d.ts +0 -1
  295. package/testing/jest/jest-28/jest-config.d.ts +0 -16
  296. package/testing/jest/jest-28/jest-environment.d.ts +0 -2
  297. package/testing/jest/jest-28/jest-facade.d.ts +0 -134
  298. package/testing/jest/jest-28/jest-preprocessor.d.ts +0 -35
  299. package/testing/jest/jest-28/jest-preset.d.ts +0 -3
  300. package/testing/jest/jest-28/jest-runner.d.ts +0 -11
  301. package/testing/jest/jest-28/jest-screenshot.d.ts +0 -2
  302. package/testing/jest/jest-28/jest-serializer.d.ts +0 -4
  303. package/testing/jest/jest-28/jest-setup-test-framework.d.ts +0 -9
  304. package/testing/jest/jest-28/matchers/attributes.d.ts +0 -14
  305. package/testing/jest/jest-28/matchers/class-list.d.ts +0 -12
  306. package/testing/jest/jest-28/matchers/events.d.ts +0 -25
  307. package/testing/jest/jest-28/matchers/html.d.ts +0 -13
  308. package/testing/jest/jest-28/matchers/index.d.ts +0 -24
  309. package/testing/jest/jest-28/matchers/screenshot.d.ts +0 -5
  310. package/testing/jest/jest-28/matchers/text.d.ts +0 -4
  311. package/testing/jest/jest-28/test/jest-config.spec.d.ts +0 -1
  312. package/testing/jest/jest-28/test/jest-preprocessor.spec.d.ts +0 -1
  313. package/testing/jest/jest-28/test/jest-runner.spec.d.ts +0 -1
  314. package/testing/jest/jest-28/test/jest-serializer.spec.d.ts +0 -1
  315. package/testing/jest/jest-28/test/jest-setup-test-framework.spec.d.ts +0 -1
  316. package/testing/jest/jest-29/jest-config.d.ts +0 -16
  317. package/testing/jest/jest-29/jest-environment.d.ts +0 -2
  318. package/testing/jest/jest-29/jest-facade.d.ts +0 -136
  319. package/testing/jest/jest-29/jest-preprocessor.d.ts +0 -35
  320. package/testing/jest/jest-29/jest-preset.d.ts +0 -3
  321. package/testing/jest/jest-29/jest-runner.d.ts +0 -11
  322. package/testing/jest/jest-29/jest-screenshot.d.ts +0 -2
  323. package/testing/jest/jest-29/jest-serializer.d.ts +0 -4
  324. package/testing/jest/jest-29/jest-setup-test-framework.d.ts +0 -9
  325. package/testing/jest/jest-29/matchers/attributes.d.ts +0 -14
  326. package/testing/jest/jest-29/matchers/class-list.d.ts +0 -12
  327. package/testing/jest/jest-29/matchers/events.d.ts +0 -25
  328. package/testing/jest/jest-29/matchers/html.d.ts +0 -13
  329. package/testing/jest/jest-29/matchers/index.d.ts +0 -24
  330. package/testing/jest/jest-29/matchers/screenshot.d.ts +0 -5
  331. package/testing/jest/jest-29/matchers/text.d.ts +0 -4
  332. package/testing/jest/jest-29/test/jest-config.spec.d.ts +0 -1
  333. package/testing/jest/jest-29/test/jest-preprocessor.spec.d.ts +0 -1
  334. package/testing/jest/jest-29/test/jest-runner.spec.d.ts +0 -1
  335. package/testing/jest/jest-29/test/jest-serializer.spec.d.ts +0 -1
  336. package/testing/jest/jest-29/test/jest-setup-test-framework.spec.d.ts +0 -1
  337. package/testing/jest/jest-apis.d.ts +0 -86
  338. package/testing/jest/jest-facade.d.ts +0 -74
  339. package/testing/jest/jest-stencil-connector.d.ts +0 -65
  340. package/testing/jest/test/jest-stencil-connector.spec.d.ts +0 -1
  341. package/testing/jest-environment.js +0 -3
  342. package/testing/jest-preprocessor.js +0 -3
  343. package/testing/jest-preset.js +0 -2
  344. package/testing/jest-runner.js +0 -3
  345. package/testing/jest-setuptestframework.js +0 -3
  346. package/testing/mock-fetch.d.ts +0 -11
  347. package/testing/mocks.d.ts +0 -56
  348. package/testing/package.json +0 -8
  349. package/testing/puppeteer/index.d.ts +0 -2
  350. package/testing/puppeteer/puppeteer-browser.d.ts +0 -6
  351. package/testing/puppeteer/puppeteer-declarations.d.ts +0 -414
  352. package/testing/puppeteer/puppeteer-element.d.ts +0 -67
  353. package/testing/puppeteer/puppeteer-emulate.d.ts +0 -2
  354. package/testing/puppeteer/puppeteer-events.d.ts +0 -21
  355. package/testing/puppeteer/puppeteer-page.d.ts +0 -2
  356. package/testing/puppeteer/puppeteer-screenshot.d.ts +0 -27
  357. package/testing/puppeteer/test/puppeteer-screenshot.spec.d.ts +0 -1
  358. package/testing/reset-build-conditionals.d.ts +0 -12
  359. package/testing/spec-page.d.ts +0 -7
  360. package/testing/test/testing-utils.spec.d.ts +0 -1
  361. package/testing/test-transpile.d.ts +0 -2
  362. package/testing/testing-logger.d.ts +0 -26
  363. package/testing/testing-sys.d.ts +0 -6
  364. package/testing/testing-utils.d.ts +0 -80
  365. package/testing/testing.d.ts +0 -2
  366. /package/{internal → dist/declarations}/stencil-ext-modules.d.ts +0 -0
  367. /package/{internal → dist/declarations}/stencil-public-docs.d.ts +0 -0
  368. /package/{screenshot/compare/build/index.esm.js → dist/declarations/stencil-public-runtime.js} +0 -0
@@ -1,2538 +0,0 @@
1
- import { result } from './utils';
2
- import type { InMemoryFileSystem } from '../compiler/sys/in-memory-fs';
3
- import type { CPSerializable } from './child_process';
4
- import type { BuildEvents, BuildLog, BuildResultsComponentGraph, CompilerBuildResults, CompilerFsStats, CompilerRequestResponse, CompilerSystem, Config, CopyResults, DevServerConfig, DevServerEditor, Diagnostic, Logger, LoggerLineUpdater, LoggerTimeSpan, OptimizeCssInput, OptimizeCssOutput, OutputTarget, OutputTargetWww, PageReloadStrategy, PrerenderConfig, StyleDoc, TaskCommand, ValidatedConfig } from './stencil-public-compiler';
5
- import type { JsonDocMethodParameter } from './stencil-public-docs';
6
- import type { ComponentInterface, ListenTargetOptions, VNode } from './stencil-public-runtime';
7
- export interface DocData {
8
- hostIds: number;
9
- rootLevelIds: number;
10
- staticComponents: Set<string>;
11
- }
12
- export type StencilDocument = Document & {
13
- _stencilDocData: DocData;
14
- };
15
- export interface SourceMap {
16
- file: string;
17
- mappings: string;
18
- names: string[];
19
- sourceRoot?: string;
20
- sources: string[];
21
- sourcesContent?: (string | null)[];
22
- version: number;
23
- }
24
- export interface PrintLine {
25
- lineIndex: number;
26
- lineNumber: number;
27
- text: string;
28
- errorCharStart: number;
29
- errorLength?: number;
30
- }
31
- export interface AssetsMeta {
32
- absolutePath: string;
33
- cmpRelativePath: string;
34
- originalComponentPath: string;
35
- }
36
- export interface ParsedImport {
37
- importPath: string;
38
- basename: string;
39
- ext: string;
40
- data: ImportData;
41
- }
42
- export interface ImportData {
43
- tag?: string;
44
- encapsulation?: string;
45
- mode?: string;
46
- }
47
- export interface SerializeImportData extends ImportData {
48
- importeePath: string;
49
- importerPath?: string;
50
- /**
51
- * True if this is a node module import (e.g. using ~ prefix like ~foo/style.css)
52
- * These should be treated as bare module specifiers and not have ./ prepended
53
- */
54
- isNodeModule?: boolean;
55
- }
56
- export interface BuildFeatures {
57
- style: boolean;
58
- mode: boolean;
59
- formAssociated: boolean;
60
- shadowDom: boolean;
61
- shadowDelegatesFocus: boolean;
62
- shadowSlotAssignmentManual: boolean;
63
- scoped: boolean;
64
- /**
65
- * Every component has a render function
66
- */
67
- allRenderFn: boolean;
68
- /**
69
- * At least one component has a render function
70
- */
71
- hasRenderFn: boolean;
72
- vdomRender: boolean;
73
- vdomAttribute: boolean;
74
- vdomClass: boolean;
75
- vdomFunctional: boolean;
76
- vdomKey: boolean;
77
- vdomListener: boolean;
78
- vdomPropOrAttr: boolean;
79
- vdomRef: boolean;
80
- vdomStyle: boolean;
81
- vdomText: boolean;
82
- vdomXlink: boolean;
83
- slotRelocation: boolean;
84
- slot: boolean;
85
- svg: boolean;
86
- element: boolean;
87
- event: boolean;
88
- hostListener: boolean;
89
- hostListenerTargetWindow: boolean;
90
- hostListenerTargetDocument: boolean;
91
- hostListenerTargetBody: boolean;
92
- /**
93
- * @deprecated Prevented from new apps, but left in for older collections
94
- */
95
- hostListenerTargetParent: boolean;
96
- hostListenerTarget: boolean;
97
- method: boolean;
98
- prop: boolean;
99
- propChangeCallback: boolean;
100
- propMutable: boolean;
101
- state: boolean;
102
- member: boolean;
103
- updatable: boolean;
104
- propBoolean: boolean;
105
- propNumber: boolean;
106
- propString: boolean;
107
- serializer: boolean;
108
- deserializer: boolean;
109
- lifecycle: boolean;
110
- asyncLoading: boolean;
111
- observeAttribute: boolean;
112
- reflect: boolean;
113
- taskQueue: boolean;
114
- }
115
- export interface BuildConditionals extends Partial<BuildFeatures> {
116
- hotModuleReplacement?: boolean;
117
- isDebug?: boolean;
118
- isTesting?: boolean;
119
- isDev?: boolean;
120
- devTools?: boolean;
121
- invisiblePrehydration?: boolean;
122
- hydrateServerSide?: boolean;
123
- hydrateClientSide?: boolean;
124
- lifecycleDOMEvents?: boolean;
125
- cssAnnotations?: boolean;
126
- lazyLoad?: boolean;
127
- profile?: boolean;
128
- constructableCSS?: boolean;
129
- appendChildSlotFix?: boolean;
130
- slotChildNodesFix?: boolean;
131
- scopedSlotTextContentFix?: boolean;
132
- cloneNodeFix?: boolean;
133
- hydratedAttribute?: boolean;
134
- hydratedClass?: boolean;
135
- hydratedSelectorName?: string;
136
- initializeNextTick?: boolean;
137
- scriptDataOpts?: boolean;
138
- shadowDomShim?: boolean;
139
- asyncQueue?: boolean;
140
- transformTagName?: boolean;
141
- additionalTagTransformers?: boolean | 'prod';
142
- attachStyles?: boolean;
143
- experimentalSlotFixes?: boolean;
144
- experimentalScopedSlotChanges?: boolean;
145
- addGlobalStyleToComponents?: boolean;
146
- }
147
- export type ModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd' | 'commonjs' | 'esm' | 'module' | 'systemjs';
148
- export interface RollupResultModule {
149
- id: string;
150
- }
151
- export interface RollupResults {
152
- modules: RollupResultModule[];
153
- }
154
- export interface UpdatedLazyBuildCtx {
155
- name: 'esm-browser' | 'esm' | 'cjs' | 'system';
156
- buildCtx: BuildCtx;
157
- }
158
- export interface BuildCtx {
159
- buildId: number;
160
- buildResults: CompilerBuildResults;
161
- buildStats?: result.Result<CompilerBuildStats, {
162
- diagnostics: Diagnostic[];
163
- }>;
164
- buildMessages: string[];
165
- bundleBuildCount: number;
166
- collections: CollectionCompilerMeta[];
167
- compilerCtx: CompilerCtx;
168
- esmBrowserComponentBundle: ReadonlyArray<BundleModule>;
169
- esmComponentBundle: ReadonlyArray<BundleModule>;
170
- es5ComponentBundle: ReadonlyArray<BundleModule>;
171
- systemComponentBundle: ReadonlyArray<BundleModule>;
172
- commonJsComponentBundle: ReadonlyArray<BundleModule>;
173
- components: ComponentCompilerMeta[];
174
- componentGraph: Map<string, string[]>;
175
- config: ValidatedConfig;
176
- createTimeSpan(msg: string, debug?: boolean): LoggerTimeSpan;
177
- data: any;
178
- debug: (msg: string) => void;
179
- diagnostics: Diagnostic[];
180
- dirsAdded: string[];
181
- dirsDeleted: string[];
182
- entryModules: EntryModule[];
183
- filesAdded: string[];
184
- filesChanged: string[];
185
- filesDeleted: string[];
186
- filesUpdated: string[];
187
- filesWritten: string[];
188
- globalStyle: string | undefined;
189
- hasConfigChanges: boolean;
190
- hasError: boolean;
191
- hasFinished: boolean;
192
- hasHtmlChanges: boolean;
193
- hasPrintedResults: boolean;
194
- hasServiceWorkerChanges: boolean;
195
- hasScriptChanges: boolean;
196
- hasStyleChanges: boolean;
197
- hasWarning: boolean;
198
- hydrateAppFilePath: string;
199
- indexBuildCount: number;
200
- indexDoc: Document;
201
- isRebuild: boolean;
202
- /**
203
- * A collection of Stencil's intermediate representation of components, tied to the current build
204
- */
205
- moduleFiles: Module[];
206
- packageJson: PackageJsonData;
207
- pendingCopyTasks: Promise<CopyResults>[];
208
- progress(task: BuildTask): void;
209
- requiresFullBuild: boolean;
210
- rollupResults?: RollupResults;
211
- scriptsAdded: string[];
212
- scriptsDeleted: string[];
213
- startTime: number;
214
- styleBuildCount: number;
215
- /**
216
- * A promise that resolves to the global styles for the current build.
217
- */
218
- stylesPromise: Promise<string>;
219
- stylesUpdated: BuildStyleUpdate[];
220
- timeSpan: LoggerTimeSpan;
221
- timestamp: string;
222
- transpileBuildCount: number;
223
- validateTypesBuild?(): Promise<void>;
224
- validateTypesHandler?: (results: any) => Promise<void>;
225
- validateTypesPromise?: Promise<any>;
226
- }
227
- export interface BuildStyleUpdate {
228
- styleTag: string;
229
- styleText: string;
230
- styleMode: string;
231
- }
232
- export type BuildTask = any;
233
- export interface CompilerBuildStats {
234
- timestamp: string;
235
- compiler: {
236
- name: string;
237
- version: string;
238
- };
239
- app: {
240
- namespace: string;
241
- fsNamespace: string;
242
- components: number;
243
- entries: number;
244
- bundles: number;
245
- outputs: any;
246
- };
247
- options: {
248
- minifyJs: boolean;
249
- minifyCss: boolean;
250
- hashFileNames: boolean;
251
- hashedFileNameLength: number;
252
- buildEs5: boolean | 'prod';
253
- };
254
- formats: {
255
- esmBrowser: ReadonlyArray<CompilerBuildStatBundle>;
256
- esm: ReadonlyArray<CompilerBuildStatBundle>;
257
- es5: ReadonlyArray<CompilerBuildStatBundle>;
258
- system: ReadonlyArray<CompilerBuildStatBundle>;
259
- commonjs: ReadonlyArray<CompilerBuildStatBundle>;
260
- };
261
- components: BuildComponent[];
262
- entries: EntryModule[];
263
- rollupResults: RollupResults;
264
- sourceGraph?: BuildSourceGraph;
265
- componentGraph: BuildResultsComponentGraph;
266
- collections: CompilerBuildStatCollection[];
267
- }
268
- export interface CompilerBuildStatCollection {
269
- name: string;
270
- source: string;
271
- tags: string[][];
272
- }
273
- export interface CompilerBuildStatBundle {
274
- key: string;
275
- components: string[];
276
- bundleId: string;
277
- fileName: string;
278
- imports: string[];
279
- originalByteSize: number;
280
- }
281
- export interface BuildSourceGraph {
282
- [filePath: string]: string[];
283
- }
284
- export interface BuildComponent {
285
- tag: string;
286
- dependencyOf?: string[];
287
- dependencies?: string[];
288
- }
289
- export type SourceTarget = 'es5' | 'es2017' | 'latest';
290
- /**
291
- * A note regarding Rollup types:
292
- * As of this writing, there is no great way to import external types for packages that are directly embedded in the
293
- * Stencil source. As a result, some types are duplicated here for Rollup that will be used within the codebase.
294
- * Updates to rollup may require these typings to be updated.
295
- */
296
- export type RollupResult = RollupChunkResult | RollupAssetResult;
297
- export interface RollupAssetResult {
298
- type: 'asset';
299
- fileName: string;
300
- content: string;
301
- }
302
- export interface RollupChunkResult {
303
- type: 'chunk';
304
- entryKey: string;
305
- fileName: string;
306
- code: string;
307
- isEntry: boolean;
308
- isComponent: boolean;
309
- isCore: boolean;
310
- isIndex: boolean;
311
- isBrowserLoader: boolean;
312
- imports: string[];
313
- moduleFormat: ModuleFormat;
314
- map?: RollupSourceMap;
315
- }
316
- export interface RollupSourceMap {
317
- file: string;
318
- mappings: string;
319
- names: string[];
320
- sources: string[];
321
- sourcesContent: string[];
322
- version: number;
323
- toString(): string;
324
- toUrl(): string;
325
- }
326
- /**
327
- * Result of Stencil compressing, mangling, and otherwise 'minifying' JavaScript
328
- */
329
- export type OptimizeJsResult = {
330
- output: string;
331
- diagnostics: Diagnostic[];
332
- sourceMap?: SourceMap;
333
- };
334
- export interface BundleModule {
335
- entryKey: string;
336
- rollupResult: RollupChunkResult;
337
- cmps: ComponentCompilerMeta[];
338
- output: BundleModuleOutput;
339
- }
340
- export interface BundleModuleOutput {
341
- bundleId: string;
342
- fileName: string;
343
- code: string;
344
- }
345
- export interface Cache {
346
- get(key: string): Promise<string | null>;
347
- put(key: string, value: string): Promise<boolean>;
348
- has(key: string): Promise<boolean>;
349
- createKey(domain: string, ...args: any[]): Promise<string>;
350
- commit(): Promise<void>;
351
- clear(): void;
352
- clearDiskCache(): Promise<void>;
353
- getMemoryStats(): string;
354
- initCacheDir(): Promise<void>;
355
- }
356
- export interface CollectionCompilerMeta {
357
- collectionName: string;
358
- moduleId?: string;
359
- moduleDir: string;
360
- moduleFiles: Module[];
361
- global?: Module;
362
- compiler?: CollectionCompilerVersion;
363
- isInitialized?: boolean;
364
- hasExports?: boolean;
365
- dependencies?: string[];
366
- bundles?: {
367
- components: string[];
368
- }[];
369
- }
370
- export interface CollectionCompilerVersion {
371
- name: string;
372
- version: string;
373
- typescriptVersion?: string;
374
- }
375
- export interface CollectionManifest {
376
- entries?: CollectionComponentEntryPath[];
377
- collections?: CollectionDependencyManifest[];
378
- global?: string;
379
- compiler?: CollectionCompilerVersion;
380
- bundles?: CollectionBundleManifest[];
381
- }
382
- export type CollectionComponentEntryPath = string;
383
- export interface CollectionBundleManifest {
384
- components: string[];
385
- }
386
- export interface CollectionDependencyManifest {
387
- name: string;
388
- tags: string[];
389
- }
390
- export interface CollectionCompiler {
391
- name: string;
392
- version: string;
393
- typescriptVersion?: string;
394
- }
395
- export interface CollectionDependencyData {
396
- name: string;
397
- tags: string[];
398
- }
399
- export interface CompilerCtx {
400
- version: number;
401
- activeBuildId: number;
402
- activeDirsAdded: string[];
403
- activeDirsDeleted: string[];
404
- activeFilesAdded: string[];
405
- activeFilesDeleted: string[];
406
- activeFilesUpdated: string[];
407
- addWatchDir: (path: string, recursive: boolean) => void;
408
- addWatchFile: (path: string) => void;
409
- cache: Cache;
410
- cssModuleImports: Map<string, string[]>;
411
- cachedGlobalStyle: string;
412
- collections: CollectionCompilerMeta[];
413
- compilerOptions: any;
414
- events: BuildEvents;
415
- fs: InMemoryFileSystem;
416
- hasSuccessfulBuild: boolean;
417
- isActivelyBuilding: boolean;
418
- lastBuildResults: CompilerBuildResults;
419
- /**
420
- * A mapping of a file path to a Stencil {@link Module}
421
- */
422
- moduleMap: ModuleMap;
423
- nodeMap: NodeMap;
424
- resolvedCollections: Set<string>;
425
- rollupCacheHydrate: any;
426
- rollupCacheLazy: any;
427
- rollupCacheNative: any;
428
- styleModeNames: Set<string>;
429
- changedModules: Set<string>;
430
- changedFiles: Set<string>;
431
- worker?: CompilerWorkerContext;
432
- rollupCache: Map<string, any>;
433
- reset(): void;
434
- }
435
- export type NodeMap = WeakMap<any, ComponentCompilerMeta>;
436
- /**
437
- * Record, for a specific component, whether or not it has various features
438
- * which need to be handled correctly in the compilation pipeline.
439
- *
440
- * Note: this must be serializable to JSON.
441
- */
442
- export interface ComponentCompilerFeatures {
443
- hasAttribute: boolean;
444
- hasAttributeChangedCallbackFn: boolean;
445
- hasComponentWillLoadFn: boolean;
446
- hasComponentDidLoadFn: boolean;
447
- hasComponentShouldUpdateFn: boolean;
448
- hasComponentWillUpdateFn: boolean;
449
- hasComponentDidUpdateFn: boolean;
450
- hasComponentWillRenderFn: boolean;
451
- hasComponentDidRenderFn: boolean;
452
- hasConnectedCallbackFn: boolean;
453
- hasDeserializer: boolean;
454
- hasDisconnectedCallbackFn: boolean;
455
- hasElement: boolean;
456
- hasEvent: boolean;
457
- hasLifecycle: boolean;
458
- hasListener: boolean;
459
- hasListenerTarget: boolean;
460
- hasListenerTargetWindow: boolean;
461
- hasListenerTargetDocument: boolean;
462
- hasListenerTargetBody: boolean;
463
- /**
464
- * @deprecated Prevented from new apps, but left in for older collections
465
- */
466
- hasListenerTargetParent: boolean;
467
- hasMember: boolean;
468
- hasMethod: boolean;
469
- hasMode: boolean;
470
- hasModernPropertyDecls: boolean;
471
- hasProp: boolean;
472
- hasPropBoolean: boolean;
473
- hasPropNumber: boolean;
474
- hasPropString: boolean;
475
- hasPropMutable: boolean;
476
- hasReflect: boolean;
477
- hasRenderFn: boolean;
478
- hasSerializer: boolean;
479
- hasSlot: boolean;
480
- hasState: boolean;
481
- hasStyle: boolean;
482
- hasVdomAttribute: boolean;
483
- hasVdomClass: boolean;
484
- hasVdomFunctional: boolean;
485
- hasVdomKey: boolean;
486
- hasVdomListener: boolean;
487
- hasVdomPropOrAttr: boolean;
488
- hasVdomRef: boolean;
489
- hasVdomRender: boolean;
490
- hasVdomStyle: boolean;
491
- hasVdomText: boolean;
492
- hasVdomXlink: boolean;
493
- hasWatchCallback: boolean;
494
- htmlAttrNames: string[];
495
- htmlTagNames: string[];
496
- htmlParts: string[];
497
- isUpdateable: boolean;
498
- /**
499
- * A plain component is one that doesn't have:
500
- * - any members decorated with `@Prop()`, `@State()`, `@Element()`, `@Method()`
501
- * - any methods decorated with `@Listen()`
502
- * - any styles
503
- * - any lifecycle methods, including `render()`
504
- */
505
- isPlain: boolean;
506
- /**
507
- * A collection of tag names of web components that a component references in its JSX/h() function
508
- */
509
- potentialCmpRefs: string[];
510
- }
511
- /**
512
- * Metadata about a given component
513
- *
514
- * Note: must be serializable to JSON!
515
- */
516
- export interface ComponentCompilerMeta extends ComponentCompilerFeatures {
517
- assetsDirs: CompilerAssetDir[];
518
- /**
519
- * The name to which an `ElementInternals` object (the return value of
520
- * `HTMLElement.attachInternals`) should be attached at runtime. If this is
521
- * `null` then `attachInternals` should not be called.
522
- */
523
- attachInternalsMemberName: string | null;
524
- /**
525
- * Custom states to initialize on the ElementInternals.states CustomStateSet.
526
- * These are defined via @AttachInternals({ states: {...} }).
527
- */
528
- attachInternalsCustomStates: ComponentCompilerCustomState[];
529
- componentClassName: string;
530
- /**
531
- * A list of web component tag names that are either:
532
- * - directly referenced in a Stencil component's JSX/h() function
533
- * - are referenced by a web component that is directly referenced in a Stencil component's JSX/h() function
534
- */
535
- dependencies: string[];
536
- /**
537
- * A list of web component tag names that either:
538
- * - directly reference the current component directly in their JSX/h() function
539
- * - indirectly/transitively reference the current component directly in their JSX/h() function
540
- */
541
- dependents: string[];
542
- deserializers: ComponentCompilerChangeHandler[];
543
- /**
544
- * A list of web component tag names that are directly referenced in a Stencil component's JSX/h() function
545
- */
546
- directDependencies: string[];
547
- /**
548
- * A list of web component tag names that the current component directly in their JSX/h() function
549
- */
550
- directDependents: string[];
551
- docs: CompilerJsDoc;
552
- doesExtend: boolean;
553
- elementRef: string;
554
- encapsulation: Encapsulation;
555
- events: ComponentCompilerEvent[];
556
- excludeFromCollection: boolean;
557
- /**
558
- * Whether or not the component is form-associated
559
- */
560
- formAssociated: boolean;
561
- internal: boolean;
562
- isCollectionDependency: boolean;
563
- jsFilePath: string;
564
- listeners: ComponentCompilerListener[];
565
- methods: ComponentCompilerMethod[];
566
- properties: ComponentCompilerProperty[];
567
- serializers: ComponentCompilerChangeHandler[];
568
- shadowDelegatesFocus: boolean;
569
- /**
570
- * Slot assignment mode for shadow DOM. 'manual', enables imperative slotting
571
- * using HTMLSlotElement.assign(). Only applicable when encapsulation is 'shadow'.
572
- */
573
- slotAssignment: 'manual' | null;
574
- sourceFilePath: string;
575
- sourceMapPath: string;
576
- states: ComponentCompilerState[];
577
- styleDocs: CompilerStyleDoc[];
578
- styles: StyleCompiler[];
579
- tagName: string;
580
- virtualProperties: ComponentCompilerVirtualProperty[];
581
- watchers: ComponentCompilerChangeHandler[];
582
- }
583
- /**
584
- * The supported style encapsulation modes on a Stencil component:
585
- * 1. 'shadow' - native Shadow DOM
586
- * 2. 'scoped' - encapsulated styles and polyfilled slots
587
- * 3. 'none' - a basic HTML element
588
- */
589
- export type Encapsulation = 'shadow' | 'scoped' | 'none';
590
- /**
591
- * Intermediate Representation (IR) of a static property on a Stencil component
592
- */
593
- export interface ComponentCompilerStaticProperty {
594
- mutable: boolean;
595
- optional: boolean;
596
- required: boolean;
597
- type: ComponentCompilerPropertyType;
598
- complexType: ComponentCompilerPropertyComplexType;
599
- attribute?: string;
600
- reflect?: boolean;
601
- docs: CompilerJsDoc;
602
- defaultValue?: string;
603
- getter: boolean;
604
- setter: boolean;
605
- ogPropName?: string;
606
- }
607
- /**
608
- * Intermediate Representation (IR) of a property on a Stencil component
609
- */
610
- export interface ComponentCompilerProperty extends ComponentCompilerStaticProperty {
611
- name: string;
612
- internal: boolean;
613
- }
614
- export interface ComponentCompilerVirtualProperty {
615
- name: string;
616
- type: string;
617
- docs: string;
618
- }
619
- export type ComponentCompilerPropertyType = 'any' | 'string' | 'boolean' | 'number' | 'unknown';
620
- /**
621
- * Information about a type used in a Stencil component or exported
622
- * from a Stencil project.
623
- */
624
- export interface ComponentCompilerPropertyComplexType {
625
- /**
626
- * The string of the original type annotation in the Stencil source code
627
- */
628
- original: string;
629
- /**
630
- * A 'resolved' type, where e.g. imported types have been resolved and inlined
631
- *
632
- * For instance, an annotation like `(foo: Foo) => string;` will be
633
- * converted to `(foo: { foo: string }) => string;`.
634
- */
635
- resolved: string;
636
- /**
637
- * A record of the types which were referenced in the assorted type
638
- * annotation in the original source file.
639
- */
640
- references: ComponentCompilerTypeReferences;
641
- }
642
- /**
643
- * A record of `ComponentCompilerTypeReference` entities.
644
- *
645
- * Each key in this record is intended to be the names of the types used by a component. However, this is not enforced
646
- * by the type system (I.E. any string can be used as a key).
647
- *
648
- * Note any key can be a user defined type or a TypeScript standard type.
649
- */
650
- export type ComponentCompilerTypeReferences = Record<string, ComponentCompilerTypeReference>;
651
- /**
652
- * Describes a reference to a type used by a component.
653
- */
654
- export interface ComponentCompilerTypeReference {
655
- /**
656
- * A type may be defined:
657
- * - locally (in the same file as the component that uses it)
658
- * - globally
659
- * - by importing it into a file (and is defined elsewhere)
660
- */
661
- location: 'local' | 'global' | 'import';
662
- /**
663
- * The path to the type reference, if applicable (global types should not need a path associated with them)
664
- */
665
- path?: string;
666
- /**
667
- * An ID for this type which is unique within a Stencil project.
668
- */
669
- id: string;
670
- /**
671
- * Whether this type was imported as a default import (e.g., `import MyEnum from './my-enum'`)
672
- * vs a named import (e.g., `import { MyType } from './my-type'`)
673
- */
674
- isDefault?: boolean;
675
- /**
676
- * The name used in the import statement (before any user-defined alias).
677
- * For `import { XAxisOption as moo }`, this would be "XAxisOption".
678
- * This is the name exported by the source module.
679
- */
680
- referenceLocation?: string;
681
- }
682
- /**
683
- * Information about a type which is referenced by another type on a Stencil
684
- * component, for instance a {@link ComponentCompilerPropertyComplexType} or a
685
- * {@link ComponentCompilerEventComplexType}.
686
- */
687
- export interface ComponentCompilerReferencedType {
688
- /**
689
- * The path to the module where the type is declared.
690
- */
691
- path: string;
692
- /**
693
- * The string of the original type annotation in the Stencil source code
694
- */
695
- declaration: string;
696
- /**
697
- * An extracted docstring
698
- */
699
- docstring: string;
700
- }
701
- export interface ComponentCompilerStaticEvent {
702
- name: string;
703
- method: string;
704
- bubbles: boolean;
705
- cancelable: boolean;
706
- composed: boolean;
707
- docs: CompilerJsDoc;
708
- complexType: ComponentCompilerEventComplexType;
709
- }
710
- export interface ComponentCompilerEvent extends ComponentCompilerStaticEvent {
711
- internal: boolean;
712
- }
713
- export interface ComponentCompilerEventComplexType {
714
- original: string;
715
- resolved: string;
716
- references: ComponentCompilerTypeReferences;
717
- }
718
- export interface ComponentCompilerListener {
719
- name: string;
720
- method: string;
721
- capture: boolean;
722
- passive: boolean;
723
- target: ListenTargetOptions | undefined;
724
- }
725
- export interface ComponentCompilerStaticMethod {
726
- docs: CompilerJsDoc;
727
- complexType: ComponentCompilerMethodComplexType;
728
- }
729
- export interface ComponentCompilerMethodComplexType {
730
- signature: string;
731
- parameters: JsonDocMethodParameter[];
732
- references: ComponentCompilerTypeReferences;
733
- return: string;
734
- }
735
- export interface ComponentCompilerChangeHandler {
736
- propName: string;
737
- methodName: string;
738
- handlerOptions?: {
739
- immediate?: boolean;
740
- };
741
- }
742
- export interface ComponentCompilerMethod extends ComponentCompilerStaticMethod {
743
- name: string;
744
- internal: boolean;
745
- }
746
- export interface ComponentCompilerState {
747
- name: string;
748
- }
749
- /**
750
- * Metadata about a custom state defined via @AttachInternals({ states: {...} })
751
- *
752
- * Custom states are exposed via the ElementInternals.states CustomStateSet
753
- * and can be targeted with the CSS :state() pseudo-class.
754
- */
755
- export interface ComponentCompilerCustomState {
756
- /**
757
- * The name of the custom state (without dashes)
758
- */
759
- name: string;
760
- /**
761
- * The initial value of the state
762
- */
763
- initialValue: boolean;
764
- /**
765
- * Optional JSDoc description for the state
766
- */
767
- docs: string;
768
- }
769
- /**
770
- * Representation of JSDoc that is pulled off a node in the AST
771
- */
772
- export interface CompilerJsDoc {
773
- /**
774
- * The text associated with the JSDoc
775
- */
776
- text: string;
777
- /**
778
- * Tags included in the JSDoc
779
- */
780
- tags: CompilerJsDocTagInfo[];
781
- }
782
- /**
783
- * Representation of a tag that exists in a JSDoc
784
- */
785
- export interface CompilerJsDocTagInfo {
786
- /**
787
- * The name of the tag - e.g. `@deprecated`
788
- */
789
- name: string;
790
- /**
791
- * Additional text that is associated with the tag - e.g. `@deprecated use v2 of this API`
792
- */
793
- text?: string;
794
- }
795
- /**
796
- * The (internal) representation of a CSS block comment in a CSS, Sass, etc. file. This data structure is used during
797
- * the initial compilation phases of Stencil, as a piece of {@link ComponentCompilerMeta}.
798
- */
799
- export interface CompilerStyleDoc {
800
- /**
801
- * The name of the CSS property
802
- */
803
- name: string;
804
- /**
805
- * The user-defined description of the CSS property
806
- */
807
- docs: string;
808
- /**
809
- * The JSDoc-style annotation (e.g. `@prop`) that was used in the block comment to detect the comment.
810
- * Used to inform Stencil where the start of a new property's description starts (and where the previous description
811
- * ends).
812
- */
813
- annotation: 'prop';
814
- /**
815
- * The Stencil style-mode that is associated with this property.
816
- */
817
- mode: string;
818
- }
819
- export interface CompilerAssetDir {
820
- absolutePath?: string;
821
- cmpRelativePath?: string;
822
- originalComponentPath?: string;
823
- }
824
- export interface ComponentCompilerData {
825
- exportLine: string;
826
- filePath: string;
827
- cmp: ComponentCompilerMeta;
828
- uniqueComponentClassName?: string;
829
- importLine?: string;
830
- }
831
- export interface ComponentConstructor {
832
- is?: string;
833
- properties?: ComponentConstructorProperties;
834
- watchers?: ComponentConstructorChangeHandlers;
835
- events?: ComponentConstructorEvent[];
836
- listeners?: ComponentConstructorListener[];
837
- style?: string;
838
- styleId?: string;
839
- encapsulation?: ComponentConstructorEncapsulation;
840
- observedAttributes?: string[];
841
- cmpMeta?: ComponentRuntimeMeta;
842
- isProxied?: boolean;
843
- isStyleRegistered?: boolean;
844
- serializers?: ComponentConstructorChangeHandlers;
845
- deserializers?: ComponentConstructorChangeHandlers;
846
- }
847
- /**
848
- * A mapping from class member names to a list of methods which are watching
849
- * them.
850
- */
851
- export interface ComponentConstructorChangeHandlers {
852
- [propName: string]: {
853
- [methodName: string]: number;
854
- }[];
855
- }
856
- export interface ComponentTestingConstructor extends ComponentConstructor {
857
- COMPILER_META: ComponentCompilerMeta;
858
- prototype?: {
859
- componentWillLoad?: Function;
860
- componentWillUpdate?: Function;
861
- componentWillRender?: Function;
862
- __componentWillLoad?: Function | null;
863
- __componentWillUpdate?: Function | null;
864
- __componentWillRender?: Function | null;
865
- };
866
- }
867
- export interface ComponentNativeConstructor extends ComponentConstructor {
868
- cmpMeta: ComponentRuntimeMeta;
869
- }
870
- export type ComponentConstructorEncapsulation = 'shadow' | 'scoped' | 'none';
871
- export interface ComponentConstructorProperties {
872
- [propName: string]: ComponentConstructorProperty;
873
- }
874
- export interface ComponentConstructorProperty {
875
- attribute?: string;
876
- elementRef?: boolean;
877
- method?: boolean;
878
- mutable?: boolean;
879
- reflect?: boolean;
880
- state?: boolean;
881
- type?: ComponentConstructorPropertyType;
882
- watchCallbacks?: string[];
883
- }
884
- export type ComponentConstructorPropertyType = StringConstructor | BooleanConstructor | NumberConstructor | 'string' | 'boolean' | 'number';
885
- export interface ComponentConstructorEvent {
886
- name: string;
887
- method: string;
888
- bubbles: boolean;
889
- cancelable: boolean;
890
- composed: boolean;
891
- }
892
- export interface ComponentConstructorListener {
893
- name: string;
894
- method: string;
895
- capture?: boolean;
896
- passive?: boolean;
897
- }
898
- export interface DevClientWindow extends Window {
899
- ['s-dev-server']: boolean;
900
- ['s-initial-load']: boolean;
901
- ['s-build-id']: number;
902
- WebSocket: new (socketUrl: string, protos: string[]) => WebSocket;
903
- devServerConfig?: DevClientConfig;
904
- }
905
- export interface DevClientConfig {
906
- basePath: string;
907
- editors: DevServerEditor[];
908
- reloadStrategy: PageReloadStrategy;
909
- socketUrl?: string;
910
- }
911
- export interface HttpRequest {
912
- method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS';
913
- acceptHeader: string;
914
- url: URL;
915
- searchParams: URLSearchParams;
916
- pathname?: string;
917
- filePath?: string;
918
- stats?: CompilerFsStats;
919
- headers?: {
920
- [name: string]: string;
921
- };
922
- host?: string;
923
- }
924
- export interface DevServerMessage {
925
- startServer?: DevServerConfig;
926
- closeServer?: boolean;
927
- serverStarted?: DevServerConfig;
928
- serverClosed?: boolean;
929
- buildStart?: boolean;
930
- buildLog?: BuildLog;
931
- buildResults?: CompilerBuildResults;
932
- requestBuildResults?: boolean;
933
- error?: {
934
- message?: string;
935
- type?: string;
936
- stack?: any;
937
- };
938
- isActivelyBuilding?: boolean;
939
- compilerRequestPath?: string;
940
- compilerRequestResults?: CompilerRequestResponse;
941
- requestLog?: {
942
- method: string;
943
- url: string;
944
- status: number;
945
- };
946
- }
947
- export type DevServerSendMessage = (msg: DevServerMessage) => void;
948
- export interface DevServerContext {
949
- connectorHtml: string;
950
- dirTemplate: string;
951
- getBuildResults: () => Promise<CompilerBuildResults>;
952
- getCompilerRequest: (path: string) => Promise<CompilerRequestResponse>;
953
- isServerListening: boolean;
954
- logRequest: (req: HttpRequest, status: number) => void;
955
- prerenderConfig: PrerenderConfig;
956
- serve302: (req: any, res: any, pathname?: string) => void;
957
- serve404: (req: any, res: any, xSource: string, content?: string) => void;
958
- serve500: (req: any, res: any, error: any, xSource: string) => void;
959
- sys: CompilerSystem;
960
- }
961
- export type InitServerProcess = (sendMsg: (msg: DevServerMessage) => void) => (msg: DevServerMessage) => void;
962
- export interface DevResponseHeaders {
963
- 'cache-control'?: string;
964
- expires?: string;
965
- 'content-type'?: string;
966
- 'content-length'?: number;
967
- date?: string;
968
- 'access-control-allow-origin'?: string;
969
- 'access-control-expose-headers'?: string;
970
- 'content-encoding'?: 'gzip';
971
- vary?: 'Accept-Encoding';
972
- server?: string;
973
- 'x-directory-index'?: string;
974
- 'x-source'?: string;
975
- }
976
- export interface OpenInEditorData {
977
- file?: string;
978
- line?: number;
979
- column?: number;
980
- open?: string;
981
- editor?: string;
982
- exists?: boolean;
983
- error?: string;
984
- }
985
- export interface EntryModule {
986
- entryKey: string;
987
- cmps: ComponentCompilerMeta[];
988
- }
989
- /**
990
- * An interface extending `HTMLElement` which describes the fields added onto
991
- * host HTML elements by the Stencil runtime.
992
- */
993
- export interface HostElement extends HTMLElement {
994
- connectedCallback?: () => void;
995
- attributeChangedCallback?: (attribName: string, oldVal: string, newVal: string, namespace: string) => void;
996
- disconnectedCallback?: () => void;
997
- host?: Element;
998
- forceUpdate?: () => void;
999
- __stencil__getHostRef?: () => HostRef;
1000
- /**
1001
- * Unique stencil id for this element
1002
- */
1003
- ['s-id']?: string;
1004
- /**
1005
- * Content Reference:
1006
- * Reference to the HTML Comment that's placed inside of the
1007
- * host element's original content. This comment is used to
1008
- * always represent where host element's light dom is.
1009
- */
1010
- ['s-cr']?: RenderNode;
1011
- /**
1012
- * Lifecycle ready
1013
- */
1014
- ['s-lr']?: boolean;
1015
- /**
1016
- * A reference to the `ElementInternals` object for the current host
1017
- *
1018
- * This is used for maintaining a reference to the object between HMR
1019
- * refreshes in the lazy build.
1020
- *
1021
- * "stencil-element-internals"
1022
- */
1023
- ['s-ei']?: ElementInternals;
1024
- /**
1025
- * On Render Callbacks:
1026
- * Array of callbacks to fire off after it has rendered.
1027
- */
1028
- ['s-rc']?: (() => void)[];
1029
- /**
1030
- * Scope Id
1031
- * The scope id of this component when using scoped css encapsulation
1032
- * or using shadow dom but the browser doesn't support it
1033
- */
1034
- ['s-sc']?: string;
1035
- /**
1036
- * Scope Ids
1037
- * All the possible scope ids of this component when using scoped css encapsulation
1038
- * or using shadow dom but the browser doesn't support it
1039
- */
1040
- ['s-scs']?: string[];
1041
- /**
1042
- * Hot Module Replacement, dev mode only
1043
- *
1044
- * This function should be defined by the HMR-supporting runtime and should
1045
- * do the work of actually updating the component in-place.
1046
- */
1047
- ['s-hmr']?: (versionId: string) => void;
1048
- /**
1049
- * A list of nested nested hydration promises that
1050
- * must be resolved for the top, ancestor component to be fully hydrated
1051
- */
1052
- ['s-p']?: Promise<void>[];
1053
- componentOnReady?: () => Promise<this>;
1054
- }
1055
- export interface HydrateResults {
1056
- buildId: string;
1057
- diagnostics: Diagnostic[];
1058
- url: string;
1059
- host: string | null;
1060
- hostname: string | null;
1061
- href: string | null;
1062
- port: string | null;
1063
- pathname: string | null;
1064
- search: string | null;
1065
- hash: string | null;
1066
- html: string | null;
1067
- components: HydrateComponent[];
1068
- anchors: HydrateAnchorElement[];
1069
- imgs: HydrateImgElement[];
1070
- scripts: HydrateScriptElement[];
1071
- styles: HydrateStyleElement[];
1072
- staticData: HydrateStaticData[];
1073
- title: string | null;
1074
- hydratedCount: number;
1075
- httpStatus: number | null;
1076
- }
1077
- export interface HydrateComponent {
1078
- tag: string;
1079
- mode: string;
1080
- count: number;
1081
- depth: number;
1082
- }
1083
- export interface HydrateElement {
1084
- [attrName: string]: string | undefined;
1085
- }
1086
- export interface HydrateAnchorElement extends HydrateElement {
1087
- href?: string;
1088
- target?: string;
1089
- }
1090
- export interface HydrateImgElement extends HydrateElement {
1091
- src?: string;
1092
- }
1093
- export interface HydrateScriptElement extends HydrateElement {
1094
- src?: string;
1095
- type?: string;
1096
- }
1097
- export interface HydrateStyleElement extends HydrateElement {
1098
- id?: string;
1099
- href?: string;
1100
- content?: string;
1101
- }
1102
- export interface HydrateStaticData {
1103
- id: string;
1104
- type: string;
1105
- content: string;
1106
- }
1107
- export interface JsDoc {
1108
- name: string;
1109
- documentation: string;
1110
- type: string;
1111
- tags: JSDocTagInfo[];
1112
- default?: string;
1113
- parameters?: JsDoc[];
1114
- returns?: {
1115
- type: string;
1116
- documentation: string;
1117
- };
1118
- }
1119
- export interface JSDocTagInfo {
1120
- name: string;
1121
- text?: string;
1122
- }
1123
- /**
1124
- * A mapping from a TypeScript or JavaScript source file path on disk, to a Stencil {@link Module}.
1125
- *
1126
- * It is advised that the key (path) be normalized before storing/retrieving the `Module` to avoid unnecessary lookup
1127
- * failures.
1128
- */
1129
- export type ModuleMap = Map<string, Module>;
1130
- /**
1131
- * Stencil's Intermediate Representation (IR) of a module, bundling together
1132
- * various pieces of information like the classes declared within it, the path
1133
- * to the original source file, HTML tag names defined in the file, and so on.
1134
- *
1135
- * Note that this gets serialized/parsed as JSON and therefore cannot contain a
1136
- * `Map` or a `Set`.
1137
- */
1138
- export interface Module {
1139
- cmps: ComponentCompilerMeta[];
1140
- isMixin: boolean;
1141
- isExtended: boolean;
1142
- /**
1143
- * A collection of modules that a component will need. The modules in this list must have import statements generated
1144
- * in order for the component to function.
1145
- */
1146
- coreRuntimeApis: string[];
1147
- /**
1148
- * A collection of modules that a component will need for a specific output target. The modules in this list must
1149
- * have import statements generated in order for the component to function, but only for a specific output target.
1150
- */
1151
- outputTargetCoreRuntimeApis: Partial<Record<OutputTarget['type'], string[]>>;
1152
- collectionName: string;
1153
- dtsFilePath: string;
1154
- excludeFromCollection: boolean;
1155
- externalImports: string[];
1156
- htmlAttrNames: string[];
1157
- htmlTagNames: string[];
1158
- htmlParts: string[];
1159
- isCollectionDependency: boolean;
1160
- isLegacy: boolean;
1161
- jsFilePath: string;
1162
- localImports: string[];
1163
- /**
1164
- * Source file paths of functional components that are used in JSX/h() calls.
1165
- * This is used to ensure htmlTagNames are properly propagated from functional
1166
- * component dependencies even when they're accessed indirectly (e.g., via barrel files).
1167
- */
1168
- functionalComponentDeps: string[];
1169
- originalImports: string[];
1170
- originalCollectionComponentPath: string;
1171
- potentialCmpRefs: string[];
1172
- sourceFilePath: string;
1173
- staticSourceFile: any;
1174
- staticSourceFileText: string;
1175
- sourceMapPath: string;
1176
- sourceMapFileText: string;
1177
- hasVdomAttribute: boolean;
1178
- hasVdomClass: boolean;
1179
- hasVdomFunctional: boolean;
1180
- hasVdomKey: boolean;
1181
- hasVdomListener: boolean;
1182
- hasVdomPropOrAttr: boolean;
1183
- hasVdomRef: boolean;
1184
- hasVdomRender: boolean;
1185
- hasVdomStyle: boolean;
1186
- hasVdomText: boolean;
1187
- hasVdomXlink: boolean;
1188
- }
1189
- export interface Plugin {
1190
- name?: string;
1191
- pluginType?: string;
1192
- load?: (id: string, context: PluginCtx) => Promise<string> | string;
1193
- resolveId?: (importee: string, importer: string, context: PluginCtx) => Promise<string> | string;
1194
- transform?: (sourceText: string, id: string, context: PluginCtx) => Promise<PluginTransformResults> | PluginTransformResults;
1195
- }
1196
- export type PluginTransformResults = PluginTransformationDescriptor | string | null;
1197
- export interface PluginTransformationDescriptor {
1198
- code?: string;
1199
- map?: string;
1200
- id?: string;
1201
- diagnostics?: Diagnostic[];
1202
- dependencies?: string[];
1203
- }
1204
- export interface PluginCtx {
1205
- config: Config;
1206
- sys: CompilerSystem;
1207
- fs: InMemoryFileSystem;
1208
- cache: Cache;
1209
- diagnostics: Diagnostic[];
1210
- }
1211
- export interface PrerenderUrlResults {
1212
- anchorUrls: string[];
1213
- diagnostics: Diagnostic[];
1214
- filePath: string;
1215
- }
1216
- export interface PrerenderUrlRequest {
1217
- appDir: string;
1218
- buildId: string;
1219
- baseUrl: string;
1220
- componentGraphPath: string;
1221
- devServerHostUrl: string;
1222
- hydrateAppFilePath: string;
1223
- isDebug: boolean;
1224
- prerenderConfigPath: string;
1225
- staticSite: boolean;
1226
- templateId: string;
1227
- url: string;
1228
- writeToFilePath: string;
1229
- }
1230
- export interface PrerenderManager {
1231
- config: Config;
1232
- prerenderUrlWorker: (prerenderRequest: PrerenderUrlRequest) => Promise<PrerenderUrlResults>;
1233
- devServerHostUrl: string;
1234
- diagnostics: Diagnostic[];
1235
- hydrateAppFilePath: string;
1236
- isDebug: boolean;
1237
- logCount: number;
1238
- outputTarget: OutputTargetWww;
1239
- prerenderConfig: PrerenderConfig;
1240
- prerenderConfigPath: string;
1241
- progressLogger?: LoggerLineUpdater;
1242
- resolve: Function;
1243
- staticSite: boolean;
1244
- templateId: string;
1245
- componentGraphPath: string;
1246
- urlsProcessing: Set<string>;
1247
- urlsPending: Set<string>;
1248
- urlsCompleted: Set<string>;
1249
- maxConcurrency: number;
1250
- }
1251
- /**
1252
- * Generic node that represents all of the
1253
- * different types of nodes we'd see when rendering
1254
- */
1255
- export interface RenderNode extends HostElement {
1256
- /**
1257
- * Shadow root's host
1258
- */
1259
- host?: Element;
1260
- /**
1261
- * On Ref Function:
1262
- * Callback function to be called when the slotted node ref is ready.
1263
- */
1264
- ['s-rf']?: (elm: Element) => unknown;
1265
- /**
1266
- * Is initially hidden
1267
- * Whether this node was originally rendered with the `hidden` attribute.
1268
- *
1269
- * Used to reset the `hidden` state of a node during slot relocation.
1270
- */
1271
- ['s-ih']?: boolean;
1272
- /**
1273
- * Is Content Reference Node:
1274
- * This node is a content reference node.
1275
- */
1276
- ['s-cn']?: boolean;
1277
- /**
1278
- * Is a `slot` node when `shadow: false` (or `scoped: true`).
1279
- *
1280
- * This is a node (either empty text-node or `<slot-fb>` element)
1281
- * that represents where a `<slot>` is located in the original JSX.
1282
- */
1283
- ['s-sr']?: boolean;
1284
- /**
1285
- * Slot name of either the slot itself or the slotted node
1286
- */
1287
- ['s-sn']?: string;
1288
- /**
1289
- * Host element tag name:
1290
- * The tag name of the host element that this
1291
- * node was created in.
1292
- */
1293
- ['s-hn']?: string;
1294
- /**
1295
- * Slot host tag name:
1296
- * This is the tag name of the element where this node
1297
- * has been moved to during slot relocation.
1298
- *
1299
- * This allows us to check if the node has been moved and prevent
1300
- * us from thinking a node _should_ be moved when it may already be in
1301
- * its final destination.
1302
- *
1303
- * This value is set to `undefined` whenever the node is put back into its original location.
1304
- */
1305
- ['s-sh']?: string;
1306
- /**
1307
- * Original Location Reference:
1308
- * A reference pointing to the comment
1309
- * which represents the original location
1310
- * before it was moved to its slot.
1311
- */
1312
- ['s-ol']?: RenderNode;
1313
- /**
1314
- * Node reference:
1315
- * This is a reference from an original location node
1316
- * back to the node that's been moved around.
1317
- */
1318
- ['s-nr']?: PatchedSlotNode | RenderNode;
1319
- /**
1320
- * Original Order:
1321
- * During SSR; a number representing the order of a slotted node
1322
- */
1323
- ['s-oo']?: number;
1324
- /**
1325
- * Scope Id
1326
- */
1327
- ['s-si']?: string;
1328
- /**
1329
- * Host Id (hydrate only)
1330
- */
1331
- ['s-host-id']?: number;
1332
- /**
1333
- * Node Id (hydrate only)
1334
- */
1335
- ['s-node-id']?: number;
1336
- /**
1337
- * Used to know the components encapsulation.
1338
- * empty "" for shadow, "c" from scoped
1339
- */
1340
- ['s-en']?: '' | /*shadow*/ 'c';
1341
- /**
1342
- * On a `scoped: true` component
1343
- * with `experimentalSlotFixes` flag enabled,
1344
- * returns the internal `childNodes` of the component
1345
- */
1346
- readonly __childNodes?: NodeListOf<ChildNode>;
1347
- /**
1348
- * On a `scoped: true` component
1349
- * with `experimentalSlotFixes` flag enabled,
1350
- * returns the internal `children` of the component
1351
- */
1352
- readonly __children?: HTMLCollectionOf<Element>;
1353
- /**
1354
- * On a `scoped: true` component
1355
- * with `experimentalSlotFixes` flag enabled,
1356
- * returns the internal `firstChild` of the component
1357
- */
1358
- readonly __firstChild?: ChildNode;
1359
- /**
1360
- * On a `scoped: true` component
1361
- * with `experimentalSlotFixes` flag enabled,
1362
- * returns the internal `lastChild` of the component
1363
- */
1364
- readonly __lastChild?: ChildNode;
1365
- /**
1366
- * On a `scoped: true` component
1367
- * with `experimentalSlotFixes` flag enabled,
1368
- * returns the internal `textContent` of the component
1369
- */
1370
- __textContent?: string;
1371
- /**
1372
- * On a `scoped: true` component
1373
- * with `experimentalSlotFixes` flag enabled,
1374
- * gives access to the original `append` method
1375
- */
1376
- __append?: (...nodes: (Node | string)[]) => void;
1377
- /**
1378
- * On a `scoped: true` component
1379
- * with `experimentalSlotFixes` flag enabled,
1380
- * gives access to the original `prepend` method
1381
- */
1382
- __prepend?: (...nodes: (Node | string)[]) => void;
1383
- /**
1384
- * On a `scoped: true` component
1385
- * with `experimentalSlotFixes` flag enabled,
1386
- * gives access to the original `appendChild` method
1387
- */
1388
- __appendChild?: <T extends Node>(newChild: T) => T;
1389
- /**
1390
- * On a `scoped: true` component
1391
- * with `experimentalSlotFixes` flag enabled,
1392
- * gives access to the original `insertBefore` method
1393
- */
1394
- __insertBefore?: <T extends Node>(node: T, child: Node | null) => T;
1395
- /**
1396
- * On a `scoped: true` component
1397
- * with `experimentalSlotFixes` flag enabled,
1398
- * gives access to the original `removeChild` method
1399
- */
1400
- __removeChild?: <T extends Node>(child: T) => T;
1401
- }
1402
- export interface PatchedSlotNode extends Node {
1403
- /**
1404
- * Slot name
1405
- */
1406
- ['s-sn']?: string;
1407
- /**
1408
- * Original Location Reference:
1409
- * A reference pointing to the comment
1410
- * which represents the original location
1411
- * before it was moved to its slot.
1412
- */
1413
- ['s-ol']?: RenderNode;
1414
- /**
1415
- * Slot host tag name:
1416
- * This is the tag name of the element where this node
1417
- * has been moved to during slot relocation.
1418
- *
1419
- * This allows us to check if the node has been moved and prevent
1420
- * us from thinking a node _should_ be moved when it may already be in
1421
- * its final destination.
1422
- *
1423
- * This value is set to `undefined` whenever the node is put back into its original location.
1424
- */
1425
- ['s-sh']?: string;
1426
- /**
1427
- * Is a `slot` node when `shadow: false` (or `scoped: true`).
1428
- *
1429
- * This is a node (either empty text-node or `<slot-fb>` element)
1430
- * that represents where a `<slot>` is located in the original JSX.
1431
- */
1432
- ['s-sr']?: boolean;
1433
- /**
1434
- * On a `scoped: true` component
1435
- * with `experimentalSlotFixes` flag enabled,
1436
- * returns the actual `parentNode` of the component
1437
- */
1438
- __parentNode?: RenderNode;
1439
- /**
1440
- * On a `scoped: true` component
1441
- * with `experimentalSlotFixes` flag enabled,
1442
- * returns the actual `nextSibling` of the component
1443
- */
1444
- __nextSibling?: RenderNode;
1445
- /**
1446
- * On a `scoped: true` component
1447
- * with `experimentalSlotFixes` flag enabled,
1448
- * returns the actual `previousSibling` of the component
1449
- */
1450
- __previousSibling?: RenderNode;
1451
- /**
1452
- * On a `scoped: true` component
1453
- * with `experimentalSlotFixes` flag enabled,
1454
- * returns the actual `nextElementSibling` of the component
1455
- */
1456
- __nextElementSibling?: RenderNode;
1457
- /**
1458
- * On a `scoped: true` component
1459
- * with `experimentalSlotFixes` flag enabled,
1460
- * returns the actual `nextElementSibling` of the component
1461
- */
1462
- __previousElementSibling?: RenderNode;
1463
- }
1464
- export type LazyBundlesRuntimeData = LazyBundleRuntimeData[];
1465
- export type LazyBundleRuntimeData = [
1466
- /** bundleIds */
1467
- string,
1468
- ComponentRuntimeMetaCompact[]
1469
- ];
1470
- export type ComponentRuntimeMetaCompact = [
1471
- /** flags */
1472
- number,
1473
- /** tagname */
1474
- string,
1475
- /** members */
1476
- {
1477
- [memberName: string]: ComponentRuntimeMember;
1478
- }?,
1479
- /** listeners */
1480
- ComponentRuntimeHostListener[]?,
1481
- /** watchers */
1482
- ComponentConstructorChangeHandlers?,
1483
- /** serializers */
1484
- ComponentConstructorChangeHandlers?,
1485
- /** deserializers */
1486
- ComponentConstructorChangeHandlers?
1487
- ];
1488
- /**
1489
- * Runtime metadata for a Stencil component
1490
- */
1491
- export interface ComponentRuntimeMeta {
1492
- /**
1493
- * This number is used to hold a series of bitflags for various features we
1494
- * support on components. The flags which this value is intended to store are
1495
- * documented in the `CMP_FLAGS` enum.
1496
- */
1497
- $flags$: number;
1498
- /**
1499
- * Just what it says on the tin - the tag name for the component, as set in
1500
- * the `@Component` decorator.
1501
- */
1502
- $tagName$: string;
1503
- /**
1504
- * A map of the component's members, which could include fields decorated
1505
- * with `@Prop`, `@State`, etc as well as methods.
1506
- */
1507
- $members$?: ComponentRuntimeMembers;
1508
- /**
1509
- * Information about listeners on the component.
1510
- */
1511
- $listeners$?: ComponentRuntimeHostListener[];
1512
- /**
1513
- * Tuples containing information about `@Prop` fields on the component which
1514
- * are set to be reflected (i.e. kept in sync) as HTML attributes when
1515
- * updated.
1516
- */
1517
- $attrsToReflect$?: ComponentRuntimeReflectingAttr[];
1518
- /**
1519
- * Information about which class members have watchers attached on the component.
1520
- */
1521
- $watchers$?: ComponentConstructorChangeHandlers;
1522
- /**
1523
- * A bundle ID used for lazy loading.
1524
- */
1525
- $lazyBundleId$?: string;
1526
- /**
1527
- * Information about which class members have prop > attribute serializers attached on the component.
1528
- */
1529
- $serializers$?: ComponentConstructorChangeHandlers;
1530
- /**
1531
- * Information about which class members have attribute > prop deserializers attached on the component.
1532
- */
1533
- $deserializers$?: ComponentConstructorChangeHandlers;
1534
- }
1535
- /**
1536
- * A mapping of the names of members on the component to some runtime-specific
1537
- * information about them.
1538
- */
1539
- export interface ComponentRuntimeMembers {
1540
- [memberName: string]: ComponentRuntimeMember;
1541
- }
1542
- /**
1543
- * A tuple with information about a class member that's relevant at runtime.
1544
- * The fields are:
1545
- *
1546
- * 1. A number used to hold bitflags for component members. The bit flags which
1547
- * this is intended to store are documented in the `MEMBER_FLAGS` enum.
1548
- * 2. The attribute name to observe.
1549
- */
1550
- export type ComponentRuntimeMember = [number, string?];
1551
- /**
1552
- * A tuple holding information about a host listener which is relevant at
1553
- * runtime. The field are:
1554
- *
1555
- * 1. A number used to hold bitflags for listeners. The bit flags which this is
1556
- * intended to store are documented in the `LISTENER_FLAGS` enum.
1557
- * 2. The event name.
1558
- * 3. The method name.
1559
- */
1560
- export type ComponentRuntimeHostListener = [number, string, string];
1561
- /**
1562
- * A tuple containing information about props which are "reflected" at runtime,
1563
- * meaning that HTML attributes on the component instance are kept in sync with
1564
- * the prop value.
1565
- *
1566
- * The fields are:
1567
- *
1568
- * 1. the prop name
1569
- * 2. the prop attribute.
1570
- */
1571
- export type ComponentRuntimeReflectingAttr = [string, string | undefined];
1572
- /**
1573
- * A runtime component reference, consistent of either a host element _or_ an
1574
- * empty object. This is used in particular in a few different places as the
1575
- * keys in a `WeakMap` which maps {@link HostElement} instances to their
1576
- * associated {@link HostRef} instance.
1577
- */
1578
- export type RuntimeRef = HostElement | {
1579
- __stencil__getHostRef?: () => HostRef;
1580
- };
1581
- /**
1582
- * Interface used to track an Element, it's virtual Node (`VNode`), and other data
1583
- */
1584
- export interface HostRef {
1585
- $ancestorComponent$?: HostElement;
1586
- $flags$: number;
1587
- $cmpMeta$: ComponentRuntimeMeta;
1588
- $hostElement$: HostElement;
1589
- $instanceValues$?: Map<string, any>;
1590
- $serializerValues$?: Map<string, string>;
1591
- $lazyInstance$?: ComponentInterface;
1592
- /**
1593
- * A list of callback functions called immediately after a lazy component module has been fetched.
1594
- */
1595
- $fetchedCbList$?: ((elm: HostElement) => void)[];
1596
- /**
1597
- * A promise that gets resolved if `BUILD.asyncLoading` is enabled and after the `componentDidLoad`
1598
- * and before the `componentDidUpdate` lifecycle events are triggered.
1599
- */
1600
- $onReadyPromise$?: Promise<HostElement>;
1601
- /**
1602
- * A callback which resolves {@link HostRef.$onReadyPromise$}
1603
- * @param elm host element
1604
- */
1605
- $onReadyResolve$?: (elm: HostElement) => void;
1606
- /**
1607
- * A promise which resolves with the host component once it has finished rendering
1608
- * for the first time. This is primarily used to wait for the first `update` to be
1609
- * called on a component.
1610
- */
1611
- $onInstancePromise$?: Promise<HostElement>;
1612
- /**
1613
- * A callback which resolves {@link HostRef.$onInstancePromise$}
1614
- * @param elm host element
1615
- */
1616
- $onInstanceResolve$?: (elm: HostElement) => void;
1617
- /**
1618
- * A promise which resolves when the component has finished rendering for the first time.
1619
- * It is called after {@link HostRef.$onInstancePromise$} resolves.
1620
- */
1621
- $onRenderResolve$?: () => void;
1622
- $vnode$?: VNode;
1623
- $queuedListeners$?: [string, any][];
1624
- $rmListeners$?: (() => void)[];
1625
- $modeName$?: string;
1626
- $renderCount$?: number;
1627
- /**
1628
- * Defer connectedCallback until after first render for components with slot relocation.
1629
- */
1630
- $deferredConnectedCallback$?: boolean;
1631
- }
1632
- export interface PlatformRuntime {
1633
- /**
1634
- * This number is used to hold a series of bitflags for various features we
1635
- * support within the runtime. The flags which this value is intended to store are
1636
- * documented in the {@link PLATFORM_FLAGS} enum.
1637
- */
1638
- $flags$: number;
1639
- /**
1640
- * Holds a map of nodes to be hydrated.
1641
- */
1642
- $orgLocNodes$?: Map<string, RenderNode>;
1643
- /**
1644
- * Holds the resource url for given platform environment.
1645
- */
1646
- $resourcesUrl$: string;
1647
- /**
1648
- * The nonce value to be applied to all script/style tags at runtime.
1649
- * If `null`, the nonce attribute will not be applied.
1650
- */
1651
- $nonce$?: string | null;
1652
- /**
1653
- * A utility function that executes a given function and returns the result.
1654
- * @param c The callback function to execute
1655
- */
1656
- jmp: (c: Function) => any;
1657
- /**
1658
- * A wrapper for {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame `requestAnimationFrame`}
1659
- */
1660
- raf: (c: FrameRequestCallback) => number;
1661
- /**
1662
- * A wrapper for {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener `addEventListener`}
1663
- */
1664
- ael: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
1665
- /**
1666
- * A wrapper for {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener `removeEventListener`}
1667
- */
1668
- rel: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
1669
- /**
1670
- * A wrapper for creating a {@link https://developer.mozilla.org/docs/Web/API/CustomEvent `CustomEvent`}
1671
- */
1672
- ce: (eventName: string, opts?: any) => CustomEvent;
1673
- }
1674
- export type StyleMap = Map<string, CSSStyleSheet | string>;
1675
- export type RootAppliedStyleMap = WeakMap<Element, Set<string>>;
1676
- export interface ScreenshotConnector {
1677
- initBuild(opts: ScreenshotConnectorOptions): Promise<void>;
1678
- completeBuild(masterBuild: ScreenshotBuild): Promise<ScreenshotBuildResults>;
1679
- getMasterBuild(): Promise<ScreenshotBuild>;
1680
- pullMasterBuild(): Promise<void>;
1681
- publishBuild(buildResults: ScreenshotBuildResults): Promise<ScreenshotBuildResults>;
1682
- getScreenshotCache(): Promise<ScreenshotCache>;
1683
- updateScreenshotCache(screenshotCache: ScreenshotCache, buildResults: ScreenshotBuildResults): Promise<ScreenshotCache>;
1684
- generateJsonpDataUris(build: ScreenshotBuild): Promise<void>;
1685
- sortScreenshots(screenshots: Screenshot[]): Screenshot[];
1686
- toJson(masterBuild: ScreenshotBuild, screenshotCache: ScreenshotCache): string;
1687
- }
1688
- export interface ScreenshotBuildResults {
1689
- appNamespace: string;
1690
- masterBuild: ScreenshotBuild;
1691
- currentBuild: ScreenshotBuild;
1692
- compare: ScreenshotCompareResults;
1693
- }
1694
- export interface ScreenshotCompareResults {
1695
- id: string;
1696
- a: {
1697
- id: string;
1698
- message: string;
1699
- author: string;
1700
- url: string;
1701
- previewUrl: string;
1702
- };
1703
- b: {
1704
- id: string;
1705
- message: string;
1706
- author: string;
1707
- url: string;
1708
- previewUrl: string;
1709
- };
1710
- timestamp: number;
1711
- url: string;
1712
- appNamespace: string;
1713
- diffs: ScreenshotDiff[];
1714
- }
1715
- export interface ScreenshotConnectorOptions {
1716
- buildId: string;
1717
- buildMessage: string;
1718
- buildAuthor?: string;
1719
- buildUrl?: string;
1720
- previewUrl?: string;
1721
- appNamespace: string;
1722
- buildTimestamp: number;
1723
- logger: Logger;
1724
- rootDir: string;
1725
- cacheDir: string;
1726
- packageDir: string;
1727
- screenshotDirName?: string;
1728
- imagesDirName?: string;
1729
- buildsDirName?: string;
1730
- currentBuildDir?: string;
1731
- updateMaster?: boolean;
1732
- allowableMismatchedPixels?: number;
1733
- allowableMismatchedRatio?: number;
1734
- pixelmatchThreshold?: number;
1735
- waitBeforeScreenshot?: number;
1736
- pixelmatchModulePath?: string;
1737
- }
1738
- export interface ScreenshotBuildData {
1739
- buildId: string;
1740
- rootDir: string;
1741
- screenshotDir: string;
1742
- imagesDir: string;
1743
- buildsDir: string;
1744
- currentBuildDir: string;
1745
- updateMaster: boolean;
1746
- allowableMismatchedPixels: number;
1747
- allowableMismatchedRatio: number;
1748
- pixelmatchThreshold: number;
1749
- masterScreenshots: {
1750
- [screenshotId: string]: string;
1751
- };
1752
- cache: {
1753
- [cacheKey: string]: number;
1754
- };
1755
- timeoutBeforeScreenshot: number;
1756
- pixelmatchModulePath: string;
1757
- }
1758
- export interface PixelMatchInput {
1759
- imageAPath: string;
1760
- imageBPath: string;
1761
- width: number;
1762
- height: number;
1763
- pixelmatchThreshold: number;
1764
- }
1765
- export interface ScreenshotBuild {
1766
- id: string;
1767
- message: string;
1768
- author?: string;
1769
- url?: string;
1770
- previewUrl?: string;
1771
- appNamespace: string;
1772
- timestamp: number;
1773
- screenshots: Screenshot[];
1774
- }
1775
- export interface ScreenshotCache {
1776
- timestamp?: number;
1777
- lastBuildId?: string;
1778
- size?: number;
1779
- items?: {
1780
- /**
1781
- * Cache key
1782
- */
1783
- key: string;
1784
- /**
1785
- * Timestamp used to remove the oldest data
1786
- */
1787
- ts: number;
1788
- /**
1789
- * Mismatched pixels
1790
- */
1791
- mp: number;
1792
- }[];
1793
- }
1794
- export interface Screenshot {
1795
- id: string;
1796
- desc?: string;
1797
- image: string;
1798
- device?: string;
1799
- userAgent?: string;
1800
- width: number;
1801
- height: number;
1802
- deviceScaleFactor?: number;
1803
- hasTouch?: boolean;
1804
- isLandscape?: boolean;
1805
- isMobile?: boolean;
1806
- testPath?: string;
1807
- diff?: ScreenshotDiff;
1808
- }
1809
- export interface ScreenshotDiff {
1810
- mismatchedPixels: number;
1811
- id: string;
1812
- desc?: string;
1813
- imageA?: string;
1814
- imageB?: string;
1815
- device?: string;
1816
- userAgent?: string;
1817
- width: number;
1818
- height: number;
1819
- deviceScaleFactor?: number;
1820
- hasTouch?: boolean;
1821
- isLandscape?: boolean;
1822
- isMobile?: boolean;
1823
- allowableMismatchedPixels: number;
1824
- allowableMismatchedRatio: number;
1825
- testPath?: string;
1826
- cacheKey?: string;
1827
- }
1828
- export interface ScreenshotOptions {
1829
- /**
1830
- * When true, takes a screenshot of the full scrollable page.
1831
- * Default: `false`
1832
- */
1833
- fullPage?: boolean;
1834
- /**
1835
- * An object which specifies clipping region of the page.
1836
- */
1837
- clip?: ScreenshotBoundingBox;
1838
- /**
1839
- * Hides default white background and allows capturing screenshots with transparency.
1840
- * Default: `false`
1841
- */
1842
- omitBackground?: boolean;
1843
- /**
1844
- * Matching threshold, ranges from `0` to 1. Smaller values make the comparison
1845
- * more sensitive. Defaults to the testing config `pixelmatchThreshold` value;
1846
- */
1847
- pixelmatchThreshold?: number;
1848
- /**
1849
- * Capture the screenshot beyond the viewport.
1850
- *
1851
- * @defaultValue `false` if there is no `clip`. `true` otherwise.
1852
- */
1853
- captureBeyondViewport?: boolean;
1854
- }
1855
- export interface ScreenshotBoundingBox {
1856
- /**
1857
- * The x-coordinate of top-left corner.
1858
- */
1859
- x: number;
1860
- /**
1861
- * The y-coordinate of top-left corner.
1862
- */
1863
- y: number;
1864
- /**
1865
- * The width in pixels.
1866
- */
1867
- width: number;
1868
- /**
1869
- * The height in pixels.
1870
- */
1871
- height: number;
1872
- }
1873
- export interface StyleCompiler {
1874
- modeName: string;
1875
- styleId: string;
1876
- styleStr: string;
1877
- styleIdentifier: string;
1878
- externalStyles: ExternalStyleCompiler[];
1879
- }
1880
- export interface ExternalStyleCompiler {
1881
- absolutePath: string;
1882
- relativePath: string;
1883
- originalComponentPath: string;
1884
- }
1885
- export interface CompilerModeStyles {
1886
- [modeName: string]: string[];
1887
- }
1888
- export interface CssImportData {
1889
- srcImport: string;
1890
- updatedImport?: string;
1891
- url: string;
1892
- filePath: string;
1893
- altFilePath?: string;
1894
- styleText?: string | null;
1895
- modifiers?: string;
1896
- }
1897
- export interface CssToEsmImportData {
1898
- srcImportText: string;
1899
- varName: string;
1900
- url: string;
1901
- filePath: string;
1902
- /**
1903
- * True if this is a node module import (e.g. using ~ prefix like ~foo/style.css)
1904
- * These should be treated as bare module specifiers and not have ./ prepended
1905
- */
1906
- isNodeModule?: boolean;
1907
- }
1908
- /**
1909
- * Input CSS to be transformed into ESM
1910
- */
1911
- export interface TransformCssToEsmInput {
1912
- input: string;
1913
- module?: 'cjs' | 'esm' | string;
1914
- file?: string;
1915
- tag?: string;
1916
- tags?: string[];
1917
- addTagTransformers: boolean;
1918
- encapsulation?: string;
1919
- /**
1920
- * The mode under which the CSS will be applied.
1921
- *
1922
- * Corresponds to a key used when `@Component`'s `styleUrls` field is an object:
1923
- * ```ts
1924
- * @Component({
1925
- * tag: 'todo-list',
1926
- * styleUrls: {
1927
- * ios: 'todo-list.ios.scss',
1928
- * md: 'todo-list.md.scss',
1929
- * }
1930
- * })
1931
- * ```
1932
- * In the example above, two `TransformCssToEsmInput`s should be created, one for 'ios' and one for 'md' (this field
1933
- * is not shared by multiple fields, nor is it a composite of multiple modes).
1934
- */
1935
- mode?: string;
1936
- sourceMap?: boolean;
1937
- minify?: boolean;
1938
- docs?: boolean;
1939
- autoprefixer?: any;
1940
- styleImportData?: string;
1941
- }
1942
- export interface TransformCssToEsmOutput {
1943
- styleText: string;
1944
- output: string;
1945
- map: any;
1946
- diagnostics: Diagnostic[];
1947
- defaultVarName: string;
1948
- styleDocs: StyleDoc[];
1949
- imports: {
1950
- varName: string;
1951
- importPath: string;
1952
- }[];
1953
- }
1954
- export interface PackageJsonData {
1955
- name?: string;
1956
- version?: string;
1957
- main?: string;
1958
- exports?: {
1959
- [key: string]: string | {
1960
- [key: string]: string;
1961
- };
1962
- };
1963
- description?: string;
1964
- bin?: {
1965
- [key: string]: string;
1966
- };
1967
- browser?: string;
1968
- module?: string;
1969
- 'jsnext:main'?: string;
1970
- 'collection:main'?: string;
1971
- unpkg?: string;
1972
- collection?: string;
1973
- types?: string;
1974
- files?: string[];
1975
- ['dist-tags']?: {
1976
- latest: string;
1977
- };
1978
- dependencies?: {
1979
- [moduleId: string]: string;
1980
- };
1981
- devDependencies?: {
1982
- [moduleId: string]: string;
1983
- };
1984
- repository?: {
1985
- type?: string;
1986
- url?: string;
1987
- };
1988
- private?: boolean;
1989
- scripts?: {
1990
- [runName: string]: string;
1991
- };
1992
- license?: string;
1993
- keywords?: string[];
1994
- }
1995
- export interface Workbox {
1996
- generateSW(swConfig: any): Promise<any>;
1997
- generateFileManifest(): Promise<any>;
1998
- getFileManifestEntries(): Promise<any>;
1999
- injectManifest(swConfig: any): Promise<any>;
2000
- copyWorkboxLibraries(wwwDir: string): Promise<any>;
2001
- }
2002
- declare global {
2003
- namespace jest {
2004
- interface Matchers<R, T> {
2005
- /**
2006
- * Compares HTML, but first normalizes the HTML so all
2007
- * whitespace, attribute order and css class order are
2008
- * the same. When given an element, it will compare
2009
- * the element's `outerHTML`. When given a Document Fragment,
2010
- * such as a Shadow Root, it'll compare its `innerHTML`.
2011
- * Otherwise it'll compare two strings representing HTML.
2012
- */
2013
- toEqualHtml(expectHtml: string): void;
2014
- /**
2015
- * Compares HTML light DOM only, but first normalizes the HTML so all
2016
- * whitespace, attribute order and css class order are
2017
- * the same. When given an element, it will compare
2018
- * the element's `outerHTML`. When given a Document Fragment,
2019
- * such as a Shadow Root, it'll compare its `innerHTML`.
2020
- * Otherwise it'll compare two strings representing HTML.
2021
- */
2022
- toEqualLightHtml(expectLightHtml: string): void;
2023
- /**
2024
- * When given an element, it'll compare the element's
2025
- * `textContent`. Otherwise it'll compare two strings. This
2026
- * matcher will also `trim()` each string before comparing.
2027
- */
2028
- toEqualText(expectTextContent: string): void;
2029
- /**
2030
- * Checks if an element simply has the attribute. It does
2031
- * not check any values of the attribute
2032
- */
2033
- toHaveAttribute(expectAttrName: string): void;
2034
- /**
2035
- * Checks if an element's attribute value equals the expect value.
2036
- */
2037
- toEqualAttribute(expectAttrName: string, expectAttrValue: any): void;
2038
- /**
2039
- * Checks if an element's has each of the expected attribute
2040
- * names and values.
2041
- */
2042
- toEqualAttributes(expectAttrs: {
2043
- [attrName: string]: any;
2044
- }): void;
2045
- /**
2046
- * Checks if an element has the expected css class.
2047
- */
2048
- toHaveClass(expectClassName: string): void;
2049
- /**
2050
- * Checks if an element has each of the expected css classes
2051
- * in the array.
2052
- */
2053
- toHaveClasses(expectClassNames: string[]): void;
2054
- /**
2055
- * Checks if an element has the exact same css classes
2056
- * as the expected array of css classes.
2057
- */
2058
- toMatchClasses(expectClassNames: string[]): void;
2059
- /**
2060
- * When given an EventSpy, checks if the event has been
2061
- * received or not.
2062
- */
2063
- toHaveReceivedEvent(): void;
2064
- /**
2065
- * When given an EventSpy, checks how many times the
2066
- * event has been received.
2067
- */
2068
- toHaveReceivedEventTimes(count: number): void;
2069
- /**
2070
- * When given an EventSpy, checks the event has
2071
- * received the correct custom event `detail` data.
2072
- */
2073
- toHaveReceivedEventDetail(eventDetail: any): void;
2074
- /**
2075
- * When given an EventSpy, checks the first event has
2076
- * received the correct custom event `detail` data.
2077
- */
2078
- toHaveFirstReceivedEventDetail(eventDetail: any): void;
2079
- /**
2080
- * When given an EventSpy, checks the last event has
2081
- * received the correct custom event `detail` data.
2082
- */
2083
- toHaveLastReceivedEventDetail(eventDetail: any): void;
2084
- /**
2085
- * When given an EventSpy, checks the event at an index
2086
- * has received the correct custom event `detail` data.
2087
- */
2088
- toHaveNthReceivedEventDetail(index: number, eventDetail: any): void;
2089
- /**
2090
- * Used to evaluate the results of `compareScreenshot()`, such as
2091
- * `expect(compare).toMatchScreenshot()`. The `allowableMismatchedRatio`
2092
- * value from the testing config is used by default if
2093
- * `MatchScreenshotOptions` were not provided.
2094
- */
2095
- toMatchScreenshot(opts?: MatchScreenshotOptions): void;
2096
- }
2097
- }
2098
- }
2099
- export interface MatchScreenshotOptions {
2100
- /**
2101
- * The `allowableMismatchedPixels` value is the total number of pixels
2102
- * that can be mismatched until the test fails. For example, if the value
2103
- * is `100`, and if there were `101` pixels that were mismatched then the
2104
- * test would fail. If the `allowableMismatchedRatio` is provided it will
2105
- * take precedence, otherwise `allowableMismatchedPixels` will be used.
2106
- */
2107
- allowableMismatchedPixels?: number;
2108
- /**
2109
- * The `allowableMismatchedRatio` ranges from `0` to `1` and is used to
2110
- * determine an acceptable ratio of pixels that can be mismatched before
2111
- * the image is considered to have changes. Realistically, two screenshots
2112
- * representing the same content may have a small number of pixels that
2113
- * are not identical due to anti-aliasing, which is perfectly normal. The
2114
- * `allowableMismatchedRatio` is the number of pixels that were mismatched,
2115
- * divided by the total number of pixels in the screenshot. For example,
2116
- * a ratio value of `0.06` means 6% of the pixels can be mismatched before
2117
- * the image is considered to have changes. If the `allowableMismatchedRatio`
2118
- * is provided it will take precedence, otherwise `allowableMismatchedPixels`
2119
- * will be used.
2120
- */
2121
- allowableMismatchedRatio?: number;
2122
- }
2123
- export interface EventSpy {
2124
- events: SerializedEvent[];
2125
- eventName: string;
2126
- firstEvent: SerializedEvent;
2127
- lastEvent: SerializedEvent;
2128
- length: number;
2129
- next(): Promise<{
2130
- done: boolean;
2131
- value: SerializedEvent;
2132
- }>;
2133
- }
2134
- export interface SerializedEvent {
2135
- bubbles: boolean;
2136
- cancelBubble: boolean;
2137
- cancelable: boolean;
2138
- composed: boolean;
2139
- currentTarget: any;
2140
- defaultPrevented: boolean;
2141
- detail: any;
2142
- eventPhase: any;
2143
- isTrusted: boolean;
2144
- returnValue: any;
2145
- srcElement: any;
2146
- target: any;
2147
- timeStamp: number;
2148
- type: string;
2149
- isSerializedEvent: boolean;
2150
- }
2151
- export interface EventInitDict {
2152
- bubbles?: boolean;
2153
- cancelable?: boolean;
2154
- composed?: boolean;
2155
- detail?: any;
2156
- }
2157
- export interface JestEnvironmentGlobal {
2158
- __NEW_TEST_PAGE__: () => Promise<any>;
2159
- __CLOSE_OPEN_PAGES__: () => Promise<any>;
2160
- loadTestWindow: (testWindow: any) => Promise<void>;
2161
- h: any;
2162
- resourcesUrl: string;
2163
- currentSpec?: {
2164
- id?: string;
2165
- description: string;
2166
- fullName: string;
2167
- testPath: string | null;
2168
- };
2169
- env: {
2170
- [prop: string]: string;
2171
- };
2172
- screenshotDescriptions: Set<string>;
2173
- }
2174
- export interface E2EProcessEnv {
2175
- STENCIL_COMMIT_ID?: string;
2176
- STENCIL_COMMIT_MESSAGE?: string;
2177
- STENCIL_REPO_URL?: string;
2178
- STENCIL_SCREENSHOT_CONNECTOR?: string;
2179
- STENCIL_SCREENSHOT_SERVER?: string;
2180
- __STENCIL_EMULATE_CONFIGS__?: string;
2181
- __STENCIL_ENV__?: string;
2182
- __STENCIL_EMULATE__?: string;
2183
- __STENCIL_BROWSER_URL__?: string;
2184
- __STENCIL_APP_SCRIPT_URL__?: string;
2185
- __STENCIL_APP_STYLE_URL__?: string;
2186
- __STENCIL_BROWSER_WS_ENDPOINT__?: string;
2187
- __STENCIL_BROWSER_WAIT_UNTIL?: string;
2188
- __STENCIL_SCREENSHOT__?: 'true';
2189
- __STENCIL_SCREENSHOT_BUILD__?: string;
2190
- __STENCIL_SCREENSHOT_TIMEOUT_MS__?: string;
2191
- __STENCIL_E2E_TESTS__?: 'true';
2192
- __STENCIL_E2E_DEVTOOLS__?: 'true';
2193
- __STENCIL_SPEC_TESTS__?: 'true';
2194
- __STENCIL_PUPPETEER_MODULE__?: string;
2195
- __STENCIL_PUPPETEER_VERSION__?: number;
2196
- __STENCIL_DEFAULT_TIMEOUT__?: string;
2197
- /**
2198
- * Property for injecting transformAliasedImportPaths into the Jest context
2199
- */
2200
- __STENCIL_TRANSPILE_PATHS__?: 'true' | 'false';
2201
- }
2202
- export interface AnyHTMLElement extends HTMLElement {
2203
- [key: string]: any;
2204
- }
2205
- export interface SpecPage {
2206
- /**
2207
- * Mocked testing `document.body`.
2208
- */
2209
- body: HTMLBodyElement;
2210
- /**
2211
- * Mocked testing `document`.
2212
- */
2213
- doc: HTMLDocument;
2214
- /**
2215
- * The first component found within the mocked `document.body`. If a component isn't found, then it'll return `document.body.firstElementChild`.
2216
- */
2217
- root?: AnyHTMLElement;
2218
- /**
2219
- * Similar to `root`, except returns the component instance. If a root component was not found it'll return `null`.
2220
- */
2221
- rootInstance?: any;
2222
- /**
2223
- * Convenience function to set `document.body.innerHTML` and `waitForChanges()`. Function argument should be a HTML string.
2224
- */
2225
- setContent: (html: string) => Promise<any>;
2226
- /**
2227
- * After changes have been made to a component, such as a update to a property or attribute, the test page does not automatically apply the changes. In order to wait for, and apply the update, call `await page.waitForChanges()`.
2228
- */
2229
- waitForChanges: () => Promise<any>;
2230
- /**
2231
- * Mocked testing `window`.
2232
- */
2233
- win: Window;
2234
- build: BuildConditionals;
2235
- flushLoadModule: (bundleId?: string) => Promise<any>;
2236
- flushQueue: () => Promise<any>;
2237
- styles: Map<string, string>;
2238
- }
2239
- /**
2240
- * Options pertaining to the creation and functionality of a {@link SpecPage}
2241
- */
2242
- export interface NewSpecPageOptions {
2243
- /**
2244
- * An array of components to test. Component classes can be imported into the spec file, then their reference should be added to the `component` array in order to be used throughout the test.
2245
- */
2246
- components: any[];
2247
- /**
2248
- * Sets the mocked `document.cookie`.
2249
- */
2250
- cookie?: string;
2251
- /**
2252
- * Sets the mocked `dir` attribute on `<html>`.
2253
- */
2254
- direction?: string;
2255
- /**
2256
- * If `false`, do not flush the render queue on initial test setup.
2257
- */
2258
- flushQueue?: boolean;
2259
- /**
2260
- * The initial HTML used to generate the test. This can be useful to construct a collection of components working together, and assign HTML attributes. This value sets the mocked `document.body.innerHTML`.
2261
- */
2262
- html?: string;
2263
- /**
2264
- * The initial JSX used to generate the test.
2265
- * Use `template` when you want to initialize a component using their properties, instead of their HTML attributes.
2266
- * It will render the specified template (JSX) into `document.body`.
2267
- */
2268
- template?: () => any;
2269
- /**
2270
- * Sets the mocked `lang` attribute on `<html>`.
2271
- */
2272
- language?: string;
2273
- /**
2274
- * Useful for debugging hydrating components client-side. Sets that the `html` option already includes annotated prerender attributes and comments.
2275
- */
2276
- hydrateClientSide?: boolean;
2277
- /**
2278
- * Useful for debugging hydrating components server-side. The output HTML will also include prerender annotations.
2279
- */
2280
- hydrateServerSide?: boolean;
2281
- /**
2282
- * Sets the mocked `document.referrer`.
2283
- */
2284
- referrer?: string;
2285
- /**
2286
- * Manually set if the mocked document supports Shadow DOM or not. Default is `true`.
2287
- */
2288
- supportsShadowDom?: boolean;
2289
- /**
2290
- * When a component is pre-rendered it includes HTML annotations, such as `s-id` attributes and `<!-t.0->` comments. This information is used by client-side hydrating. Default is `false`.
2291
- */
2292
- includeAnnotations?: boolean;
2293
- /**
2294
- * Sets the mocked browser's `location.href`.
2295
- */
2296
- url?: string;
2297
- /**
2298
- * Sets the mocked browser's `navigator.userAgent`.
2299
- */
2300
- userAgent?: string;
2301
- /**
2302
- * By default, any changes to component properties and attributes must `page.waitForChanges()` in order to test the updates. As an option, `autoApplyChanges` continuously flushes the queue on the background. Default is `false`.
2303
- */
2304
- autoApplyChanges?: boolean;
2305
- /**
2306
- * By default, styles are not attached to the DOM and they are not reflected in the serialized HTML.
2307
- * Setting this option to `true` will include the component's styles in the serializable output.
2308
- */
2309
- attachStyles?: boolean;
2310
- /**
2311
- * Set {@link BuildConditionals} for testing based off the metadata of the component under test.
2312
- * When `true` all `BuildConditionals` will be assigned to the global testing `BUILD` object, regardless of their
2313
- * value. When `false`, only `BuildConditionals` with a value of `true` will be assigned to the `BUILD` object.
2314
- */
2315
- strictBuild?: boolean;
2316
- /**
2317
- * Default values to be set on the platform runtime object {@see PlatformRuntime} when creating
2318
- * the spec page.
2319
- */
2320
- platform?: Partial<PlatformRuntime>;
2321
- }
2322
- /**
2323
- * A record of `TypesMemberNameData` entities.
2324
- *
2325
- * Each key in this record is intended to be the path to a file that declares one or more types used by a component.
2326
- * However, this is not enforced by the type system - users of this interface should not make any assumptions regarding
2327
- * the format of the path used as a key (relative vs. absolute)
2328
- */
2329
- export interface TypesImportData {
2330
- [key: string]: TypesMemberNameData[];
2331
- }
2332
- /**
2333
- * A type describing how Stencil may alias an imported type to avoid naming collisions when performing operations such
2334
- * as generating `components.d.ts` files.
2335
- */
2336
- export interface TypesMemberNameData {
2337
- /**
2338
- * The original name of the import before any aliasing was applied.
2339
- *
2340
- * i.e. if a component imports a type as follows:
2341
- * `import { MyType as MyCoolType } from './my-type';`
2342
- *
2343
- * the `originalName` would be 'MyType'. If the import is not aliased, then `originalName` and `localName` will be the same.
2344
- */
2345
- originalName: string;
2346
- /**
2347
- * The name of the type as it's used within a file.
2348
- */
2349
- localName: string;
2350
- /**
2351
- * An alias that Stencil may apply to the `localName` to avoid naming collisions. This name does not appear in the
2352
- * file that is using `localName`.
2353
- */
2354
- importName?: string;
2355
- /**
2356
- * Whether this is a default import/export (e.g., `import MyEnum from './my-enum'`)
2357
- * vs a named import/export (e.g., `import { MyType } from './my-type'`)
2358
- */
2359
- isDefault?: boolean;
2360
- }
2361
- export interface TypesModule {
2362
- isDep: boolean;
2363
- tagName: string;
2364
- tagNameAsPascal: string;
2365
- htmlElementName: string;
2366
- component: string;
2367
- jsx: string;
2368
- element: string;
2369
- explicitAttributes: string | null;
2370
- explicitProperties: string | null;
2371
- requiredProps: Array<{
2372
- name: string;
2373
- type: string;
2374
- complexType?: ComponentCompilerProperty['complexType'];
2375
- }> | null;
2376
- }
2377
- export type TypeInfo = {
2378
- name: string;
2379
- type: string;
2380
- optional: boolean;
2381
- required: boolean;
2382
- internal: boolean;
2383
- jsdoc?: string;
2384
- }[];
2385
- export type ChildType = VNode | number | string;
2386
- export type PropsType = VNodeProdData | number | string | null;
2387
- export interface VNodeProdData {
2388
- key?: string | number;
2389
- class?: {
2390
- [className: string]: boolean;
2391
- } | string;
2392
- className?: {
2393
- [className: string]: boolean;
2394
- } | string;
2395
- style?: any;
2396
- [key: string]: any;
2397
- }
2398
- /**
2399
- * An abstraction to bundle up four methods which _may_ be handled by
2400
- * dispatching work to workers running in other OS threads or may be called
2401
- * synchronously. Environment and `CompilerSystem` related setup code will
2402
- * determine which one, but in either case the call sites for these methods can
2403
- * dispatch to this shared interface.
2404
- */
2405
- export interface CompilerWorkerContext {
2406
- optimizeCss(inputOpts: OptimizeCssInput): Promise<OptimizeCssOutput>;
2407
- prepareModule(input: string, minifyOpts: any, transpile: boolean, inlineHelpers: boolean): Promise<{
2408
- output: string;
2409
- diagnostics: Diagnostic[];
2410
- sourceMap?: SourceMap;
2411
- }>;
2412
- prerenderWorker(prerenderRequest: PrerenderUrlRequest): Promise<PrerenderUrlResults>;
2413
- transformCssToEsm(input: TransformCssToEsmInput): Promise<TransformCssToEsmOutput>;
2414
- }
2415
- /**
2416
- * The methods that are supported on a {@link CompilerWorkerContext}
2417
- */
2418
- export type WorkerContextMethod = keyof CompilerWorkerContext;
2419
- /**
2420
- * A little type guard which will cause a type error if the parameter `T` does
2421
- * not satisfy {@link CPSerializable} (i.e. if it's not possible to cleanly
2422
- * serialize it for message passing via an IPC channel).
2423
- */
2424
- type IPCSerializable<T extends CPSerializable> = T;
2425
- /**
2426
- * A manifest for a job that a worker thread should carry out, as determined by
2427
- * and dispatched from the main thread. This includes the name of the task to do
2428
- * and any arguments necessary to carry it out properly.
2429
- *
2430
- * This message must satisfy {@link CPSerializable} so it can be sent from the
2431
- * main thread to a worker thread via an IPC channel
2432
- */
2433
- export type MsgToWorker<T extends WorkerContextMethod> = IPCSerializable<{
2434
- stencilId: number;
2435
- method: T;
2436
- args: Parameters<CompilerWorkerContext[T]>;
2437
- }>;
2438
- /**
2439
- * A manifest for a job that a worker thread should carry out, as determined by
2440
- * and dispatched from the main thread. This includes the name of the task to do
2441
- * and any arguments necessary to carry it out properly.
2442
- *
2443
- * This message must satisfy {@link CPSerializable} so it can be sent from the
2444
- * main thread to a worker thread via an IPC channel
2445
- */
2446
- export type MsgFromWorker<T extends WorkerContextMethod> = IPCSerializable<{
2447
- stencilId?: number;
2448
- stencilRtnValue: ReturnType<CompilerWorkerContext[T]>;
2449
- stencilRtnError: string | null;
2450
- }>;
2451
- /**
2452
- * A description of a task which should be passed to a worker in another
2453
- * thread. This interface differs from {@link MsgToWorker} in that it doesn't
2454
- * have to be serializable for transmission through an IPC channel, so we can
2455
- * hold things like a `resolve` and `reject` callback to use when the task
2456
- * completes.
2457
- */
2458
- export interface CompilerWorkerTask {
2459
- stencilId: number;
2460
- inputArgs: any[];
2461
- resolve: (val: any) => any;
2462
- reject: (msg: string) => any;
2463
- retries: number;
2464
- }
2465
- /**
2466
- * A handler for IPC messages from the main thread to a worker thread. This
2467
- * involves dispatching an action specified by a {@link MsgToWorker} object to a
2468
- * {@link CompilerWorkerContext}.
2469
- *
2470
- * @param msgToWorker the message to handle
2471
- * @returns the return value of the specified function
2472
- */
2473
- export type WorkerMsgHandler = <T extends WorkerContextMethod>(msgToWorker: MsgToWorker<T>) => ReturnType<CompilerWorkerContext[T]>;
2474
- export interface TranspileModuleResults {
2475
- sourceFilePath: string;
2476
- code: string;
2477
- map: any;
2478
- diagnostics: Diagnostic[];
2479
- moduleFile: Module;
2480
- }
2481
- export interface ValidateTypesResults {
2482
- diagnostics: Diagnostic[];
2483
- dirPaths: string[];
2484
- filePaths: string[];
2485
- }
2486
- export interface TerminalInfo {
2487
- /**
2488
- * Whether this is in CI or not.
2489
- */
2490
- readonly ci: boolean;
2491
- /**
2492
- * Whether the terminal is an interactive TTY or not.
2493
- */
2494
- readonly tty: boolean;
2495
- }
2496
- /**
2497
- * The task to run in order to collect the duration data point.
2498
- */
2499
- export type TelemetryCallback = (...args: any[]) => void | Promise<void>;
2500
- /**
2501
- * The model for the data that's tracked.
2502
- */
2503
- export interface TrackableData {
2504
- arguments: string[];
2505
- build: string;
2506
- component_count?: number;
2507
- config: Config;
2508
- cpu_model: string | undefined;
2509
- duration_ms: number | undefined;
2510
- has_app_pwa_config: boolean;
2511
- os_name: string | undefined;
2512
- os_version: string | undefined;
2513
- packages: string[];
2514
- packages_no_versions?: string[];
2515
- rollup: string;
2516
- stencil: string;
2517
- system: string;
2518
- system_major?: string;
2519
- targets: string[];
2520
- task: TaskCommand | null;
2521
- typescript: string;
2522
- yarn: boolean;
2523
- }
2524
- /**
2525
- * Used as the object sent to the server. Value is the data tracked.
2526
- */
2527
- export interface Metric {
2528
- name: string;
2529
- timestamp: string;
2530
- source: 'stencil_cli';
2531
- value: TrackableData;
2532
- session_id: string;
2533
- }
2534
- export interface TelemetryConfig {
2535
- 'telemetry.stencil'?: boolean;
2536
- 'tokens.telemetry'?: string;
2537
- }
2538
- export {};