@stencil/core 4.43.3 → 5.0.0-alpha.1

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 (377) hide show
  1. package/bin/stencil.mjs +2 -0
  2. package/dist/chunk-CjcI7cDX.mjs +15 -0
  3. package/dist/client-B1nuvCd2.mjs +4524 -0
  4. package/dist/compiler/index.d.mts +192 -0
  5. package/dist/compiler/index.mjs +3 -0
  6. package/dist/compiler/utils/index.d.mts +2 -0
  7. package/dist/compiler/utils/index.mjs +3 -0
  8. package/dist/compiler-LX4_RKKd.mjs +21782 -0
  9. package/{internal → dist/declarations}/stencil-ext-modules.d.ts +8 -8
  10. package/dist/declarations/stencil-public-compiler.d.ts +2 -0
  11. package/dist/declarations/stencil-public-compiler.js +53 -0
  12. package/dist/declarations/stencil-public-docs.d.ts +2 -0
  13. package/dist/declarations/stencil-public-runtime.d.ts +2 -0
  14. package/dist/declarations/stencil-public-runtime.js +0 -0
  15. package/dist/index-BONzXKJt.d.ts +1893 -0
  16. package/{internal/app-data/index.d.ts → dist/index-CHjZtib0.d.ts} +11 -7
  17. package/dist/index-D-LlB2nw.d.mts +6918 -0
  18. package/dist/index-fIuYTL9f.d.mts +178 -0
  19. package/{internal/stencil-core/index.d.ts → dist/index.d.mts} +10 -3
  20. package/dist/index.mjs +2 -0
  21. package/dist/jsx-runtime-DBzBJLKk.d.ts +28 -0
  22. package/dist/jsx-runtime.d.ts +2 -0
  23. package/dist/jsx-runtime.js +2 -0
  24. package/dist/mock-doc.d.mts +1 -0
  25. package/dist/mock-doc.mjs +2 -0
  26. package/dist/node-SxQIOCZE.mjs +1947 -0
  27. package/dist/runtime/app-data/index.d.ts +2 -0
  28. package/dist/runtime/app-data/index.js +99 -0
  29. package/dist/runtime/app-globals/index.d.ts +5 -0
  30. package/dist/runtime/app-globals/index.js +5 -0
  31. package/dist/runtime/client/index.d.ts +2358 -0
  32. package/dist/runtime/client/index.js +4866 -0
  33. package/dist/runtime/index.d.ts +182 -0
  34. package/dist/runtime/index.js +2 -0
  35. package/dist/runtime/server/index.d.mts +1146 -0
  36. package/dist/runtime/server/index.mjs +4945 -0
  37. package/dist/runtime/server/runner.d.mts +323 -0
  38. package/dist/runtime/server/runner.mjs +14046 -0
  39. package/dist/runtime-CF9DJtSu.js +4748 -0
  40. package/dist/serialize-BkYHk7Mi.mjs +766 -0
  41. package/dist/stencil-public-compiler-C_X1iolo.d.ts +4455 -0
  42. package/dist/stencil-public-runtime-DlV8o7-z.d.ts +1845 -0
  43. package/dist/sys/node/index.d.mts +32 -0
  44. package/dist/sys/node/index.mjs +2 -0
  45. package/dist/sys/node/worker.d.mts +1 -0
  46. package/dist/sys/node/worker.mjs +48 -0
  47. package/dist/testing/index.d.mts +209 -0
  48. package/dist/testing/index.mjs +1169 -0
  49. package/dist/validation-CaCgjw-f.mjs +1441 -0
  50. package/package.json +99 -228
  51. package/bin/stencil +0 -57
  52. package/cli/config-flags.d.ts +0 -132
  53. package/cli/index.cjs +0 -6041
  54. package/cli/index.d.ts +0 -19
  55. package/cli/index.js +0 -6034
  56. package/cli/package.json +0 -14
  57. package/compiler/lib.d.ts +0 -22
  58. package/compiler/lib.decorators.d.ts +0 -384
  59. package/compiler/lib.decorators.legacy.d.ts +0 -22
  60. package/compiler/lib.dom.asynciterable.d.ts +0 -41
  61. package/compiler/lib.dom.d.ts +0 -29610
  62. package/compiler/lib.dom.iterable.d.ts +0 -493
  63. package/compiler/lib.es2015.collection.d.ts +0 -147
  64. package/compiler/lib.es2015.core.d.ts +0 -597
  65. package/compiler/lib.es2015.d.ts +0 -28
  66. package/compiler/lib.es2015.generator.d.ts +0 -77
  67. package/compiler/lib.es2015.iterable.d.ts +0 -605
  68. package/compiler/lib.es2015.promise.d.ts +0 -81
  69. package/compiler/lib.es2015.proxy.d.ts +0 -128
  70. package/compiler/lib.es2015.reflect.d.ts +0 -144
  71. package/compiler/lib.es2015.symbol.d.ts +0 -46
  72. package/compiler/lib.es2015.symbol.wellknown.d.ts +0 -326
  73. package/compiler/lib.es2016.array.include.d.ts +0 -116
  74. package/compiler/lib.es2016.d.ts +0 -21
  75. package/compiler/lib.es2016.full.d.ts +0 -23
  76. package/compiler/lib.es2016.intl.d.ts +0 -31
  77. package/compiler/lib.es2017.arraybuffer.d.ts +0 -21
  78. package/compiler/lib.es2017.d.ts +0 -26
  79. package/compiler/lib.es2017.date.d.ts +0 -31
  80. package/compiler/lib.es2017.full.d.ts +0 -23
  81. package/compiler/lib.es2017.intl.d.ts +0 -44
  82. package/compiler/lib.es2017.object.d.ts +0 -49
  83. package/compiler/lib.es2017.sharedmemory.d.ts +0 -135
  84. package/compiler/lib.es2017.string.d.ts +0 -45
  85. package/compiler/lib.es2017.typedarrays.d.ts +0 -53
  86. package/compiler/lib.es2018.asyncgenerator.d.ts +0 -77
  87. package/compiler/lib.es2018.asynciterable.d.ts +0 -53
  88. package/compiler/lib.es2018.d.ts +0 -24
  89. package/compiler/lib.es2018.full.d.ts +0 -24
  90. package/compiler/lib.es2018.intl.d.ts +0 -83
  91. package/compiler/lib.es2018.promise.d.ts +0 -30
  92. package/compiler/lib.es2018.regexp.d.ts +0 -37
  93. package/compiler/lib.es2019.array.d.ts +0 -79
  94. package/compiler/lib.es2019.d.ts +0 -24
  95. package/compiler/lib.es2019.full.d.ts +0 -24
  96. package/compiler/lib.es2019.intl.d.ts +0 -23
  97. package/compiler/lib.es2019.object.d.ts +0 -33
  98. package/compiler/lib.es2019.string.d.ts +0 -37
  99. package/compiler/lib.es2019.symbol.d.ts +0 -24
  100. package/compiler/lib.es2020.bigint.d.ts +0 -765
  101. package/compiler/lib.es2020.d.ts +0 -27
  102. package/compiler/lib.es2020.date.d.ts +0 -42
  103. package/compiler/lib.es2020.full.d.ts +0 -24
  104. package/compiler/lib.es2020.intl.d.ts +0 -474
  105. package/compiler/lib.es2020.number.d.ts +0 -28
  106. package/compiler/lib.es2020.promise.d.ts +0 -47
  107. package/compiler/lib.es2020.sharedmemory.d.ts +0 -99
  108. package/compiler/lib.es2020.string.d.ts +0 -44
  109. package/compiler/lib.es2020.symbol.wellknown.d.ts +0 -41
  110. package/compiler/lib.es2021.d.ts +0 -23
  111. package/compiler/lib.es2021.full.d.ts +0 -24
  112. package/compiler/lib.es2021.intl.d.ts +0 -166
  113. package/compiler/lib.es2021.promise.d.ts +0 -48
  114. package/compiler/lib.es2021.string.d.ts +0 -33
  115. package/compiler/lib.es2021.weakref.d.ts +0 -78
  116. package/compiler/lib.es2022.array.d.ts +0 -121
  117. package/compiler/lib.es2022.d.ts +0 -25
  118. package/compiler/lib.es2022.error.d.ts +0 -75
  119. package/compiler/lib.es2022.full.d.ts +0 -24
  120. package/compiler/lib.es2022.intl.d.ts +0 -121
  121. package/compiler/lib.es2022.object.d.ts +0 -26
  122. package/compiler/lib.es2022.regexp.d.ts +0 -39
  123. package/compiler/lib.es2022.string.d.ts +0 -25
  124. package/compiler/lib.es2023.array.d.ts +0 -924
  125. package/compiler/lib.es2023.collection.d.ts +0 -21
  126. package/compiler/lib.es2023.d.ts +0 -22
  127. package/compiler/lib.es2023.full.d.ts +0 -24
  128. package/compiler/lib.es2023.intl.d.ts +0 -56
  129. package/compiler/lib.es2024.arraybuffer.d.ts +0 -65
  130. package/compiler/lib.es2024.collection.d.ts +0 -29
  131. package/compiler/lib.es2024.d.ts +0 -26
  132. package/compiler/lib.es2024.full.d.ts +0 -24
  133. package/compiler/lib.es2024.object.d.ts +0 -29
  134. package/compiler/lib.es2024.promise.d.ts +0 -35
  135. package/compiler/lib.es2024.regexp.d.ts +0 -25
  136. package/compiler/lib.es2024.sharedmemory.d.ts +0 -68
  137. package/compiler/lib.es2024.string.d.ts +0 -29
  138. package/compiler/lib.es5.d.ts +0 -4594
  139. package/compiler/lib.es6.d.ts +0 -23
  140. package/compiler/lib.esnext.array.d.ts +0 -35
  141. package/compiler/lib.esnext.collection.d.ts +0 -96
  142. package/compiler/lib.esnext.d.ts +0 -27
  143. package/compiler/lib.esnext.decorators.d.ts +0 -28
  144. package/compiler/lib.esnext.disposable.d.ts +0 -193
  145. package/compiler/lib.esnext.float16.d.ts +0 -443
  146. package/compiler/lib.esnext.full.d.ts +0 -24
  147. package/compiler/lib.esnext.intl.d.ts +0 -21
  148. package/compiler/lib.esnext.iterator.d.ts +0 -148
  149. package/compiler/lib.esnext.promise.d.ts +0 -34
  150. package/compiler/lib.scripthost.d.ts +0 -322
  151. package/compiler/lib.webworker.asynciterable.d.ts +0 -41
  152. package/compiler/lib.webworker.d.ts +0 -9894
  153. package/compiler/lib.webworker.importscripts.d.ts +0 -23
  154. package/compiler/lib.webworker.iterable.d.ts +0 -287
  155. package/compiler/package.json +0 -8
  156. package/compiler/stencil.d.ts +0 -73
  157. package/compiler/stencil.js +0 -288027
  158. package/compiler/sys/in-memory-fs.d.ts +0 -227
  159. package/compiler/transpile.d.ts +0 -32
  160. package/dev-server/client/app-error.d.ts +0 -20
  161. package/dev-server/client/events.d.ts +0 -6
  162. package/dev-server/client/hmr-components.d.ts +0 -12
  163. package/dev-server/client/hmr-external-styles.d.ts +0 -1
  164. package/dev-server/client/hmr-images.d.ts +0 -1
  165. package/dev-server/client/hmr-inline-styles.d.ts +0 -1
  166. package/dev-server/client/hmr-util.d.ts +0 -39
  167. package/dev-server/client/hmr-window.d.ts +0 -10
  168. package/dev-server/client/index.d.ts +0 -6
  169. package/dev-server/client/index.js +0 -793
  170. package/dev-server/client/logger.d.ts +0 -6
  171. package/dev-server/client/package.json +0 -8
  172. package/dev-server/client/progress.d.ts +0 -3
  173. package/dev-server/client/status.d.ts +0 -4
  174. package/dev-server/client/test/hmr-util.spec.d.ts +0 -1
  175. package/dev-server/client/test/status.spec.d.ts +0 -1
  176. package/dev-server/connector.html +0 -6
  177. package/dev-server/index.d.ts +0 -3
  178. package/dev-server/index.js +0 -247
  179. package/dev-server/package.json +0 -8
  180. package/dev-server/server-process.js +0 -12304
  181. package/dev-server/server-worker-thread.js +0 -39
  182. package/dev-server/static/favicon.ico +0 -0
  183. package/dev-server/templates/directory-index.html +0 -176
  184. package/dev-server/templates/initial-load.html +0 -168
  185. package/dev-server/visualstudio.vbs +0 -82
  186. package/dev-server/xdg-open +0 -1066
  187. package/internal/app-data/index.cjs +0 -119
  188. package/internal/app-data/index.js +0 -92
  189. package/internal/app-data/package.json +0 -15
  190. package/internal/app-globals/index.d.ts +0 -2
  191. package/internal/app-globals/index.js +0 -14
  192. package/internal/app-globals/package.json +0 -14
  193. package/internal/child_process.d.ts +0 -7
  194. package/internal/client/index.js +0 -4736
  195. package/internal/client/package.json +0 -10
  196. package/internal/client/patch-browser.js +0 -45
  197. package/internal/client/polyfills/core-js.js +0 -11
  198. package/internal/client/polyfills/dom.js +0 -79
  199. package/internal/client/polyfills/es5-html-element.js +0 -1
  200. package/internal/client/polyfills/index.js +0 -34
  201. package/internal/client/polyfills/system.js +0 -6
  202. package/internal/client/shadow-css.js +0 -414
  203. package/internal/hydrate/index.js +0 -6880
  204. package/internal/hydrate/package.json +0 -7
  205. package/internal/hydrate/runner.d.ts +0 -287
  206. package/internal/hydrate/runner.js +0 -18157
  207. package/internal/index.d.ts +0 -4
  208. package/internal/index.js +0 -2
  209. package/internal/package.json +0 -9
  210. package/internal/stencil-core/index.cjs +0 -1
  211. package/internal/stencil-core/index.js +0 -18
  212. package/internal/stencil-core/jsx-dev-runtime.cjs +0 -7
  213. package/internal/stencil-core/jsx-dev-runtime.d.ts +0 -41
  214. package/internal/stencil-core/jsx-dev-runtime.js +0 -2
  215. package/internal/stencil-core/jsx-runtime.cjs +0 -8
  216. package/internal/stencil-core/jsx-runtime.d.ts +0 -40
  217. package/internal/stencil-core/jsx-runtime.js +0 -2
  218. package/internal/stencil-private.d.ts +0 -2549
  219. package/internal/stencil-public-compiler.d.ts +0 -2922
  220. package/internal/stencil-public-docs.d.ts +0 -472
  221. package/internal/stencil-public-runtime.d.ts +0 -1860
  222. package/internal/testing/index.js +0 -6737
  223. package/internal/testing/jsx-dev-runtime.d.ts +0 -2
  224. package/internal/testing/jsx-dev-runtime.js +0 -8
  225. package/internal/testing/jsx-runtime.d.ts +0 -2
  226. package/internal/testing/jsx-runtime.js +0 -9
  227. package/internal/testing/package.json +0 -7
  228. package/internal/utils/index.d.ts +0 -1
  229. package/internal/utils/result.d.ts +0 -112
  230. package/mock-doc/index.cjs +0 -10163
  231. package/mock-doc/index.d.ts +0 -1172
  232. package/mock-doc/index.js +0 -10142
  233. package/mock-doc/package.json +0 -15
  234. package/readme.md +0 -94
  235. package/screenshot/compare/assets/favicon.ico +0 -0
  236. package/screenshot/compare/assets/logo.png +0 -0
  237. package/screenshot/compare/build/app.css +0 -1
  238. package/screenshot/compare/build/app.esm.js +0 -1
  239. package/screenshot/compare/build/app.js +0 -33
  240. package/screenshot/compare/build/p-081b0641.js +0 -1
  241. package/screenshot/compare/build/p-227a1e18.entry.js +0 -1
  242. package/screenshot/compare/build/p-2c298727.entry.js +0 -1
  243. package/screenshot/compare/build/p-5479268c.entry.js +0 -1
  244. package/screenshot/compare/build/p-573ec8a4.entry.js +0 -1
  245. package/screenshot/compare/build/p-6ba08604.entry.js +0 -1
  246. package/screenshot/compare/build/p-6bc63295.entry.js +0 -1
  247. package/screenshot/compare/build/p-7a3759fd.entry.js +0 -1
  248. package/screenshot/compare/build/p-7b4e3ba7.js +0 -1
  249. package/screenshot/compare/build/p-988eb362.css +0 -1
  250. package/screenshot/compare/build/p-9b6a9315.js +0 -1
  251. package/screenshot/compare/build/p-b4cc611c.entry.js +0 -1
  252. package/screenshot/compare/build/p-d1bf53f5.entry.js +0 -1
  253. package/screenshot/compare/build/p-e2efe0df.js +0 -1
  254. package/screenshot/compare/build/p-e8ca6d97.entry.js +0 -1
  255. package/screenshot/compare/build/p-ec2f13e0.entry.js +0 -1
  256. package/screenshot/compare/build/p-f0b99977.entry.js +0 -1
  257. package/screenshot/compare/build/p-f4745c2f.entry.js +0 -1
  258. package/screenshot/compare/build/p-fbbae598.js +0 -1
  259. package/screenshot/compare/host.config.json +0 -15
  260. package/screenshot/compare/index.html +0 -1
  261. package/screenshot/compare/manifest.json +0 -13
  262. package/screenshot/connector-base.d.ts +0 -42
  263. package/screenshot/connector-local.d.ts +0 -7
  264. package/screenshot/connector.js +0 -2
  265. package/screenshot/index.d.ts +0 -3
  266. package/screenshot/index.js +0 -2642
  267. package/screenshot/local-connector.js +0 -2
  268. package/screenshot/package.json +0 -15
  269. package/screenshot/pixel-match.d.ts +0 -1
  270. package/screenshot/pixel-match.js +0 -2315
  271. package/screenshot/screenshot-compare.d.ts +0 -20
  272. package/screenshot/screenshot-fs.d.ts +0 -14
  273. package/sys/node/460.node-fetch.js +0 -451
  274. package/sys/node/autoprefixer.js +0 -9
  275. package/sys/node/glob.js +0 -1
  276. package/sys/node/graceful-fs.js +0 -1
  277. package/sys/node/index.d.ts +0 -39
  278. package/sys/node/index.js +0 -62
  279. package/sys/node/node-fetch.js +0 -12
  280. package/sys/node/package.json +0 -8
  281. package/sys/node/prompts.js +0 -1
  282. package/sys/node/worker.js +0 -4
  283. package/testing/index.d.ts +0 -9
  284. package/testing/index.js +0 -13273
  285. package/testing/jest/jest-27-and-under/jest-config.d.ts +0 -16
  286. package/testing/jest/jest-27-and-under/jest-environment.d.ts +0 -2
  287. package/testing/jest/jest-27-and-under/jest-facade.d.ts +0 -155
  288. package/testing/jest/jest-27-and-under/jest-preprocessor.d.ts +0 -59
  289. package/testing/jest/jest-27-and-under/jest-preset.d.ts +0 -3
  290. package/testing/jest/jest-27-and-under/jest-runner.d.ts +0 -11
  291. package/testing/jest/jest-27-and-under/jest-screenshot.d.ts +0 -2
  292. package/testing/jest/jest-27-and-under/jest-serializer.d.ts +0 -4
  293. package/testing/jest/jest-27-and-under/jest-setup-test-framework.d.ts +0 -9
  294. package/testing/jest/jest-27-and-under/matchers/attributes.d.ts +0 -14
  295. package/testing/jest/jest-27-and-under/matchers/class-list.d.ts +0 -12
  296. package/testing/jest/jest-27-and-under/matchers/events.d.ts +0 -25
  297. package/testing/jest/jest-27-and-under/matchers/html.d.ts +0 -13
  298. package/testing/jest/jest-27-and-under/matchers/index.d.ts +0 -24
  299. package/testing/jest/jest-27-and-under/matchers/screenshot.d.ts +0 -5
  300. package/testing/jest/jest-27-and-under/matchers/text.d.ts +0 -4
  301. package/testing/jest/jest-27-and-under/test/jest-config.spec.d.ts +0 -1
  302. package/testing/jest/jest-27-and-under/test/jest-preprocessor.spec.d.ts +0 -1
  303. package/testing/jest/jest-27-and-under/test/jest-runner.spec.d.ts +0 -1
  304. package/testing/jest/jest-27-and-under/test/jest-serializer.spec.d.ts +0 -1
  305. package/testing/jest/jest-27-and-under/test/jest-setup-test-framework.spec.d.ts +0 -1
  306. package/testing/jest/jest-28/jest-config.d.ts +0 -16
  307. package/testing/jest/jest-28/jest-environment.d.ts +0 -2
  308. package/testing/jest/jest-28/jest-facade.d.ts +0 -134
  309. package/testing/jest/jest-28/jest-preprocessor.d.ts +0 -35
  310. package/testing/jest/jest-28/jest-preset.d.ts +0 -3
  311. package/testing/jest/jest-28/jest-runner.d.ts +0 -11
  312. package/testing/jest/jest-28/jest-screenshot.d.ts +0 -2
  313. package/testing/jest/jest-28/jest-serializer.d.ts +0 -4
  314. package/testing/jest/jest-28/jest-setup-test-framework.d.ts +0 -9
  315. package/testing/jest/jest-28/matchers/attributes.d.ts +0 -14
  316. package/testing/jest/jest-28/matchers/class-list.d.ts +0 -12
  317. package/testing/jest/jest-28/matchers/events.d.ts +0 -25
  318. package/testing/jest/jest-28/matchers/html.d.ts +0 -13
  319. package/testing/jest/jest-28/matchers/index.d.ts +0 -24
  320. package/testing/jest/jest-28/matchers/screenshot.d.ts +0 -5
  321. package/testing/jest/jest-28/matchers/text.d.ts +0 -4
  322. package/testing/jest/jest-28/test/jest-config.spec.d.ts +0 -1
  323. package/testing/jest/jest-28/test/jest-preprocessor.spec.d.ts +0 -1
  324. package/testing/jest/jest-28/test/jest-runner.spec.d.ts +0 -1
  325. package/testing/jest/jest-28/test/jest-serializer.spec.d.ts +0 -1
  326. package/testing/jest/jest-28/test/jest-setup-test-framework.spec.d.ts +0 -1
  327. package/testing/jest/jest-29/jest-config.d.ts +0 -16
  328. package/testing/jest/jest-29/jest-environment.d.ts +0 -2
  329. package/testing/jest/jest-29/jest-facade.d.ts +0 -136
  330. package/testing/jest/jest-29/jest-preprocessor.d.ts +0 -35
  331. package/testing/jest/jest-29/jest-preset.d.ts +0 -3
  332. package/testing/jest/jest-29/jest-runner.d.ts +0 -11
  333. package/testing/jest/jest-29/jest-screenshot.d.ts +0 -2
  334. package/testing/jest/jest-29/jest-serializer.d.ts +0 -4
  335. package/testing/jest/jest-29/jest-setup-test-framework.d.ts +0 -9
  336. package/testing/jest/jest-29/matchers/attributes.d.ts +0 -14
  337. package/testing/jest/jest-29/matchers/class-list.d.ts +0 -12
  338. package/testing/jest/jest-29/matchers/events.d.ts +0 -25
  339. package/testing/jest/jest-29/matchers/html.d.ts +0 -13
  340. package/testing/jest/jest-29/matchers/index.d.ts +0 -24
  341. package/testing/jest/jest-29/matchers/screenshot.d.ts +0 -5
  342. package/testing/jest/jest-29/matchers/text.d.ts +0 -4
  343. package/testing/jest/jest-29/test/jest-config.spec.d.ts +0 -1
  344. package/testing/jest/jest-29/test/jest-preprocessor.spec.d.ts +0 -1
  345. package/testing/jest/jest-29/test/jest-runner.spec.d.ts +0 -1
  346. package/testing/jest/jest-29/test/jest-serializer.spec.d.ts +0 -1
  347. package/testing/jest/jest-29/test/jest-setup-test-framework.spec.d.ts +0 -1
  348. package/testing/jest/jest-apis.d.ts +0 -86
  349. package/testing/jest/jest-facade.d.ts +0 -74
  350. package/testing/jest/jest-stencil-connector.d.ts +0 -65
  351. package/testing/jest/test/jest-stencil-connector.spec.d.ts +0 -1
  352. package/testing/jest-environment.js +0 -3
  353. package/testing/jest-preprocessor.js +0 -3
  354. package/testing/jest-preset.js +0 -2
  355. package/testing/jest-runner.js +0 -3
  356. package/testing/jest-setuptestframework.js +0 -3
  357. package/testing/mock-fetch.d.ts +0 -11
  358. package/testing/mocks.d.ts +0 -56
  359. package/testing/package.json +0 -8
  360. package/testing/puppeteer/index.d.ts +0 -2
  361. package/testing/puppeteer/puppeteer-browser.d.ts +0 -6
  362. package/testing/puppeteer/puppeteer-declarations.d.ts +0 -414
  363. package/testing/puppeteer/puppeteer-element.d.ts +0 -67
  364. package/testing/puppeteer/puppeteer-emulate.d.ts +0 -2
  365. package/testing/puppeteer/puppeteer-events.d.ts +0 -21
  366. package/testing/puppeteer/puppeteer-page.d.ts +0 -2
  367. package/testing/puppeteer/puppeteer-screenshot.d.ts +0 -27
  368. package/testing/puppeteer/test/puppeteer-screenshot.spec.d.ts +0 -1
  369. package/testing/reset-build-conditionals.d.ts +0 -12
  370. package/testing/spec-page.d.ts +0 -7
  371. package/testing/test/testing-utils.spec.d.ts +0 -1
  372. package/testing/test-transpile.d.ts +0 -2
  373. package/testing/testing-logger.d.ts +0 -26
  374. package/testing/testing-sys.d.ts +0 -6
  375. package/testing/testing-utils.d.ts +0 -80
  376. package/testing/testing.d.ts +0 -2
  377. /package/{screenshot/compare/build/index.esm.js → dist/declarations/stencil-public-docs.js} +0 -0
