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