@@ -0,0 +1,4455 @@
1
+ import { I as ListenTargetOptions, Q as ResolutionHandler } from "./stencil-public-runtime-DlV8o7-z.js";
2
+ //#region src/utils/result.d.ts
3
+ /**
4
+ * A Result wraps up a success state and a failure state, allowing you to
5
+ * return a single type from a function and discriminate between the two
6
+ * possible states in a principled way.
7
+ *
8
+ * Using it could look something like this:
9
+ *
10
+ * ```ts
11
+ * import { result } from './';
12
+ *
13
+ * const mightFail = (input: number): Result<number, string> => {
14
+ * try {
15
+ * let value: number = calculateSomethingWithInput(input);
16
+ * return result.ok(value);
17
+ * } catch (e) {
18
+ * return result.err(e.message);
19
+ * }
20
+ * }
21
+ *
22
+ * const sumResult = mightFail(2);
23
+ *
24
+ * const msg = result.map(sumResult, (sum: number) => `the sum was: ${sum}`);
25
+ * ```
26
+ *
27
+ * A few utility methods are defined in this module, like `map` and `unwrap`,
28
+ * which are (probably obviously) inspired by the correspond methods on
29
+ * `std::result::Result` in Rust.
30
+ */
31
+ type Result<OnSuccess, OnFailure> = Ok<OnSuccess> | Err<OnFailure>;
32
+ /**
33
+ * Type for the Ok state of a Result
34
+ */
35
+ type Ok<T> = {
36
+ isOk: true;
37
+ isErr: false;
38
+ value: T;
39
+ };
40
+ /**
41
+ * Type for the Err state of a Result
42
+ */
43
+ type Err<T> = {
44
+ isOk: false;
45
+ isErr: true;
46
+ value: T;
47
+ };
48
+ /**
49
+ * Create an `Ok` given a value. This doesn't do any checking that the value is
50
+ * 'ok-ish' since doing so would make an undue assumption about what is 'ok'.
51
+ * Instead, this trusts the user to determine, at the call site, whether
52
+ * something is `ok()` or `err()`.
53
+ *
54
+ * @param value the value to wrap up in an `Ok`
55
+ * @returns an Ok wrapping the value
56
+ */
57
+ //#endregion
58
+ //#region src/compiler/sys/in-memory-fs.d.ts
59
+ /**
60
+ * An in-memory FS which proxies the underlying OS filesystem using a simple
61
+ * in-memory cache. FS writes can accumulate on the in-memory system, using an
62
+ * API similar to Node.js' `"fs"` module, and then be committed to disk as a
63
+ * unit.
64
+ *
65
+ * Files written to the in-memory system can be edited, deleted, and so on.
66
+ * This allows the compiler to proceed freely as if it is modifying the
67
+ * filesystem, modifying the world in whatever way suits it, while deferring
68
+ * actual FS writes until the end of the compilation process, making actual
69
+ * changes to the filesystem on disk contingent on an error-free build or any
70
+ * other condition.
71
+ *
72
+ * Usage example:
73
+ *
74
+ * ```ts
75
+ * // create an in-memory FS
76
+ * const sys = createSystem();
77
+ * const inMemoryFs = createInMemoryFs(sys);
78
+ *
79
+ * // do a few fs operations
80
+ * await inMemoryFs.writeFile("path/to/file.js", 'console.log("hey!");')
81
+ * await inMemoryFs.remove("path/to/another_file.ts");
82
+ *
83
+ * // commit the results to disk
84
+ * const commitStats = await inMemoryFs.commit();
85
+ * ```
86
+ *
87
+ * In the above example the write operation and the delete operation (w/
88
+ * `.remove`) are both queued in the in-memory proxy but not committed to
89
+ * disk until the `.commit` method is called.
90
+ */
91
+ type InMemoryFileSystem = ReturnType<typeof createInMemoryFs>;
92
+ /**
93
+ * A node in the in-memory file system. This may represent a file or
94
+ * a directory, and pending copy, write, and delete operations may be stored
95
+ * on it.
96
+ */
97
+ interface FsItem {
98
+ fileText: string;
99
+ isFile: boolean;
100
+ isDirectory: boolean;
101
+ size: number;
102
+ mtimeMs: number;
103
+ exists: boolean;
104
+ queueCopyFileToDest: string;
105
+ queueWriteToDisk: boolean;
106
+ queueDeleteFromDisk?: boolean;
107
+ useCache: boolean;
108
+ }
109
+ /**
110
+ * Options supported by write methods on the in-memory filesystem.
111
+ */
112
+ interface FsWriteOptions {
113
+ /**
114
+ * only use the in-memory cache and do not write the file to disk
115
+ */
116
+ inMemoryOnly?: boolean;
117
+ clearFileCache?: boolean;
118
+ /**
119
+ * flush the write to disk immediately, skipping the in-memory cache
120
+ */
121
+ immediateWrite?: boolean;
122
+ /**
123
+ * specify that the cache should be used
124
+ */
125
+ useCache?: boolean;
126
+ /**
127
+ * An optional tag for the current output target for which this file is being
128
+ * written.
129
+ */
130
+ outputTargetType?: string;
131
+ }
132
+ /**
133
+ * Results from a write operation on the in-memory filesystem.
134
+ */
135
+ interface FsWriteResults {
136
+ changedContent: boolean;
137
+ queuedWrite: boolean;
138
+ ignored: boolean;
139
+ }
140
+ /**
141
+ * Options supported by read methods on the in-memory filesystem.
142
+ */
143
+ interface FsReadOptions {
144
+ useCache?: boolean;
145
+ setHash?: boolean;
146
+ }
147
+ /**
148
+ * Options supported by the readdir option on the in-memory filesystem.
149
+ */
150
+ interface FsReaddirOptions {
151
+ inMemoryOnly?: boolean;
152
+ recursive?: boolean;
153
+ /**
154
+ * Directory names to exclude. Just the basename,
155
+ * not the entire path. Basically for "node_modules".
156
+ */
157
+ excludeDirNames?: string[];
158
+ /**
159
+ * Extensions we know we can avoid. Each extension
160
+ * should include the `.` so that we can test for both
161
+ * `.d.ts.` and `.ts`. If `excludeExtensions` isn't provided it
162
+ * doesn't try to exclude anything. This only checks against
163
+ * the filename, not directory names when recursive.
164
+ */
165
+ excludeExtensions?: string[];
166
+ }
167
+ /**
168
+ * A result from a directory read operation
169
+ */
170
+ interface FsReaddirItem {
171
+ absPath: string;
172
+ relPath: string;
173
+ isDirectory: boolean;
174
+ isFile: boolean;
175
+ }
176
+ /**
177
+ * Information about a file in the in-memory filesystem.
178
+ */
179
+ interface FsStat {
180
+ exists: boolean;
181
+ isFile: boolean;
182
+ isDirectory: boolean;
183
+ size: number;
184
+ }
185
+ /**
186
+ * Create an in-memory FS which proxies the underlying OS filesystem using an
187
+ * in-memory cache. FS writes can accumulate on the in-memory system, using an
188
+ * API similar to Node.js' `"fs"` module, and then be committed to disk as a
189
+ * unit.
190
+ *
191
+ * Files written to the in-memory system can be edited, deleted, and so on.
192
+ * This allows the compiler to proceed freely as if it is modifying the
193
+ * filesystem, modifying the world in whatever way suits it, while deferring
194
+ * actual FS writes until the end of the compilation process, making actual
195
+ * changes to the filesystem on disk contingent on an error-free build or any
196
+ * other condition.
197
+ *
198
+ * @param sys a compiler system object
199
+ * @returns an in-memory filesystem interface
200
+ */
201
+ declare const createInMemoryFs: (sys: CompilerSystem) => {
202
+ access: (filePath: string) => Promise<boolean>;
203
+ accessSync: (filePath: string) => boolean;
204
+ cancelDeleteDirectoriesFromDisk: (dirPaths: string[]) => void;
205
+ cancelDeleteFilesFromDisk: (filePaths: string[]) => void;
206
+ clearCache: () => void;
207
+ clearDirCache: (dirPath: string) => void;
208
+ clearFileCache: (filePath: string) => void;
209
+ commit: () => Promise<FsCommitResults>;
210
+ copyFile: (src: string, dest: string) => Promise<void>;
211
+ emptyDirs: (dirs: string[]) => Promise<void>;
212
+ getBuildOutputs: () => BuildOutput[];
213
+ getItem: (itemPath: string) => FsItem;
214
+ getMemoryStats: () => string;
215
+ readFile: (filePath: string, opts?: FsReadOptions) => Promise<string>;
216
+ readFileSync: (filePath: string, opts?: FsReadOptions) => string;
217
+ readdir: (dirPath: string, opts?: FsReaddirOptions) => Promise<FsReaddirItem[]>;
218
+ remove: (itemPath: string) => Promise<void>;
219
+ stat: (itemPath: string) => Promise<FsStat>;
220
+ statSync: (itemPath: string) => FsStat;
221
+ sys: CompilerSystem;
222
+ writeFile: (filePath: string, content: string, opts?: FsWriteOptions) => Promise<FsWriteResults>;
223
+ writeFiles: (files: {
224
+ [filePath: string]: string;
225
+ } | Map<string, string>, opts?: FsWriteOptions) => Promise<FsWriteResults[]>;
226
+ };
227
+ /**
228
+ * The information needed to carry out a file copy operation.
229
+ *
230
+ * `[ source, destination ]`
231
+ */
232
+ type FileCopyTuple = [string, string];
233
+ /**
234
+ * Collected instructions for all pending filesystem operations saved
235
+ * to the in-memory filesystem.
236
+ */
237
+ /**
238
+ * Results from committing pending filesystem operations
239
+ */
240
+ interface FsCommitResults {
241
+ filesCopied: FileCopyTuple[];
242
+ filesWritten: string[];
243
+ filesDeleted: string[];
244
+ dirsDeleted: string[];
245
+ dirsAdded: string[];
246
+ }
247
+ /**
248
+ * Given the current state of the in-memory proxy filesystem, collect all of
249
+ * the changes that need to be made in order to commit the currently-pending
250
+ * operations (e.g. write, copy, delete) to the OS filesystem.
251
+ *
252
+ * @param items the storage data structure for the in-memory FS cache
253
+ * @returns a collection of all the operations that need to be done
254
+ */
255
+ //#endregion
256
+ //#region src/declarations/stencil-public-docs.d.ts
257
+ /**
258
+ * The Type Library holds information about the types which are used in a
259
+ * Stencil project. During compilation, Stencil gathers information about the
260
+ * types which form part of a component's public API, such as properties
261
+ * decorated with `@Prop`, `@Event`, `@Watch`, etc. This type information is
262
+ * then added to the Type Library, where it can be accessed later on for
263
+ * generating documentation.
264
+ *
265
+ * This information is included in the file written by the `docs-json` output
266
+ * target (see {@link JsonDocs.typeLibrary}).
267
+ */
268
+ type JsonDocsTypeLibrary = Record<string, ComponentCompilerReferencedType>;
269
+ /**
270
+ * A container for JSDoc metadata for a project
271
+ */
272
+ interface JsonDocs {
273
+ /**
274
+ * The metadata for the JSDocs for each component in a Stencil project
275
+ */
276
+ components: JsonDocsComponent[];
277
+ /**
278
+ * The timestamp at which the metadata was generated, in the format YYYY-MM-DDThh:mm:ss
279
+ */
280
+ timestamp: string;
281
+ compiler: {
282
+ /**
283
+ * The name of the compiler that generated the metadata
284
+ */
285
+ name: string;
286
+ /**
287
+ * The version of the Stencil compiler that generated the metadata
288
+ */
289
+ version: string;
290
+ /**
291
+ * The version of TypeScript that was used to generate the metadata
292
+ */
293
+ typescriptVersion: string;
294
+ };
295
+ typeLibrary: JsonDocsTypeLibrary;
296
+ }
297
+ /**
298
+ * Container for JSDoc metadata for a single Stencil component
299
+ */
300
+ interface JsonDocsComponent {
301
+ /**
302
+ * The directory containing the Stencil component, minus the file name.
303
+ *
304
+ * @example /workspaces/stencil-project/src/components/my-component
305
+ */
306
+ dirPath?: string;
307
+ /**
308
+ * The name of the file containing the Stencil component, with no path
309
+ *
310
+ * @example my-component.tsx
311
+ */
312
+ fileName?: string;
313
+ /**
314
+ * The full path of the file containing the Stencil component
315
+ *
316
+ * @example /workspaces/stencil-project/src/components/my-component/my-component.tsx
317
+ */
318
+ filePath?: string;
319
+ /**
320
+ * The path to the component's `readme.md` file, including the filename
321
+ *
322
+ * @example /workspaces/stencil-project/src/components/my-component/readme.md
323
+ */
324
+ readmePath?: string;
325
+ /**
326
+ * The path to the component's `usage` directory
327
+ *
328
+ * @example /workspaces/stencil-project/src/components/my-component/usage/
329
+ */
330
+ usagesDir?: string;
331
+ /**
332
+ * The encapsulation strategy for a component
333
+ */
334
+ encapsulation: 'shadow' | 'scoped' | 'none';
335
+ /**
336
+ * The tag name for the component, for use in HTML
337
+ */
338
+ tag: string;
339
+ /**
340
+ * The contents of a component's `readme.md` that are user generated.
341
+ *
342
+ * Auto-generated contents are not stored in this reference.
343
+ */
344
+ readme: string;
345
+ /**
346
+ * The description of a Stencil component, found in the JSDoc that sits above the component's declaration
347
+ */
348
+ docs: string;
349
+ /**
350
+ * JSDoc tags found in the JSDoc comment written atop a component's declaration
351
+ */
352
+ docsTags: JsonDocsTag[];
353
+ /**
354
+ * The text from the class-level JSDoc for a Stencil component, if present.
355
+ */
356
+ overview?: string;
357
+ /**
358
+ * A mapping of usage example file names to their contents for the component.
359
+ */
360
+ usage: JsonDocsUsage;
361
+ /**
362
+ * Array of metadata for a component's `@Prop`s
363
+ */
364
+ props: JsonDocsProp[];
365
+ /**
366
+ * Array of metadata for a component's `@Method`s
367
+ */
368
+ methods: JsonDocsMethod[];
369
+ /**
370
+ * Array of metadata for a component's `@Event`s
371
+ */
372
+ events: JsonDocsEvent[];
373
+ /**
374
+ * Array of metadata for a component's `@Listen` handlers
375
+ */
376
+ listeners: JsonDocsListener[];
377
+ /**
378
+ * Array of metadata for a component's CSS styling information
379
+ */
380
+ styles: JsonDocsStyle[];
381
+ /**
382
+ * Array of component Slot information, generated from `@slot` tags
383
+ */
384
+ slots: JsonDocsSlot[];
385
+ /**
386
+ * Array of component Parts information, generate from `@part` tags
387
+ */
388
+ parts: JsonDocsPart[];
389
+ /**
390
+ * Array of custom states defined via @AttachInternals({ states: {...} })
391
+ */
392
+ customStates: JsonDocsCustomState[];
393
+ /**
394
+ * Array of metadata describing where the current component is used
395
+ */
396
+ dependents: string[];
397
+ /**
398
+ * Array of metadata listing the components which are used in current component
399
+ */
400
+ dependencies: string[];
401
+ /**
402
+ * Describes a tree of components coupling
403
+ */
404
+ dependencyGraph: JsonDocsDependencyGraph;
405
+ /**
406
+ * A deprecation reason/description found following a `@deprecated` tag
407
+ */
408
+ deprecation?: string;
409
+ }
410
+ interface JsonDocsDependencyGraph {
411
+ [tagName: string]: string[];
412
+ }
413
+ /**
414
+ * A descriptor for a single JSDoc tag found in a block comment
415
+ */
416
+ interface JsonDocsTag {
417
+ /**
418
+ * The tag name (immediately following the '@')
419
+ */
420
+ name: string;
421
+ /**
422
+ * The description that immediately follows the tag name
423
+ */
424
+ text?: string;
425
+ }
426
+ interface JsonDocsValue {
427
+ value?: string;
428
+ type: string;
429
+ }
430
+ /**
431
+ * A mapping of file names to their contents.
432
+ *
433
+ * This type is meant to be used when reading one or more usage markdown files associated with a component. For the
434
+ * given directory structure:
435
+ * ```
436
+ * src/components/my-component
437
+ * ├── my-component.tsx
438
+ * └── usage
439
+ * ├── bar.md
440
+ * └── foo.md
441
+ * ```
442
+ * an instance of this type would include the name of the markdown file, mapped to its contents:
443
+ * ```ts
444
+ * {
445
+ * 'bar': STRING_CONTENTS_OF_BAR.MD
446
+ * 'foo': STRING_CONTENTS_OF_FOO.MD
447
+ * }
448
+ * ```
449
+ */
450
+ interface JsonDocsUsage {
451
+ [key: string]: string;
452
+ }
453
+ /**
454
+ * An intermediate representation of a `@Prop` decorated member's JSDoc
455
+ */
456
+ interface JsonDocsProp {
457
+ /**
458
+ * the name of the prop
459
+ */
460
+ name: string;
461
+ complexType?: ComponentCompilerPropertyComplexType;
462
+ /**
463
+ * the type of the prop, in terms of the TypeScript type system (as opposed to JavaScript's or HTML's)
464
+ */
465
+ type: string;
466
+ /**
467
+ * `true` if the prop was configured as "mutable" where it was declared, `false` otherwise
468
+ */
469
+ mutable: boolean;
470
+ /**
471
+ * The name of the attribute that is exposed to configure a compiled web component
472
+ */
473
+ attr?: string;
474
+ /**
475
+ * `true` if the prop was configured to "reflect" back to HTML where it (the prop) was declared, `false` otherwise
476
+ */
477
+ reflectToAttr: boolean;
478
+ /**
479
+ * the JSDoc description text associated with the prop
480
+ */
481
+ docs: string;
482
+ /**
483
+ * JSDoc tags associated with the prop
484
+ */
485
+ docsTags: JsonDocsTag[];
486
+ /**
487
+ * The default value of the prop
488
+ */
489
+ default?: string;
490
+ /**
491
+ * Deprecation text associated with the prop. This is the text that immediately follows a `@deprecated` tag
492
+ */
493
+ deprecation?: string;
494
+ values: JsonDocsValue[];
495
+ /**
496
+ * `true` if a component is declared with a '?', `false` otherwise
497
+ *
498
+ * @example
499
+ * ```tsx
500
+ * @Prop() componentProps?: any;
501
+ * ```
502
+ */
503
+ optional: boolean;
504
+ /**
505
+ * `true` if a component is declared with a '!', `false` otherwise
506
+ *
507
+ * @example
508
+ * ```tsx
509
+ * @Prop() componentProps!: any;
510
+ * ```
511
+ */
512
+ required: boolean;
513
+ /**
514
+ * `true` if the prop has a `get()`. `false` otherwise
515
+ */
516
+ getter: boolean;
517
+ /**
518
+ * `true` if the prop has a `set()`. `false` otherwise
519
+ */
520
+ setter: boolean;
521
+ }
522
+ interface JsonDocsMethod {
523
+ name: string;
524
+ docs: string;
525
+ docsTags: JsonDocsTag[];
526
+ deprecation?: string;
527
+ signature: string;
528
+ returns: JsonDocsMethodReturn;
529
+ parameters: JsonDocMethodParameter[];
530
+ complexType: ComponentCompilerMethodComplexType;
531
+ }
532
+ interface JsonDocsMethodReturn {
533
+ type: string;
534
+ docs: string;
535
+ }
536
+ interface JsonDocMethodParameter {
537
+ name: string;
538
+ type: string;
539
+ docs: string;
540
+ }
541
+ interface JsonDocsEvent {
542
+ event: string;
543
+ bubbles: boolean;
544
+ cancelable: boolean;
545
+ composed: boolean;
546
+ complexType: ComponentCompilerEventComplexType;
547
+ docs: string;
548
+ docsTags: JsonDocsTag[];
549
+ deprecation?: string;
550
+ detail: string;
551
+ }
552
+ /**
553
+ * Type describing a CSS Style, as described by a JSDoc-style comment
554
+ */
555
+ interface JsonDocsStyle {
556
+ /**
557
+ * The name of the style
558
+ */
559
+ name: string;
560
+ /**
561
+ * The type/description associated with the style
562
+ */
563
+ docs: string;
564
+ /**
565
+ * The annotation used in the JSDoc of the style (e.g. `@prop`)
566
+ */
567
+ annotation: string;
568
+ /**
569
+ * The mode associated with the style
570
+ */
571
+ mode: string | undefined;
572
+ }
573
+ interface JsonDocsListener {
574
+ event: string;
575
+ target?: string;
576
+ capture: boolean;
577
+ passive: boolean;
578
+ }
579
+ /**
580
+ * A descriptor for a slot
581
+ *
582
+ * Objects of this type are translated from the JSDoc tag, `@slot`
583
+ */
584
+ interface JsonDocsSlot {
585
+ /**
586
+ * The name of the slot. Defaults to an empty string for an unnamed slot.
587
+ */
588
+ name: string;
589
+ /**
590
+ * A textual description of the slot.
591
+ */
592
+ docs: string;
593
+ }
594
+ /**
595
+ * A descriptor of a CSS Shadow Part
596
+ *
597
+ * Objects of this type are translated from the JSDoc tag, `@part`, or the 'part'
598
+ * attribute on a component in TSX
599
+ */
600
+ interface JsonDocsPart {
601
+ /**
602
+ * The name of the Shadow part
603
+ */
604
+ name: string;
605
+ /**
606
+ * A textual description of the Shadow part.
607
+ */
608
+ docs: string;
609
+ }
610
+ /**
611
+ * A descriptor for a Custom State defined via @AttachInternals({ states: {...} })
612
+ *
613
+ * Custom states are exposed via the ElementInternals.states CustomStateSet
614
+ * and can be targeted with the CSS `:state()` pseudo-class.
615
+ *
616
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet
617
+ */
618
+ interface JsonDocsCustomState {
619
+ /**
620
+ * The name of the custom state (without dashes)
621
+ */
622
+ name: string;
623
+ /**
624
+ * The initial/default value of the state
625
+ */
626
+ initialValue: boolean;
627
+ /**
628
+ * A textual description of the custom state
629
+ */
630
+ docs: string;
631
+ }
632
+ /**
633
+ * Represents a parsed block comment in a CSS, Sass, etc. file for a custom property.
634
+ */
635
+ interface StyleDoc {
636
+ /**
637
+ * The name of the CSS property
638
+ */
639
+ name: string;
640
+ /**
641
+ * The user-defined description of the CSS property
642
+ */
643
+ docs: string;
644
+ /**
645
+ * The JSDoc-style annotation (e.g. `@prop`) that was used in the block comment to detect the comment.
646
+ * Used to inform Stencil where the start of a new property's description starts (and where the previous description
647
+ * ends).
648
+ */
649
+ annotation: 'prop';
650
+ /**
651
+ * The Stencil style-mode that is associated with this property.
652
+ */
653
+ mode: string | undefined;
654
+ }
655
+ //#endregion
656
+ //#region src/declarations/stencil-private.d.ts
657
+ interface SourceMap {
658
+ file: string;
659
+ mappings: string;
660
+ names: string[];
661
+ sourceRoot?: string;
662
+ sources: string[];
663
+ sourcesContent?: (string | null)[];
664
+ version: number;
665
+ }
666
+ interface PrintLine {
667
+ lineIndex: number;
668
+ lineNumber: number;
669
+ text: string;
670
+ errorCharStart: number;
671
+ errorLength?: number;
672
+ }
673
+ type ModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd' | 'commonjs' | 'esm' | 'module' | 'systemjs';
674
+ interface RollupResultModule {
675
+ id: string;
676
+ }
677
+ interface RollupResults {
678
+ modules: RollupResultModule[];
679
+ }
680
+ interface BuildCtx {
681
+ buildId: number;
682
+ buildResults: CompilerBuildResults;
683
+ buildStats?: Result<CompilerBuildStats, {
684
+ diagnostics: Diagnostic[];
685
+ }>;
686
+ buildMessages: string[];
687
+ bundleBuildCount: number;
688
+ collections: CollectionCompilerMeta[];
689
+ compilerCtx: CompilerCtx;
690
+ esmBrowserComponentBundle: ReadonlyArray<BundleModule>;
691
+ esmComponentBundle: ReadonlyArray<BundleModule>;
692
+ es5ComponentBundle: ReadonlyArray<BundleModule>;
693
+ systemComponentBundle: ReadonlyArray<BundleModule>;
694
+ commonJsComponentBundle: ReadonlyArray<BundleModule>;
695
+ components: ComponentCompilerMeta[];
696
+ componentGraph: Map<string, string[]>;
697
+ config: ValidatedConfig;
698
+ createTimeSpan(msg: string, debug?: boolean): LoggerTimeSpan;
699
+ data: any;
700
+ debug: (msg: string) => void;
701
+ diagnostics: Diagnostic[];
702
+ dirsAdded: string[];
703
+ dirsDeleted: string[];
704
+ entryModules: EntryModule[];
705
+ filesAdded: string[];
706
+ filesChanged: string[];
707
+ filesDeleted: string[];
708
+ filesUpdated: string[];
709
+ filesWritten: string[];
710
+ globalStyle: string | undefined;
711
+ hasConfigChanges: boolean;
712
+ hasError: boolean;
713
+ hasFinished: boolean;
714
+ hasHtmlChanges: boolean;
715
+ hasPrintedResults: boolean;
716
+ hasServiceWorkerChanges: boolean;
717
+ hasScriptChanges: boolean;
718
+ hasStyleChanges: boolean;
719
+ hasWarning: boolean;
720
+ hydrateAppFilePath: string;
721
+ indexBuildCount: number;
722
+ indexDoc: Document;
723
+ isRebuild: boolean;
724
+ /**
725
+ * A collection of Stencil's intermediate representation of components, tied to the current build
726
+ */
727
+ moduleFiles: Module[];
728
+ packageJson: PackageJsonData;
729
+ pendingCopyTasks: Promise<CopyResults>[];
730
+ progress(task: BuildTask): void;
731
+ requiresFullBuild: boolean;
732
+ rollupResults?: RollupResults;
733
+ scriptsAdded: string[];
734
+ scriptsDeleted: string[];
735
+ startTime: number;
736
+ styleBuildCount: number;
737
+ /**
738
+ * A promise that resolves to the global styles for the current build.
739
+ */
740
+ stylesPromise: Promise<string>;
741
+ stylesUpdated: BuildStyleUpdate[];
742
+ timeSpan: LoggerTimeSpan;
743
+ timestamp: string;
744
+ transpileBuildCount: number;
745
+ validateTypesBuild?(): Promise<void>;
746
+ validateTypesHandler?: (results: any) => Promise<void>;
747
+ validateTypesPromise?: Promise<any>;
748
+ }
749
+ interface BuildStyleUpdate {
750
+ styleTag: string;
751
+ styleText: string;
752
+ styleMode: string;
753
+ }
754
+ type BuildTask = any;
755
+ interface CompilerBuildStats {
756
+ timestamp: string;
757
+ compiler: {
758
+ name: string;
759
+ version: string;
760
+ };
761
+ app: {
762
+ namespace: string;
763
+ fsNamespace: string;
764
+ components: number;
765
+ entries: number;
766
+ bundles: number;
767
+ outputs: any;
768
+ };
769
+ options: {
770
+ minifyJs: boolean;
771
+ minifyCss: boolean;
772
+ hashFileNames: boolean;
773
+ hashedFileNameLength: number;
774
+ buildEs5: boolean | 'prod';
775
+ };
776
+ formats: {
777
+ esmBrowser: ReadonlyArray<CompilerBuildStatBundle>;
778
+ esm: ReadonlyArray<CompilerBuildStatBundle>;
779
+ es5: ReadonlyArray<CompilerBuildStatBundle>;
780
+ system: ReadonlyArray<CompilerBuildStatBundle>;
781
+ commonjs: ReadonlyArray<CompilerBuildStatBundle>;
782
+ };
783
+ components: BuildComponent[];
784
+ entries: EntryModule[];
785
+ rollupResults: RollupResults;
786
+ sourceGraph?: BuildSourceGraph;
787
+ componentGraph: BuildResultsComponentGraph;
788
+ collections: CompilerBuildStatCollection[];
789
+ }
790
+ interface CompilerBuildStatCollection {
791
+ name: string;
792
+ source: string;
793
+ tags: string[][];
794
+ }
795
+ interface CompilerBuildStatBundle {
796
+ key: string;
797
+ components: string[];
798
+ bundleId: string;
799
+ fileName: string;
800
+ imports: string[];
801
+ originalByteSize: number;
802
+ }
803
+ interface BuildSourceGraph {
804
+ [filePath: string]: string[];
805
+ }
806
+ interface BuildComponent {
807
+ tag: string;
808
+ dependencyOf?: string[];
809
+ dependencies?: string[];
810
+ }
811
+ interface RollupChunkResult {
812
+ type: 'chunk';
813
+ entryKey: string;
814
+ fileName: string;
815
+ code: string;
816
+ isEntry: boolean;
817
+ isComponent: boolean;
818
+ isCore: boolean;
819
+ isIndex: boolean;
820
+ isBrowserLoader: boolean;
821
+ imports: string[];
822
+ moduleFormat: ModuleFormat;
823
+ map?: RollupSourceMap;
824
+ }
825
+ interface RollupSourceMap {
826
+ file: string;
827
+ mappings: string;
828
+ names: string[];
829
+ sources: string[];
830
+ sourcesContent: string[];
831
+ version: number;
832
+ toString(): string;
833
+ toUrl(): string;
834
+ }
835
+ interface BundleModule {
836
+ entryKey: string;
837
+ rollupResult: RollupChunkResult;
838
+ cmps: ComponentCompilerMeta[];
839
+ output: BundleModuleOutput;
840
+ }
841
+ interface BundleModuleOutput {
842
+ bundleId: string;
843
+ fileName: string;
844
+ code: string;
845
+ }
846
+ interface Cache {
847
+ get(key: string): Promise<string | null>;
848
+ put(key: string, value: string): Promise<boolean>;
849
+ has(key: string): Promise<boolean>;
850
+ createKey(domain: string, ...args: any[]): Promise<string>;
851
+ commit(): Promise<void>;
852
+ clear(): void;
853
+ clearDiskCache(): Promise<void>;
854
+ getMemoryStats(): string;
855
+ initCacheDir(): Promise<void>;
856
+ }
857
+ interface CollectionCompilerMeta {
858
+ collectionName: string;
859
+ moduleId?: string;
860
+ moduleDir: string;
861
+ moduleFiles: Module[];
862
+ global?: Module;
863
+ compiler?: CollectionCompilerVersion;
864
+ isInitialized?: boolean;
865
+ hasExports?: boolean;
866
+ dependencies?: string[];
867
+ bundles?: {
868
+ components: string[];
869
+ }[];
870
+ }
871
+ interface CollectionCompilerVersion {
872
+ name: string;
873
+ version: string;
874
+ typescriptVersion?: string;
875
+ }
876
+ interface CompilerCtx {
877
+ version: number;
878
+ activeBuildId: number;
879
+ activeDirsAdded: string[];
880
+ activeDirsDeleted: string[];
881
+ activeFilesAdded: string[];
882
+ activeFilesDeleted: string[];
883
+ activeFilesUpdated: string[];
884
+ addWatchDir: (path: string, recursive: boolean) => void;
885
+ addWatchFile: (path: string) => void;
886
+ cache: Cache;
887
+ cssModuleImports: Map<string, string[]>;
888
+ cachedGlobalStyle: string;
889
+ collections: CollectionCompilerMeta[];
890
+ compilerOptions: any;
891
+ events: BuildEvents;
892
+ fs: InMemoryFileSystem;
893
+ hasSuccessfulBuild: boolean;
894
+ isActivelyBuilding: boolean;
895
+ lastBuildResults: CompilerBuildResults;
896
+ /**
897
+ * A mapping of a file path to a Stencil {@link Module}
898
+ */
899
+ moduleMap: ModuleMap;
900
+ nodeMap: NodeMap;
901
+ resolvedCollections: Set<string>;
902
+ rollupCacheHydrate: any;
903
+ rollupCacheLazy: any;
904
+ rollupCacheNative: any;
905
+ styleModeNames: Set<string>;
906
+ changedModules: Set<string>;
907
+ changedFiles: Set<string>;
908
+ worker?: CompilerWorkerContext;
909
+ rollupCache: Map<string, any>;
910
+ reset(): void;
911
+ }
912
+ type NodeMap = WeakMap<any, ComponentCompilerMeta>;
913
+ /**
914
+ * Record, for a specific component, whether or not it has various features
915
+ * which need to be handled correctly in the compilation pipeline.
916
+ *
917
+ * Note: this must be serializable to JSON.
918
+ */
919
+ interface ComponentCompilerFeatures {
920
+ hasAttribute: boolean;
921
+ hasAttributeChangedCallbackFn: boolean;
922
+ hasComponentWillLoadFn: boolean;
923
+ hasComponentDidLoadFn: boolean;
924
+ hasComponentShouldUpdateFn: boolean;
925
+ hasComponentWillUpdateFn: boolean;
926
+ hasComponentDidUpdateFn: boolean;
927
+ hasComponentWillRenderFn: boolean;
928
+ hasComponentDidRenderFn: boolean;
929
+ hasConnectedCallbackFn: boolean;
930
+ hasDeserializer: boolean;
931
+ hasDisconnectedCallbackFn: boolean;
932
+ hasElement: boolean;
933
+ hasEvent: boolean;
934
+ hasLifecycle: boolean;
935
+ hasListener: boolean;
936
+ hasListenerTarget: boolean;
937
+ hasListenerTargetWindow: boolean;
938
+ hasListenerTargetDocument: boolean;
939
+ hasListenerTargetBody: boolean;
940
+ /**
941
+ * @deprecated Prevented from new apps, but left in for older collections
942
+ */
943
+ hasListenerTargetParent: boolean;
944
+ hasMember: boolean;
945
+ hasMethod: boolean;
946
+ hasMode: boolean;
947
+ hasModernPropertyDecls: boolean;
948
+ hasProp: boolean;
949
+ hasPropBoolean: boolean;
950
+ hasPropNumber: boolean;
951
+ hasPropString: boolean;
952
+ hasPropMutable: boolean;
953
+ hasReflect: boolean;
954
+ hasRenderFn: boolean;
955
+ hasSerializer: boolean;
956
+ hasSlot: boolean;
957
+ hasState: boolean;
958
+ hasStyle: boolean;
959
+ hasVdomAttribute: boolean;
960
+ hasVdomClass: boolean;
961
+ hasVdomFunctional: boolean;
962
+ hasVdomKey: boolean;
963
+ hasVdomListener: boolean;
964
+ hasVdomPropOrAttr: boolean;
965
+ hasVdomRef: boolean;
966
+ hasVdomRender: boolean;
967
+ hasVdomStyle: boolean;
968
+ hasVdomText: boolean;
969
+ hasVdomXlink: boolean;
970
+ hasWatchCallback: boolean;
971
+ htmlAttrNames: string[];
972
+ htmlTagNames: string[];
973
+ htmlParts: string[];
974
+ isUpdateable: boolean;
975
+ /**
976
+ * A plain component is one that doesn't have:
977
+ * - any members decorated with `@Prop()`, `@State()`, `@Element()`, `@Method()`
978
+ * - any methods decorated with `@Listen()`
979
+ * - any styles
980
+ * - any lifecycle methods, including `render()`
981
+ */
982
+ isPlain: boolean;
983
+ /**
984
+ * A collection of tag names of web components that a component references in its JSX/h() function
985
+ */
986
+ potentialCmpRefs: string[];
987
+ }
988
+ /**
989
+ * Metadata about a given component
990
+ *
991
+ * Note: must be serializable to JSON!
992
+ */
993
+ interface ComponentCompilerMeta extends ComponentCompilerFeatures {
994
+ assetsDirs: CompilerAssetDir[];
995
+ /**
996
+ * The name to which an `ElementInternals` object (the return value of
997
+ * `HTMLElement.attachInternals`) should be attached at runtime. If this is
998
+ * `null` then `attachInternals` should not be called.
999
+ */
1000
+ attachInternalsMemberName: string | null;
1001
+ /**
1002
+ * Custom states to initialize on the ElementInternals.states CustomStateSet.
1003
+ * These are defined via @AttachInternals({ states: {...} }).
1004
+ */
1005
+ attachInternalsCustomStates: ComponentCompilerCustomState[];
1006
+ componentClassName: string;
1007
+ /**
1008
+ * A list of web component tag names that are either:
1009
+ * - directly referenced in a Stencil component's JSX/h() function
1010
+ * - are referenced by a web component that is directly referenced in a Stencil component's JSX/h() function
1011
+ */
1012
+ dependencies: string[];
1013
+ /**
1014
+ * A list of web component tag names that either:
1015
+ * - directly reference the current component directly in their JSX/h() function
1016
+ * - indirectly/transitively reference the current component directly in their JSX/h() function
1017
+ */
1018
+ dependents: string[];
1019
+ deserializers: ComponentCompilerChangeHandler[];
1020
+ /**
1021
+ * A list of web component tag names that are directly referenced in a Stencil component's JSX/h() function
1022
+ */
1023
+ directDependencies: string[];
1024
+ /**
1025
+ * A list of web component tag names that the current component directly in their JSX/h() function
1026
+ */
1027
+ directDependents: string[];
1028
+ docs: CompilerJsDoc;
1029
+ doesExtend: boolean;
1030
+ elementRef: string;
1031
+ encapsulation: Encapsulation;
1032
+ events: ComponentCompilerEvent[];
1033
+ excludeFromCollection: boolean;
1034
+ /**
1035
+ * Whether or not the component is form-associated
1036
+ */
1037
+ formAssociated: boolean;
1038
+ internal: boolean;
1039
+ isCollectionDependency: boolean;
1040
+ jsFilePath: string;
1041
+ listeners: ComponentCompilerListener[];
1042
+ methods: ComponentCompilerMethod[];
1043
+ properties: ComponentCompilerProperty[];
1044
+ serializers: ComponentCompilerChangeHandler[];
1045
+ shadowDelegatesFocus: boolean;
1046
+ /**
1047
+ * Slot assignment mode for shadow DOM. 'manual', enables imperative slotting
1048
+ * using HTMLSlotElement.assign(). Only applicable when encapsulation is 'shadow'.
1049
+ */
1050
+ slotAssignment: 'manual' | null;
1051
+ sourceFilePath: string;
1052
+ sourceMapPath: string;
1053
+ states: ComponentCompilerState[];
1054
+ styleDocs: CompilerStyleDoc[];
1055
+ styles: StyleCompiler[];
1056
+ tagName: string;
1057
+ virtualProperties: ComponentCompilerVirtualProperty[];
1058
+ watchers: ComponentCompilerChangeHandler[];
1059
+ }
1060
+ /**
1061
+ * The supported style encapsulation modes on a Stencil component:
1062
+ * 1. 'shadow' - native Shadow DOM
1063
+ * 2. 'scoped' - encapsulated styles and polyfilled slots
1064
+ * 3. 'none' - a basic HTML element
1065
+ */
1066
+ type Encapsulation = 'shadow' | 'scoped' | 'none';
1067
+ /**
1068
+ * Intermediate Representation (IR) of a static property on a Stencil component
1069
+ */
1070
+ interface ComponentCompilerStaticProperty {
1071
+ mutable: boolean;
1072
+ optional: boolean;
1073
+ required: boolean;
1074
+ type: ComponentCompilerPropertyType;
1075
+ complexType: ComponentCompilerPropertyComplexType;
1076
+ attribute?: string;
1077
+ reflect?: boolean;
1078
+ docs: CompilerJsDoc;
1079
+ defaultValue?: string;
1080
+ getter: boolean;
1081
+ setter: boolean;
1082
+ ogPropName?: string;
1083
+ }
1084
+ /**
1085
+ * Intermediate Representation (IR) of a property on a Stencil component
1086
+ */
1087
+ interface ComponentCompilerProperty extends ComponentCompilerStaticProperty {
1088
+ name: string;
1089
+ internal: boolean;
1090
+ }
1091
+ interface ComponentCompilerVirtualProperty {
1092
+ name: string;
1093
+ type: string;
1094
+ docs: string;
1095
+ }
1096
+ type ComponentCompilerPropertyType = 'any' | 'string' | 'boolean' | 'number' | 'unknown';
1097
+ /**
1098
+ * Information about a type used in a Stencil component or exported
1099
+ * from a Stencil project.
1100
+ */
1101
+ interface ComponentCompilerPropertyComplexType {
1102
+ /**
1103
+ * The string of the original type annotation in the Stencil source code
1104
+ */
1105
+ original: string;
1106
+ /**
1107
+ * A 'resolved' type, where e.g. imported types have been resolved and inlined
1108
+ *
1109
+ * For instance, an annotation like `(foo: Foo) => string;` will be
1110
+ * converted to `(foo: { foo: string }) => string;`.
1111
+ */
1112
+ resolved: string;
1113
+ /**
1114
+ * A record of the types which were referenced in the assorted type
1115
+ * annotation in the original source file.
1116
+ */
1117
+ references: ComponentCompilerTypeReferences;
1118
+ }
1119
+ /**
1120
+ * A record of `ComponentCompilerTypeReference` entities.
1121
+ *
1122
+ * Each key in this record is intended to be the names of the types used by a component. However, this is not enforced
1123
+ * by the type system (I.E. any string can be used as a key).
1124
+ *
1125
+ * Note any key can be a user defined type or a TypeScript standard type.
1126
+ */
1127
+ type ComponentCompilerTypeReferences = Record<string, ComponentCompilerTypeReference>;
1128
+ /**
1129
+ * Describes a reference to a type used by a component.
1130
+ */
1131
+ interface ComponentCompilerTypeReference {
1132
+ /**
1133
+ * A type may be defined:
1134
+ * - locally (in the same file as the component that uses it)
1135
+ * - globally
1136
+ * - by importing it into a file (and is defined elsewhere)
1137
+ */
1138
+ location: 'local' | 'global' | 'import';
1139
+ /**
1140
+ * The path to the type reference, if applicable (global types should not need a path associated with them)
1141
+ */
1142
+ path?: string;
1143
+ /**
1144
+ * An ID for this type which is unique within a Stencil project.
1145
+ */
1146
+ id: string;
1147
+ /**
1148
+ * Whether this type was imported as a default import (e.g., `import MyEnum from './my-enum'`)
1149
+ * vs a named import (e.g., `import { MyType } from './my-type'`)
1150
+ */
1151
+ isDefault?: boolean;
1152
+ /**
1153
+ * The name used in the import statement (before any user-defined alias).
1154
+ * For `import { XAxisOption as moo }`, this would be "XAxisOption".
1155
+ * This is the name exported by the source module.
1156
+ */
1157
+ referenceLocation?: string;
1158
+ }
1159
+ /**
1160
+ * Information about a type which is referenced by another type on a Stencil
1161
+ * component, for instance a {@link ComponentCompilerPropertyComplexType} or a
1162
+ * {@link ComponentCompilerEventComplexType}.
1163
+ */
1164
+ interface ComponentCompilerReferencedType {
1165
+ /**
1166
+ * The path to the module where the type is declared.
1167
+ */
1168
+ path: string;
1169
+ /**
1170
+ * The string of the original type annotation in the Stencil source code
1171
+ */
1172
+ declaration: string;
1173
+ /**
1174
+ * An extracted docstring
1175
+ */
1176
+ docstring: string;
1177
+ }
1178
+ interface ComponentCompilerStaticEvent {
1179
+ name: string;
1180
+ method: string;
1181
+ bubbles: boolean;
1182
+ cancelable: boolean;
1183
+ composed: boolean;
1184
+ docs: CompilerJsDoc;
1185
+ complexType: ComponentCompilerEventComplexType;
1186
+ }
1187
+ interface ComponentCompilerEvent extends ComponentCompilerStaticEvent {
1188
+ internal: boolean;
1189
+ }
1190
+ interface ComponentCompilerEventComplexType {
1191
+ original: string;
1192
+ resolved: string;
1193
+ references: ComponentCompilerTypeReferences;
1194
+ }
1195
+ interface ComponentCompilerListener {
1196
+ name: string;
1197
+ method: string;
1198
+ capture: boolean;
1199
+ passive: boolean;
1200
+ target: ListenTargetOptions | undefined;
1201
+ }
1202
+ interface ComponentCompilerStaticMethod {
1203
+ docs: CompilerJsDoc;
1204
+ complexType: ComponentCompilerMethodComplexType;
1205
+ }
1206
+ interface ComponentCompilerMethodComplexType {
1207
+ signature: string;
1208
+ parameters: JsonDocMethodParameter[];
1209
+ references: ComponentCompilerTypeReferences;
1210
+ return: string;
1211
+ }
1212
+ interface ComponentCompilerChangeHandler {
1213
+ propName: string;
1214
+ methodName: string;
1215
+ handlerOptions?: {
1216
+ immediate?: boolean;
1217
+ };
1218
+ }
1219
+ interface ComponentCompilerMethod extends ComponentCompilerStaticMethod {
1220
+ name: string;
1221
+ internal: boolean;
1222
+ }
1223
+ interface ComponentCompilerState {
1224
+ name: string;
1225
+ }
1226
+ /**
1227
+ * Metadata about a custom state defined via @AttachInternals({ states: {...} })
1228
+ *
1229
+ * Custom states are exposed via the ElementInternals.states CustomStateSet
1230
+ * and can be targeted with the CSS :state() pseudo-class.
1231
+ */
1232
+ interface ComponentCompilerCustomState {
1233
+ /**
1234
+ * The name of the custom state (without dashes)
1235
+ */
1236
+ name: string;
1237
+ /**
1238
+ * The initial value of the state
1239
+ */
1240
+ initialValue: boolean;
1241
+ /**
1242
+ * Optional JSDoc description for the state
1243
+ */
1244
+ docs: string;
1245
+ }
1246
+ /**
1247
+ * Representation of JSDoc that is pulled off a node in the AST
1248
+ */
1249
+ interface CompilerJsDoc {
1250
+ /**
1251
+ * The text associated with the JSDoc
1252
+ */
1253
+ text: string;
1254
+ /**
1255
+ * Tags included in the JSDoc
1256
+ */
1257
+ tags: CompilerJsDocTagInfo[];
1258
+ }
1259
+ /**
1260
+ * Representation of a tag that exists in a JSDoc
1261
+ */
1262
+ interface CompilerJsDocTagInfo {
1263
+ /**
1264
+ * The name of the tag - e.g. `@deprecated`
1265
+ */
1266
+ name: string;
1267
+ /**
1268
+ * Additional text that is associated with the tag - e.g. `@deprecated use v2 of this API`
1269
+ */
1270
+ text?: string;
1271
+ }
1272
+ /**
1273
+ * The (internal) representation of a CSS block comment in a CSS, Sass, etc. file. This data structure is used during
1274
+ * the initial compilation phases of Stencil, as a piece of {@link ComponentCompilerMeta}.
1275
+ */
1276
+ interface CompilerStyleDoc {
1277
+ /**
1278
+ * The name of the CSS property
1279
+ */
1280
+ name: string;
1281
+ /**
1282
+ * The user-defined description of the CSS property
1283
+ */
1284
+ docs: string;
1285
+ /**
1286
+ * The JSDoc-style annotation (e.g. `@prop`) that was used in the block comment to detect the comment.
1287
+ * Used to inform Stencil where the start of a new property's description starts (and where the previous description
1288
+ * ends).
1289
+ */
1290
+ annotation: 'prop';
1291
+ /**
1292
+ * The Stencil style-mode that is associated with this property.
1293
+ */
1294
+ mode: string;
1295
+ }
1296
+ interface CompilerAssetDir {
1297
+ absolutePath?: string;
1298
+ cmpRelativePath?: string;
1299
+ originalComponentPath?: string;
1300
+ }
1301
+ interface EntryModule {
1302
+ entryKey: string;
1303
+ cmps: ComponentCompilerMeta[];
1304
+ }
1305
+ /**
1306
+ * A mapping from a TypeScript or JavaScript source file path on disk, to a Stencil {@link Module}.
1307
+ *
1308
+ * It is advised that the key (path) be normalized before storing/retrieving the `Module` to avoid unnecessary lookup
1309
+ * failures.
1310
+ */
1311
+ type ModuleMap = Map<string, Module>;
1312
+ /**
1313
+ * Stencil's Intermediate Representation (IR) of a module, bundling together
1314
+ * various pieces of information like the classes declared within it, the path
1315
+ * to the original source file, HTML tag names defined in the file, and so on.
1316
+ *
1317
+ * Note that this gets serialized/parsed as JSON and therefore cannot contain a
1318
+ * `Map` or a `Set`.
1319
+ */
1320
+ interface Module {
1321
+ cmps: ComponentCompilerMeta[];
1322
+ isMixin: boolean;
1323
+ isExtended: boolean;
1324
+ /**
1325
+ * Indicates this module contains mixin/abstract classes that can be extended by other projects.
1326
+ * These are classes with Stencil static members (properties, states, etc.) but no @Component decorator.
1327
+ */
1328
+ hasExportableMixins: boolean;
1329
+ /**
1330
+ * A collection of modules that a component will need. The modules in this list must have import statements generated
1331
+ * in order for the component to function.
1332
+ */
1333
+ coreRuntimeApis: string[];
1334
+ /**
1335
+ * A collection of modules that a component will need for a specific output target. The modules in this list must
1336
+ * have import statements generated in order for the component to function, but only for a specific output target.
1337
+ */
1338
+ outputTargetCoreRuntimeApis: Partial<Record<OutputTarget['type'], string[]>>;
1339
+ collectionName: string;
1340
+ dtsFilePath: string;
1341
+ excludeFromCollection: boolean;
1342
+ externalImports: string[];
1343
+ htmlAttrNames: string[];
1344
+ htmlTagNames: string[];
1345
+ htmlParts: string[];
1346
+ isCollectionDependency: boolean;
1347
+ isLegacy: boolean;
1348
+ jsFilePath: string;
1349
+ localImports: string[];
1350
+ /**
1351
+ * Source file paths of functional components that are used in JSX/h() calls.
1352
+ * This is used to ensure htmlTagNames are properly propagated from functional
1353
+ * component dependencies even when they're accessed indirectly (e.g., via barrel files).
1354
+ */
1355
+ functionalComponentDeps: string[];
1356
+ originalImports: string[];
1357
+ originalCollectionComponentPath: string;
1358
+ potentialCmpRefs: string[];
1359
+ sourceFilePath: string;
1360
+ staticSourceFile: any;
1361
+ staticSourceFileText: string;
1362
+ sourceMapPath: string;
1363
+ sourceMapFileText: string;
1364
+ hasVdomAttribute: boolean;
1365
+ hasVdomClass: boolean;
1366
+ hasVdomFunctional: boolean;
1367
+ hasVdomKey: boolean;
1368
+ hasVdomListener: boolean;
1369
+ hasVdomPropOrAttr: boolean;
1370
+ hasVdomRef: boolean;
1371
+ hasVdomRender: boolean;
1372
+ hasVdomStyle: boolean;
1373
+ hasVdomText: boolean;
1374
+ hasVdomXlink: boolean;
1375
+ }
1376
+ interface PrerenderUrlResults {
1377
+ anchorUrls: string[];
1378
+ diagnostics: Diagnostic[];
1379
+ filePath: string;
1380
+ }
1381
+ interface PrerenderUrlRequest {
1382
+ appDir: string;
1383
+ buildId: string;
1384
+ baseUrl: string;
1385
+ componentGraphPath: string;
1386
+ devServerHostUrl: string;
1387
+ hydrateAppFilePath: string;
1388
+ isDebug: boolean;
1389
+ prerenderConfigPath: string;
1390
+ staticSite: boolean;
1391
+ templateId: string;
1392
+ url: string;
1393
+ writeToFilePath: string;
1394
+ }
1395
+ interface StyleCompiler {
1396
+ modeName: string;
1397
+ styleId: string;
1398
+ styleStr: string;
1399
+ styleIdentifier: string;
1400
+ externalStyles: ExternalStyleCompiler[];
1401
+ }
1402
+ interface ExternalStyleCompiler {
1403
+ absolutePath: string;
1404
+ relativePath: string;
1405
+ originalComponentPath: string;
1406
+ }
1407
+ /**
1408
+ * Input CSS to be transformed into ESM
1409
+ */
1410
+ interface TransformCssToEsmInput {
1411
+ input: string;
1412
+ module?: 'cjs' | 'esm' | string;
1413
+ file?: string;
1414
+ tag?: string;
1415
+ tags?: string[];
1416
+ addTagTransformers: boolean;
1417
+ encapsulation?: string;
1418
+ /**
1419
+ * The mode under which the CSS will be applied.
1420
+ *
1421
+ * Corresponds to a key used when `@Component`'s `styleUrls` field is an object:
1422
+ * ```ts
1423
+ * @Component({
1424
+ * tag: 'todo-list',
1425
+ * styleUrls: {
1426
+ * ios: 'todo-list.ios.scss',
1427
+ * md: 'todo-list.md.scss',
1428
+ * }
1429
+ * })
1430
+ * ```
1431
+ * In the example above, two `TransformCssToEsmInput`s should be created, one for 'ios' and one for 'md' (this field
1432
+ * is not shared by multiple fields, nor is it a composite of multiple modes).
1433
+ */
1434
+ mode?: string;
1435
+ sourceMap?: boolean;
1436
+ minify?: boolean;
1437
+ docs?: boolean;
1438
+ autoprefixer?: any;
1439
+ styleImportData?: string;
1440
+ }
1441
+ interface TransformCssToEsmOutput {
1442
+ styleText: string;
1443
+ output: string;
1444
+ map: any;
1445
+ diagnostics: Diagnostic[];
1446
+ defaultVarName: string;
1447
+ styleDocs: StyleDoc[];
1448
+ imports: {
1449
+ varName: string;
1450
+ importPath: string;
1451
+ }[];
1452
+ }
1453
+ interface PackageJsonData {
1454
+ name?: string;
1455
+ version?: string;
1456
+ main?: string;
1457
+ exports?: {
1458
+ [key: string]: string | {
1459
+ [key: string]: string;
1460
+ };
1461
+ };
1462
+ description?: string;
1463
+ bin?: {
1464
+ [key: string]: string;
1465
+ };
1466
+ browser?: string;
1467
+ module?: string;
1468
+ 'jsnext:main'?: string;
1469
+ 'collection:main'?: string;
1470
+ unpkg?: string;
1471
+ collection?: string;
1472
+ types?: string;
1473
+ files?: string[];
1474
+ ['dist-tags']?: {
1475
+ latest: string;
1476
+ };
1477
+ dependencies?: {
1478
+ [moduleId: string]: string;
1479
+ };
1480
+ devDependencies?: {
1481
+ [moduleId: string]: string;
1482
+ };
1483
+ repository?: {
1484
+ type?: string;
1485
+ url?: string;
1486
+ };
1487
+ private?: boolean;
1488
+ scripts?: {
1489
+ [runName: string]: string;
1490
+ };
1491
+ license?: string;
1492
+ keywords?: string[];
1493
+ }
1494
+ /**
1495
+ * An abstraction to bundle up four methods which _may_ be handled by
1496
+ * dispatching work to workers running in other OS threads or may be called
1497
+ * synchronously. Environment and `CompilerSystem` related setup code will
1498
+ * determine which one, but in either case the call sites for these methods can
1499
+ * dispatch to this shared interface.
1500
+ */
1501
+ interface CompilerWorkerContext {
1502
+ optimizeCss(inputOpts: OptimizeCssInput): Promise<OptimizeCssOutput>;
1503
+ prepareModule(input: string, minifyOpts: any, transpile: boolean, inlineHelpers: boolean): Promise<{
1504
+ output: string;
1505
+ diagnostics: Diagnostic[];
1506
+ sourceMap?: SourceMap;
1507
+ }>;
1508
+ prerenderWorker(prerenderRequest: PrerenderUrlRequest): Promise<PrerenderUrlResults>;
1509
+ transformCssToEsm(input: TransformCssToEsmInput): Promise<TransformCssToEsmOutput>;
1510
+ }
1511
+ //#endregion
1512
+ //#region src/declarations/stencil-public-compiler.d.ts
1513
+ /**
1514
+ * https://stenciljs.com/docs/config/
1515
+ */
1516
+ interface StencilConfig {
1517
+ /**
1518
+ * By default, Stencil will attempt to optimize small scripts by inlining them in HTML. Setting
1519
+ * this flag to `false` will prevent this optimization and keep all scripts separate from HTML.
1520
+ */
1521
+ allowInlineScripts?: boolean;
1522
+ /**
1523
+ * By setting `autoprefixCss` to `true`, Stencil will use the appropriate config to automatically
1524
+ * prefix css. For example, developers can write modern and standard css properties, such as
1525
+ * "transform", and Stencil will automatically add in the prefixed version, such as "-webkit-transform".
1526
+ * As of Stencil v2, autoprefixing CSS is no longer the default.
1527
+ * Defaults to `false`
1528
+ */
1529
+ autoprefixCss?: boolean | any;
1530
+ /**
1531
+ * By default, Stencil will statically analyze the application and generate a component graph of
1532
+ * how all the components are interconnected.
1533
+ *
1534
+ * From the component graph it is able to best decide how components should be grouped
1535
+ * depending on their usage with one another within the app.
1536
+ * By doing so it's able to bundle components together in order to reduce network requests.
1537
+ * However, bundles can be manually generated using the bundles config.
1538
+ *
1539
+ * The bundles config is an array of objects that represent how components are grouped together
1540
+ * in lazy-loaded bundles.
1541
+ * This config is rarely needed as Stencil handles this automatically behind the scenes.
1542
+ */
1543
+ bundles?: ConfigBundle[];
1544
+ /**
1545
+ * Stencil will cache build results in order to speed up rebuilds.
1546
+ * To disable this feature, set enableCache to false.
1547
+ */
1548
+ enableCache?: boolean;
1549
+ /**
1550
+ * The directory where sub-directories will be created for caching when `enableCache` is set
1551
+ * `true` or if using Stencil's Screenshot Connector.
1552
+ *
1553
+ * @default '.stencil'
1554
+ *
1555
+ * @example
1556
+ *
1557
+ * A Stencil config like the following:
1558
+ * ```ts
1559
+ * export const config = {
1560
+ * ...,
1561
+ * enableCache: true,
1562
+ * cacheDir: '.cache',
1563
+ * testing: {
1564
+ * screenshotConnector: 'connector.js'
1565
+ * }
1566
+ * }
1567
+ * ```
1568
+ *
1569
+ * Will result in the following file structure:
1570
+ * ```tree
1571
+ * stencil-project-root
1572
+ * └── .cache
1573
+ * ├── .build <-- Where build related file caching is written
1574
+ * |
1575
+ * └── screenshot-cache.json <-- Where screenshot caching is written
1576
+ * ```
1577
+ */
1578
+ cacheDir?: string;
1579
+ /**
1580
+ * Stencil is traditionally used to compile many components into an app,
1581
+ * and each component comes with its own compartmentalized styles.
1582
+ * However, it's still common to have styles which should be "global" across all components and the website.
1583
+ * A global CSS file is often useful to set CSS Variables.
1584
+ *
1585
+ * Additionally, the globalStyle config can be used to precompile styles with Sass, PostCSS, etc.
1586
+ * Below is an example folder structure containing a webapp's global sass file, named app.css.
1587
+ */
1588
+ globalStyle?: string;
1589
+ /**
1590
+ * Will generate {@link https://nodejs.org/api/packages.html#packages_exports export map} entry points
1591
+ * for each component in the build when `true`.
1592
+ *
1593
+ * @default false
1594
+ */
1595
+ generateExportMaps?: boolean;
1596
+ /**
1597
+ * When the hashFileNames config is set to true, and it is a production build,
1598
+ * the hashedFileNameLength config is used to determine how many characters the file name's hash should be.
1599
+ */
1600
+ hashedFileNameLength?: number;
1601
+ /**
1602
+ * During production builds, the content of each generated file is hashed to represent the content,
1603
+ * and the hashed value is used as the filename. If the content isn't updated between builds,
1604
+ * then it receives the same filename. When the content is updated, then the filename is different.
1605
+ *
1606
+ * By doing this, deployed apps can "forever-cache" the build directory and take full advantage of
1607
+ * content delivery networks (CDNs) and heavily caching files for faster apps.
1608
+ */
1609
+ hashFileNames?: boolean;
1610
+ /**
1611
+ * The namespace config is a string representing a namespace for the app.
1612
+ * For apps that are not meant to be a library of reusable components,
1613
+ * the default of App is just fine. However, if the app is meant to be consumed
1614
+ * as a third-party library, such as Ionic, a unique namespace is required.
1615
+ */
1616
+ namespace?: string;
1617
+ /**
1618
+ * Stencil is able to take an app's source and compile it to numerous targets,
1619
+ * such as an app to be deployed on an http server, or as a third-party library
1620
+ * to be distributed on npm. By default, Stencil apps have an output target type of www.
1621
+ *
1622
+ * The outputTargets config is an array of objects, with types of www and dist.
1623
+ */
1624
+ outputTargets?: OutputTarget[];
1625
+ /**
1626
+ * The plugins config can be used to add your own rollup plugins.
1627
+ * By default, Stencil does not come with Sass or PostCSS support.
1628
+ * However, either can be added using the plugin array.
1629
+ */
1630
+ plugins?: any[];
1631
+ /**
1632
+ * Generate js source map files for all bundles.
1633
+ * Set to `true` to always generate source maps, `false` to never generate source maps.
1634
+ * Set to `'dev'` to only generate source maps when the `--dev` flag is passed.
1635
+ * Defaults to `'dev'`.
1636
+ */
1637
+ sourceMap?: boolean | 'dev';
1638
+ /**
1639
+ * The srcDir config specifies the directory which should contain the source typescript files
1640
+ * for each component. The standard for Stencil apps is to use src, which is the default.
1641
+ */
1642
+ srcDir?: string;
1643
+ /**
1644
+ * Sets whether or not Stencil should transform path aliases set in a project's
1645
+ * `tsconfig.json` from the assigned module aliases to resolved relative paths.
1646
+ *
1647
+ * This behavior defaults to `true`, but may be opted-out of by setting this flag to `false`.
1648
+ */
1649
+ transformAliasedImportPaths?: boolean;
1650
+ /**
1651
+ * When `true`, Stencil will suppress diagnostics which warn about public members using reserved names
1652
+ * (for example, decorating a method named `focus` with `@Method()`). Defaults to `false`.
1653
+ */
1654
+ suppressReservedPublicNameWarnings?: boolean;
1655
+ /**
1656
+ * When `true`, we will validate a project's `package.json` based on the output target the user has designated
1657
+ * as `isPrimaryPackageOutputTarget: true` in their Stencil config.
1658
+ */
1659
+ validatePrimaryPackageOutputTarget?: boolean;
1660
+ /**
1661
+ * Passes custom configuration down to the "@rollup/plugin-commonjs" that Stencil uses under the hood.
1662
+ * For further information: https://stenciljs.com/docs/module-bundling
1663
+ */
1664
+ commonjs?: BundlingConfig;
1665
+ /**
1666
+ * Passes custom configuration down to the "@rollup/plugin-node-resolve" that Stencil uses under the hood.
1667
+ * For further information: https://stenciljs.com/docs/module-bundling
1668
+ */
1669
+ nodeResolve?: NodeResolveConfig;
1670
+ /**
1671
+ * Passes custom configuration down to rollup itself, not all rollup options can be overridden.
1672
+ */
1673
+ rollupConfig?: RollupConfig;
1674
+ /**
1675
+ * Sets if the ES5 build should be generated or not. Stencil generates a modern build without ES5,
1676
+ * whereas this setting to `true` will also create es5 builds for both dev and prod modes. Setting
1677
+ * `buildEs5` to `prod` will only build ES5 in prod mode. Basically if the app does not need to run
1678
+ * on legacy browsers (IE11 and Edge 18 and below), it's safe to not build ES5, which will also speed
1679
+ * up build times. Defaults to `false`.
1680
+ */
1681
+ buildEs5?: boolean | 'prod';
1682
+ /**
1683
+ * Sets if the JS browser files are minified or not. Stencil uses `terser` under the hood.
1684
+ * Defaults to `false` in dev mode and `true` in production mode.
1685
+ */
1686
+ minifyJs?: boolean;
1687
+ /**
1688
+ * Sets if the CSS is minified or not.
1689
+ * Defaults to `false` in dev mode and `true` in production mode.
1690
+ */
1691
+ minifyCss?: boolean;
1692
+ /**
1693
+ * Forces Stencil to run in `dev` mode if the value is `true` and `production` mode
1694
+ * if it's `false`.
1695
+ *
1696
+ * Defaults to `false` (ie. production) unless the `--dev` flag is used in the CLI.
1697
+ */
1698
+ devMode?: boolean;
1699
+ /**
1700
+ * Object to provide a custom logger. By default a `logger` is already provided for the
1701
+ * platform the compiler is running on, such as NodeJS or a browser.
1702
+ */
1703
+ logger?: Logger;
1704
+ /**
1705
+ * Config to add extra runtime for DOM features that require more polyfills. Note
1706
+ * that not all DOM APIs are fully polyfilled when using the slot polyfill. These
1707
+ * are opt-in since not all users will require the additional runtime.
1708
+ */
1709
+ extras?: ConfigExtras;
1710
+ /**
1711
+ * The hydrated flag identifies if a component and all of its child components
1712
+ * have finished hydrating. This helps prevent any flash of unstyled content (FOUC)
1713
+ * as various components are asynchronously downloaded and rendered. By default it
1714
+ * will add the `hydrated` CSS class to the element. The `hydratedFlag` config can be used
1715
+ * to change the name of the CSS class, change it to an attribute, or change which
1716
+ * type of CSS properties and values are assigned before and after hydrating. This config
1717
+ * can also be used to not include the hydrated flag at all by setting it to `null`.
1718
+ */
1719
+ hydratedFlag?: HydratedFlag | null;
1720
+ /**
1721
+ * Ionic prefers to hide all components prior to hydration with a style tag appended
1722
+ * to the head of the document containing some `visibility: hidden;` css rules.
1723
+ *
1724
+ * Disabling this will remove the style tag that sets `visibility: hidden;` on all
1725
+ * un-hydrated web components. This more closely follows the HTML spec, and allows
1726
+ * you to set your own fallback content.
1727
+ *
1728
+ */
1729
+ invisiblePrehydration?: boolean;
1730
+ /**
1731
+ * Sets the task queue used by stencil's runtime. The task queue schedules DOM read and writes
1732
+ * across the frames to efficiently render and reduce layout thrashing. By default,
1733
+ * `async` is used. It's recommended to also try each setting to decide which works
1734
+ * best for your use-case. In all cases, if your app has many CPU intensive tasks causing the
1735
+ * main thread to periodically lock-up, it's always recommended to try
1736
+ * [Web Workers](https://stenciljs.com/docs/web-workers) for those tasks.
1737
+ *
1738
+ * - `async`: DOM read and writes are scheduled in the next frame to prevent layout thrashing.
1739
+ * During intensive CPU tasks it will not reschedule rendering to happen in the next frame.
1740
+ * `async` is ideal for most apps, and if the app has many intensive tasks causing the main
1741
+ * thread to lock-up, it's recommended to try [Web Workers](https://stenciljs.com/docs/web-workers)
1742
+ * rather than the congestion async queue.
1743
+ *
1744
+ * - `congestionAsync`: DOM reads and writes are scheduled in the next frame to prevent layout
1745
+ * thrashing. When the app is heavily tasked and the queue becomes congested it will then
1746
+ * split the work across multiple frames to prevent blocking the main thread. However, it can
1747
+ * also introduce unnecessary reflows in some cases, especially during startup. `congestionAsync`
1748
+ * is ideal for apps running animations while also simultaneously executing intensive tasks
1749
+ * which may lock-up the main thread.
1750
+ *
1751
+ * - `immediate`: Makes writeTask() and readTask() callbacks to be executed synchronously. Tasks
1752
+ * are not scheduled to run in the next frame, but do note there is at least one microtask.
1753
+ * The `immediate` setting is ideal for apps that do not provide long running and smooth
1754
+ * animations. Like the async setting, if the app has intensive tasks causing the main thread
1755
+ * to lock-up, it's recommended to try [Web Workers](https://stenciljs.com/docs/web-workers).
1756
+ */
1757
+ taskQueue?: 'async' | 'immediate' | 'congestionAsync';
1758
+ /**
1759
+ * Provide a object of key/values accessible within the app, using the `Env` object.
1760
+ */
1761
+ env?: {
1762
+ [prop: string]: string | undefined;
1763
+ };
1764
+ docs?: StencilDocsConfig;
1765
+ globalScript?: string;
1766
+ srcIndexHtml?: string;
1767
+ /**
1768
+ * Configuration for Stencil's integrated testing (Jest + Puppeteer).
1769
+ *
1770
+ * @deprecated Integrated testing support will be removed in Stencil v5. Migrate spec tests to
1771
+ * [`@stencil/vitest`](https://github.com/stenciljs/vitest) and e2e / browser tests to either
1772
+ * [`@stencil/vitest`](https://github.com/stenciljs/vitest) or
1773
+ * [`@stencil/playwright`](https://github.com/stenciljs/playwright).
1774
+ * See https://github.com/stenciljs/core/issues/6584 for full discussion and migration guidance.
1775
+ */
1776
+ testing?: TestingConfig;
1777
+ maxConcurrentWorkers?: number;
1778
+ preamble?: string;
1779
+ rollupPlugins?: {
1780
+ before?: any[];
1781
+ after?: any[];
1782
+ };
1783
+ entryComponentsHint?: string[];
1784
+ /**
1785
+ * Sets whether Stencil will write files to `dist/` during the build or not.
1786
+ *
1787
+ * By default this value is set to the opposite value of {@link devMode},
1788
+ * i.e. it will be `true` when building for production and `false` when
1789
+ * building for development.
1790
+ */
1791
+ buildDist?: boolean;
1792
+ buildLogFilePath?: string;
1793
+ devInspector?: boolean;
1794
+ devServer?: StencilDevServerConfig;
1795
+ sys?: CompilerSystem;
1796
+ tsconfig?: string;
1797
+ validateTypes?: boolean;
1798
+ /**
1799
+ * Sets whether Stencil will watch for changes in the source files and rebuild the project automatically.
1800
+ * @default true
1801
+ */
1802
+ watch?: boolean;
1803
+ /**
1804
+ * External directories to watch for changes. By default, Stencil will watch the root and {@link StencilConfig.srcDir}
1805
+ * directory for changes. If you want to watch additional directories, including e.g. `node_modules`, you can add them here.
1806
+ * @default []
1807
+ */
1808
+ watchExternalDirs?: string[];
1809
+ /**
1810
+ * An array of RegExp patterns that are matched against all source files before adding
1811
+ * to the watch list in watch mode. If the file path matches any of the patterns, when it
1812
+ * is updated, it will not trigger a re-run of tests.
1813
+ */
1814
+ watchIgnoredRegex?: RegExp | RegExp[];
1815
+ /**
1816
+ * An array of component tag names to exclude from production builds.
1817
+ * Useful to remove test, demo or experimental components from final output.
1818
+ *
1819
+ * **Note:** Exclusion only applies to production builds (default, or when `--prod` is used).
1820
+ * Development builds (with `--dev` flag) will include all components to support local testing.
1821
+ *
1822
+ * Supports glob patterns for matching multiple components:
1823
+ * - `['demo-*']` - Excludes all components starting with "demo-"
1824
+ * - `['*-test', '*-demo']` - Excludes components ending with "-test" or "-demo"
1825
+ * - `['my-component']` - Excludes a specific component
1826
+ *
1827
+ * Components matching these patterns will be completely excluded from all output targets.
1828
+ *
1829
+ * @example
1830
+ * ```ts
1831
+ * export const config: Config = {
1832
+ * excludeComponents: ['demo-*', 'test-component', '*-internal'],
1833
+ * };
1834
+ * ```
1835
+ *
1836
+ * @default []
1837
+ */
1838
+ excludeComponents?: string[];
1839
+ /**
1840
+ * Set whether unused dependencies should be excluded from the built output.
1841
+ */
1842
+ excludeUnusedDependencies?: boolean;
1843
+ stencilCoreResolvedId?: string;
1844
+ }
1845
+ interface ConfigExtrasBase {
1846
+ /**
1847
+ * Experimental flag. Projects that use a Stencil library built using the `dist` output target may have trouble lazily
1848
+ * loading components when using a bundler such as Vite or Parcel. Setting this flag to `true` will change how Stencil
1849
+ * lazily loads components in a way that works with additional bundlers. Setting this flag to `true` will increase
1850
+ * the size of the compiled output. Defaults to `false`.
1851
+ * @deprecated This flag has been deprecated in favor of `enableImportInjection`, which provides the same
1852
+ * functionality. `experimentalImportInjection` will be removed in a future major version of Stencil.
1853
+ */
1854
+ experimentalImportInjection?: boolean;
1855
+ /**
1856
+ * Projects that use a Stencil library built using the `dist` output target may have trouble lazily
1857
+ * loading components when using a bundler such as Vite or Parcel. Setting this flag to `true` will change how Stencil
1858
+ * lazily loads components in a way that works with additional bundlers. Setting this flag to `true` will increase
1859
+ * the size of the compiled output. Defaults to `false`.
1860
+ */
1861
+ enableImportInjection?: boolean;
1862
+ /**
1863
+ * Dispatches component lifecycle events. Mainly used for testing. Defaults to `false`.
1864
+ */
1865
+ lifecycleDOMEvents?: boolean;
1866
+ /**
1867
+ * When a component is first attached to the DOM, this setting will wait a single tick before
1868
+ * rendering. This works around an Angular issue, where Angular attaches the elements before
1869
+ * settings their initial state, leading to double renders and unnecessary event dispatches.
1870
+ * Defaults to `false`.
1871
+ */
1872
+ initializeNextTick?: boolean;
1873
+ /**
1874
+ * Enables the tagNameTransform option of `defineCustomElements()`, so the component tagName
1875
+ * can be customized at runtime. Defaults to `false`.
1876
+ * @deprecated This option has been deprecated in favour of `setTagTransformer` and `transformTag`. It will be removed in a future major version of Stencil.
1877
+ */
1878
+ tagNameTransform?: boolean;
1879
+ /**
1880
+ * Adds `transformTag` calls to css strings and querySelector(All) calls
1881
+ */
1882
+ additionalTagTransformers?: boolean | 'prod';
1883
+ /**
1884
+ * Experimental flag.
1885
+ * Updates the behavior of scoped components to align more closely with the behavior of the native
1886
+ * Shadow DOM when using `slot`s.
1887
+ * Defaults to `false`.
1888
+ */
1889
+ experimentalScopedSlotChanges?: boolean;
1890
+ /**
1891
+ * By default Stencil turns the stylesheet provided to `globalStyle` into a constructable stylesheet
1892
+ * and adds it to each component when rendered on the client which can be useful for sharing styles
1893
+ * efficiently across components.
1894
+ *
1895
+ * If you want Stencil to also add the `globalStyle` to each component when rendering on the server
1896
+ * then set this to `true`. If your `globalStyle` sheet is large then doing this may bloat the size
1897
+ * of your SSR output when using declarative-shadow-dom.
1898
+ *
1899
+ * Setting this to `false` will prevent Stencil from adding any `globalStyle` to each component.
1900
+ *
1901
+ * Defaults to `'client'`.
1902
+ */
1903
+ addGlobalStyleToComponents?: boolean | 'client';
1904
+ }
1905
+ type ConfigExtrasSlotFixes<ExperimentalFixesEnabled extends boolean, IndividualFlags extends boolean> = {
1906
+ /**
1907
+ * By default, the slot polyfill does not update `appendChild()` so that it appends
1908
+ * new child nodes into the correct child slot like how shadow dom works. This is an opt-in
1909
+ * polyfill for those who need it when using `element.appendChild(node)` and expecting the
1910
+ * child to be appended in the same location shadow dom would. This is not required for
1911
+ * IE11 or Edge 18, but can be enabled if the app is using `appendChild()`. Defaults to `false`.
1912
+ */
1913
+ appendChildSlotFix?: IndividualFlags;
1914
+ /**
1915
+ * By default, the runtime does not polyfill `cloneNode()` when cloning a component
1916
+ * that uses the slot polyfill. This is an opt-in polyfill for those who need it.
1917
+ * This is not required for IE11 or Edge 18, but can be enabled if the app is using
1918
+ * `cloneNode()` and unexpected node are being cloned due to the slot polyfill
1919
+ * simulating shadow dom. Defaults to `false`.
1920
+ */
1921
+ cloneNodeFix?: IndividualFlags;
1922
+ /**
1923
+ * Experimental flag to align the behavior of invoking `textContent` on a scoped component to act more like a
1924
+ * component that uses the shadow DOM. Defaults to `false`
1925
+ */
1926
+ scopedSlotTextContentFix?: IndividualFlags;
1927
+ /**
1928
+ * For browsers that do not support shadow dom (IE11 and Edge 18 and below), slot is polyfilled
1929
+ * to simulate the same behavior. However, the host element's `childNodes` and `children`
1930
+ * getters are not patched to only show the child nodes and elements of the default slot.
1931
+ * Defaults to `false`.
1932
+ */
1933
+ slotChildNodesFix?: IndividualFlags;
1934
+ /**
1935
+ * Enables all slot-related fixes such as {@link slotChildNodesFix}, and
1936
+ * {@link scopedSlotTextContentFix}.
1937
+ */
1938
+ experimentalSlotFixes?: ExperimentalFixesEnabled;
1939
+ };
1940
+ type ConfigExtras = ConfigExtrasBase & (ConfigExtrasSlotFixes<true, true> | ConfigExtrasSlotFixes<false, boolean>);
1941
+ interface Config extends StencilConfig {
1942
+ buildAppCore?: boolean;
1943
+ buildDocs?: boolean;
1944
+ configPath?: string;
1945
+ writeLog?: boolean;
1946
+ devServer?: DevServerConfig;
1947
+ fsNamespace?: string;
1948
+ logLevel?: LogLevel;
1949
+ rootDir?: string;
1950
+ packageJsonFilePath?: string;
1951
+ suppressLogs?: boolean;
1952
+ profile?: boolean;
1953
+ tsCompilerOptions?: any;
1954
+ tsWatchOptions?: any;
1955
+ _isValidated?: boolean;
1956
+ _isTesting?: boolean;
1957
+ /**
1958
+ * Whether running in a CI environment (disables interactive features, adjusts worker count)
1959
+ */
1960
+ ci?: boolean;
1961
+ /**
1962
+ * Enable server-side rendering mode
1963
+ */
1964
+ ssr?: boolean;
1965
+ /**
1966
+ * Enable prerendering
1967
+ */
1968
+ prerender?: boolean;
1969
+ /**
1970
+ * Path to output docs JSON file (when --docsJson flag is used)
1971
+ */
1972
+ docsJsonPath?: string;
1973
+ /**
1974
+ * Path to output stats JSON file, or true to use default path
1975
+ */
1976
+ statsJsonPath?: string | boolean;
1977
+ /**
1978
+ * Whether to generate service worker
1979
+ */
1980
+ generateServiceWorker?: boolean;
1981
+ /**
1982
+ * Whether e2e tests are being run
1983
+ */
1984
+ e2eTests?: boolean;
1985
+ /**
1986
+ * Dev server address override
1987
+ */
1988
+ devServerAddress?: string;
1989
+ /**
1990
+ * Dev server port override
1991
+ */
1992
+ devServerPort?: number;
1993
+ /**
1994
+ * Whether to open browser on dev server start
1995
+ */
1996
+ devServerOpen?: boolean;
1997
+ }
1998
+ /**
1999
+ * A 'loose' type useful for wrapping an incomplete / possible malformed
2000
+ * object as we work on getting it comply with a particular Interface T.
2001
+ *
2002
+ * Example:
2003
+ *
2004
+ * ```ts
2005
+ * interface Foo {
2006
+ * bar: string
2007
+ * }
2008
+ *
2009
+ * function validateFoo(foo: Loose<Foo>): Foo {
2010
+ * let validatedFoo = {
2011
+ * ...foo,
2012
+ * bar: foo.bar || DEFAULT_BAR
2013
+ * }
2014
+ *
2015
+ * return validatedFoo
2016
+ * }
2017
+ * ```
2018
+ *
2019
+ * Use this when you need to take user input or something from some other part
2020
+ * of the world that we don't control and transform it into something
2021
+ * conforming to a given interface. For best results, pair with a validation
2022
+ * function as shown in the example.
2023
+ */
2024
+ type Loose<T extends object> = Record<string, any> & Partial<T>;
2025
+ /**
2026
+ * A Loose version of the Config interface. This is intended to let us load a partial config
2027
+ * and have type information carry though as we construct an object which is a valid `Config`.
2028
+ */
2029
+ type UnvalidatedConfig = Loose<Config>;
2030
+ /**
2031
+ * Helper type to strip optional markers from keys in a type, while preserving other type information for the key.
2032
+ * This type takes a union of keys, K, in type T to allow for the type T to be gradually updated.
2033
+ *
2034
+ * ```typescript
2035
+ * type Foo { bar?: number, baz?: string }
2036
+ * type ReqFieldFoo = RequireFields<Foo, 'bar'>; // { bar: number, baz?: string }
2037
+ * ```
2038
+ */
2039
+ type RequireFields<T, K extends keyof T> = T & { [P in K]-?: T[P] };
2040
+ /**
2041
+ * Fields in {@link Config} to make required for {@link ValidatedConfig}
2042
+ */
2043
+ type StrictConfigFields = keyof Pick<Config, 'buildEs5' | 'cacheDir' | 'devMode' | 'devServer' | 'extras' | 'fsNamespace' | 'hashFileNames' | 'hashedFileNameLength' | 'hydratedFlag' | 'logLevel' | 'logger' | 'minifyCss' | 'minifyJs' | 'namespace' | 'outputTargets' | 'packageJsonFilePath' | 'rollupConfig' | 'rootDir' | 'srcDir' | 'srcIndexHtml' | 'sys' | 'testing' | 'transformAliasedImportPaths' | 'validatePrimaryPackageOutputTarget'>;
2044
+ /**
2045
+ * A version of {@link Config} that makes certain fields required. This type represents a valid configuration entity.
2046
+ * When a configuration is received by the user, it is a bag of unverified data. In order to make stricter guarantees
2047
+ * about the data from a type-safety perspective, this type is intended to be used throughout the codebase once
2048
+ * validations have occurred at runtime.
2049
+ */
2050
+ type ValidatedConfig = RequireFields<Config, StrictConfigFields> & {
2051
+ sourceMap: boolean;
2052
+ };
2053
+ interface HydratedFlag {
2054
+ /**
2055
+ * Defaults to `hydrated`.
2056
+ */
2057
+ name?: string;
2058
+ /**
2059
+ * Can be either `class` or `attribute`. Defaults to `class`.
2060
+ */
2061
+ selector?: 'class' | 'attribute';
2062
+ /**
2063
+ * The CSS property used to show and hide components. Defaults to use the CSS `visibility`
2064
+ * property. Other commonly used CSS properties would be `display` with the `initialValue`
2065
+ * setting as `none`, or `opacity` with the `initialValue` as `0`. Defaults to `visibility`
2066
+ * and the default `initialValue` is `hidden`.
2067
+ */
2068
+ property?: string;
2069
+ /**
2070
+ * This is the CSS value to give all components before it has been hydrated.
2071
+ * Defaults to `hidden`.
2072
+ */
2073
+ initialValue?: string;
2074
+ /**
2075
+ * This is the CSS value to assign once a component has finished hydrating.
2076
+ * This is the CSS value that'll allow the component to show. Defaults to `inherit`.
2077
+ */
2078
+ hydratedValue?: string;
2079
+ }
2080
+ interface StencilDevServerConfig {
2081
+ /**
2082
+ * IP address used by the dev server. The default is `0.0.0.0`, which points to all IPv4 addresses
2083
+ * on the local machine, such as `localhost`.
2084
+ */
2085
+ address?: string;
2086
+ /**
2087
+ * Base path to be used by the server. Defaults to the root pathname.
2088
+ */
2089
+ basePath?: string;
2090
+ /**
2091
+ * EXPERIMENTAL!
2092
+ * During development, node modules can be independently requested and bundled, making for
2093
+ * faster build times. This is only available using the Stencil Dev Server throughout
2094
+ * development. Production builds and builds with the `es5` flag will override
2095
+ * this setting to `false`. Default is `false`.
2096
+ */
2097
+ experimentalDevModules?: boolean;
2098
+ /**
2099
+ * If the dev server should respond with gzip compressed content. Defaults to `true`.
2100
+ */
2101
+ gzip?: boolean;
2102
+ /**
2103
+ * When set, the dev server will run via https using the SSL certificate and key you provide
2104
+ * (use `fs` if you want to read them from files).
2105
+ */
2106
+ https?: Credentials;
2107
+ /**
2108
+ * The URL the dev server should first open to. Defaults to `/`.
2109
+ */
2110
+ initialLoadUrl?: string;
2111
+ /**
2112
+ * When `true`, every request to the server will be logged within the terminal.
2113
+ * Defaults to `false`.
2114
+ */
2115
+ logRequests?: boolean;
2116
+ /**
2117
+ * When set to `true`, the local dev URL is opened in your default browser when the dev server starts.
2118
+ * Defaults to `false`.
2119
+ */
2120
+ openBrowser?: boolean;
2121
+ /**
2122
+ * Sets the server's port. Defaults to `3333`.
2123
+ */
2124
+ port?: number;
2125
+ /**
2126
+ * When set to `true`, the dev server will exit with an error if the specified port is already in use.
2127
+ * When set to `false`, the dev server will automatically try the next available port.
2128
+ * Defaults to `false`.
2129
+ */
2130
+ strictPort?: boolean;
2131
+ /**
2132
+ * When files are watched and updated, by default the dev server will use `hmr` (Hot Module Replacement)
2133
+ * to update the page without a full page refresh. To have the page do a full refresh use `pageReload`.
2134
+ * To disable any reloading, use `null`. Defaults to `hmr`.
2135
+ */
2136
+ reloadStrategy?: PageReloadStrategy;
2137
+ /**
2138
+ * Local path to a NodeJs file with a dev server request listener as the default export.
2139
+ * The user's request listener is given the first chance to handle every request the dev server
2140
+ * receives, and can choose to handle it or instead pass it on to the default dev server
2141
+ * by calling `next()`.
2142
+ *
2143
+ * Below is an example of a NodeJs file the `requestListenerPath` config is using.
2144
+ * The request and response arguments are the same as Node's `http` module and `RequestListener`
2145
+ * callback. https://nodejs.org/api/http.html#http_http_createserver_options_requestlistener
2146
+ *
2147
+ * ```js
2148
+ * module.exports = function (req, res, next) {
2149
+ * if (req.url === '/ping') {
2150
+ * // custom response overriding the dev server
2151
+ * res.setHeader('Content-Type', 'text/plain');
2152
+ * res.writeHead(200);
2153
+ * res.end('pong');
2154
+ * } else {
2155
+ * // pass request on to the default dev server
2156
+ * next();
2157
+ * }
2158
+ * };
2159
+ * ```
2160
+ */
2161
+ requestListenerPath?: string;
2162
+ /**
2163
+ * The root directory to serve the files from.
2164
+ */
2165
+ root?: string;
2166
+ /**
2167
+ * If the dev server should Server-Side Render (SSR) each page, meaning it'll dynamically generate
2168
+ * server-side rendered html on each page load. The `--ssr` flag will most commonly be used with
2169
+ * the`--dev --watch --serve` flags during development. Note that this is for development purposes
2170
+ * only, and the built-in dev server should not be used for production. Defaults to `false`.
2171
+ */
2172
+ ssr?: boolean;
2173
+ /**
2174
+ * If the dev server fails to start up within the given timeout (in milliseconds), the startup will
2175
+ * be canceled. Set to zero to disable the timeout. Defaults to `15000`.
2176
+ */
2177
+ startupTimeout?: number;
2178
+ /**
2179
+ * Whether to use the dev server's websocket client or not. Defaults to `true`.
2180
+ */
2181
+ websocket?: boolean;
2182
+ /**
2183
+ * If the dev server should fork a worker for the server process or not. A singled-threaded dev server
2184
+ * is slower, however it is useful for debugging http requests and responses. Defaults to `true`.
2185
+ */
2186
+ worker?: boolean;
2187
+ }
2188
+ interface DevServerConfig extends StencilDevServerConfig {
2189
+ browserUrl?: string;
2190
+ devServerDir?: string;
2191
+ /**
2192
+ * A list of glob patterns like `subdir/*.js` to exclude from hot-module
2193
+ * reloading updates.
2194
+ */
2195
+ excludeHmr?: string[];
2196
+ historyApiFallback?: HistoryApiFallback;
2197
+ openBrowser?: boolean;
2198
+ prerenderConfig?: string;
2199
+ protocol?: 'http' | 'https';
2200
+ srcIndexHtml?: string;
2201
+ /**
2202
+ * Route to be used for the "ping" sub-route of the Stencil dev server.
2203
+ * This route will return a 200 status code once the Stencil build has finished.
2204
+ * Setting this to `null` will disable the ping route.
2205
+ *
2206
+ * Defaults to `/ping`
2207
+ */
2208
+ pingRoute?: string | null;
2209
+ }
2210
+ interface HistoryApiFallback {
2211
+ index?: string;
2212
+ disableDotRule?: boolean;
2213
+ }
2214
+ interface DevServerEditor {
2215
+ id: string;
2216
+ name?: string;
2217
+ supported?: boolean;
2218
+ priority?: number;
2219
+ }
2220
+ type PageReloadStrategy = 'hmr' | 'pageReload' | null;
2221
+ /**
2222
+ * The prerender config is used when prerendering a `www` output target.
2223
+ * Within `stencil.config.ts`, set the path to the prerendering
2224
+ * config file path using the `prerenderConfig` property, such as:
2225
+ *
2226
+ * ```tsx
2227
+ * import { Config } from '@stencil/core';
2228
+ * export const config: Config = {
2229
+ * outputTargets: [
2230
+ * {
2231
+ * type: 'www',
2232
+ * baseUrl: 'https://stenciljs.com/',
2233
+ * prerenderConfig: './prerender.config.ts',
2234
+ * }
2235
+ * ]
2236
+ * };
2237
+ * ```
2238
+ *
2239
+ * The `prerender.config.ts` should export a `config` object using
2240
+ * the `PrerenderConfig` interface.
2241
+ *
2242
+ * ```tsx
2243
+ * import { PrerenderConfig } from '@stencil/core';
2244
+ * export const config: PrerenderConfig = {
2245
+ * ...
2246
+ * };
2247
+ * ```
2248
+ *
2249
+ * For more info: https://stenciljs.com/docs/static-site-generation
2250
+ */
2251
+ interface PrerenderConfig {
2252
+ /**
2253
+ * Run after each `document` is hydrated, but before it is serialized
2254
+ * into an HTML string. Hook is passed the `document` and its `URL`.
2255
+ */
2256
+ afterHydrate?(document: Document, url: URL, results: PrerenderUrlResults): any | Promise<any>;
2257
+ /**
2258
+ * Run before each `document` is hydrated. Hook is passed the `document` it's `URL`.
2259
+ */
2260
+ beforeHydrate?(document: Document, url: URL): any | Promise<any>;
2261
+ /**
2262
+ * Runs after the template Document object has serialize into an
2263
+ * HTML formatted string. Returns an HTML string to be used as the
2264
+ * base template for all prerendered pages.
2265
+ */
2266
+ afterSerializeTemplate?(html: string): string | Promise<string>;
2267
+ /**
2268
+ * Runs before the template Document object is serialize into an
2269
+ * HTML formatted string. Returns the Document to be serialized which
2270
+ * will become the base template html for all prerendered pages.
2271
+ */
2272
+ beforeSerializeTemplate?(document: Document): Document | Promise<Document>;
2273
+ /**
2274
+ * A hook to be used to generate the canonical `<link>` tag
2275
+ * which goes in the `<head>` of every prerendered page. Returning `null`
2276
+ * will not add a canonical url tag to the page.
2277
+ */
2278
+ canonicalUrl?(url: URL): string | null;
2279
+ /**
2280
+ * While prerendering, crawl same-origin URLs found within `<a href>` elements.
2281
+ * Defaults to `true`.
2282
+ */
2283
+ crawlUrls?: boolean;
2284
+ /**
2285
+ * URLs to start the prerendering from. By default the root URL of `/` is used.
2286
+ */
2287
+ entryUrls?: string[];
2288
+ /**
2289
+ * Return `true` the given `<a>` element should be crawled or not.
2290
+ */
2291
+ filterAnchor?(attrs: {
2292
+ [attrName: string]: string;
2293
+ }, base?: URL): boolean;
2294
+ /**
2295
+ * Return `true` if the given URL should be prerendered or not.
2296
+ */
2297
+ filterUrl?(url: URL, base: URL): boolean;
2298
+ /**
2299
+ * Returns the file path which the prerendered HTML content
2300
+ * should be written to.
2301
+ */
2302
+ filePath?(url: URL, filePath: string): string;
2303
+ /**
2304
+ * Returns the hydrate options to use for each individual prerendered page.
2305
+ */
2306
+ hydrateOptions?(url: URL): PrerenderHydrateOptions;
2307
+ /**
2308
+ * Returns the template file's content. The template is the base
2309
+ * HTML used for all prerendered pages.
2310
+ */
2311
+ loadTemplate?(filePath: string): string | Promise<string>;
2312
+ /**
2313
+ * Used to normalize the page's URL from a given a string and the current
2314
+ * page's base URL. Largely used when reading an anchor's `href` attribute
2315
+ * value and normalizing it into a `URL`.
2316
+ */
2317
+ normalizeUrl?(href: string, base: URL): URL;
2318
+ robotsTxt?(opts: RobotsTxtOpts): string | RobotsTxtResults;
2319
+ sitemapXml?(opts: SitemapXmpOpts): string | SitemapXmpResults;
2320
+ /**
2321
+ * Static Site Generated (SSG). Does not include Stencil's client-side
2322
+ * JavaScript, custom elements or preload modules.
2323
+ */
2324
+ staticSite?: boolean;
2325
+ /**
2326
+ * If the prerendered URLs should have a trailing "/"" or not. Defaults to `false`.
2327
+ */
2328
+ trailingSlash?: boolean;
2329
+ }
2330
+ interface HydrateDocumentOptions {
2331
+ /**
2332
+ * Build ID that will be added to `<html data-stencil-build="BUILD_ID">`. By default
2333
+ * a random ID will be generated
2334
+ */
2335
+ buildId?: string;
2336
+ /**
2337
+ * Sets the `href` attribute on the `<link rel="canonical">`
2338
+ * tag within the `<head>`. If the value is not defined it will
2339
+ * ensure a canonical link tag is no included in the `<head>`.
2340
+ */
2341
+ canonicalUrl?: string;
2342
+ /**
2343
+ * Include the HTML comments and attributes used by the client-side
2344
+ * JavaScript to read the structure of the HTML and rebuild each
2345
+ * component. Defaults to `true`.
2346
+ */
2347
+ clientHydrateAnnotations?: boolean;
2348
+ /**
2349
+ * Constrain `setTimeout()` to 1ms, but still async. Also
2350
+ * only allows `setInterval()` to fire once, also constrained to 1ms.
2351
+ * Defaults to `true`.
2352
+ */
2353
+ constrainTimeouts?: boolean;
2354
+ /**
2355
+ * Sets `document.cookie`
2356
+ */
2357
+ cookie?: string;
2358
+ /**
2359
+ * Sets the `dir` attribute on the top level `<html>`.
2360
+ */
2361
+ direction?: string;
2362
+ /**
2363
+ * Component tag names listed here will not be prerendered, nor will
2364
+ * hydrated on the client-side. Components listed here will be ignored
2365
+ * as custom elements and treated no differently than a `<div>`.
2366
+ */
2367
+ excludeComponents?: string[];
2368
+ /**
2369
+ * Sets the `lang` attribute on the top level `<html>`.
2370
+ */
2371
+ language?: string;
2372
+ /**
2373
+ * Maximum number of components to hydrate on one page. Defaults to `300`.
2374
+ */
2375
+ maxHydrateCount?: number;
2376
+ /**
2377
+ * Sets `document.referrer`
2378
+ */
2379
+ referrer?: string;
2380
+ /**
2381
+ * Removes every `<script>` element found in the `document`. Defaults to `false`.
2382
+ */
2383
+ removeScripts?: boolean;
2384
+ /**
2385
+ * Removes CSS not used by elements within the `document`. Defaults to `true`.
2386
+ */
2387
+ removeUnusedStyles?: boolean;
2388
+ /**
2389
+ * The url the runtime uses for the resources, such as the assets directory.
2390
+ */
2391
+ resourcesUrl?: string;
2392
+ /**
2393
+ * Prints out runtime console logs to the NodeJS process. Defaults to `false`.
2394
+ */
2395
+ runtimeLogging?: boolean;
2396
+ /**
2397
+ * Component tags listed here will only be prerendered or server-side-rendered
2398
+ * and will not be client-side hydrated. This is useful for components that
2399
+ * are not dynamic and do not need to be defined as a custom element within the
2400
+ * browser. For example, a header or footer component would be a good example that
2401
+ * may not require any client-side JavaScript.
2402
+ */
2403
+ staticComponents?: string[];
2404
+ /**
2405
+ * The amount of milliseconds to wait for a page to finish rendering until
2406
+ * a timeout error is thrown. Defaults to `15000`.
2407
+ */
2408
+ timeout?: number;
2409
+ /**
2410
+ * Sets `document.title`.
2411
+ */
2412
+ title?: string;
2413
+ /**
2414
+ * Sets `location.href`
2415
+ */
2416
+ url?: string;
2417
+ /**
2418
+ * Sets `navigator.userAgent`
2419
+ */
2420
+ userAgent?: string;
2421
+ /**
2422
+ * Configure how Stencil serializes the components shadow root.
2423
+ * - If set to `declarative-shadow-dom` the component will be rendered within a Declarative Shadow DOM.
2424
+ * - If set to `scoped` Stencil will render the contents of the shadow root as a `scoped: true` component
2425
+ * and the shadow DOM will be created during client-side hydration.
2426
+ * - Alternatively you can mix and match the two by providing an object with `declarative-shadow-dom` and `scoped` keys,
2427
+ * the value arrays containing the tag names of the components that should be rendered in that mode.
2428
+ *
2429
+ * Examples:
2430
+ * - `{ 'declarative-shadow-dom': ['my-component-1', 'another-component'], default: 'scoped' }`
2431
+ * Render all components as `scoped` apart from `my-component-1` and `another-component`
2432
+ * - `{ 'scoped': ['an-option-component'], default: 'declarative-shadow-dom' }`
2433
+ * Render all components within `declarative-shadow-dom` apart from `an-option-component`
2434
+ * - `'scoped'` Render all components as `scoped`
2435
+ * - `false` disables shadow root serialization
2436
+ *
2437
+ * *NOTE* `true` has been deprecated in favor of `declarative-shadow-dom` and `scoped`
2438
+ * @default 'declarative-shadow-dom'
2439
+ */
2440
+ serializeShadowRoot?: 'declarative-shadow-dom' | 'scoped' | {
2441
+ 'declarative-shadow-dom'?: string[];
2442
+ scoped?: string[];
2443
+ default: 'declarative-shadow-dom' | 'scoped';
2444
+ } | boolean;
2445
+ }
2446
+ interface SerializeDocumentOptions extends HydrateDocumentOptions {
2447
+ /**
2448
+ * Runs after the `document` has been hydrated.
2449
+ */
2450
+ afterHydrate?(document: any): any | Promise<any>;
2451
+ /**
2452
+ * Sets an approximate line width the HTML should attempt to stay within.
2453
+ * Note that this is "approximate", in that HTML may often not be able
2454
+ * to be split at an exact line width. Additionally, new lines created
2455
+ * is where HTML naturally already has whitespace, such as before an
2456
+ * attribute or spaces between words. Defaults to `100`.
2457
+ */
2458
+ approximateLineWidth?: number;
2459
+ /**
2460
+ * Runs before the `document` has been hydrated.
2461
+ */
2462
+ beforeHydrate?(document: any): any | Promise<any>;
2463
+ /**
2464
+ * Format the HTML in a nicely indented format.
2465
+ * Defaults to `false`.
2466
+ */
2467
+ prettyHtml?: boolean;
2468
+ /**
2469
+ * Remove quotes from attribute values when possible.
2470
+ * Defaults to `true`.
2471
+ */
2472
+ removeAttributeQuotes?: boolean;
2473
+ /**
2474
+ * Remove the `=""` from standardized `boolean` attributes,
2475
+ * such as `hidden` or `checked`. Defaults to `true`.
2476
+ */
2477
+ removeBooleanAttributeQuotes?: boolean;
2478
+ /**
2479
+ * Remove these standardized attributes when their value is empty:
2480
+ * `class`, `dir`, `id`, `lang`, and `name`, `title`. Defaults to `true`.
2481
+ */
2482
+ removeEmptyAttributes?: boolean;
2483
+ /**
2484
+ * Remove HTML comments. Defaults to `true`.
2485
+ */
2486
+ removeHtmlComments?: boolean;
2487
+ /**
2488
+ * The `fullDocument` flag determines the format of the rendered output. Set it to true to
2489
+ * generate a complete HTML document, or false to render only the component.
2490
+ * @default true
2491
+ */
2492
+ fullDocument?: boolean;
2493
+ /**
2494
+ * Style modes to render the component in.
2495
+ * @see https://stenciljs.com/docs/styling#style-modes
2496
+ */
2497
+ modes?: ResolutionHandler[];
2498
+ }
2499
+ interface HydrateFactoryOptions extends SerializeDocumentOptions {
2500
+ serializeToHtml: boolean;
2501
+ destroyWindow: boolean;
2502
+ destroyDocument: boolean;
2503
+ }
2504
+ interface PrerenderHydrateOptions extends SerializeDocumentOptions {
2505
+ /**
2506
+ * Adds `<link rel="modulepreload">` for modules that will eventually be requested.
2507
+ * Defaults to `true`.
2508
+ */
2509
+ addModulePreloads?: boolean;
2510
+ /**
2511
+ * Hash the content of assets, such as images, fonts and css files,
2512
+ * and add the hashed value as `v` querystring. For example,
2513
+ * `/assets/image.png?v=abcd1234`. This allows for assets to be
2514
+ * heavily cached by setting the server's response header with
2515
+ * `Cache-Control: max-age=31536000, immutable`.
2516
+ */
2517
+ hashAssets?: 'querystring';
2518
+ /**
2519
+ * External stylesheets from `<link rel="stylesheet">` are instead inlined
2520
+ * into `<style>` elements. Defaults to `false`.
2521
+ */
2522
+ inlineExternalStyleSheets?: boolean;
2523
+ /**
2524
+ * Minify CSS content within `<style>` elements. Defaults to `true`.
2525
+ */
2526
+ minifyStyleElements?: boolean;
2527
+ /**
2528
+ * Minify JavaScript content within `<script>` elements. Defaults to `true`.
2529
+ */
2530
+ minifyScriptElements?: boolean;
2531
+ /**
2532
+ * Entire `document` should be static. This is useful for specific pages that
2533
+ * should be static, rather than the entire site. If the whole site should be static,
2534
+ * use the `staticSite` property on the prerender config instead. If only certain
2535
+ * components should be static then use `staticComponents` instead.
2536
+ */
2537
+ staticDocument?: boolean;
2538
+ }
2539
+ interface RobotsTxtOpts {
2540
+ urls: string[];
2541
+ sitemapUrl: string;
2542
+ baseUrl: string;
2543
+ dir: string;
2544
+ }
2545
+ interface RobotsTxtResults {
2546
+ content: string;
2547
+ filePath: string;
2548
+ url: string;
2549
+ }
2550
+ interface SitemapXmpOpts {
2551
+ urls: string[];
2552
+ baseUrl: string;
2553
+ dir: string;
2554
+ }
2555
+ interface SitemapXmpResults {
2556
+ content: string;
2557
+ filePath: string;
2558
+ url: string;
2559
+ }
2560
+ /**
2561
+ * Common system used by the compiler. All file reads, writes, access, etc. will all use
2562
+ * this system. Additionally, throughout each build, the compiler will use an internal
2563
+ * in-memory file system as to prevent unnecessary fs reads and writes. At the end of each
2564
+ * build all actions the in-memory fs performed will be written to disk using this system.
2565
+ * A NodeJS based system will use APIs such as `fs` and `crypto`, and a web-based system
2566
+ * will use in-memory Maps and browser APIs. Either way, the compiler itself is unaware
2567
+ * of the actual platform it's being ran on top of.
2568
+ */
2569
+ interface CompilerSystem {
2570
+ name: 'node' | 'in-memory';
2571
+ version: string;
2572
+ events?: BuildEvents;
2573
+ details?: SystemDetails;
2574
+ /**
2575
+ * Add a callback which will be ran when destroy() is called.
2576
+ */
2577
+ addDestroy(cb: () => void): void;
2578
+ /**
2579
+ * Always returns a boolean, does not throw.
2580
+ */
2581
+ access(p: string): Promise<boolean>;
2582
+ /**
2583
+ * SYNC! Always returns a boolean, does not throw.
2584
+ */
2585
+ accessSync(p: string): boolean;
2586
+ applyGlobalPatch?(fromDir: string): Promise<void>;
2587
+ applyPrerenderGlobalPatch?(opts: {
2588
+ devServerHostUrl: string;
2589
+ window: any;
2590
+ }): void;
2591
+ cacheStorage?: CacheStorage;
2592
+ checkVersion?: (logger: Logger, currentVersion: string) => Promise<() => void>;
2593
+ copy?(copyTasks: Required<CopyTask>[], srcDir: string): Promise<CopyResults>;
2594
+ /**
2595
+ * Always returns a boolean if the files were copied or not. Does not throw.
2596
+ */
2597
+ copyFile(src: string, dst: string): Promise<boolean>;
2598
+ /**
2599
+ * Used to destroy any listeners, file watchers or child processes.
2600
+ */
2601
+ destroy(): Promise<void>;
2602
+ /**
2603
+ * Does not throw.
2604
+ */
2605
+ createDir(p: string, opts?: CompilerSystemCreateDirectoryOptions): Promise<CompilerSystemCreateDirectoryResults>;
2606
+ /**
2607
+ * SYNC! Does not throw.
2608
+ */
2609
+ createDirSync(p: string, opts?: CompilerSystemCreateDirectoryOptions): CompilerSystemCreateDirectoryResults;
2610
+ homeDir(): string;
2611
+ /**
2612
+ * Used to determine if the current context of the terminal is TTY.
2613
+ */
2614
+ isTTY(): boolean;
2615
+ /**
2616
+ * Each platform has a different way to dynamically import modules.
2617
+ */
2618
+ dynamicImport?(p: string): Promise<any>;
2619
+ /**
2620
+ * Creates the worker controller for the current system.
2621
+ *
2622
+ * @param maxConcurrentWorkers the max number of concurrent workers to
2623
+ * support
2624
+ * @returns a worker controller appropriate for the current platform (node.js)
2625
+ */
2626
+ createWorkerController?(maxConcurrentWorkers: number): WorkerMainController;
2627
+ encodeToBase64(str: string): string;
2628
+ /**
2629
+ * @deprecated
2630
+ */
2631
+ ensureDependencies?(opts: {
2632
+ rootDir: string;
2633
+ logger: Logger;
2634
+ dependencies: CompilerDependency[];
2635
+ }): Promise<{
2636
+ stencilPath: string;
2637
+ diagnostics: Diagnostic[];
2638
+ }>;
2639
+ /**
2640
+ * @deprecated
2641
+ */
2642
+ ensureResources?(opts: {
2643
+ rootDir: string;
2644
+ logger: Logger;
2645
+ dependencies: CompilerDependency[];
2646
+ }): Promise<void>;
2647
+ /**
2648
+ * process.exit()
2649
+ */
2650
+ exit(exitCode: number): Promise<void>;
2651
+ /**
2652
+ * Optionally provide a fetch() function rather than using the built-in fetch().
2653
+ * First arg is a url string or Request object (RequestInfo).
2654
+ * Second arg is the RequestInit. Returns the Response object
2655
+ */
2656
+ fetch?(input: string | any, init?: any): Promise<any>;
2657
+ /**
2658
+ * Generates a sha1 digest encoded as HEX
2659
+ */
2660
+ generateContentHash?(content: string | any, length?: number): Promise<string>;
2661
+ /**
2662
+ * Generates a sha1 digest encoded as HEX from a file path
2663
+ */
2664
+ generateFileHash?(filePath: string | any, length?: number): Promise<string>;
2665
+ /**
2666
+ * Get the current directory.
2667
+ */
2668
+ getCurrentDirectory(): string;
2669
+ /**
2670
+ * The compiler's executing path.
2671
+ */
2672
+ getCompilerExecutingPath(): string;
2673
+ getEnvironmentVar?(key: string): string;
2674
+ /**
2675
+ * Gets the absolute file path when for a dependency module.
2676
+ */
2677
+ getLocalModulePath(opts: {
2678
+ rootDir: string;
2679
+ moduleId: string;
2680
+ path: string;
2681
+ }): string;
2682
+ /**
2683
+ * Gets the full url when requesting a dependency module to fetch from a CDN.
2684
+ */
2685
+ getRemoteModuleUrl(opts: {
2686
+ moduleId: string;
2687
+ path?: string;
2688
+ version?: string;
2689
+ }): string;
2690
+ /**
2691
+ * Async glob task. Only available in NodeJS compiler system.
2692
+ */
2693
+ glob?(pattern: string, options: {
2694
+ cwd?: string;
2695
+ nodir?: boolean;
2696
+ [key: string]: any;
2697
+ }): Promise<string[]>;
2698
+ /**
2699
+ * The number of logical processors available to run threads on the user's computer (cpus).
2700
+ */
2701
+ hardwareConcurrency: number;
2702
+ /**
2703
+ * Tests if the path is a symbolic link or not. Always resolves a boolean. Does not throw.
2704
+ */
2705
+ isSymbolicLink(p: string): Promise<boolean>;
2706
+ lazyRequire?: LazyRequire;
2707
+ nextTick(cb: () => void): void;
2708
+ /**
2709
+ * Normalize file system path.
2710
+ */
2711
+ normalizePath(p: string): string;
2712
+ onProcessInterrupt?(cb: () => void): void;
2713
+ parseYarnLockFile?: (content: string) => {
2714
+ type: 'success' | 'merge' | 'conflict';
2715
+ object: any;
2716
+ };
2717
+ platformPath: PlatformPath;
2718
+ /**
2719
+ * All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
2720
+ */
2721
+ readDir(p: string): Promise<string[]>;
2722
+ /**
2723
+ * SYNC! All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
2724
+ */
2725
+ readDirSync(p: string): string[];
2726
+ /**
2727
+ * Returns undefined if file is not found. Does not throw.
2728
+ */
2729
+ readFile(p: string): Promise<string>;
2730
+ readFile(p: string, encoding: 'utf8'): Promise<string>;
2731
+ readFile(p: string, encoding: 'binary'): Promise<any>;
2732
+ /**
2733
+ * SYNC! Returns undefined if file is not found. Does not throw.
2734
+ */
2735
+ readFileSync(p: string, encoding?: string): string;
2736
+ /**
2737
+ * Does not throw.
2738
+ */
2739
+ realpath(p: string): Promise<CompilerSystemRealpathResults>;
2740
+ /**
2741
+ * SYNC! Does not throw.
2742
+ */
2743
+ realpathSync(p: string): CompilerSystemRealpathResults;
2744
+ /**
2745
+ * Remove a callback which will be ran when destroy() is called.
2746
+ */
2747
+ removeDestroy(cb: () => void): void;
2748
+ /**
2749
+ * Rename old path to new path. Does not throw.
2750
+ */
2751
+ rename(oldPath: string, newPath: string): Promise<CompilerSystemRenameResults>;
2752
+ resolveModuleId?(opts: ResolveModuleIdOptions): Promise<ResolveModuleIdResults>;
2753
+ resolvePath(p: string): string;
2754
+ /**
2755
+ * Does not throw.
2756
+ */
2757
+ removeDir(p: string, opts?: CompilerSystemRemoveDirectoryOptions): Promise<CompilerSystemRemoveDirectoryResults>;
2758
+ /**
2759
+ * SYNC! Does not throw.
2760
+ */
2761
+ removeDirSync(p: string, opts?: CompilerSystemRemoveDirectoryOptions): CompilerSystemRemoveDirectoryResults;
2762
+ /**
2763
+ * Does not throw.
2764
+ */
2765
+ removeFile(p: string): Promise<CompilerSystemRemoveFileResults>;
2766
+ /**
2767
+ * SYNC! Does not throw.
2768
+ */
2769
+ removeFileSync(p: string): CompilerSystemRemoveFileResults;
2770
+ setupCompiler?: (c: {
2771
+ ts: any;
2772
+ }) => void;
2773
+ /**
2774
+ * Always returns an object. Does not throw. Check for "error" property if there's an error.
2775
+ */
2776
+ stat(p: string): Promise<CompilerFsStats>;
2777
+ /**
2778
+ * SYNC! Always returns an object. Does not throw. Check for "error" property if there's an error.
2779
+ */
2780
+ statSync(p: string): CompilerFsStats;
2781
+ tmpDirSync(): string;
2782
+ watchDirectory?(p: string, callback: CompilerFileWatcherCallback, recursive?: boolean): CompilerFileWatcher;
2783
+ /**
2784
+ * A `watchFile` implementation in order to hook into the rest of the {@link CompilerSystem} implementation that is
2785
+ * used when running Stencil's compiler in "watch mode".
2786
+ *
2787
+ * It is analogous to TypeScript's `watchFile` implementation.
2788
+ *
2789
+ * Note, this function may be called for full builds of Stencil projects by the TypeScript compiler. It should not
2790
+ * assume that it will only be called in watch mode.
2791
+ *
2792
+ * This function should not perform any file watcher registration itself. Each `path` provided to it when called
2793
+ * should already have been registered as a file to watch.
2794
+ *
2795
+ * @param path the path to the file that is being watched
2796
+ * @param callback a callback to invoke when a file that is being watched has changed in some way
2797
+ * @returns an object with a method for unhooking the file watcher from the system
2798
+ */
2799
+ watchFile?(path: string, callback: CompilerFileWatcherCallback): CompilerFileWatcher;
2800
+ /**
2801
+ * How many milliseconds to wait after a change before calling watch callbacks.
2802
+ */
2803
+ watchTimeout?: number;
2804
+ /**
2805
+ * Does not throw.
2806
+ */
2807
+ writeFile(p: string, content: string): Promise<CompilerSystemWriteFileResults>;
2808
+ /**
2809
+ * SYNC! Does not throw.
2810
+ */
2811
+ writeFileSync(p: string, content: string): CompilerSystemWriteFileResults;
2812
+ }
2813
+ interface TranspileOnlyResults {
2814
+ diagnostics: Diagnostic[];
2815
+ output: string;
2816
+ sourceMap: any;
2817
+ }
2818
+ interface ParsedPath {
2819
+ root: string;
2820
+ dir: string;
2821
+ base: string;
2822
+ ext: string;
2823
+ name: string;
2824
+ }
2825
+ interface PlatformPath {
2826
+ normalize(p: string): string;
2827
+ join(...paths: string[]): string;
2828
+ resolve(...pathSegments: string[]): string;
2829
+ isAbsolute(p: string): boolean;
2830
+ relative(from: string, to: string): string;
2831
+ dirname(p: string): string;
2832
+ basename(p: string, ext?: string): string;
2833
+ extname(p: string): string;
2834
+ parse(p: string): ParsedPath;
2835
+ sep: string;
2836
+ delimiter: string;
2837
+ posix: any;
2838
+ win32: any;
2839
+ }
2840
+ interface CompilerDependency {
2841
+ name: string;
2842
+ version: string;
2843
+ main: string;
2844
+ resources?: string[];
2845
+ }
2846
+ interface ResolveModuleIdOptions {
2847
+ moduleId: string;
2848
+ containingFile?: string;
2849
+ exts?: string[];
2850
+ packageFilter?: (pkg: any, pkgFile: string) => any;
2851
+ }
2852
+ interface ResolveModuleIdResults {
2853
+ moduleId: string;
2854
+ resolveId: string;
2855
+ pkgData: {
2856
+ name: string;
2857
+ version: string;
2858
+ [key: string]: any;
2859
+ };
2860
+ pkgDirPath: string;
2861
+ }
2862
+ /**
2863
+ * A controller which provides for communication and coordination between
2864
+ * threaded workers.
2865
+ */
2866
+ interface WorkerMainController {
2867
+ /**
2868
+ * Send a given set of arguments to a worker
2869
+ */
2870
+ send(...args: any[]): Promise<any>;
2871
+ /**
2872
+ * Handle a particular method
2873
+ *
2874
+ * @param name of the method to be passed to a worker
2875
+ * @returns a Promise wrapping the results
2876
+ */
2877
+ handler(name: string): (...args: any[]) => Promise<any>;
2878
+ /**
2879
+ * Destroy the worker represented by this instance, rejecting all outstanding
2880
+ * tasks and killing the child process.
2881
+ */
2882
+ destroy(): void;
2883
+ /**
2884
+ * The current setting for the max number of workers
2885
+ */
2886
+ maxWorkers: number;
2887
+ }
2888
+ interface CopyResults {
2889
+ diagnostics: Diagnostic[];
2890
+ filePaths: string[];
2891
+ dirPaths: string[];
2892
+ }
2893
+ interface SystemDetails {
2894
+ cpuModel: string;
2895
+ freemem(): number;
2896
+ platform: 'darwin' | 'windows' | 'linux' | '';
2897
+ release: string;
2898
+ totalmem: number;
2899
+ }
2900
+ interface BuildOnEvents {
2901
+ on(cb: (eventName: CompilerEventName, data: any) => void): BuildOnEventRemove;
2902
+ on(eventName: CompilerEventFileAdd, cb: (path: string) => void): BuildOnEventRemove;
2903
+ on(eventName: CompilerEventFileDelete, cb: (path: string) => void): BuildOnEventRemove;
2904
+ on(eventName: CompilerEventFileUpdate, cb: (path: string) => void): BuildOnEventRemove;
2905
+ on(eventName: CompilerEventDirAdd, cb: (path: string) => void): BuildOnEventRemove;
2906
+ on(eventName: CompilerEventDirDelete, cb: (path: string) => void): BuildOnEventRemove;
2907
+ on(eventName: CompilerEventBuildStart, cb: (buildStart: CompilerBuildStart) => void): BuildOnEventRemove;
2908
+ on(eventName: CompilerEventBuildFinish, cb: (buildResults: CompilerBuildResults) => void): BuildOnEventRemove;
2909
+ on(eventName: CompilerEventBuildLog, cb: (buildLog: BuildLog) => void): BuildOnEventRemove;
2910
+ on(eventName: CompilerEventBuildNoChange, cb: () => void): BuildOnEventRemove;
2911
+ }
2912
+ interface BuildEmitEvents {
2913
+ emit(eventName: CompilerEventName, path: string): void;
2914
+ emit(eventName: CompilerEventFileAdd, path: string): void;
2915
+ emit(eventName: CompilerEventFileDelete, path: string): void;
2916
+ emit(eventName: CompilerEventFileUpdate, path: string): void;
2917
+ emit(eventName: CompilerEventDirAdd, path: string): void;
2918
+ emit(eventName: CompilerEventDirDelete, path: string): void;
2919
+ emit(eventName: CompilerEventBuildStart, buildStart: CompilerBuildStart): void;
2920
+ emit(eventName: CompilerEventBuildFinish, buildResults: CompilerBuildResults): void;
2921
+ emit(eventName: CompilerEventBuildNoChange, buildNoChange: BuildNoChangeResults): void;
2922
+ emit(eventName: CompilerEventBuildLog, buildLog: BuildLog): void;
2923
+ emit(eventName: CompilerEventFsChange, fsWatchResults: FsWatchResults): void;
2924
+ }
2925
+ interface FsWatchResults {
2926
+ dirsAdded: string[];
2927
+ dirsDeleted: string[];
2928
+ filesUpdated: string[];
2929
+ filesAdded: string[];
2930
+ filesDeleted: string[];
2931
+ }
2932
+ interface BuildLog {
2933
+ buildId: number;
2934
+ messages: string[];
2935
+ progress: number;
2936
+ }
2937
+ interface BuildNoChangeResults {
2938
+ buildId: number;
2939
+ noChange: boolean;
2940
+ }
2941
+ interface CompilerBuildResults {
2942
+ buildId: number;
2943
+ componentGraph?: BuildResultsComponentGraph;
2944
+ diagnostics: Diagnostic[];
2945
+ dirsAdded: string[];
2946
+ dirsDeleted: string[];
2947
+ duration: number;
2948
+ filesAdded: string[];
2949
+ filesChanged: string[];
2950
+ filesDeleted: string[];
2951
+ filesUpdated: string[];
2952
+ hasError: boolean;
2953
+ hasSuccessfulBuild: boolean;
2954
+ hmr?: HotModuleReplacement;
2955
+ hydrateAppFilePath?: string;
2956
+ isRebuild: boolean;
2957
+ namespace: string;
2958
+ outputs: BuildOutput[];
2959
+ rootDir: string;
2960
+ srcDir: string;
2961
+ timestamp: string;
2962
+ }
2963
+ interface BuildResultsComponentGraph {
2964
+ [scopeId: string]: string[];
2965
+ }
2966
+ interface BuildOutput {
2967
+ type: string;
2968
+ files: string[];
2969
+ }
2970
+ interface HotModuleReplacement {
2971
+ componentsUpdated?: string[];
2972
+ excludeHmr?: string[];
2973
+ externalStylesUpdated?: string[];
2974
+ imagesUpdated?: string[];
2975
+ indexHtmlUpdated?: boolean;
2976
+ inlineStylesUpdated?: HmrStyleUpdate[];
2977
+ reloadStrategy: PageReloadStrategy;
2978
+ scriptsAdded?: string[];
2979
+ scriptsDeleted?: string[];
2980
+ serviceWorkerUpdated?: boolean;
2981
+ versionId?: string;
2982
+ }
2983
+ interface HmrStyleUpdate {
2984
+ styleId: string;
2985
+ styleTag: string;
2986
+ styleText: string;
2987
+ }
2988
+ type BuildOnEventRemove = () => boolean;
2989
+ interface BuildEvents extends BuildOnEvents, BuildEmitEvents {
2990
+ unsubscribeAll(): void;
2991
+ }
2992
+ interface CompilerBuildStart {
2993
+ buildId: number;
2994
+ timestamp: string;
2995
+ }
2996
+ /**
2997
+ * A type describing a function to call when an event is emitted by a file watcher
2998
+ * @param fileName the path of the file tied to event
2999
+ * @param eventKind a variant describing the type of event that was emitter (added, edited, etc.)
3000
+ */
3001
+ type CompilerFileWatcherCallback = (fileName: string, eventKind: CompilerFileWatcherEvent) => void;
3002
+ /**
3003
+ * A type describing the different types of events that Stencil expects may happen when a file being watched is altered
3004
+ * in some way
3005
+ */
3006
+ type CompilerFileWatcherEvent = CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventFileUpdate | CompilerEventDirAdd | CompilerEventDirDelete;
3007
+ type CompilerEventName = CompilerEventFsChange | CompilerEventFileUpdate | CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventDirAdd | CompilerEventDirDelete | CompilerEventBuildStart | CompilerEventBuildFinish | CompilerEventBuildNoChange | CompilerEventBuildLog;
3008
+ type CompilerEventFsChange = 'fsChange';
3009
+ type CompilerEventFileUpdate = 'fileUpdate';
3010
+ type CompilerEventFileAdd = 'fileAdd';
3011
+ type CompilerEventFileDelete = 'fileDelete';
3012
+ type CompilerEventDirAdd = 'dirAdd';
3013
+ type CompilerEventDirDelete = 'dirDelete';
3014
+ type CompilerEventBuildStart = 'buildStart';
3015
+ type CompilerEventBuildFinish = 'buildFinish';
3016
+ type CompilerEventBuildLog = 'buildLog';
3017
+ type CompilerEventBuildNoChange = 'buildNoChange';
3018
+ interface CompilerFileWatcher {
3019
+ close(): void | Promise<void>;
3020
+ }
3021
+ interface CompilerFsStats {
3022
+ /**
3023
+ * If it's a directory. `false` if there was an error.
3024
+ */
3025
+ isDirectory: boolean;
3026
+ /**
3027
+ * If it's a file. `false` if there was an error.
3028
+ */
3029
+ isFile: boolean;
3030
+ /**
3031
+ * If it's a symlink. `false` if there was an error.
3032
+ */
3033
+ isSymbolicLink: boolean;
3034
+ /**
3035
+ * The size of the file in bytes. `0` for directories or if there was an error.
3036
+ */
3037
+ size: number;
3038
+ /**
3039
+ * The timestamp indicating the last time this file was modified expressed in milliseconds since the POSIX Epoch.
3040
+ */
3041
+ mtimeMs?: number;
3042
+ /**
3043
+ * Error if there was one, otherwise `null`. `stat` and `statSync` do not throw errors but always returns this interface.
3044
+ */
3045
+ error: any;
3046
+ }
3047
+ interface CompilerSystemCreateDirectoryOptions {
3048
+ /**
3049
+ * Indicates whether parent directories should be created.
3050
+ * @default false
3051
+ */
3052
+ recursive?: boolean;
3053
+ /**
3054
+ * A file mode. If a string is passed, it is parsed as an octal integer. If not specified
3055
+ * @default 0o777.
3056
+ */
3057
+ mode?: number;
3058
+ }
3059
+ interface CompilerSystemCreateDirectoryResults {
3060
+ basename: string;
3061
+ dirname: string;
3062
+ path: string;
3063
+ newDirs: string[];
3064
+ error: any;
3065
+ }
3066
+ interface CompilerSystemRemoveDirectoryOptions {
3067
+ /**
3068
+ * Indicates whether child files and subdirectories should be removed.
3069
+ * @default false
3070
+ */
3071
+ recursive?: boolean;
3072
+ }
3073
+ interface CompilerSystemRemoveDirectoryResults {
3074
+ basename: string;
3075
+ dirname: string;
3076
+ path: string;
3077
+ removedDirs: string[];
3078
+ removedFiles: string[];
3079
+ error: any;
3080
+ }
3081
+ interface CompilerSystemRenameResults extends CompilerSystemRenamedPath {
3082
+ renamed: CompilerSystemRenamedPath[];
3083
+ oldDirs: string[];
3084
+ oldFiles: string[];
3085
+ newDirs: string[];
3086
+ newFiles: string[];
3087
+ error: any;
3088
+ }
3089
+ interface CompilerSystemRenamedPath {
3090
+ oldPath: string;
3091
+ newPath: string;
3092
+ isFile: boolean;
3093
+ isDirectory: boolean;
3094
+ }
3095
+ interface CompilerSystemRealpathResults {
3096
+ path: string;
3097
+ error: any;
3098
+ }
3099
+ interface CompilerSystemRemoveFileResults {
3100
+ basename: string;
3101
+ dirname: string;
3102
+ path: string;
3103
+ error: any;
3104
+ }
3105
+ interface CompilerSystemWriteFileResults {
3106
+ path: string;
3107
+ error: any;
3108
+ }
3109
+ interface Credentials {
3110
+ key: string;
3111
+ cert: string;
3112
+ }
3113
+ interface ConfigBundle {
3114
+ components: string[];
3115
+ }
3116
+ /**
3117
+ * A file and/or directory copy operation that may be specified as part of
3118
+ * certain output targets for Stencil (in particular `dist`,
3119
+ * `dist-custom-elements`, and `www`).
3120
+ */
3121
+ interface CopyTask {
3122
+ /**
3123
+ * The source file path for a copy operation. This may be an absolute or
3124
+ * relative path to a directory or a file, and may also include a glob
3125
+ * pattern.
3126
+ *
3127
+ * If the path is a relative path it will be treated as relative to
3128
+ * `Config.srcDir`.
3129
+ */
3130
+ src: string;
3131
+ /**
3132
+ * An optional destination file path for a copy operation. This may be an
3133
+ * absolute or relative path.
3134
+ *
3135
+ * If relative, this will be treated as relative to the output directory for
3136
+ * the output target for which this copy operation is configured.
3137
+ */
3138
+ dest?: string;
3139
+ /**
3140
+ * An optional array of glob patterns to exclude from the copy operation.
3141
+ * @default ['**\/__mocks__/**', '**\/__fixtures__/**', '**\/dist/**', '**\/.{idea,git,cache,output,temp}/**', '**\/.ds_store', '**\/.gitignore', '**\/desktop.ini', '**\/thumbs.db']
3142
+ */
3143
+ ignore?: string[];
3144
+ /**
3145
+ * Whether or not Stencil should issue warnings if it cannot find the
3146
+ * specified source files or directories. Defaults to `false`.
3147
+ *
3148
+ * To receive warnings if a copy task source can't be found set this to
3149
+ * `true`.
3150
+ */
3151
+ warn?: boolean;
3152
+ /**
3153
+ * Whether or not directory structure should be preserved when copying files
3154
+ * from a source directory. Defaults to `true` if no `dest` path is supplied,
3155
+ * else it defaults to `false`.
3156
+ *
3157
+ * If this is set to `false`, all the files from a source directory will be
3158
+ * copied directly to the destination directory, but if it's set to `true` they
3159
+ * will be copied to a new directory inside the destination directory with
3160
+ * the same name as their original source directory.
3161
+ *
3162
+ * So if, for instance, `src` is set to `"images"` and `keepDirStructure` is
3163
+ * set to `true` the copy task will then produce the following directory
3164
+ * structure:
3165
+ *
3166
+ * ```
3167
+ * images
3168
+ * └── foo.png
3169
+ * dist
3170
+ * └── images
3171
+ * └── foo.png
3172
+ * ```
3173
+ *
3174
+ * Conversely if `keepDirStructure` is set to `false` then files in `images/`
3175
+ * will be copied to `dist` without first creating a new subdirectory,
3176
+ * resulting in the following directory structure:
3177
+ *
3178
+ * ```
3179
+ * images
3180
+ * └── foo.png
3181
+ * dist
3182
+ * └── foo.png
3183
+ * ```
3184
+ *
3185
+ * If a `dest` path is supplied then `keepDirStructure`
3186
+ * will default to `false`, so that Stencil will write the
3187
+ * copied files directly into the `dest` directory without creating a new
3188
+ * subdirectory. This behavior can be overridden by setting
3189
+ * `keepDirStructure` to `true`.
3190
+ */
3191
+ keepDirStructure?: boolean;
3192
+ }
3193
+ /**
3194
+ * Configuration for generating documentation from Stencil components.
3195
+ */
3196
+ interface StencilDocsConfig {
3197
+ /**
3198
+ * Options for processing and rendering Markdown documentation files.
3199
+ */
3200
+ markdown?: {
3201
+ /**
3202
+ * Styling for how the target component will be represented within documentation (e.g., in component diagrams).
3203
+ */
3204
+ targetComponent?: {
3205
+ /**
3206
+ * Background color used for nodes representing the component in diagrams (e.g., Mermaid graphs).
3207
+ * Use standard color names or hex codes.
3208
+ * @example '#f0f0f0' (light gray)
3209
+ */
3210
+ background?: string;
3211
+ /**
3212
+ * Text color used within nodes representing the component in diagrams (e.g., Mermaid graphs).
3213
+ * Use standard color names or hex codes.
3214
+ * @example '#333' (dark gray)
3215
+ */
3216
+ textColor?: string;
3217
+ };
3218
+ };
3219
+ }
3220
+ interface BundlingConfig {
3221
+ /**
3222
+ * @deprecated the `namedExports` field is no longer honored by `@rollup/plugin-commonjs` and is not used by Stencil.
3223
+ * This field can be safely removed from your Stencil configuration file.
3224
+ */
3225
+ namedExports?: {
3226
+ [key: string]: string[];
3227
+ };
3228
+ }
3229
+ interface NodeResolveConfig {
3230
+ exportConditions?: string[];
3231
+ browser?: boolean;
3232
+ moduleDirectories?: string[];
3233
+ modulePaths?: string[];
3234
+ dedupe?: string[] | ((importee: string) => boolean);
3235
+ extensions?: readonly string[];
3236
+ jail?: string;
3237
+ mainFields?: readonly string[];
3238
+ modulesOnly?: boolean;
3239
+ preferBuiltins?: boolean | ((module: string) => boolean);
3240
+ resolveOnly?: ReadonlyArray<string | RegExp> | null | ((module: string) => boolean);
3241
+ rootDir?: string;
3242
+ allowExportsFolderMapping?: boolean;
3243
+ /**
3244
+ * @see https://github.com/browserify/resolve#resolveid-opts-cb
3245
+ * @deprecated the `customResolveOptions` field is no longer honored in future versions of
3246
+ * `@rollup/plugin-node-resolve`. If you are currently using it, please open a new issue in the Stencil repo to
3247
+ * describe your use case & provide input (https://github.com/stenciljs/core/issues/new/choose)
3248
+ */
3249
+ customResolveOptions?: {
3250
+ basedir?: string;
3251
+ package?: string;
3252
+ extensions?: string[];
3253
+ readFile?: Function;
3254
+ isFile?: Function;
3255
+ isDirectory?: Function;
3256
+ packageFilter?: Function;
3257
+ pathFilter?: Function;
3258
+ paths?: Function | string[];
3259
+ moduleDirectory?: string | string[];
3260
+ preserveSymlinks?: boolean;
3261
+ };
3262
+ }
3263
+ interface RollupConfig {
3264
+ inputOptions?: RollupInputOptions;
3265
+ outputOptions?: RollupOutputOptions;
3266
+ }
3267
+ interface RollupInputOptions {
3268
+ context?: string;
3269
+ moduleContext?: ((id: string) => string) | {
3270
+ [id: string]: string;
3271
+ };
3272
+ treeshake?: boolean;
3273
+ maxParallelFileOps?: number;
3274
+ external?: (string | RegExp)[] | string | RegExp | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | null | undefined);
3275
+ }
3276
+ interface RollupOutputOptions {
3277
+ globals?: {
3278
+ [name: string]: string;
3279
+ } | ((name: string) => string);
3280
+ }
3281
+ /**
3282
+ * @deprecated Integrated testing support will be removed in Stencil v5. Migrate spec tests to
3283
+ * [`@stencil/vitest`](https://github.com/stenciljs/vitest) and e2e / browser tests to either
3284
+ * [`@stencil/vitest`](https://github.com/stenciljs/vitest) or
3285
+ * [`@stencil/playwright`](https://github.com/stenciljs/playwright).
3286
+ * See https://github.com/stenciljs/core/issues/6584 for full discussion and migration guidance.
3287
+ */
3288
+ interface Testing {
3289
+ run(opts: TestingRunOptions): Promise<boolean>;
3290
+ destroy(): Promise<void>;
3291
+ }
3292
+ declare type Path = string;
3293
+ declare type TransformerConfig = [string, Record<string, unknown>];
3294
+ /**
3295
+ * Options for initiating a run of Stencil tests (spec and/or end-to-end)
3296
+ *
3297
+ * @deprecated Integrated testing support will be removed in Stencil v5. Migrate spec tests to
3298
+ * [`@stencil/vitest`](https://github.com/stenciljs/vitest) and e2e / browser tests to either
3299
+ * [`@stencil/vitest`](https://github.com/stenciljs/vitest) or
3300
+ * [`@stencil/playwright`](https://github.com/stenciljs/playwright).
3301
+ * See https://github.com/stenciljs/core/issues/6584 for full discussion and migration guidance.
3302
+ */
3303
+ interface TestingRunOptions {
3304
+ /**
3305
+ * If true, run end-to-end tests
3306
+ */
3307
+ e2e?: boolean;
3308
+ /**
3309
+ * If true, run screenshot tests
3310
+ */
3311
+ screenshot?: boolean;
3312
+ /**
3313
+ * If true, run spec tests
3314
+ */
3315
+ spec?: boolean;
3316
+ /**
3317
+ * If true, update 'golden' screenshots. Otherwise, compare against priori.
3318
+ */
3319
+ updateScreenshot?: boolean;
3320
+ }
3321
+ /**
3322
+ * @deprecated Integrated testing support will be removed in Stencil v5. Migrate spec tests to
3323
+ * [`@stencil/vitest`](https://github.com/stenciljs/vitest) and e2e / browser tests to either
3324
+ * [`@stencil/vitest`](https://github.com/stenciljs/vitest) or
3325
+ * [`@stencil/playwright`](https://github.com/stenciljs/playwright).
3326
+ * See https://github.com/stenciljs/core/issues/6584 for full discussion and migration guidance.
3327
+ */
3328
+ interface JestConfig {
3329
+ /**
3330
+ * This option tells Jest that all imported modules in your tests should be mocked automatically.
3331
+ * All modules used in your tests will have a replacement implementation, keeping the API surface. Default: false
3332
+ */
3333
+ automock?: boolean;
3334
+ /**
3335
+ * By default, Jest runs all tests and produces all errors into the console upon completion.
3336
+ * The bail config option can be used here to have Jest stop running tests after the first failure. Default: false
3337
+ */
3338
+ bail?: boolean | number;
3339
+ /**
3340
+ * The directory where Jest should store its cached dependency information. Jest attempts to scan your dependency tree once (up-front)
3341
+ * and cache it in order to ease some of the filesystem raking that needs to happen while running tests. This config option lets you
3342
+ * customize where Jest stores that cache data on disk. Default: "/tmp/<path>"
3343
+ */
3344
+ cacheDirectory?: string;
3345
+ /**
3346
+ * Automatically clear mock calls and instances between every test. Equivalent to calling jest.clearAllMocks()
3347
+ * between each test. This does not remove any mock implementation that may have been provided. Default: false
3348
+ */
3349
+ clearMocks?: boolean;
3350
+ /**
3351
+ * Indicates whether the coverage information should be collected while executing the test. Because this retrofits all
3352
+ * executed files with coverage collection statements, it may significantly slow down your tests. Default: false
3353
+ */
3354
+ collectCoverage?: boolean;
3355
+ /**
3356
+ * An array of glob patterns indicating a set of files for which coverage information should be collected.
3357
+ * If a file matches the specified glob pattern, coverage information will be collected for it even if no tests exist
3358
+ * for this file and it's never required in the test suite. Default: undefined
3359
+ */
3360
+ collectCoverageFrom?: any[];
3361
+ /**
3362
+ * The directory where Jest should output its coverage files. Default: undefined
3363
+ */
3364
+ coverageDirectory?: string;
3365
+ /**
3366
+ * An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path matches
3367
+ * any of the patterns, coverage information will be skipped. These pattern strings match against the full path.
3368
+ * Use the <rootDir> string token to include the path to your project's root directory to prevent it from accidentally
3369
+ * ignoring all of your files in different environments that may have different root directories.
3370
+ * Example: ["<rootDir>/build/", "<rootDir>/node_modules/"]. Default: ["/node_modules/"]
3371
+ */
3372
+ coveragePathIgnorePatterns?: any[];
3373
+ /**
3374
+ * A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter can be used.
3375
+ * Default: `["json", "lcov", "text"]`
3376
+ */
3377
+ coverageReporters?: any[];
3378
+ /**
3379
+ * This will be used to configure minimum threshold enforcement for coverage results. Thresholds can be specified as global,
3380
+ * as a glob, and as a directory or file path. If thresholds aren't met, jest will fail. Thresholds specified as a positive
3381
+ * number are taken to be the minimum percentage required. Thresholds specified as a negative number represent the maximum
3382
+ * number of uncovered entities allowed. Default: undefined
3383
+ */
3384
+ coverageThreshold?: any;
3385
+ errorOnDeprecated?: boolean;
3386
+ forceCoverageMatch?: any[];
3387
+ globals?: any;
3388
+ globalSetup?: string;
3389
+ globalTeardown?: string;
3390
+ /**
3391
+ * An array of directory names to be searched recursively up from the requiring module's location. Setting this option will
3392
+ * override the default, if you wish to still search node_modules for packages include it along with any other
3393
+ * options: ["node_modules", "bower_components"]. Default: ["node_modules"]
3394
+ */
3395
+ moduleDirectories?: string[];
3396
+ /**
3397
+ * An array of file extensions your modules use. If you require modules without specifying a file extension,
3398
+ * these are the extensions Jest will look for. Default: ['ts', 'tsx', 'js', 'json']
3399
+ */
3400
+ moduleFileExtensions?: string[];
3401
+ moduleNameMapper?: any;
3402
+ modulePaths?: any[];
3403
+ modulePathIgnorePatterns?: any[];
3404
+ notify?: boolean;
3405
+ notifyMode?: string;
3406
+ preset?: string;
3407
+ prettierPath?: string;
3408
+ projects?: any;
3409
+ reporters?: any;
3410
+ resetMocks?: boolean;
3411
+ resetModules?: boolean;
3412
+ resolver?: Path | null;
3413
+ restoreMocks?: boolean;
3414
+ rootDir?: string;
3415
+ roots?: any[];
3416
+ runner?: string;
3417
+ /**
3418
+ * The paths to modules that run some code to configure or set up the testing environment before each test.
3419
+ * Since every test runs in its own environment, these scripts will be executed in the testing environment
3420
+ * immediately before executing the test code itself. Default: []
3421
+ */
3422
+ setupFiles?: string[];
3423
+ setupFilesAfterEnv?: string[];
3424
+ snapshotSerializers?: any[];
3425
+ testEnvironment?: string;
3426
+ testEnvironmentOptions?: any;
3427
+ testMatch?: string[];
3428
+ testPathIgnorePatterns?: string[];
3429
+ testPreset?: string;
3430
+ testRegex?: string[];
3431
+ testResultsProcessor?: string;
3432
+ testRunner?: string;
3433
+ testURL?: string;
3434
+ timers?: string;
3435
+ transform?: {
3436
+ [regex: string]: Path | TransformerConfig;
3437
+ };
3438
+ transformIgnorePatterns?: any[];
3439
+ unmockedModulePathPatterns?: any[];
3440
+ verbose?: boolean;
3441
+ watchPathIgnorePatterns?: any[];
3442
+ }
3443
+ /**
3444
+ * Configuration for Stencil's integrated testing (Jest + Puppeteer).
3445
+ *
3446
+ * @deprecated Integrated testing support will be removed in Stencil v5. Migrate spec tests to
3447
+ * [`@stencil/vitest`](https://github.com/stenciljs/vitest) and e2e / browser tests to either
3448
+ * [`@stencil/vitest`](https://github.com/stenciljs/vitest) or
3449
+ * [`@stencil/playwright`](https://github.com/stenciljs/playwright).
3450
+ * See https://github.com/stenciljs/core/issues/6584 for full discussion and migration guidance.
3451
+ */
3452
+ interface TestingConfig extends JestConfig {
3453
+ /**
3454
+ * The `allowableMismatchedPixels` value is used to determine an acceptable
3455
+ * number of pixels that can be mismatched before the image is considered
3456
+ * to have changes. Realistically, two screenshots representing the same
3457
+ * content may have a small number of pixels that are not identical due to
3458
+ * anti-aliasing, which is perfectly normal. If the `allowableMismatchedRatio`
3459
+ * is provided it will take precedence, otherwise `allowableMismatchedPixels`
3460
+ * will be used.
3461
+ */
3462
+ allowableMismatchedPixels?: number;
3463
+ /**
3464
+ * The `allowableMismatchedRatio` ranges from `0` to `1` and is used to
3465
+ * determine an acceptable ratio of pixels that can be mismatched before
3466
+ * the image is considered to have changes. Realistically, two screenshots
3467
+ * representing the same content may have a small number of pixels that
3468
+ * are not identical due to anti-aliasing, which is perfectly normal. The
3469
+ * `allowableMismatchedRatio` is the number of pixels that were mismatched,
3470
+ * divided by the total number of pixels in the screenshot. For example,
3471
+ * a ratio value of `0.06` means 6% of the pixels can be mismatched before
3472
+ * the image is considered to have changes. If the `allowableMismatchedRatio`
3473
+ * is provided it will take precedence, otherwise `allowableMismatchedPixels`
3474
+ * will be used.
3475
+ */
3476
+ allowableMismatchedRatio?: number;
3477
+ /**
3478
+ * Matching threshold while comparing two screenshots. Value ranges from `0` to `1`.
3479
+ * Smaller values make the comparison more sensitive. The `pixelmatchThreshold`
3480
+ * value helps to ignore anti-aliasing. Default: `0.1`
3481
+ */
3482
+ pixelmatchThreshold?: number;
3483
+ /**
3484
+ * Additional arguments to pass to the browser instance.
3485
+ */
3486
+ browserArgs?: string[];
3487
+ /**
3488
+ * Path to a Chromium or Chrome executable to run instead of the bundled Chromium.
3489
+ * @default env.PUPPETEER_EXECUTABLE_PATH || env.CHROME_PATH || puppeteer.computeExecutablePath()
3490
+ */
3491
+ browserExecutablePath?: string;
3492
+ /**
3493
+ * Url of remote Chrome instance to use instead of local Chrome.
3494
+ */
3495
+ browserWSEndpoint?: string;
3496
+ /**
3497
+ * The browser channel to use for e2e tests (stable, beta, dev or canary).
3498
+ * @default 'chrome'
3499
+ */
3500
+ browserChannel?: 'chrome' | 'chrome-beta' | 'chrome-dev' | 'chrome-canary';
3501
+ /**
3502
+ * Whether to run browser e2e tests in headless mode using Chrome Headless Shell
3503
+ * @see https://developer.chrome.com/blog/chrome-headless-shell
3504
+ * @default shell
3505
+ */
3506
+ browserHeadless?: boolean | 'shell';
3507
+ /**
3508
+ * Slows down e2e browser operations by the specified amount of milliseconds.
3509
+ * Useful so that you can see what is going on.
3510
+ */
3511
+ browserSlowMo?: number;
3512
+ /**
3513
+ * By default, all E2E pages wait until the "load" event, this global setting can be used
3514
+ * to change the default `waitUntil` behavior.
3515
+ */
3516
+ browserWaitUntil?: 'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2';
3517
+ /**
3518
+ * Whether to auto-open a DevTools panel for each tab.
3519
+ * If this option is true, the headless option will be set false
3520
+ */
3521
+ browserDevtools?: boolean;
3522
+ /**
3523
+ * Array of browser emulations to be used during _screenshot_ tests. A full screenshot
3524
+ * test is ran for each emulation.
3525
+ *
3526
+ * To emulate a device display for your e2e tests, use the `setViewport` method on a test's E2E page.
3527
+ * An example can be found in [the Stencil docs](https://stenciljs.com/docs/end-to-end-testing#emulate-a-display).
3528
+ */
3529
+ emulate?: EmulateConfig[];
3530
+ /**
3531
+ * Path to the Screenshot Connector module.
3532
+ */
3533
+ screenshotConnector?: string;
3534
+ /**
3535
+ * Timeout for the pixelmatch worker to resolve (in ms).
3536
+ * @default 2500
3537
+ */
3538
+ screenshotTimeout?: number | null;
3539
+ /**
3540
+ * Amount of time in milliseconds to wait before a screenshot is taken.
3541
+ */
3542
+ waitBeforeScreenshot?: number;
3543
+ }
3544
+ /**
3545
+ * @deprecated Integrated testing support will be removed in Stencil v5. Migrate spec tests to
3546
+ * [`@stencil/vitest`](https://github.com/stenciljs/vitest) and e2e / browser tests to either
3547
+ * [`@stencil/vitest`](https://github.com/stenciljs/vitest) or
3548
+ * [`@stencil/playwright`](https://github.com/stenciljs/playwright).
3549
+ * See https://github.com/stenciljs/core/issues/6584 for full discussion and migration guidance.
3550
+ */
3551
+ interface EmulateConfig {
3552
+ /**
3553
+ * Predefined device descriptor name, such as "iPhone X" or "Nexus 10".
3554
+ * For a complete list please see: https://github.com/puppeteer/puppeteer/blob/main/src/common/DeviceDescriptors.ts
3555
+ */
3556
+ device?: string;
3557
+ /**
3558
+ * User-Agent to be used. Defaults to the user-agent of the installed Puppeteer version.
3559
+ */
3560
+ userAgent?: string;
3561
+ viewport?: EmulateViewport;
3562
+ }
3563
+ /**
3564
+ * @deprecated Integrated testing support will be removed in Stencil v5. Migrate spec tests to
3565
+ * [`@stencil/vitest`](https://github.com/stenciljs/vitest) and e2e / browser tests to either
3566
+ * [`@stencil/vitest`](https://github.com/stenciljs/vitest) or
3567
+ * [`@stencil/playwright`](https://github.com/stenciljs/playwright).
3568
+ * See https://github.com/stenciljs/core/issues/6584 for full discussion and migration guidance.
3569
+ */
3570
+ interface EmulateViewport {
3571
+ /**
3572
+ * Page width in pixels.
3573
+ */
3574
+ width: number;
3575
+ /**
3576
+ * page height in pixels.
3577
+ */
3578
+ height: number;
3579
+ /**
3580
+ * Specify device scale factor (can be thought of as dpr). Defaults to 1.
3581
+ */
3582
+ deviceScaleFactor?: number;
3583
+ /**
3584
+ * Whether the meta viewport tag is taken into account. Defaults to false.
3585
+ */
3586
+ isMobile?: boolean;
3587
+ /**
3588
+ * Specifies if viewport supports touch events. Defaults to false
3589
+ */
3590
+ hasTouch?: boolean;
3591
+ /**
3592
+ * Specifies if viewport is in landscape mode. Defaults to false.
3593
+ */
3594
+ isLandscape?: boolean;
3595
+ }
3596
+ /**
3597
+ * This sets the log level hierarchy for our terminal logger, ranging from
3598
+ * most to least verbose.
3599
+ *
3600
+ * Ordering the levels like this lets us easily check whether we should log a
3601
+ * message at a given time. For instance, if the log level is set to `'warn'`,
3602
+ * then anything passed to the logger with level `'warn'` or `'error'` should
3603
+ * be logged, but we should _not_ log anything with level `'info'` or `'debug'`.
3604
+ *
3605
+ * If we have a current log level `currentLevel` and a message with level
3606
+ * `msgLevel` is passed to the logger, we can determine whether or not we should
3607
+ * log it by checking if the log level on the message is further up or at the
3608
+ * same level in the hierarchy than `currentLevel`, like so:
3609
+ *
3610
+ * ```ts
3611
+ * LOG_LEVELS.indexOf(msgLevel) >= LOG_LEVELS.indexOf(currentLevel)
3612
+ * ```
3613
+ *
3614
+ * NOTE: for the reasons described above, do not change the order of the entries
3615
+ * in this array without good reason!
3616
+ */
3617
+ declare const LOG_LEVELS: readonly ["debug", "info", "warn", "error"];
3618
+ type LogLevel = (typeof LOG_LEVELS)[number];
3619
+ /**
3620
+ * Abstract interface representing a logger with the capability to accept log
3621
+ * messages at various levels (debug, info, warn, and error), set colors, log
3622
+ * time spans, print diagnostic messages, and more.
3623
+ *
3624
+ * A Node.js-specific implementation of this interface is used when Stencil is
3625
+ * building and compiling a project.
3626
+ */
3627
+ interface Logger {
3628
+ enableColors: (useColors: boolean) => void;
3629
+ setLevel: (level: LogLevel) => void;
3630
+ getLevel: () => LogLevel;
3631
+ debug: (...msg: any[]) => void;
3632
+ info: (...msg: any[]) => void;
3633
+ warn: (...msg: any[]) => void;
3634
+ error: (...msg: any[]) => void;
3635
+ createTimeSpan: (startMsg: string, debug?: boolean, appendTo?: string[]) => LoggerTimeSpan;
3636
+ printDiagnostics: (diagnostics: Diagnostic[], cwd?: string) => void;
3637
+ red: (msg: string) => string;
3638
+ green: (msg: string) => string;
3639
+ yellow: (msg: string) => string;
3640
+ blue: (msg: string) => string;
3641
+ magenta: (msg: string) => string;
3642
+ cyan: (msg: string) => string;
3643
+ gray: (msg: string) => string;
3644
+ bold: (msg: string) => string;
3645
+ dim: (msg: string) => string;
3646
+ bgRed: (msg: string) => string;
3647
+ emoji: (e: string) => string;
3648
+ setLogFilePath?: (p: string) => void;
3649
+ writeLogs?: (append: boolean) => void;
3650
+ createLineUpdater?: () => Promise<LoggerLineUpdater>;
3651
+ }
3652
+ interface LoggerLineUpdater {
3653
+ update(text: string): Promise<void>;
3654
+ stop(): Promise<void>;
3655
+ }
3656
+ interface LoggerTimeSpan {
3657
+ duration(): number;
3658
+ finish(finishedMsg: string, color?: string, bold?: boolean, newLineSuffix?: boolean): number;
3659
+ }
3660
+ interface OutputTargetDist extends OutputTargetValidationConfig {
3661
+ type: 'dist';
3662
+ buildDir?: string;
3663
+ collectionDir?: string | null;
3664
+ /**
3665
+ * When `true` this flag will transform aliased import paths defined in
3666
+ * a project's `tsconfig.json` to relative import paths in the compiled output's
3667
+ * `dist-collection` bundle if it is generated (i.e. `collectionDir` is set).
3668
+ *
3669
+ * Paths will be left in aliased format if `false`.
3670
+ *
3671
+ * @example
3672
+ * // tsconfig.json
3673
+ * {
3674
+ * paths: {
3675
+ * "@utils/*": ['/src/utils/*']
3676
+ * }
3677
+ * }
3678
+ *
3679
+ * // Source file
3680
+ * import * as dateUtils from '@utils/date-utils';
3681
+ * // Output file
3682
+ * import * as dateUtils from '../utils/date-utils';
3683
+ */
3684
+ transformAliasedImportPathsInCollection?: boolean | null;
3685
+ typesDir?: string;
3686
+ /**
3687
+ * Provide a custom path for the ESM loader directory, containing files you can import
3688
+ * in an initiation script within your application to register all your components for
3689
+ * lazy loading.
3690
+ *
3691
+ * @default /dist/loader
3692
+ */
3693
+ esmLoaderPath?: string;
3694
+ copy?: CopyTask[];
3695
+ polyfills?: boolean;
3696
+ empty?: boolean;
3697
+ }
3698
+ interface OutputTargetDistCollection extends OutputTargetValidationConfig {
3699
+ type: 'dist-collection';
3700
+ empty?: boolean;
3701
+ dir: string;
3702
+ collectionDir: string;
3703
+ /**
3704
+ * When `true` this flag will transform aliased import paths defined in
3705
+ * a project's `tsconfig.json` to relative import paths in the compiled output.
3706
+ *
3707
+ * Paths will be left in aliased format if `false` or `undefined`.
3708
+ *
3709
+ * @example
3710
+ * // tsconfig.json
3711
+ * {
3712
+ * paths: {
3713
+ * "@utils/*": ['/src/utils/*']
3714
+ * }
3715
+ * }
3716
+ *
3717
+ * // Source file
3718
+ * import * as dateUtils from '@utils/date-utils';
3719
+ * // Output file
3720
+ * import * as dateUtils from '../utils/date-utils';
3721
+ */
3722
+ transformAliasedImportPaths?: boolean | null;
3723
+ }
3724
+ interface OutputTargetDistTypes extends OutputTargetValidationConfig {
3725
+ type: 'dist-types';
3726
+ dir: string;
3727
+ typesDir: string;
3728
+ }
3729
+ interface OutputTargetDistLazy extends OutputTargetBase {
3730
+ type: 'dist-lazy';
3731
+ dir?: string;
3732
+ esmDir?: string;
3733
+ esmEs5Dir?: string;
3734
+ systemDir?: string;
3735
+ cjsDir?: string;
3736
+ polyfills?: boolean;
3737
+ isBrowserBuild?: boolean;
3738
+ esmIndexFile?: string;
3739
+ cjsIndexFile?: string;
3740
+ systemLoaderFile?: string;
3741
+ legacyLoaderFile?: string;
3742
+ empty?: boolean;
3743
+ }
3744
+ interface OutputTargetDistGlobalStyles extends OutputTargetBase {
3745
+ type: 'dist-global-styles';
3746
+ file: string;
3747
+ }
3748
+ interface OutputTargetDistLazyLoader extends OutputTargetBase {
3749
+ type: 'dist-lazy-loader';
3750
+ dir: string;
3751
+ esmDir: string;
3752
+ esmEs5Dir?: string;
3753
+ cjsDir: string;
3754
+ componentDts: string;
3755
+ empty: boolean;
3756
+ }
3757
+ interface OutputTargetHydrate extends OutputTargetBase {
3758
+ type: 'dist-hydrate-script';
3759
+ dir?: string;
3760
+ /**
3761
+ * Whether to generate a package.json file in the hydrate output directory.
3762
+ * Defaults to `true`
3763
+ * @deprecated
3764
+ * In the next major release, the `package.json` file will be completely removed from the `dist-hydrate-script` output (use `exports` from your library's main `package.json`)
3765
+ */
3766
+ generatePackageJson?: boolean;
3767
+ /**
3768
+ * Module IDs that should not be bundled into the script.
3769
+ * By default, all node builtin's, such as `fs` or `path`
3770
+ * will be considered "external" and not bundled.
3771
+ */
3772
+ external?: string[];
3773
+ empty?: boolean;
3774
+ minify?: boolean;
3775
+ }
3776
+ interface OutputTargetCustom extends OutputTargetBase {
3777
+ type: 'custom';
3778
+ name: string;
3779
+ /**
3780
+ * Indicate when the output target should be executed.
3781
+ *
3782
+ * - `"onBuildOnly"`: Executed only when `stencil build` is called without `--watch`.
3783
+ * - `"always"`: Executed on every build, including in `watch` mode.
3784
+ *
3785
+ * Defaults to "always".
3786
+ */
3787
+ taskShouldRun?: 'onBuildOnly' | 'always';
3788
+ validate?: (config: Config, diagnostics: Diagnostic[]) => void;
3789
+ generator: (config: Config, compilerCtx: CompilerCtx, buildCtx: BuildCtx, docs: JsonDocs) => Promise<void>;
3790
+ copy?: CopyTask[];
3791
+ }
3792
+ /**
3793
+ * Output target for generating [custom data](https://github.com/microsoft/vscode-custom-data) for VS Code as a JSON
3794
+ * file.
3795
+ */
3796
+ interface OutputTargetDocsVscode extends OutputTargetBase {
3797
+ /**
3798
+ * Designates this output target to be used for generating VS Code custom data.
3799
+ * @see OutputTargetBase#type
3800
+ */
3801
+ type: 'docs-vscode';
3802
+ /**
3803
+ * The location on disk to write the JSON file.
3804
+ */
3805
+ file: string;
3806
+ /**
3807
+ * A base URL to find the source code of the component(s) described in the JSON file.
3808
+ */
3809
+ sourceCodeBaseUrl?: string;
3810
+ }
3811
+ interface OutputTargetDocsReadme extends OutputTargetBase {
3812
+ type: 'docs-readme';
3813
+ /**
3814
+ * The root directory where README files should be written
3815
+ *
3816
+ * defaults to {@link Config.srcDir}
3817
+ */
3818
+ dir?: string;
3819
+ dependencies?: boolean;
3820
+ /**
3821
+ * Controls how READMEs are written to the destination directory.
3822
+ *
3823
+ * - `true`: Always overwrite the destination README with the full content.
3824
+ * - `false` (default): Only update the autogenerated content, preserving existing custom content above it.
3825
+ * - `'if-missing'`: Write the full README only if no file exists at the destination.
3826
+ *
3827
+ * This option enables workflows requiring consistent, idempotent output across builds,
3828
+ * and supports setups where custom documentation may need to coexist or vary between environments.
3829
+ */
3830
+ overwriteExisting?: boolean | 'if-missing';
3831
+ footer?: string;
3832
+ strict?: boolean;
3833
+ }
3834
+ interface OutputTargetDocsJson extends OutputTargetBase {
3835
+ type: 'docs-json';
3836
+ file: string;
3837
+ /**
3838
+ * Set an optional file path where Stencil should write a `d.ts` file to disk
3839
+ * at build-time containing type declarations for {@link JsonDocs} and related
3840
+ * interfaces. If this is omitted or set to `null` Stencil will not write such
3841
+ * a file.
3842
+ */
3843
+ typesFile?: string | null;
3844
+ strict?: boolean;
3845
+ /**
3846
+ * An optional file path pointing to a public type library which should be
3847
+ * included and documented in the same way as other types which are included
3848
+ * in this output target.
3849
+ *
3850
+ * This could be useful if, for instance, there are some important interfaces
3851
+ * used in a few places in a Stencil project which don't form part of the
3852
+ * public API for any of the project's components. Such interfaces will not
3853
+ * be included in the `docs-json` output by default, but if they're declared
3854
+ * and exported from a 'supplemental' file designated with this property then
3855
+ * they'll be included in the output, facilitating their documentation.
3856
+ */
3857
+ supplementalPublicTypes?: string;
3858
+ }
3859
+ interface OutputTargetDocsCustomElementsManifest extends OutputTargetBase {
3860
+ type: 'docs-custom-elements-manifest';
3861
+ /**
3862
+ * The file path where the custom-elements.json manifest will be written.
3863
+ * Defaults to 'custom-elements.json' in the root directory.
3864
+ */
3865
+ file: string;
3866
+ strict?: boolean;
3867
+ }
3868
+ interface OutputTargetDocsCustom extends OutputTargetBase {
3869
+ type: 'docs-custom';
3870
+ generator: (docs: JsonDocs, config: Config) => void | Promise<void>;
3871
+ strict?: boolean;
3872
+ }
3873
+ interface OutputTargetStats extends OutputTargetBase {
3874
+ type: 'stats';
3875
+ file?: string;
3876
+ }
3877
+ interface OutputTargetBaseNext {
3878
+ type: string;
3879
+ dir?: string;
3880
+ }
3881
+ /**
3882
+ * The collection of valid export behaviors.
3883
+ * Used to generate a type for typed configs as well as output target validation
3884
+ * for the `dist-custom-elements` output target.
3885
+ *
3886
+ * Adding a value to this const array will automatically add it as a valid option on the
3887
+ * output target configuration for `customElementsExportBehavior`.
3888
+ *
3889
+ * - `default`: No additional export or definition behavior will happen.
3890
+ * - `auto-define-custom-elements`: Enables the auto-definition of a component and its children (recursively) in the custom elements registry. This
3891
+ * functionality allows consumers to bypass the explicit call to define a component, its children, its children's
3892
+ * children, etc. Users of this flag should be aware that enabling this functionality may increase bundle size.
3893
+ * - `bundle`: A `defineCustomElements` function will be exported from the distribution directory. This behavior was added to allow easy migration
3894
+ * from `dist-custom-elements-bundle` to `dist-custom-elements`.
3895
+ * - `single-export-module`: All components will be re-exported from the specified directory's root `index.js` file.
3896
+ */
3897
+ declare const CustomElementsExportBehaviorOptions: readonly ["default", "auto-define-custom-elements", "bundle", "single-export-module"];
3898
+ /**
3899
+ * This type is auto-generated based on the values in `CustomElementsExportBehaviorOptions` array.
3900
+ * This is used on the output target config for intellisense in typed configs.
3901
+ */
3902
+ type CustomElementsExportBehavior = (typeof CustomElementsExportBehaviorOptions)[number];
3903
+ interface OutputTargetDistCustomElements extends OutputTargetValidationConfig {
3904
+ type: 'dist-custom-elements';
3905
+ empty?: boolean;
3906
+ /**
3907
+ * Triggers the following behaviors when enabled:
3908
+ * 1. All `@stencil/core/*` module references are treated as external during bundling.
3909
+ * 2. File names are not hashed.
3910
+ * 3. File minification will follow the behavior defined at the root of the Stencil config.
3911
+ */
3912
+ externalRuntime?: boolean;
3913
+ copy?: CopyTask[];
3914
+ includeGlobalScripts?: boolean;
3915
+ minify?: boolean;
3916
+ /**
3917
+ * Enables the generation of type definition files for the output target.
3918
+ */
3919
+ generateTypeDeclarations?: boolean;
3920
+ /**
3921
+ * Define the export/definition behavior for the output target's generated output.
3922
+ * This controls if/how custom elements will be defined or where components will be exported from.
3923
+ * If omitted, no auto-definition behavior or re-exporting will happen.
3924
+ */
3925
+ customElementsExportBehavior?: CustomElementsExportBehavior;
3926
+ /**
3927
+ * Generate an auto-loader script that uses MutationObserver to lazily load
3928
+ * and define custom elements as they appear in the DOM.
3929
+ *
3930
+ * When set to `true`, generates a `loader.js` file that auto-starts on import.
3931
+ * Can also be configured with an object for more control:
3932
+ * - `fileName`: Custom filename for the loader (default: 'loader.js')
3933
+ * - `autoStart`: Whether to auto-start the loader on import (default: true)
3934
+ *
3935
+ * @example
3936
+ * ```typescript
3937
+ * // Simple usage
3938
+ * autoLoader: true
3939
+ *
3940
+ * // With options
3941
+ * autoLoader: {
3942
+ * fileName: 'my-loader.js',
3943
+ * autoStart: false
3944
+ * }
3945
+ * ```
3946
+ */
3947
+ autoLoader?: boolean | {
3948
+ /**
3949
+ * Custom filename for the generated loader script.
3950
+ * @default 'loader.js'
3951
+ */
3952
+ fileName?: string;
3953
+ /**
3954
+ * Whether to automatically start the loader when the script is imported.
3955
+ * If false, you must call `start()` manually.
3956
+ * @default true
3957
+ */
3958
+ autoStart?: boolean;
3959
+ };
3960
+ }
3961
+ /**
3962
+ * The base type for output targets. All output targets should extend this base type.
3963
+ */
3964
+ interface OutputTargetBase {
3965
+ /**
3966
+ * A unique string to differentiate one output target from another
3967
+ */
3968
+ type: string;
3969
+ }
3970
+ /**
3971
+ * Output targets that can have validation for common `package.json` field values
3972
+ * (module, types, etc.). This allows them to be marked for validation in a project's Stencil config.
3973
+ */
3974
+ interface OutputTargetValidationConfig extends OutputTargetBaseNext {
3975
+ isPrimaryPackageOutputTarget?: boolean;
3976
+ }
3977
+ type EligiblePrimaryPackageOutputTarget = OutputTargetDist | OutputTargetDistCustomElements | OutputTargetDistCollection | OutputTargetDistTypes;
3978
+ type OutputTargetBuild = OutputTargetDistCollection | OutputTargetDistLazy;
3979
+ interface OutputTargetCopy extends OutputTargetBase {
3980
+ type: 'copy';
3981
+ dir: string;
3982
+ copy?: CopyTask[];
3983
+ copyAssets?: 'collection' | 'dist';
3984
+ }
3985
+ interface OutputTargetWww extends OutputTargetBase {
3986
+ /**
3987
+ * Webapp output target.
3988
+ */
3989
+ type: 'www';
3990
+ /**
3991
+ * The directory to write the app's JavaScript and CSS build
3992
+ * files to. The default is to place this directory as a child
3993
+ * to the `dir` config. Default: `build`
3994
+ */
3995
+ buildDir?: string;
3996
+ /**
3997
+ * The directory to write the entire application to.
3998
+ * Note, the `buildDir` is where the app's JavaScript and CSS build
3999
+ * files are written. Default: `www`
4000
+ */
4001
+ dir?: string;
4002
+ /**
4003
+ * Empty the build directory of all files and directories on first build.
4004
+ * Default: `true`
4005
+ */
4006
+ empty?: boolean;
4007
+ /**
4008
+ * The default index html file of the app, commonly found at the
4009
+ * root of the `src` directory.
4010
+ * Default: `index.html`
4011
+ */
4012
+ indexHtml?: string;
4013
+ /**
4014
+ * The copy config is an array of objects that defines any files or folders that should
4015
+ * be copied over to the build directory.
4016
+ *
4017
+ * Each object in the array must include a src property which can be either an absolute path,
4018
+ * a relative path or a glob pattern. The config can also provide an optional dest property
4019
+ * which can be either an absolute path or a path relative to the build directory.
4020
+ * Also note that any files within src/assets are automatically copied to www/assets for convenience.
4021
+ *
4022
+ * In the copy config below, it will copy the entire directory from src/docs-content over to www/docs-content.
4023
+ */
4024
+ copy?: CopyTask[];
4025
+ /**
4026
+ * The base url of the app, it's required during prerendering to be the absolute path
4027
+ * of your app, such as: `https://my.app.com/app`.
4028
+ *
4029
+ * Default: `/`
4030
+ */
4031
+ baseUrl?: string;
4032
+ /**
4033
+ * By default, stencil will include all the polyfills required by legacy browsers in the ES5 build.
4034
+ * If it's `false`, stencil will not emit this polyfills anymore and it's your responsibility to provide them before
4035
+ * stencil initializes.
4036
+ */
4037
+ polyfills?: boolean;
4038
+ /**
4039
+ * Path to an external node module which has exports of the prerender config object.
4040
+ * ```
4041
+ * module.exports = {
4042
+ * afterHydrate(document, url) {
4043
+ * document.title = `URL: ${url.href}`;
4044
+ * }
4045
+ * }
4046
+ * ```
4047
+ */
4048
+ prerenderConfig?: string;
4049
+ /**
4050
+ * Service worker config for production builds. During development builds
4051
+ * service worker script will be injected to automatically deregister existing
4052
+ * service workers. When set to `false` neither a service worker registration
4053
+ * or deregistration will be added to the index.html.
4054
+ */
4055
+ serviceWorker?: ServiceWorkerConfig | null | false;
4056
+ appDir?: string;
4057
+ }
4058
+ type OutputTarget = OutputTargetCopy | OutputTargetCustom | OutputTargetDist | OutputTargetDistCollection | OutputTargetDistCustomElements | OutputTargetDistLazy | OutputTargetDistGlobalStyles | OutputTargetDistLazyLoader | OutputTargetDocsJson | OutputTargetDocsCustom | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetDocsCustomElementsManifest | OutputTargetWww | OutputTargetHydrate | OutputTargetStats | OutputTargetDistTypes;
4059
+ /**
4060
+ * Our custom configuration interface for generated caching Service Workers
4061
+ * using the Workbox library (see https://developer.chrome.com/docs/workbox/).
4062
+ *
4063
+ * Although we are using Workbox we are unfortunately unable to depend on the
4064
+ * published types for the library because they must be compiled using the
4065
+ * `webworker` lib for TypeScript, which cannot be used at the same time as
4066
+ * the `dom` lib. So as a workaround we maintain our own interface here. See
4067
+ * here to refer to the published version:
4068
+ * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/c7b4dadae5b320ad1311a8f82242b8f2f41b7b8c/types/workbox-build/generate-sw.d.ts#L3
4069
+ */
4070
+ interface ServiceWorkerConfig {
4071
+ unregister?: boolean;
4072
+ swDest?: string;
4073
+ swSrc?: string;
4074
+ globPatterns?: string[];
4075
+ globDirectory?: string | string[];
4076
+ globIgnores?: string | string[];
4077
+ templatedUrls?: any;
4078
+ maximumFileSizeToCacheInBytes?: number;
4079
+ manifestTransforms?: any;
4080
+ modifyUrlPrefix?: any;
4081
+ dontCacheBustURLsMatching?: RegExp;
4082
+ navigateFallback?: string;
4083
+ navigateFallbackWhitelist?: RegExp[];
4084
+ navigateFallbackBlacklist?: RegExp[];
4085
+ cacheId?: string;
4086
+ skipWaiting?: boolean;
4087
+ clientsClaim?: boolean;
4088
+ directoryIndex?: string;
4089
+ runtimeCaching?: any[];
4090
+ ignoreUrlParametersMatching?: any[];
4091
+ handleFetch?: boolean;
4092
+ }
4093
+ interface LoadConfigInit {
4094
+ /**
4095
+ * User config object to merge into default config and
4096
+ * config loaded from a file path.
4097
+ */
4098
+ config?: UnvalidatedConfig;
4099
+ /**
4100
+ * Absolute path to a Stencil config file. This path cannot be
4101
+ * relative and it does not resolve config files within a directory.
4102
+ */
4103
+ configPath?: string;
4104
+ logger?: Logger;
4105
+ sys?: CompilerSystem;
4106
+ /**
4107
+ * When set to true, if the "tsconfig.json" file is not found
4108
+ * it'll automatically generate and save a default tsconfig
4109
+ * within the root directory.
4110
+ */
4111
+ initTsConfig?: boolean;
4112
+ }
4113
+ /**
4114
+ * Results from an attempt to load a config. The values on this interface
4115
+ * have not yet been validated and are not ready to be used for arbitrary
4116
+ * operations around the codebase.
4117
+ */
4118
+ interface LoadConfigResults {
4119
+ config: ValidatedConfig;
4120
+ diagnostics: Diagnostic[];
4121
+ tsconfig: {
4122
+ path: string;
4123
+ compilerOptions: any;
4124
+ files: string[];
4125
+ include: string[];
4126
+ exclude: string[];
4127
+ extends: string;
4128
+ };
4129
+ }
4130
+ interface Diagnostic {
4131
+ absFilePath?: string | undefined;
4132
+ code?: string;
4133
+ columnNumber?: number | undefined;
4134
+ debugText?: string;
4135
+ header?: string;
4136
+ language?: string;
4137
+ level: 'error' | 'warn' | 'info' | 'log' | 'debug';
4138
+ lineNumber?: number | undefined;
4139
+ lines: PrintLine[];
4140
+ messageText: string;
4141
+ relFilePath?: string | undefined;
4142
+ type: string;
4143
+ }
4144
+ interface CacheStorage {
4145
+ get(key: string): Promise<any>;
4146
+ set(key: string, value: any): Promise<void>;
4147
+ }
4148
+ interface WorkerOptions {
4149
+ maxConcurrentWorkers?: number;
4150
+ maxConcurrentTasksPerWorker?: number;
4151
+ logger?: Logger;
4152
+ }
4153
+ interface RollupInterface {
4154
+ rollup: {
4155
+ (config: any): Promise<any>;
4156
+ };
4157
+ plugins: {
4158
+ nodeResolve(opts: any): any;
4159
+ replace(opts: any): any;
4160
+ commonjs(opts: any): any;
4161
+ json(): any;
4162
+ };
4163
+ }
4164
+ interface ResolveModuleOptions {
4165
+ manuallyResolve?: boolean;
4166
+ packageJson?: boolean;
4167
+ }
4168
+ interface PrerenderStartOptions {
4169
+ buildId?: string;
4170
+ hydrateAppFilePath?: string;
4171
+ componentGraph?: BuildResultsComponentGraph;
4172
+ srcIndexHtmlPath?: string;
4173
+ }
4174
+ interface PrerenderResults {
4175
+ buildId: string;
4176
+ diagnostics: Diagnostic[];
4177
+ urls: number;
4178
+ duration: number;
4179
+ average: number;
4180
+ }
4181
+ /**
4182
+ * Input for CSS optimization functions, including the input CSS
4183
+ * string and a few boolean options which turn on or off various
4184
+ * optimizations.
4185
+ */
4186
+ interface OptimizeCssInput {
4187
+ input: string;
4188
+ filePath?: string;
4189
+ autoprefixer?: boolean | null | AutoprefixerOptions;
4190
+ minify?: boolean;
4191
+ sourceMap?: boolean;
4192
+ resolveUrl?: (url: string) => Promise<string> | string;
4193
+ }
4194
+ /**
4195
+ * This is not a real interface describing the options which can
4196
+ * be passed to autoprefixer, for that see the docs, here:
4197
+ * https://github.com/postcss/autoprefixer#options
4198
+ *
4199
+ * Instead, this basically just serves as a label type to track
4200
+ * that arguments are being passed consistently.
4201
+ */
4202
+ type AutoprefixerOptions = object;
4203
+ /**
4204
+ * Output from CSS optimization functions, wrapping up optimized
4205
+ * CSS and any diagnostics produced during optimization.
4206
+ */
4207
+ interface OptimizeCssOutput {
4208
+ output: string;
4209
+ diagnostics: Diagnostic[];
4210
+ }
4211
+ interface OptimizeJsInput {
4212
+ input: string;
4213
+ filePath?: string;
4214
+ target?: 'es5' | 'latest';
4215
+ pretty?: boolean;
4216
+ sourceMap?: boolean;
4217
+ }
4218
+ interface OptimizeJsOutput {
4219
+ output: string;
4220
+ sourceMap: any;
4221
+ diagnostics: Diagnostic[];
4222
+ }
4223
+ interface LazyRequire {
4224
+ ensure(fromDir: string, moduleIds: string[]): Promise<Diagnostic[]>;
4225
+ require(fromDir: string, moduleId: string): any;
4226
+ getModulePath(fromDir: string, moduleId: string): string;
4227
+ }
4228
+ /**
4229
+ * @deprecated This interface is no longer used by Stencil
4230
+ * TODO(STENCIL-743): Remove this interface
4231
+ */
4232
+ interface FsWatcherItem {
4233
+ close(): void;
4234
+ }
4235
+ /**
4236
+ * @deprecated This interface is no longer used by Stencil
4237
+ * TODO(STENCIL-743): Remove this interface
4238
+ */
4239
+ interface MakeDirectoryOptions {
4240
+ /**
4241
+ * Indicates whether parent folders should be created.
4242
+ * @default false
4243
+ */
4244
+ recursive?: boolean;
4245
+ /**
4246
+ * A file mode. If a string is passed, it is parsed as an octal integer. If not specified
4247
+ * @default 0o777.
4248
+ */
4249
+ mode?: number;
4250
+ }
4251
+ /**
4252
+ * @deprecated This interface is no longer used by Stencil
4253
+ * TODO(STENCIL-743): Remove this interface
4254
+ */
4255
+ interface FsStats {
4256
+ isFile(): boolean;
4257
+ isDirectory(): boolean;
4258
+ isBlockDevice(): boolean;
4259
+ isCharacterDevice(): boolean;
4260
+ isSymbolicLink(): boolean;
4261
+ isFIFO(): boolean;
4262
+ isSocket(): boolean;
4263
+ dev: number;
4264
+ ino: number;
4265
+ mode: number;
4266
+ nlink: number;
4267
+ uid: number;
4268
+ gid: number;
4269
+ rdev: number;
4270
+ size: number;
4271
+ blksize: number;
4272
+ blocks: number;
4273
+ atime: Date;
4274
+ mtime: Date;
4275
+ ctime: Date;
4276
+ birthtime: Date;
4277
+ }
4278
+ interface Compiler {
4279
+ build(): Promise<CompilerBuildResults>;
4280
+ createWatcher(): Promise<CompilerWatcher>;
4281
+ destroy(): Promise<void>;
4282
+ sys: CompilerSystem;
4283
+ }
4284
+ interface CompilerWatcher extends BuildOnEvents {
4285
+ start: () => Promise<WatcherCloseResults>;
4286
+ close: () => Promise<WatcherCloseResults>;
4287
+ request: (data: CompilerRequest) => Promise<CompilerRequestResponse>;
4288
+ }
4289
+ interface CompilerRequest {
4290
+ path?: string;
4291
+ }
4292
+ interface WatcherCloseResults {
4293
+ exitCode: number;
4294
+ }
4295
+ interface CompilerRequestResponse {
4296
+ path: string;
4297
+ nodeModuleId: string;
4298
+ nodeModuleVersion: string;
4299
+ nodeResolvedPath: string;
4300
+ cachePath: string;
4301
+ cacheHit: boolean;
4302
+ content: string;
4303
+ status: number;
4304
+ }
4305
+ /**
4306
+ * Options for Stencil's string-to-string transpiler
4307
+ */
4308
+ interface TranspileOptions {
4309
+ /**
4310
+ * A component can be defined as a custom element by using `customelement`, or the
4311
+ * component class can be exported by using `module`. Default is `customelement`.
4312
+ */
4313
+ componentExport?: 'customelement' | 'module' | string | undefined;
4314
+ /**
4315
+ * Sets how and if component metadata should be assigned on the compiled
4316
+ * component output. The `compilerstatic` value will set the metadata to
4317
+ * a static `COMPILER_META` getter on the component class. This option
4318
+ * is useful for unit testing preprocessors. Default is `null`.
4319
+ */
4320
+ componentMetadata?: 'runtimestatic' | 'compilerstatic' | string | undefined;
4321
+ /**
4322
+ * The actual internal import path for any `@stencil/core` imports.
4323
+ * Default is `@stencil/core/runtime/client`.
4324
+ */
4325
+ coreImportPath?: string;
4326
+ /**
4327
+ * The current working directory. Default is `/`.
4328
+ */
4329
+ currentDirectory?: string;
4330
+ /**
4331
+ * The filename of the code being compiled. Default is `module.tsx`.
4332
+ */
4333
+ file?: string;
4334
+ /**
4335
+ * Module format to use for the compiled code output, which can be either `esm` or `cjs`.
4336
+ * Default is `esm`.
4337
+ */
4338
+ module?: 'cjs' | 'esm' | string;
4339
+ /**
4340
+ * Sets how and if any properties, methods and events are proxied on the
4341
+ * component class. The `defineproperty` value sets the getters and setters
4342
+ * using Object.defineProperty. Default is `defineproperty`.
4343
+ */
4344
+ proxy?: 'defineproperty' | string | undefined;
4345
+ /**
4346
+ * How component styles should be associated to the component. The `static`
4347
+ * setting will assign the styles as a static getter on the component class.
4348
+ */
4349
+ style?: 'static' | string | undefined;
4350
+ /**
4351
+ * How style data should be added for imports. For example, the `queryparams` value
4352
+ * adds the component's tagname and encapsulation info as querystring parameter
4353
+ * to the style's import, such as `style.css?tag=my-tag&encapsulation=shadow`. This
4354
+ * style data can be used by bundlers to further optimize each component's css.
4355
+ * Set to `null` to not include the querystring parameters. Default is `queryparams`.
4356
+ */
4357
+ styleImportData?: 'queryparams' | string | undefined;
4358
+ /**
4359
+ * The JavaScript source target TypeScript should to transpile to. Values can be
4360
+ * `latest`, `esnext`, `es2017`, `es2015`, or `es5`. Defaults to `latest`.
4361
+ */
4362
+ target?: CompileTarget;
4363
+ /**
4364
+ * Create a source map. Using `inline` will inline the source map into the
4365
+ * code, otherwise the source map will be in the returned `map` property.
4366
+ * Default is `true`.
4367
+ */
4368
+ sourceMap?: boolean | 'inline';
4369
+ /**
4370
+ * Base directory to resolve non-relative module names. Same as the `baseUrl`
4371
+ * TypeScript compiler option: https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping
4372
+ */
4373
+ baseUrl?: string;
4374
+ /**
4375
+ * List of path mapping entries for module names to locations relative to the `baseUrl`.
4376
+ * Same as the `paths` TypeScript compiler option:
4377
+ * https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping
4378
+ */
4379
+ paths?: {
4380
+ [key: string]: string[];
4381
+ };
4382
+ /**
4383
+ * JSX mode for TypeScript compilation. Can be 'react', 'react-jsx', 'react-jsxdev', etc.
4384
+ * Same as the `jsx` TypeScript compiler option.
4385
+ */
4386
+ jsx?: number;
4387
+ /**
4388
+ * Module specifier for JSX factory. Used with automatic JSX runtime.
4389
+ * Same as the `jsxImportSource` TypeScript compiler option.
4390
+ */
4391
+ jsxImportSource?: string;
4392
+ /**
4393
+ * Passed in Stencil Compiler System, otherwise falls back to the internal in-memory only system.
4394
+ */
4395
+ sys?: CompilerSystem;
4396
+ /**
4397
+ * This option enables the same behavior as {@link Config.transformAliasedImportPaths}, transforming paths aliased in
4398
+ * `tsconfig.json` to relative paths.
4399
+ */
4400
+ transformAliasedImportPaths?: boolean;
4401
+ /**
4402
+ * List of tags to transform, by default only the incoming component tag is transformed
4403
+ */
4404
+ tagsToTransform?: string[];
4405
+ /**
4406
+ * Adds `transformTag` calls to css strings and querySelector(All) calls
4407
+ */
4408
+ additionalTagTransformers?: boolean;
4409
+ }
4410
+ type CompileTarget = 'latest' | 'esnext' | 'es2020' | 'es2019' | 'es2018' | 'es2017' | 'es2015' | 'es5' | string | undefined;
4411
+ interface TranspileResults {
4412
+ code: string;
4413
+ data?: any[];
4414
+ diagnostics: Diagnostic[];
4415
+ imports?: {
4416
+ path: string;
4417
+ }[];
4418
+ inputFileExtension: string;
4419
+ inputFilePath: string;
4420
+ map: any;
4421
+ outputFilePath: string;
4422
+ }
4423
+ interface TransformOptions {
4424
+ coreImportPath: string;
4425
+ componentExport: 'lazy' | 'module' | 'customelement' | null;
4426
+ componentMetadata: 'runtimestatic' | 'compilerstatic' | null;
4427
+ currentDirectory: string;
4428
+ file?: string;
4429
+ isolatedModules?: boolean;
4430
+ module?: 'cjs' | 'esm';
4431
+ proxy: 'defineproperty' | null;
4432
+ style: 'static' | null;
4433
+ styleImportData: 'queryparams' | null;
4434
+ target?: string;
4435
+ }
4436
+ interface CompileScriptMinifyOptions {
4437
+ target?: CompileTarget;
4438
+ pretty?: boolean;
4439
+ }
4440
+ interface DevServer extends BuildEmitEvents {
4441
+ address: string;
4442
+ basePath: string;
4443
+ browserUrl: string;
4444
+ protocol: string;
4445
+ port: number;
4446
+ root: string;
4447
+ close(): Promise<void>;
4448
+ }
4449
+ interface CliInitOptions {
4450
+ args: string[];
4451
+ logger: Logger;
4452
+ sys: CompilerSystem;
4453
+ }
4454
+ //#endregion
4455
+ export { CustomElementsExportBehavior as $, JsonDocsValue as $n, PageReloadStrategy as $t, CompilerFileWatcher as A, TranspileOptions as An, OptimizeJsInput as At, CompilerSystemRemoveDirectoryOptions as B, JsonDocsCustomState as Bn, OutputTargetDistCustomElements as Bt, CompilerEventDirAdd as C, SystemDetails as Cn, Logger as Ct, CompilerEventFileUpdate as D, TransformOptions as Dn, NodeResolveConfig as Dt, CompilerEventFileDelete as E, TestingRunOptions as En, MakeDirectoryOptions as Et, CompilerRequestResponse as F, WorkerMainController as Fn, OutputTargetBuild as Ft, CompilerSystemWriteFileResults as G, JsonDocsMethodReturn as Gn, OutputTargetDocsCustom as Gt, CompilerSystemRemoveFileResults as H, JsonDocsEvent as Hn, OutputTargetDistLazy as Ht, CompilerSystem as I, WorkerOptions as In, OutputTargetCopy as It, ConfigBundle as J, JsonDocsSlot as Jn, OutputTargetDocsReadme as Jt, CompilerWatcher as K, JsonDocsPart as Kn, OutputTargetDocsCustomElementsManifest as Kt, CompilerSystemCreateDirectoryOptions as L, JsonDocMethodParameter as Ln, OutputTargetCustom as Lt, CompilerFileWatcherEvent as M, UnvalidatedConfig as Mn, OutputTarget as Mt, CompilerFsStats as N, ValidatedConfig as Nn, OutputTargetBase as Nt, CompilerEventFsChange as O, TransformerConfig as On, OptimizeCssInput as Ot, CompilerRequest as P, WatcherCloseResults as Pn, OutputTargetBaseNext as Pt, Credentials as Q, JsonDocsUsage as Qn, OutputTargetWww as Qt, CompilerSystemCreateDirectoryResults as R, JsonDocs as Rn, OutputTargetDist as Rt, CompilerEventBuildStart as S, StencilDocsConfig as Sn, LogLevel as St, CompilerEventFileAdd as T, TestingConfig as Tn, LoggerTimeSpan as Tt, CompilerSystemRenameResults as U, JsonDocsListener as Un, OutputTargetDistLazyLoader as Ut, CompilerSystemRemoveDirectoryResults as V, JsonDocsDependencyGraph as Vn, OutputTargetDistGlobalStyles as Vt, CompilerSystemRenamedPath as W, JsonDocsMethod as Wn, OutputTargetDistTypes as Wt, CopyResults as X, JsonDocsTag as Xn, OutputTargetHydrate as Xt, ConfigExtras as Y, JsonDocsStyle as Yn, OutputTargetDocsVscode as Yt, CopyTask as Z, JsonDocsTypeLibrary as Zn, OutputTargetStats as Zt, CompilerBuildStart as _, ServiceWorkerConfig as _n, JestConfig as _t, BuildNoChangeResults as a, PrerenderResults as an, EligiblePrimaryPackageOutputTarget as at, CompilerEventBuildLog as b, StencilConfig as bn, LoadConfigInit as bt, BuildOutput as c, ResolveModuleIdResults as cn, FsStats as ct, CacheStorage as d, RobotsTxtResults as dn, HistoryApiFallback as dt, ParsedPath as en, StyleDoc as er, CustomElementsExportBehaviorOptions as et, CliInitOptions as f, RollupConfig as fn, HmrStyleUpdate as ft, CompilerBuildResults as g, SerializeDocumentOptions as gn, HydratedFlag as gt, Compiler as h, RollupOutputOptions as hn, HydrateFactoryOptions as ht, BuildLog as i, PrerenderHydrateOptions as in, Diagnostic as it, CompilerFileWatcherCallback as j, TranspileResults as jn, OptimizeJsOutput as jt, CompilerEventName as k, TranspileOnlyResults as kn, OptimizeCssOutput as kt, BuildResultsComponentGraph as l, ResolveModuleOptions as ln, FsWatchResults as lt, CompileTarget as m, RollupInterface as mn, HydrateDocumentOptions as mt, BuildEmitEvents as n, PlatformPath as nn, DevServerConfig as nt, BuildOnEventRemove as o, PrerenderStartOptions as on, EmulateConfig as ot, CompileScriptMinifyOptions as p, RollupInputOptions as pn, HotModuleReplacement as pt, Config as q, JsonDocsProp as qn, OutputTargetDocsJson as qt, BuildEvents as r, PrerenderConfig as rn, DevServerEditor as rt, BuildOnEvents as s, ResolveModuleIdOptions as sn, EmulateViewport as st, AutoprefixerOptions as t, Path as tn, DevServer as tt, BundlingConfig as u, RobotsTxtOpts as un, FsWatcherItem as ut, CompilerDependency as v, SitemapXmpOpts as vn, LOG_LEVELS as vt, CompilerEventDirDelete as w, Testing as wn, LoggerLineUpdater as wt, CompilerEventBuildNoChange as x, StencilDevServerConfig as xn, LoadConfigResults as xt, CompilerEventBuildFinish as y, SitemapXmpResults as yn, LazyRequire as yt, CompilerSystemRealpathResults as z, JsonDocsComponent as zn, OutputTargetDistCollection as zt };