@rindo/core 1.8.12 → 2.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (608) hide show
  1. package/LICENSE.md +27 -27
  2. package/bin/cli.ts +20 -0
  3. package/bin/rindo +51 -22
  4. package/cli/index.cjs +1263 -0
  5. package/cli/index.d.ts +15 -0
  6. package/cli/index.js +1237 -0
  7. package/cli/package.json +14 -0
  8. package/compiler/lib.d.ts +24 -0
  9. package/compiler/lib.dom.d.ts +20230 -0
  10. package/compiler/lib.dom.iterable.d.ts +351 -0
  11. package/compiler/lib.es2015.collection.d.ts +89 -0
  12. package/compiler/lib.es2015.core.d.ts +517 -0
  13. package/compiler/lib.es2015.d.ts +30 -0
  14. package/compiler/lib.es2015.generator.d.ts +79 -0
  15. package/compiler/lib.es2015.iterable.d.ts +505 -0
  16. package/compiler/lib.es2015.promise.d.ts +150 -0
  17. package/compiler/lib.es2015.proxy.d.ts +41 -0
  18. package/compiler/lib.es2015.reflect.d.ts +123 -0
  19. package/compiler/lib.es2015.symbol.d.ts +48 -0
  20. package/compiler/lib.es2015.symbol.wellknown.d.ts +324 -0
  21. package/compiler/lib.es2016.array.include.d.ts +118 -0
  22. package/compiler/lib.es2016.d.ts +22 -0
  23. package/compiler/lib.es2016.full.d.ts +25 -0
  24. package/compiler/lib.es2017.d.ts +26 -0
  25. package/compiler/lib.es2017.full.d.ts +25 -0
  26. package/compiler/lib.es2017.intl.d.ts +32 -0
  27. package/compiler/lib.es2017.object.d.ts +51 -0
  28. package/compiler/lib.es2017.sharedmemory.d.ts +137 -0
  29. package/compiler/lib.es2017.string.d.ts +47 -0
  30. package/compiler/lib.es2017.typedarrays.d.ts +55 -0
  31. package/compiler/lib.es2018.asyncgenerator.d.ts +79 -0
  32. package/compiler/lib.es2018.asynciterable.d.ts +45 -0
  33. package/compiler/lib.es2018.d.ts +26 -0
  34. package/compiler/lib.es2018.full.d.ts +25 -0
  35. package/compiler/lib.es2018.intl.d.ts +61 -0
  36. package/compiler/lib.es2018.promise.d.ts +32 -0
  37. package/compiler/lib.es2018.regexp.d.ts +39 -0
  38. package/compiler/lib.es2019.array.d.ts +85 -0
  39. package/compiler/lib.es2019.d.ts +25 -0
  40. package/compiler/lib.es2019.full.d.ts +25 -0
  41. package/compiler/lib.es2019.object.d.ts +35 -0
  42. package/compiler/lib.es2019.string.d.ts +33 -0
  43. package/compiler/lib.es2019.symbol.d.ts +26 -0
  44. package/compiler/lib.es2020.bigint.d.ts +728 -0
  45. package/compiler/lib.es2020.d.ts +27 -0
  46. package/compiler/lib.es2020.full.d.ts +25 -0
  47. package/compiler/lib.es2020.intl.d.ts +310 -0
  48. package/compiler/lib.es2020.promise.d.ts +50 -0
  49. package/compiler/lib.es2020.sharedmemory.d.ts +99 -0
  50. package/compiler/lib.es2020.string.d.ts +30 -0
  51. package/compiler/lib.es2020.symbol.wellknown.d.ts +39 -0
  52. package/compiler/lib.es5.d.ts +4435 -0
  53. package/compiler/lib.es6.d.ts +25 -0
  54. package/compiler/lib.esnext.d.ts +25 -0
  55. package/compiler/lib.esnext.full.d.ts +25 -0
  56. package/compiler/lib.esnext.intl.d.ts +32 -0
  57. package/compiler/lib.esnext.promise.d.ts +43 -0
  58. package/compiler/lib.esnext.string.d.ts +35 -0
  59. package/compiler/lib.esnext.weakref.d.ts +75 -0
  60. package/compiler/lib.scripthost.d.ts +327 -0
  61. package/compiler/lib.webworker.d.ts +6042 -0
  62. package/compiler/lib.webworker.importscripts.d.ts +26 -0
  63. package/compiler/lib.webworker.iterable.d.ts +166 -0
  64. package/compiler/package.json +8 -6
  65. package/compiler/rindo.d.ts +95 -0
  66. package/compiler/rindo.js +65051 -6657
  67. package/compiler/rindo.min.js +4 -0
  68. package/dependencies.json +103 -0
  69. package/dev-server/client/app-error.d.ts +18 -0
  70. package/dev-server/client/events.d.ts +6 -0
  71. package/dev-server/client/hmr-components.d.ts +1 -0
  72. package/dev-server/client/hmr-external-styles.d.ts +1 -0
  73. package/dev-server/client/hmr-images.d.ts +1 -0
  74. package/dev-server/client/hmr-inline-styles.d.ts +1 -0
  75. package/dev-server/client/hmr-util.d.ts +9 -0
  76. package/dev-server/client/hmr-window.d.ts +10 -0
  77. package/dev-server/client/index.d.ts +6 -0
  78. package/dev-server/client/index.js +808 -0
  79. package/dev-server/client/logger.d.ts +5 -0
  80. package/dev-server/client/package.json +8 -0
  81. package/dev-server/client/progress.d.ts +3 -0
  82. package/dev-server/client/status.d.ts +4 -0
  83. package/dev-server/connector.html +6 -0
  84. package/dev-server/index.d.ts +3 -0
  85. package/dev-server/index.js +264 -0
  86. package/dev-server/open-in-editor-api.js +1 -0
  87. package/dev-server/package.json +8 -0
  88. package/dev-server/server-process.js +1738 -0
  89. package/dev-server/server-worker-thread.js +39 -0
  90. package/{dist/dev-server → dev-server}/templates/directory-index.html +132 -132
  91. package/{dist/dev-server → dev-server}/templates/initial-load.html +160 -160
  92. package/dev-server/ws.js +1 -0
  93. package/internal/app-data/index.cjs +90 -0
  94. package/internal/app-data/index.d.ts +4 -0
  95. package/internal/{client/build-conditionals.mjs → app-data/index.js} +25 -21
  96. package/internal/app-data/package.json +15 -0
  97. package/internal/client/css-shim.js +4 -0
  98. package/internal/client/{dom.rindo-client.mjs → dom.js} +73 -137
  99. package/{dist/client/index.mjs → internal/client/index.js} +863 -789
  100. package/internal/client/package.json +8 -0
  101. package/internal/client/patch-browser.js +120 -0
  102. package/internal/client/patch-esm.js +23 -0
  103. package/internal/client/polyfills/core-js.js +11 -10
  104. package/internal/client/polyfills/css-shim.js +1 -656
  105. package/internal/client/polyfills/dom.js +79 -146
  106. package/internal/client/polyfills/es5-html-element.js +1 -18
  107. package/internal/client/polyfills/index.js +34 -35
  108. package/internal/client/{shadow-css.rindo-client.mjs → shadow-css.js} +20 -17
  109. package/internal/hydrate/index.js +1097 -0
  110. package/internal/hydrate/package.json +7 -0
  111. package/internal/hydrate/runner.d.ts +217 -0
  112. package/internal/hydrate/runner.js +777 -0
  113. package/internal/hydrate/shadow-css.js +146 -0
  114. package/internal/index.d.ts +4 -18
  115. package/internal/index.js +1 -1
  116. package/internal/package.json +9 -6
  117. package/internal/rindo-core/index.cjs +1 -0
  118. package/internal/rindo-core/index.d.ts +51 -0
  119. package/internal/rindo-core/index.js +15 -0
  120. package/internal/rindo-ext-modules.d.ts +41 -0
  121. package/internal/rindo-private.d.ts +2128 -0
  122. package/internal/rindo-public-compiler.d.ts +2170 -0
  123. package/{dist/declarations/docs.d.ts → internal/rindo-public-docs.d.ts} +13 -1
  124. package/internal/rindo-public-runtime.d.ts +1555 -0
  125. package/internal/testing/index.js +1055 -0
  126. package/internal/testing/package.json +7 -0
  127. package/internal/testing/shadow-css.js +146 -0
  128. package/mock-doc/index.cjs +4610 -0
  129. package/mock-doc/index.d.ts +916 -0
  130. package/mock-doc/index.js +4574 -2
  131. package/mock-doc/package.json +15 -10
  132. package/package.json +132 -186
  133. package/readme.md +21 -174
  134. package/screenshot/compare/build/app.css +1 -1
  135. package/screenshot/compare/build/app.esm.js +1 -1
  136. package/screenshot/compare/build/app.js +33 -818
  137. package/screenshot/compare/build/{p-113f7459.js → p-081b0641.js} +1 -1
  138. package/screenshot/compare/build/p-227a1e18.entry.js +1 -0
  139. package/screenshot/compare/build/p-2c298727.entry.js +1 -0
  140. package/screenshot/compare/build/p-5479268c.entry.js +1 -0
  141. package/screenshot/compare/build/p-573ec8a4.entry.js +1 -0
  142. package/screenshot/compare/build/p-6ba08604.entry.js +1 -0
  143. package/screenshot/compare/build/p-6bc63295.entry.js +1 -0
  144. package/screenshot/compare/build/p-7a3759fd.entry.js +1 -0
  145. package/screenshot/compare/build/{p-ejpsp3kx.js → p-7b4e3ba7.js} +1 -1
  146. package/screenshot/compare/build/p-988eb362.css +1 -0
  147. package/screenshot/compare/build/p-9b6a9315.js +1 -0
  148. package/screenshot/compare/build/p-b4cc611c.entry.js +1 -0
  149. package/screenshot/compare/build/p-d1bf53f5.entry.js +1 -0
  150. package/screenshot/compare/build/{p-efb0eac6.js → p-e2efe0df.js} +1 -1
  151. package/screenshot/compare/build/p-e8ca6d97.entry.js +1 -0
  152. package/screenshot/compare/build/p-ec2f13e0.entry.js +1 -0
  153. package/screenshot/compare/build/p-f0b99977.entry.js +1 -0
  154. package/screenshot/compare/build/p-f4745c2f.entry.js +1 -0
  155. package/screenshot/compare/build/p-fbbae598.js +1 -0
  156. package/screenshot/compare/host.config.json +14 -14
  157. package/screenshot/compare/index.html +1 -1
  158. package/{dist/screenshot → screenshot}/connector-base.d.ts +1 -1
  159. package/{dist/screenshot → screenshot}/connector-local.d.ts +1 -1
  160. package/screenshot/connector.js +2 -3
  161. package/{dist/screenshot → screenshot}/index.d.ts +1 -1
  162. package/screenshot/index.js +659 -2
  163. package/screenshot/local-connector.js +2 -3
  164. package/screenshot/package.json +15 -13
  165. package/screenshot/pixel-match.js +62 -49
  166. package/screenshot/screenshot-compare.d.ts +3 -0
  167. package/{dist/screenshot → screenshot}/screenshot-fs.d.ts +1 -1
  168. package/sys/deno/index.js +1785 -0
  169. package/sys/deno/node-compat.js +2654 -0
  170. package/sys/deno/worker.js +44 -0
  171. package/sys/node/autoprefixer.js +8 -0
  172. package/sys/node/glob.js +1 -0
  173. package/sys/node/graceful-fs.js +1 -0
  174. package/sys/node/index.d.ts +18 -0
  175. package/sys/node/index.js +1386 -2
  176. package/sys/node/node-fetch.js +1 -0
  177. package/sys/node/package.json +8 -5
  178. package/sys/node/prompts.js +1 -0
  179. package/sys/node/worker.js +52 -0
  180. package/{dist/testing → testing}/index.d.ts +5 -6
  181. package/testing/index.js +4017 -2
  182. package/testing/jest/jest-config.d.ts +5 -0
  183. package/{dist/testing → testing}/jest/jest-environment.d.ts +4 -2
  184. package/{dist/testing → testing}/jest/jest-preprocessor.d.ts +1 -0
  185. package/{dist/testing → testing}/jest/jest-runner.d.ts +1 -1
  186. package/{dist/testing → testing}/jest/jest-screenshot.d.ts +1 -1
  187. package/{dist/testing → testing}/jest/jest-serializer.d.ts +1 -1
  188. package/testing/jest-environment.js +3 -3
  189. package/testing/jest-preprocessor.js +3 -3
  190. package/testing/jest-preset.js +32 -40
  191. package/testing/jest-runner.js +3 -3
  192. package/testing/jest-setuptestframework.js +3 -3
  193. package/{dist/testing → testing}/matchers/events.d.ts +9 -1
  194. package/{dist/testing → testing}/matchers/index.d.ts +3 -1
  195. package/{dist/testing → testing}/matchers/screenshot.d.ts +1 -1
  196. package/testing/mock-fetch.d.ts +11 -0
  197. package/testing/mocks.d.ts +14 -0
  198. package/testing/package.json +8 -6
  199. package/testing/puppeteer/index.d.ts +2 -0
  200. package/{dist/testing → testing}/puppeteer/puppeteer-browser.d.ts +3 -3
  201. package/{dist/testing → testing}/puppeteer/puppeteer-declarations.d.ts +18 -18
  202. package/{dist/testing → testing}/puppeteer/puppeteer-element.d.ts +7 -5
  203. package/testing/puppeteer/puppeteer-emulate.d.ts +2 -0
  204. package/{dist/testing → testing}/puppeteer/puppeteer-events.d.ts +9 -9
  205. package/testing/puppeteer/puppeteer-page.d.ts +2 -0
  206. package/testing/puppeteer/puppeteer-screenshot.d.ts +4 -0
  207. package/testing/reset-build-conditionals.d.ts +2 -0
  208. package/testing/spec-page.d.ts +2 -0
  209. package/testing/test-transpile.d.ts +2 -0
  210. package/{dist/testing → testing}/testing-logger.d.ts +10 -8
  211. package/testing/testing-sys.d.ts +1 -0
  212. package/{dist/testing → testing}/testing-utils.d.ts +3 -2
  213. package/testing/testing.d.ts +2 -0
  214. package/build-conditionals/index.d.ts +0 -2
  215. package/build-conditionals/index.mjs +0 -66
  216. package/build-conditionals/package.json +0 -6
  217. package/compiler/index.js +0 -2
  218. package/dist/cli/index.js +0 -6068
  219. package/dist/client/css-shim-14a9812e.js +0 -656
  220. package/dist/client/css-shim-69821662.js +0 -658
  221. package/dist/client/declarations/rindo.core.d.ts +0 -1347
  222. package/dist/client/dom-68c8fe31.js +0 -139
  223. package/dist/client/dom-af01458a.js +0 -137
  224. package/dist/client/index.js +0 -2937
  225. package/dist/client/polyfills/core-js.js +0 -10
  226. package/dist/client/polyfills/css-shim.js +0 -656
  227. package/dist/client/polyfills/dom.js +0 -146
  228. package/dist/client/polyfills/es5-html-element.js +0 -18
  229. package/dist/client/polyfills/index.js +0 -35
  230. package/dist/client/polyfills/promise.js +0 -9
  231. package/dist/client/polyfills/system.js +0 -6
  232. package/dist/client/shadow-css-6ef31c68.js +0 -386
  233. package/dist/client/shadow-css-8fd1a9e4.js +0 -388
  234. package/dist/compiler/app-core/app-es5-disabled.d.ts +0 -2
  235. package/dist/compiler/app-core/app-polyfills.d.ts +0 -3
  236. package/dist/compiler/app-core/build-conditionals.d.ts +0 -6
  237. package/dist/compiler/app-core/bundle-app-core.d.ts +0 -6
  238. package/dist/compiler/app-core/component-styles.d.ts +0 -4
  239. package/dist/compiler/app-core/format-component-runtime-meta.d.ts +0 -4
  240. package/dist/compiler/app-core/optimize-module.d.ts +0 -7
  241. package/dist/compiler/browser/build-conditionals-client.d.ts +0 -3
  242. package/dist/compiler/browser/compile-options.d.ts +0 -12
  243. package/dist/compiler/browser/compile.d.ts +0 -2
  244. package/dist/compiler/browser/create-compiler.d.ts +0 -14
  245. package/dist/compiler/browser/index.d.ts +0 -11
  246. package/dist/compiler/build/build-ctx.d.ts +0 -74
  247. package/dist/compiler/build/build-finish.d.ts +0 -3
  248. package/dist/compiler/build/build-hmr.d.ts +0 -2
  249. package/dist/compiler/build/build-results.d.ts +0 -2
  250. package/dist/compiler/build/build-stats.d.ts +0 -3
  251. package/dist/compiler/build/build.d.ts +0 -2
  252. package/dist/compiler/build/cache-stats.d.ts +0 -4
  253. package/dist/compiler/build/compiler-build-id.d.ts +0 -6
  254. package/dist/compiler/build/compiler-ctx.d.ts +0 -44
  255. package/dist/compiler/build/init-index-html.d.ts +0 -2
  256. package/dist/compiler/build/validate-files.d.ts +0 -2
  257. package/dist/compiler/build/write-build.d.ts +0 -2
  258. package/dist/compiler/cache.d.ts +0 -22
  259. package/dist/compiler/compiler.d.ts +0 -27
  260. package/dist/compiler/component-hydrate/bundle-hydrate-factory.d.ts +0 -3
  261. package/dist/compiler/component-hydrate/generate-hydrate-app.d.ts +0 -2
  262. package/dist/compiler/component-hydrate/hydrate-factory-closure.d.ts +0 -2
  263. package/dist/compiler/component-hydrate/update-to-hydrate-components.d.ts +0 -2
  264. package/dist/compiler/component-hydrate/write-hydrate-outputs.d.ts +0 -3
  265. package/dist/compiler/component-lazy/generate-cjs.d.ts +0 -3
  266. package/dist/compiler/component-lazy/generate-esm-browser.d.ts +0 -3
  267. package/dist/compiler/component-lazy/generate-esm.d.ts +0 -3
  268. package/dist/compiler/component-lazy/generate-lazy-app.d.ts +0 -3
  269. package/dist/compiler/component-lazy/generate-lazy-module.d.ts +0 -4
  270. package/dist/compiler/component-lazy/generate-system.d.ts +0 -3
  271. package/dist/compiler/component-lazy/update-to-lazy-component.d.ts +0 -2
  272. package/dist/compiler/component-lazy/write-lazy-entry-module.d.ts +0 -2
  273. package/dist/compiler/component-native/update-to-native-component.d.ts +0 -2
  274. package/dist/compiler/config/config-reload.d.ts +0 -3
  275. package/dist/compiler/config/config-utils.d.ts +0 -4
  276. package/dist/compiler/config/validate-config.d.ts +0 -4
  277. package/dist/compiler/config/validate-copy.d.ts +0 -2
  278. package/dist/compiler/config/validate-dev-server.d.ts +0 -2
  279. package/dist/compiler/config/validate-docs.d.ts +0 -2
  280. package/dist/compiler/config/validate-namespace.d.ts +0 -3
  281. package/dist/compiler/config/validate-output-stats.d.ts +0 -2
  282. package/dist/compiler/config/validate-outputs-angular.d.ts +0 -2
  283. package/dist/compiler/config/validate-outputs-custom.d.ts +0 -2
  284. package/dist/compiler/config/validate-outputs-dist-module.d.ts +0 -2
  285. package/dist/compiler/config/validate-outputs-dist.d.ts +0 -2
  286. package/dist/compiler/config/validate-outputs-hydrate-script.d.ts +0 -2
  287. package/dist/compiler/config/validate-outputs-www.d.ts +0 -2
  288. package/dist/compiler/config/validate-outputs.d.ts +0 -2
  289. package/dist/compiler/config/validate-paths.d.ts +0 -2
  290. package/dist/compiler/config/validate-plugins.d.ts +0 -2
  291. package/dist/compiler/config/validate-prerender.d.ts +0 -2
  292. package/dist/compiler/config/validate-rollup-config.d.ts +0 -2
  293. package/dist/compiler/config/validate-service-worker.d.ts +0 -2
  294. package/dist/compiler/config/validate-testing.d.ts +0 -2
  295. package/dist/compiler/config/validate-workers.d.ts +0 -2
  296. package/dist/compiler/copy/assets-copy-tasks.d.ts +0 -3
  297. package/dist/compiler/copy/hashed-copy.d.ts +0 -2
  298. package/dist/compiler/copy/local-copy-tasks.d.ts +0 -3
  299. package/dist/compiler/docs/constants.d.ts +0 -2
  300. package/dist/compiler/docs/custom/index.d.ts +0 -2
  301. package/dist/compiler/docs/docs.d.ts +0 -2
  302. package/dist/compiler/docs/generate-doc-data.d.ts +0 -3
  303. package/dist/compiler/docs/json/index.d.ts +0 -3
  304. package/dist/compiler/docs/readme/docs-util.d.ts +0 -13
  305. package/dist/compiler/docs/readme/index.d.ts +0 -3
  306. package/dist/compiler/docs/readme/markdown-css-props.d.ts +0 -2
  307. package/dist/compiler/docs/readme/markdown-dependencies.d.ts +0 -2
  308. package/dist/compiler/docs/readme/markdown-events.d.ts +0 -2
  309. package/dist/compiler/docs/readme/markdown-methods.d.ts +0 -2
  310. package/dist/compiler/docs/readme/markdown-props.d.ts +0 -2
  311. package/dist/compiler/docs/readme/markdown-slots.d.ts +0 -2
  312. package/dist/compiler/docs/readme/markdown-usage.d.ts +0 -6
  313. package/dist/compiler/docs/readme/output-docs.d.ts +0 -3
  314. package/dist/compiler/docs/style-docs.d.ts +0 -2
  315. package/dist/compiler/docs/vscode/index.d.ts +0 -2
  316. package/dist/compiler/entries/component-bundles.d.ts +0 -3
  317. package/dist/compiler/entries/component-graph.d.ts +0 -2
  318. package/dist/compiler/entries/default-bundles.d.ts +0 -3
  319. package/dist/compiler/entries/entry-modules.d.ts +0 -6
  320. package/dist/compiler/entries/resolve-component-dependencies.d.ts +0 -2
  321. package/dist/compiler/events.d.ts +0 -15
  322. package/dist/compiler/fs-watch/fs-watch-init.d.ts +0 -2
  323. package/dist/compiler/fs-watch/fs-watch-log.d.ts +0 -2
  324. package/dist/compiler/fs-watch/fs-watch-rebuild.d.ts +0 -7
  325. package/dist/compiler/html/inject-module-preloads.d.ts +0 -3
  326. package/dist/compiler/html/inject-sw-script.d.ts +0 -4
  327. package/dist/compiler/html/inline-esm-import.d.ts +0 -2
  328. package/dist/compiler/html/inline-style-sheets.d.ts +0 -2
  329. package/dist/compiler/html/update-global-styles-link.d.ts +0 -2
  330. package/dist/compiler/html/used-components.d.ts +0 -2
  331. package/dist/compiler/html/utils.d.ts +0 -2
  332. package/dist/compiler/html/validate-manifest-json.d.ts +0 -2
  333. package/dist/compiler/index.d.ts +0 -10
  334. package/dist/compiler/index.js +0 -18008
  335. package/dist/compiler/output-targets/empty-dir.d.ts +0 -6
  336. package/dist/compiler/output-targets/index.d.ts +0 -2
  337. package/dist/compiler/output-targets/output-angular.d.ts +0 -4
  338. package/dist/compiler/output-targets/output-app.d.ts +0 -4
  339. package/dist/compiler/output-targets/output-collection.d.ts +0 -3
  340. package/dist/compiler/output-targets/output-copy.d.ts +0 -2
  341. package/dist/compiler/output-targets/output-custom.d.ts +0 -2
  342. package/dist/compiler/output-targets/output-docs.d.ts +0 -2
  343. package/dist/compiler/output-targets/output-hydrate.d.ts +0 -2
  344. package/dist/compiler/output-targets/output-lazy-loader.d.ts +0 -2
  345. package/dist/compiler/output-targets/output-module.d.ts +0 -4
  346. package/dist/compiler/output-targets/output-prerender.d.ts +0 -2
  347. package/dist/compiler/output-targets/output-service-workers.d.ts +0 -2
  348. package/dist/compiler/output-targets/output-types.d.ts +0 -2
  349. package/dist/compiler/output-targets/output-utils.d.ts +0 -54
  350. package/dist/compiler/output-targets/output-www.d.ts +0 -2
  351. package/dist/compiler/plugin/plugin.d.ts +0 -6
  352. package/dist/compiler/prerender/crawl-urls.d.ts +0 -3
  353. package/dist/compiler/prerender/host-config.d.ts +0 -12
  354. package/dist/compiler/prerender/prerender-config.d.ts +0 -2
  355. package/dist/compiler/prerender/prerender-main.d.ts +0 -2
  356. package/dist/compiler/prerender/prerender-queue.d.ts +0 -3
  357. package/dist/compiler/prerender/prerender-template-html.d.ts +0 -2
  358. package/dist/compiler/prerender/prerendered-write-path.d.ts +0 -2
  359. package/dist/compiler/prerender/robots-txt.d.ts +0 -2
  360. package/dist/compiler/prerender/sitemap-xml.d.ts +0 -3
  361. package/dist/compiler/rollup-plugins/component-entry.d.ts +0 -3
  362. package/dist/compiler/rollup-plugins/css-transformer.d.ts +0 -3
  363. package/dist/compiler/rollup-plugins/global-scripts.d.ts +0 -4
  364. package/dist/compiler/rollup-plugins/image-plugin.d.ts +0 -3
  365. package/dist/compiler/rollup-plugins/in-memory-fs-read.d.ts +0 -3
  366. package/dist/compiler/rollup-plugins/loader.d.ts +0 -4
  367. package/dist/compiler/rollup-plugins/plugin-helper.d.ts +0 -5
  368. package/dist/compiler/rollup-plugins/rindo-build-conditionals.d.ts +0 -7
  369. package/dist/compiler/rollup-plugins/rindo-client.d.ts +0 -3
  370. package/dist/compiler/rollup-plugins/rindo-external-runtime.d.ts +0 -2
  371. package/dist/compiler/rollup-plugins/rindo-hydrate.d.ts +0 -3
  372. package/dist/compiler/rollup-plugins/rindo-public-plugin.d.ts +0 -2
  373. package/dist/compiler/service-worker/generate-sw.d.ts +0 -7
  374. package/dist/compiler/service-worker/service-worker-util.d.ts +0 -2
  375. package/dist/compiler/style/cached-styles.d.ts +0 -5
  376. package/dist/compiler/style/component-styles.d.ts +0 -2
  377. package/dist/compiler/style/css-imports.d.ts +0 -9
  378. package/dist/compiler/style/css-to-esm.d.ts +0 -5
  379. package/dist/compiler/style/generate-styles.d.ts +0 -2
  380. package/dist/compiler/style/global-styles.d.ts +0 -3
  381. package/dist/compiler/style/normalize-styles.d.ts +0 -2
  382. package/dist/compiler/style/optimize-css.d.ts +0 -2
  383. package/dist/compiler/style/scope-css.d.ts +0 -3
  384. package/dist/compiler/style/style-utils.d.ts +0 -10
  385. package/dist/compiler/transformers/add-component-meta-proxy.d.ts +0 -3
  386. package/dist/compiler/transformers/add-component-meta-static.d.ts +0 -4
  387. package/dist/compiler/transformers/add-imports.d.ts +0 -3
  388. package/dist/compiler/transformers/collections/add-external-import.d.ts +0 -2
  389. package/dist/compiler/transformers/collections/parse-collection-components.d.ts +0 -2
  390. package/dist/compiler/transformers/collections/parse-collection-deprecated.d.ts +0 -2
  391. package/dist/compiler/transformers/collections/parse-collection-manifest.d.ts +0 -7
  392. package/dist/compiler/transformers/collections/parse-collection-module.d.ts +0 -2
  393. package/dist/compiler/transformers/component-build-conditionals.d.ts +0 -2
  394. package/dist/compiler/transformers/component-hydrate/hydrate-component.d.ts +0 -3
  395. package/dist/compiler/transformers/component-hydrate/hydrate-runtime-cmp-meta.d.ts +0 -3
  396. package/dist/compiler/transformers/component-hydrate/tranform-to-hydrate-component.d.ts +0 -2
  397. package/dist/compiler/transformers/component-lazy/lazy-component.d.ts +0 -3
  398. package/dist/compiler/transformers/component-lazy/lazy-constructor.d.ts +0 -3
  399. package/dist/compiler/transformers/component-lazy/lazy-element-getter.d.ts +0 -3
  400. package/dist/compiler/transformers/component-lazy/transform-lazy-component.d.ts +0 -4
  401. package/dist/compiler/transformers/component-native/native-component.d.ts +0 -3
  402. package/dist/compiler/transformers/component-native/native-connected-callback.d.ts +0 -3
  403. package/dist/compiler/transformers/component-native/native-constructor.d.ts +0 -3
  404. package/dist/compiler/transformers/component-native/native-element-getter.d.ts +0 -3
  405. package/dist/compiler/transformers/component-native/native-static-style.d.ts +0 -3
  406. package/dist/compiler/transformers/component-native/tranform-to-native-component.d.ts +0 -4
  407. package/dist/compiler/transformers/core-runtime-apis.d.ts +0 -30
  408. package/dist/compiler/transformers/create-event.d.ts +0 -3
  409. package/dist/compiler/transformers/decorators-to-static/component-decorator.d.ts +0 -3
  410. package/dist/compiler/transformers/decorators-to-static/convert-decorators.d.ts +0 -3
  411. package/dist/compiler/transformers/decorators-to-static/decorator-utils.d.ts +0 -10
  412. package/dist/compiler/transformers/decorators-to-static/element-decorator.d.ts +0 -3
  413. package/dist/compiler/transformers/decorators-to-static/event-decorator.d.ts +0 -4
  414. package/dist/compiler/transformers/decorators-to-static/listen-decorator.d.ts +0 -6
  415. package/dist/compiler/transformers/decorators-to-static/method-decorator.d.ts +0 -3
  416. package/dist/compiler/transformers/decorators-to-static/prop-decorator.d.ts +0 -4
  417. package/dist/compiler/transformers/decorators-to-static/state-decorator.d.ts +0 -3
  418. package/dist/compiler/transformers/decorators-to-static/style-to-static.d.ts +0 -3
  419. package/dist/compiler/transformers/decorators-to-static/watch-decorator.d.ts +0 -3
  420. package/dist/compiler/transformers/define-custom-element.d.ts +0 -3
  421. package/dist/compiler/transformers/host-data-transform.d.ts +0 -3
  422. package/dist/compiler/transformers/legacy-props.d.ts +0 -3
  423. package/dist/compiler/transformers/remove-static-meta-properties.d.ts +0 -2
  424. package/dist/compiler/transformers/reserved-public-members.d.ts +0 -3
  425. package/dist/compiler/transformers/rindo-import-path.d.ts +0 -3
  426. package/dist/compiler/transformers/static-to-meta/call-expression.d.ts +0 -3
  427. package/dist/compiler/transformers/static-to-meta/class-methods.d.ts +0 -3
  428. package/dist/compiler/transformers/static-to-meta/component.d.ts +0 -3
  429. package/dist/compiler/transformers/static-to-meta/element-ref.d.ts +0 -2
  430. package/dist/compiler/transformers/static-to-meta/encapsulation.d.ts +0 -3
  431. package/dist/compiler/transformers/static-to-meta/events.d.ts +0 -3
  432. package/dist/compiler/transformers/static-to-meta/import.d.ts +0 -3
  433. package/dist/compiler/transformers/static-to-meta/listeners.d.ts +0 -3
  434. package/dist/compiler/transformers/static-to-meta/methods.d.ts +0 -3
  435. package/dist/compiler/transformers/static-to-meta/props.d.ts +0 -3
  436. package/dist/compiler/transformers/static-to-meta/states.d.ts +0 -3
  437. package/dist/compiler/transformers/static-to-meta/string-literal.d.ts +0 -3
  438. package/dist/compiler/transformers/static-to-meta/styles.d.ts +0 -3
  439. package/dist/compiler/transformers/static-to-meta/vdom.d.ts +0 -3
  440. package/dist/compiler/transformers/static-to-meta/visitor.d.ts +0 -3
  441. package/dist/compiler/transformers/static-to-meta/watchers.d.ts +0 -3
  442. package/dist/compiler/transformers/style-imports.d.ts +0 -3
  443. package/dist/compiler/transformers/transform-utils.d.ts +0 -31
  444. package/dist/compiler/transformers/update-component-class.d.ts +0 -3
  445. package/dist/compiler/transformers/update-rindo-core-import.d.ts +0 -3
  446. package/dist/compiler/transformers/watcher-meta-transform.d.ts +0 -3
  447. package/dist/compiler/transpile/compiler-options.d.ts +0 -4
  448. package/dist/compiler/transpile/transpile-app.d.ts +0 -2
  449. package/dist/compiler/transpile/transpile-module.d.ts +0 -5
  450. package/dist/compiler/transpile/transpile-service.d.ts +0 -3
  451. package/dist/compiler/transpile/transpile-to-es5-main.d.ts +0 -2
  452. package/dist/compiler/transpile/validate-types-main.d.ts +0 -2
  453. package/dist/compiler/types/generate-app-types.d.ts +0 -2
  454. package/dist/compiler/types/generate-component-types.d.ts +0 -8
  455. package/dist/compiler/types/generate-event-types.d.ts +0 -2
  456. package/dist/compiler/types/generate-method-types.d.ts +0 -2
  457. package/dist/compiler/types/generate-prop-types.d.ts +0 -2
  458. package/dist/compiler/types/generate-types.d.ts +0 -2
  459. package/dist/compiler/types/rindo-types.d.ts +0 -3
  460. package/dist/compiler/types/types-utils.d.ts +0 -4
  461. package/dist/compiler/types/update-import-refs.d.ts +0 -11
  462. package/dist/compiler/types/validate-package-json.d.ts +0 -9
  463. package/dist/declarations/assets.d.ts +0 -17
  464. package/dist/declarations/browser-compile.d.ts +0 -47
  465. package/dist/declarations/build-conditionals.d.ts +0 -91
  466. package/dist/declarations/build-events.d.ts +0 -19
  467. package/dist/declarations/build.d.ts +0 -247
  468. package/dist/declarations/cache.d.ts +0 -11
  469. package/dist/declarations/collection-manifest.d.ts +0 -106
  470. package/dist/declarations/collection.d.ts +0 -139
  471. package/dist/declarations/compiler.d.ts +0 -53
  472. package/dist/declarations/component-compiler-meta.d.ts +0 -198
  473. package/dist/declarations/component-constructor.d.ts +0 -61
  474. package/dist/declarations/component-interfaces.d.ts +0 -123
  475. package/dist/declarations/config.d.ts +0 -409
  476. package/dist/declarations/css-var-shim.d.ts +0 -9
  477. package/dist/declarations/decorators.d.ts +0 -150
  478. package/dist/declarations/dev-server.d.ts +0 -135
  479. package/dist/declarations/diagnostics.d.ts +0 -21
  480. package/dist/declarations/entry.d.ts +0 -28
  481. package/dist/declarations/events.d.ts +0 -13
  482. package/dist/declarations/file-system.d.ts +0 -91
  483. package/dist/declarations/fs-watch.d.ts +0 -15
  484. package/dist/declarations/host-element.d.ts +0 -53
  485. package/dist/declarations/hydrate.d.ts +0 -99
  486. package/dist/declarations/in-memory-fs.d.ts +0 -59
  487. package/dist/declarations/index.d.ts +0 -45
  488. package/dist/declarations/jsdoc.d.ts +0 -16
  489. package/dist/declarations/jsx.d.ts +0 -1050
  490. package/dist/declarations/logger.d.ts +0 -25
  491. package/dist/declarations/minify-js.d.ts +0 -11
  492. package/dist/declarations/module.d.ts +0 -35
  493. package/dist/declarations/optimize-css.d.ts +0 -12
  494. package/dist/declarations/output-targets.d.ts +0 -189
  495. package/dist/declarations/plugin.d.ts +0 -23
  496. package/dist/declarations/prerender.d.ts +0 -79
  497. package/dist/declarations/render.d.ts +0 -62
  498. package/dist/declarations/runtime.d.ts +0 -92
  499. package/dist/declarations/screenshots.d.ts +0 -192
  500. package/dist/declarations/server.d.ts +0 -19
  501. package/dist/declarations/style.d.ts +0 -35
  502. package/dist/declarations/system.d.ts +0 -174
  503. package/dist/declarations/testing.d.ts +0 -523
  504. package/dist/declarations/transpile.d.ts +0 -24
  505. package/dist/declarations/types.d.ts +0 -24
  506. package/dist/declarations/vdom.d.ts +0 -55
  507. package/dist/declarations/worker.d.ts +0 -33
  508. package/dist/dev-server/content-type-db.json +0 -1
  509. package/dist/dev-server/index.js +0 -887
  510. package/dist/dev-server/static/app-error.css +0 -257
  511. package/dist/dev-server/static/dev-server-client.html +0 -13
  512. package/dist/hydrate/index.d.ts +0 -101
  513. package/dist/hydrate/index.mjs +0 -1281
  514. package/dist/hydrate/platform.mjs +0 -347
  515. package/dist/index.d.ts +0 -99
  516. package/dist/index.js +0 -1
  517. package/dist/mock-doc/index.d.ts +0 -851
  518. package/dist/mock-doc/index.js +0 -3982
  519. package/dist/mock-doc/index.mjs +0 -3954
  520. package/dist/runtime/index.js +0 -2576
  521. package/dist/runtime/index.mjs +0 -2521
  522. package/dist/runtime/shadow-css-6ef31c68.js +0 -386
  523. package/dist/runtime/shadow-css-8fd1a9e4.js +0 -388
  524. package/dist/screenshot/index.js +0 -520
  525. package/dist/sys/node/graceful-fs.js +0 -975
  526. package/dist/sys/node/index.js +0 -33545
  527. package/dist/sys/node/node-fetch.js +0 -1779
  528. package/dist/sys/node/open-in-editor.js +0 -734
  529. package/dist/sys/node/sys-worker.js +0 -67035
  530. package/dist/sys/node/websocket.js +0 -3728
  531. package/dist/testing/build-conditionals.d.ts +0 -4
  532. package/dist/testing/build-conditionals.js +0 -43
  533. package/dist/testing/core.d.ts +0 -35
  534. package/dist/testing/core.js +0 -52
  535. package/dist/testing/index.js +0 -40511
  536. package/dist/testing/jest/jest-config.d.ts +0 -4
  537. package/dist/testing/mock-fetch.d.ts +0 -46
  538. package/dist/testing/mocks.d.ts +0 -12
  539. package/dist/testing/platform.d.ts +0 -23
  540. package/dist/testing/platform.js +0 -321
  541. package/dist/testing/puppeteer/puppeteer-emulate.d.ts +0 -2
  542. package/dist/testing/puppeteer/puppeteer-find.d.ts +0 -5
  543. package/dist/testing/puppeteer/puppeteer-page.d.ts +0 -2
  544. package/dist/testing/puppeteer/puppeteer-screenshot.d.ts +0 -4
  545. package/dist/testing/spec-page.d.ts +0 -5
  546. package/dist/testing/task-queue.d.ts +0 -15
  547. package/dist/testing/test-transpile.d.ts +0 -5
  548. package/dist/testing/testing-fs.d.ts +0 -31
  549. package/dist/testing/testing-sys.d.ts +0 -19
  550. package/dist/testing/testing.d.ts +0 -12
  551. package/dist/utils/index.js +0 -1575
  552. package/dist/utils/index.mjs +0 -1511
  553. package/internal/client/css-shim.rindo-client.mjs +0 -656
  554. package/internal/client/index.mjs +0 -2859
  555. package/internal/client/polyfills/promise.js +0 -9
  556. package/internal/images.d.ts +0 -5
  557. package/runtime/package.json +0 -5
  558. package/screenshot/compare/build/p-020f8d73.js +0 -1
  559. package/screenshot/compare/build/p-09qdknbg.system.entry.js +0 -1
  560. package/screenshot/compare/build/p-0a13mpsc.system.entry.js +0 -1
  561. package/screenshot/compare/build/p-168ec2c4.system.js +0 -1
  562. package/screenshot/compare/build/p-2ab1fdf1.system.js +0 -1
  563. package/screenshot/compare/build/p-2pxcsgrj.entry.js +0 -1
  564. package/screenshot/compare/build/p-42fb7034.system.js +0 -1
  565. package/screenshot/compare/build/p-54d9d7c2.system.js +0 -1
  566. package/screenshot/compare/build/p-67c1f911.js +0 -1
  567. package/screenshot/compare/build/p-68613371.system.js +0 -1
  568. package/screenshot/compare/build/p-7dvsjpu0.entry.js +0 -1
  569. package/screenshot/compare/build/p-aa67fb06.js +0 -1
  570. package/screenshot/compare/build/p-aeb3cec1.system.js +0 -1
  571. package/screenshot/compare/build/p-b6e44a24.js +0 -1
  572. package/screenshot/compare/build/p-c1c25b8a.js +0 -1
  573. package/screenshot/compare/build/p-c9bopbjy.system.entry.js +0 -1
  574. package/screenshot/compare/build/p-c9iqz1pp.system.entry.js +0 -1
  575. package/screenshot/compare/build/p-dizjz8rg.entry.js +0 -1
  576. package/screenshot/compare/build/p-dnta0rwp.system.entry.js +0 -1
  577. package/screenshot/compare/build/p-e9670d22.system.js +0 -1
  578. package/screenshot/compare/build/p-ei9jkpd0.system.entry.js +0 -1
  579. package/screenshot/compare/build/p-ejwcppol.entry.js +0 -1
  580. package/screenshot/compare/build/p-f6612d5d.system.js +0 -1
  581. package/screenshot/compare/build/p-foiivsfc.css +0 -1
  582. package/screenshot/compare/build/p-gpjjyogx.entry.js +0 -1
  583. package/screenshot/compare/build/p-howklem2.system.entry.js +0 -1
  584. package/screenshot/compare/build/p-knv9wvoc.entry.js +0 -1
  585. package/screenshot/compare/build/p-nsqsfhhy.entry.js +0 -1
  586. package/screenshot/compare/build/p-ojt278pp.entry.js +0 -1
  587. package/screenshot/compare/build/p-oywass99.entry.js +0 -1
  588. package/screenshot/compare/build/p-q3ujhub6.entry.js +0 -1
  589. package/screenshot/compare/build/p-qw4xnmxv.entry.js +0 -1
  590. package/screenshot/compare/build/p-t1wvevhc.system.entry.js +0 -1
  591. package/screenshot/compare/build/p-tnjarrex.system.entry.js +0 -1
  592. package/screenshot/compare/build/p-vhfpd6kk.system.entry.js +0 -1
  593. package/screenshot/compare/build/p-vk6rhemd.system.entry.js +0 -1
  594. package/screenshot/compare/build/p-w6bnm16k.entry.js +0 -1
  595. package/screenshot/compare/build/p-xje6d7zl.system.entry.js +0 -1
  596. package/screenshot/compare/build/p-y5jlrcha.system.entry.js +0 -1
  597. package/screenshot/compare/build/p-yh170wkt.entry.js +0 -1
  598. package/testing/jest.preprocessor.js +0 -7
  599. /package/{dist/dev-server → dev-server}/static/favicon.ico +0 -0
  600. /package/{dist/sys/node → dev-server}/visualstudio.vbs +0 -0
  601. /package/{dist/sys/node → dev-server}/xdg-open +0 -0
  602. /package/{dist/compiler/polyfills.d.ts → screenshot/compare/build/index.esm.js} +0 -0
  603. /package/{dist/screenshot → screenshot}/pixel-match.d.ts +0 -0
  604. /package/{dist/testing → testing}/jest/jest-setup-test-framework.d.ts +0 -0
  605. /package/{dist/testing → testing}/matchers/attributes.d.ts +0 -0
  606. /package/{dist/testing → testing}/matchers/class-list.d.ts +0 -0
  607. /package/{dist/testing → testing}/matchers/html.d.ts +0 -0
  608. /package/{dist/testing → testing}/matchers/text.d.ts +0 -0
@@ -0,0 +1,2170 @@
1
+ import type { JsonDocs } from './rindo-public-docs';
2
+ import type { PrerenderUrlResults } from '../internal';
3
+ export * from './rindo-public-docs';
4
+ /**
5
+ * https://rindojs.web.app/docs/config/
6
+ */
7
+ export interface RindoConfig {
8
+ /**
9
+ * By default, Rindo will attempt to optimize small scripts by inlining them in HTML. Setting
10
+ * this flag to `false` will prevent this optimization and keep all scripts separate from HTML.
11
+ */
12
+ allowInlineScripts?: boolean;
13
+ /**
14
+ * By setting `autoprefixCss` to `true`, Rindo will use the appropriate config to automatically
15
+ * prefix css. For example, developers can write modern and standard css properties, such as
16
+ * "transform", and Rindo will automatically add in the prefixed version, such as "-webkit-transform".
17
+ * As of Rindo v2, autoprefixing CSS is no longer the default.
18
+ * Defaults to `false`
19
+ */
20
+ autoprefixCss?: boolean | any;
21
+ /**
22
+ * By default, Rindo will statically analyze the application and generate a component graph of
23
+ * how all the components are interconnected.
24
+ *
25
+ * From the component graph it is able to best decide how components should be grouped
26
+ * depending on their usage with one another within the app.
27
+ * By doing so it's able to bundle components together in order to reduce network requests.
28
+ * However, bundles can be manually generated using the bundles config.
29
+ *
30
+ * The bundles config is an array of objects that represent how components are grouped together
31
+ * in lazy-loaded bundles.
32
+ * This config is rarely needed as Rindo handles this automatically behind the scenes.
33
+ */
34
+ bundles?: ConfigBundle[];
35
+ /**
36
+ * Rindo will cache build results in order to speed up rebuilds.
37
+ * To disable this feature, set enableCache to false.
38
+ */
39
+ enableCache?: boolean;
40
+ /**
41
+ * Rindo is traditionally used to compile many components into an app,
42
+ * and each component comes with its own compartmentalized styles.
43
+ * However, it's still common to have styles which should be "global" across all components and the website.
44
+ * A global CSS file is often useful to set CSS Variables.
45
+ *
46
+ * Additonally, the globalStyle config is can be used to precompile styles with Sass, PostCss, etc.
47
+ * Below is an example folder structure containing a webapp's global sass file, named app.css.
48
+ */
49
+ globalStyle?: string;
50
+ /**
51
+ * When the hashFileNames config is set to true, and it is a production build,
52
+ * the hashedFileNameLength config is used to determine how many characters the file name's hash should be.
53
+ */
54
+ hashedFileNameLength?: number;
55
+ /**
56
+ * During production builds, the content of each generated file is hashed to represent the content,
57
+ * and the hashed value is used as the filename. If the content isn't updated between builds,
58
+ * then it receives the same filename. When the content is updated, then the filename is different.
59
+ *
60
+ * By doing this, deployed apps can "forever-cache" the build directory and take full advantage of
61
+ * content delivery networks (CDNs) and heavily caching files for faster apps.
62
+ */
63
+ hashFileNames?: boolean;
64
+ /**
65
+ * The namespace config is a string representing a namespace for the app.
66
+ * For apps that are not meant to be a library of reusable components,
67
+ * the default of App is just fine. However, if the app is meant to be consumed
68
+ * as a third-party library, such as Family, a unique namespace is required.
69
+ */
70
+ namespace?: string;
71
+ /**
72
+ * Rindo is able to take an app's source and compile it to numerous targets,
73
+ * such as an app to be deployed on an http server, or as a third-party library
74
+ * to be distributed on npm. By default, Rindo apps have an output target type of www.
75
+ *
76
+ * The outputTargets config is an array of objects, with types of www and dist.
77
+ */
78
+ outputTargets?: OutputTarget[];
79
+ /**
80
+ * The plugins config can be used to add your own rollup plugins.
81
+ * By default, Rindo does not come with Sass or PostCss support.
82
+ * However, either can be added using the plugin array.
83
+ */
84
+ plugins?: any[];
85
+ /**
86
+ * The srcDir config specifies the directory which should contain the source typescript files
87
+ * for each component. The standard for Rindo apps is to use src, which is the default.
88
+ */
89
+ srcDir?: string;
90
+ /**
91
+ * Passes custom configuration down to the "@rollup/plugin-commonjs" that Rindo uses under the hood.
92
+ * For further information: https://rindojs.web.app/docs/module-bundling
93
+ */
94
+ commonjs?: BundlingConfig;
95
+ /**
96
+ * Passes custom configuration down to the "@rollup/plugin-node-resolve" that Rindo uses under the hood.
97
+ * For further information: https://rindojs.web.app/docs/module-bundling
98
+ */
99
+ nodeResolve?: NodeResolveConfig;
100
+ /**
101
+ * Passes custom configuration down to rollup itself, not all rollup options can be overriden.
102
+ */
103
+ rollupConfig?: RollupConfig;
104
+ /**
105
+ * Sets if the ES5 build should be generated or not. Rindo generates a modern build without ES5,
106
+ * whereas this setting to `true` will also create es5 builds for both dev and prod modes. Setting
107
+ * `buildEs5` to `prod` will only build ES5 in prod mode. Basically if the app does not need to run
108
+ * on legacy browsers (IE11 and Edge 18 and below), it's safe to not build ES5, which will also speed
109
+ * up build times. Defaults to `false`.
110
+ */
111
+ buildEs5?: boolean | 'prod';
112
+ /**
113
+ * Sets if the JS browser files are minified or not. Rindo uses `terser` under the hood.
114
+ * Defaults to `false` in dev mode and `true` in production mode.
115
+ */
116
+ minifyJs?: boolean;
117
+ /**
118
+ * Sets if the CSS is minified or not.
119
+ * Defaults to `false` in dev mode and `true` in production mode.
120
+ */
121
+ minifyCss?: boolean;
122
+ /**
123
+ * Forces Rindo to run in `dev` mode if the value is `true` and `production` mode
124
+ * if it's `false`.
125
+ *
126
+ * Defaults to `false` (ie. production) unless the `--dev` flag is used in the CLI.
127
+ */
128
+ devMode?: boolean;
129
+ /**
130
+ * Object to provide a custom logger. By default a `logger` is already provided for the
131
+ * platform the compiler is running on, such as NodeJS or a browser.
132
+ */
133
+ logger?: Logger;
134
+ /**
135
+ * Config to add extra runtime for DOM features that require more polyfills. Note
136
+ * that not all DOM APIs are fully polyfilled when using the slot polyfill. These
137
+ * are opt-in since not all users will require the additional runtime.
138
+ */
139
+ extras?: ConfigExtras;
140
+ /**
141
+ * The hydrated flag identifies if a component and all of its child components
142
+ * have finished hydrating. This helps prevent any flash of unstyled content (FOUC)
143
+ * as various components are asynchronously downloaded and rendered. By default it
144
+ * will add the `hydrated` CSS class to the element. The `hydratedFlag` confg can be used
145
+ * to change the name of the CSS class, change it to an attribute, or change which
146
+ * type of CSS properties and values are assigned before and after hydrating. This config
147
+ * can also be used to not include the hydrated flag at all by setting it to `null`.
148
+ */
149
+ hydratedFlag?: HydratedFlag;
150
+ /**
151
+ * Sets the task queue used by rindo's runtime. The task queue schedules DOM read and writes
152
+ * across the frames to efficiently render and reduce layout thrashing. By default,
153
+ * `async` is used. It's recommended to also try each setting to decide which works
154
+ * best for your use-case. In all cases, if your app has many CPU intensive tasks causing the
155
+ * main thread to periodically lock-up, it's always recommended to try
156
+ * [Web Workers](https://rindojs.web.app/docs/web-workers) for those tasks.
157
+ *
158
+ * - `async`: DOM read and writes are scheduled in the next frame to prevent layout thrashing.
159
+ * During intensive CPU tasks it will not reschedule rendering to happen in the next frame.
160
+ * `async` is ideal for most apps, and if the app has many intensive tasks causing the main
161
+ * thread to lock-up, it's recommended to try [Web Workers](https://rindojs.web.app/docs/web-workers)
162
+ * rather than the congestion async queue.
163
+ *
164
+ * - `congestionAsync`: DOM reads and writes are scheduled in the next frame to prevent layout
165
+ * thrashing. When the app is heavily tasked and the queue becomes congested it will then
166
+ * split the work across multiple frames to prevent blocking the main thread. However, it can
167
+ * also introduce unnecesary reflows in some cases, especially during startup. `congestionAsync`
168
+ * is ideal for apps running animations while also simultaniously executing intesive tasks
169
+ * which may lock-up the main thread.
170
+ *
171
+ * - `immediate`: Makes writeTask() and readTask() callbacks to be executed syncronously. Tasks
172
+ * are not scheduled to run in the next frame, but do note there is at least one microtask.
173
+ * The `immediate` setting is ideal for apps that do not provide long running and smooth
174
+ * animations. Like the async setting, if the app has intensive tasks causing the main thread
175
+ * to lock-up, it's recommended to try [Web Workers](https://rindojs.web.app/docs/web-workers).
176
+ */
177
+ taskQueue?: 'async' | 'immediate' | 'congestionAsync';
178
+ /**
179
+ * Provide a object of key/values accessible within the app, using the `Env` object.
180
+ */
181
+ env?: {
182
+ [prop: string]: string | undefined;
183
+ };
184
+ globalScript?: string;
185
+ srcIndexHtml?: string;
186
+ watch?: boolean;
187
+ testing?: TestingConfig;
188
+ maxConcurrentWorkers?: number;
189
+ preamble?: string;
190
+ rollupPlugins?: {
191
+ before?: any[];
192
+ after?: any[];
193
+ };
194
+ entryComponentsHint?: string[];
195
+ buildDist?: boolean;
196
+ buildLogFilePath?: string;
197
+ cacheDir?: string;
198
+ devInspector?: boolean;
199
+ devServer?: RindoDevServerConfig;
200
+ enableCacheStats?: boolean;
201
+ sys?: CompilerSystem;
202
+ tsconfig?: string;
203
+ validateTypes?: boolean;
204
+ /**
205
+ * An array of RegExp patterns that are matched against all source files before adding
206
+ * to the watch list in watch mode. If the file path matches any of the patterns, when it
207
+ * is updated, it will not trigger a re-run of tests.
208
+ */
209
+ watchIgnoredRegex?: RegExp | RegExp[];
210
+ excludeUnusedDependencies?: boolean;
211
+ rindoCoreResolvedId?: string;
212
+ }
213
+ export interface ConfigExtras {
214
+ /**
215
+ * By default, the slot polyfill does not update `appendChild()` so that it appends
216
+ * new child nodes into the correct child slot like how shadow dom works. This is an opt-in
217
+ * polyfill for those who need it when using `element.appendChild(node)` and expecting the
218
+ * child to be appended in the same location shadom dom would. This is not required for
219
+ * IE11 or Edge 18, but can be enabled if the app is using `appendChild()`. Defaults to `false`.
220
+ */
221
+ appendChildSlotFix?: boolean;
222
+ /**
223
+ * By default, the runtime does not polyfill `cloneNode()` when cloning a component
224
+ * that uses the slot polyfill. This is an opt-in polyfill for those who need it.
225
+ * This is not required for IE11 or Edge 18, but can be enabled if the app is using
226
+ * `cloneNode()` and unexpected node are being cloned due to the slot polyfill
227
+ * simulating shadow dom. Defaults to `false`.
228
+ */
229
+ cloneNodeFix?: boolean;
230
+ /**
231
+ * Include the CSS Custom Property polyfill/shim for legacy browsers. ESM builds will
232
+ * not include the css vars shim. Defaults to `false`
233
+ */
234
+ cssVarsShim?: boolean;
235
+ /**
236
+ * Dynamic `import()` shim. This is only needed for Edge 18 and below, and Firefox 67
237
+ * and below. Defaults to `false`.
238
+ */
239
+ dynamicImportShim?: boolean;
240
+ /**
241
+ * Dispatches component lifecycle events. Mainly used for testing. Defaults to `false`.
242
+ */
243
+ lifecycleDOMEvents?: boolean;
244
+ /**
245
+ * Safari 10 supports ES modules with `<script type="module">`, however, it did not implement
246
+ * `<script nomodule>`. When set to `true`, the runtime will patch support for Safari 10
247
+ * due to its lack of `nomodule` support.
248
+ * Defaults to `false`.
249
+ */
250
+ safari10?: boolean;
251
+ /**
252
+ * It is possible to assign data to the actual `<script>` element's `data-opts` property,
253
+ * which then gets passed to Rindo's initial bootstrap. This feature is only required
254
+ * for very special cases and rarely needed. Defaults to `false`.
255
+ */
256
+ scriptDataOpts?: boolean;
257
+ /**
258
+ * If enabled `true`, the runtime will check if the shadow dom shim is required. However,
259
+ * if it's determined that shadow dom is already natively supported by the browser then
260
+ * it does not request the shim. When set to `false` it will avoid all shadow dom tests.
261
+ * Defaults to `false`.
262
+ */
263
+ shadowDomShim?: boolean;
264
+ /**
265
+ * When a component is first attached to the DOM, this setting will wait a single tick before
266
+ * rendering. This worksaround an Angular issue, where Angular attaches the elements before
267
+ * settings their initial state, leading to double renders and unnecesary event dispatchs.
268
+ * Defaults to `false`.
269
+ */
270
+ initializeNextTick?: boolean;
271
+ /**
272
+ * For browsers that do not support shadow dom (IE11 and Edge 18 and below), slot is polyfilled
273
+ * to simulate the same behavior. However, the host element's `childNodes` and `children`
274
+ * getters are not patched to only show the child nodes and elements of the default slot.
275
+ * Defaults to `false`.
276
+ */
277
+ slotChildNodesFix?: boolean;
278
+ /**
279
+ * Enables the tagNameTransform option of `defineCustomElements()`, so the component tagName
280
+ * can be customized at runtime. Defaults to `false`.
281
+ */
282
+ tagNameTransform?: boolean;
283
+ }
284
+ export interface Config extends RindoConfig {
285
+ buildAppCore?: boolean;
286
+ buildDocs?: boolean;
287
+ configPath?: string;
288
+ writeLog?: boolean;
289
+ devServer?: DevServerConfig;
290
+ flags?: ConfigFlags;
291
+ fsNamespace?: string;
292
+ logLevel?: LogLevel;
293
+ rootDir?: string;
294
+ packageJsonFilePath?: string;
295
+ sourceMap?: boolean;
296
+ suppressLogs?: boolean;
297
+ profile?: boolean;
298
+ tsCompilerOptions?: any;
299
+ _isValidated?: boolean;
300
+ _isTesting?: boolean;
301
+ }
302
+ export interface HydratedFlag {
303
+ /**
304
+ * Defaults to `hydrated`.
305
+ */
306
+ name?: string;
307
+ /**
308
+ * Can be either `class` or `attribute`. Defaults to `class`.
309
+ */
310
+ selector?: 'class' | 'attribute';
311
+ /**
312
+ * The CSS property used to show and hide components. Defaults to use the CSS `visibility`
313
+ * property. Other commonly used CSS properties would be `display` with the `initialValue`
314
+ * setting as `none`, or `opacity` with the `initialValue` as `0`. Defaults to `visibility`
315
+ * and the default `initialValue` is `hidden`.
316
+ */
317
+ property?: string;
318
+ /**
319
+ * This is the CSS value to give all components before it has been hydrated.
320
+ * Defaults to `hidden`.
321
+ */
322
+ initialValue?: string;
323
+ /**
324
+ * This is the CSS value to assign once a component has finished hydrating.
325
+ * This is the CSS value that'll allow the component to show. Defaults to `inherit`.
326
+ */
327
+ hydratedValue?: string;
328
+ }
329
+ export interface RindoDevServerConfig {
330
+ /**
331
+ * IP address used by the dev server. The default is `0.0.0.0`, which points to all IPv4 addresses
332
+ * on the local machine, such as `localhost`.
333
+ */
334
+ address?: string;
335
+ /**
336
+ * Base path to be used by the server. Defaults to the root pathname.
337
+ */
338
+ basePath?: string;
339
+ /**
340
+ * EXPERIMENTAL!
341
+ * During development, node modules can be independently requested and bundled, making for
342
+ * faster build times. This is only available using the Rindo Dev Server throughout
343
+ * development. Production builds and builds with the `es5` flag will override
344
+ * this setting to `false`. Default is `false`.
345
+ */
346
+ experimentalDevModules?: boolean;
347
+ /**
348
+ * If the dev server should respond with gzip compressed content. Defaults to `true`.
349
+ */
350
+ gzip?: boolean;
351
+ /**
352
+ * When set, the dev server will run via https using the SSL certificate and key you provide
353
+ * (use `fs` if you want to read them from files).
354
+ */
355
+ https?: Credentials;
356
+ /**
357
+ * The URL the dev server should first open to. Defaults to `/`.
358
+ */
359
+ initialLoadUrl?: string;
360
+ /**
361
+ * When `true`, every request to the server will be logged within the terminal.
362
+ * Defaults to `false`.
363
+ */
364
+ logRequests?: boolean;
365
+ /**
366
+ * By default, when dev server is started the local dev URL is opened in your default browser.
367
+ * However, to prevent this URL to be opened change this value to `false`. Defaults to `true`.
368
+ */
369
+ openBrowser?: boolean;
370
+ /**
371
+ * Sets the server's port. Defaults to `3333`.
372
+ */
373
+ port?: number;
374
+ /**
375
+ * When files are watched and updated, by default the dev server will use `hmr` (Hot Module Replacement)
376
+ * to update the page without a full page refresh. To have the page do a full refresh use `pageReload`.
377
+ * To disable any reloading, use `null`. Defaults to `hmr`.
378
+ */
379
+ reloadStrategy?: PageReloadStrategy;
380
+ /**
381
+ * Local path to a NodeJs file with a dev server request listener as the default export.
382
+ * The user's request listener is given the first chance to handle every request the dev server
383
+ * receives, and can choose to handle it or instead pass it on to the default dev server
384
+ * by calling `next()`.
385
+ *
386
+ * Below is an example of a NodeJs file the `requestListenerPath` config is using.
387
+ * The request and response arguments are the same as Node's `http` module and `RequestListener`
388
+ * callback. https://nodejs.org/api/http.html#http_http_createserver_options_requestlistener
389
+ *
390
+ * ```js
391
+ * module.exports = function (req, res, next) {
392
+ * if (req.url === '/ping') {
393
+ * // custom response overriding the dev server
394
+ * res.setHeader('Content-Type', 'text/plain');
395
+ * res.writeHead(200);
396
+ * res.end('pong');
397
+ * } else {
398
+ * // pass request on to the default dev server
399
+ * next();
400
+ * }
401
+ * };
402
+ * ```
403
+ */
404
+ requestListenerPath?: string;
405
+ /**
406
+ * The root directory to serve the files from.
407
+ */
408
+ root?: string;
409
+ /**
410
+ * If the dev server should Server-Side Render (SSR) each page, meaning it'll dynamically generate
411
+ * server-side rendered html on each page load. The `--ssr` flag will most commonly be used with
412
+ * the`--dev --watch --serve` flags during development. Note that this is for development purposes
413
+ * only, and the built-in dev server should not be used for production. Defaults to `false`.
414
+ */
415
+ ssr?: boolean;
416
+ /**
417
+ * If the dev server fails to start up within the given timout (in milliseconds), the startup will
418
+ * be canceled. Set to zero to disable the timeout. Defaults to `15000`.
419
+ */
420
+ startupTimeout?: number;
421
+ /**
422
+ * Whether to use the dev server's websocket client or not. Defaults to `true`.
423
+ */
424
+ websocket?: boolean;
425
+ /**
426
+ * If the dev server should fork a worker for the server process or not. A singled-threaded dev server
427
+ * is slower, however it is useful for debugging http requests and responses. Defaults to `true`.
428
+ */
429
+ worker?: boolean;
430
+ }
431
+ export interface DevServerConfig extends RindoDevServerConfig {
432
+ browserUrl?: string;
433
+ devServerDir?: string;
434
+ excludeHmr?: string[];
435
+ historyApiFallback?: HistoryApiFallback;
436
+ openBrowser?: boolean;
437
+ prerenderConfig?: string;
438
+ protocol?: 'http' | 'https';
439
+ srcIndexHtml?: string;
440
+ }
441
+ export interface HistoryApiFallback {
442
+ index?: string;
443
+ disableDotRule?: boolean;
444
+ }
445
+ export interface DevServerEditor {
446
+ id: string;
447
+ name?: string;
448
+ supported?: boolean;
449
+ priority?: number;
450
+ }
451
+ export interface ConfigFlags {
452
+ task?: TaskCommand;
453
+ args?: string[];
454
+ knownArgs?: string[];
455
+ unknownArgs?: string[];
456
+ address?: string;
457
+ build?: boolean;
458
+ cache?: boolean;
459
+ checkVersion?: boolean;
460
+ ci?: boolean;
461
+ compare?: boolean;
462
+ config?: string;
463
+ debug?: boolean;
464
+ dev?: boolean;
465
+ docs?: boolean;
466
+ docsApi?: string;
467
+ docsJson?: string;
468
+ e2e?: boolean;
469
+ emulate?: string;
470
+ es5?: boolean;
471
+ headless?: boolean;
472
+ help?: boolean;
473
+ log?: boolean;
474
+ logLevel?: string;
475
+ verbose?: boolean;
476
+ maxWorkers?: number;
477
+ open?: boolean;
478
+ port?: number;
479
+ prerender?: boolean;
480
+ prod?: boolean;
481
+ profile?: boolean;
482
+ root?: string;
483
+ screenshot?: boolean;
484
+ screenshotConnector?: string;
485
+ serve?: boolean;
486
+ serviceWorker?: boolean;
487
+ spec?: boolean;
488
+ ssr?: boolean;
489
+ stats?: boolean;
490
+ updateScreenshot?: boolean;
491
+ version?: boolean;
492
+ watch?: boolean;
493
+ devtools?: boolean;
494
+ }
495
+ export declare type TaskCommand = 'build' | 'docs' | 'generate' | 'g' | 'help' | 'info' | 'prerender' | 'serve' | 'test' | 'version';
496
+ export declare type PageReloadStrategy = 'hmr' | 'pageReload' | null;
497
+ /**
498
+ * The prerender config is used when prerendering a `www` output target.
499
+ * Within `rindo.config.ts`, set the path to the prerendering
500
+ * config file path using the `prerenderConfig` property, such as:
501
+ *
502
+ * ```tsx
503
+ * import { Config } from '@rindo/core';
504
+ * export const config: Config = {
505
+ * outputTargets: [
506
+ * {
507
+ * type: 'www',
508
+ * baseUrl: 'https://rindojs.web.app/',
509
+ * prerenderConfig: './prerender.config.ts',
510
+ * }
511
+ * ]
512
+ * };
513
+ * ```
514
+ *
515
+ * The `prerender.config.ts` should export a `config` object using
516
+ * the `PrerenderConfig` interface.
517
+ *
518
+ * ```tsx
519
+ * import { PrerenderConfig } from '@rindo/core';
520
+ * export const config: PrerenderConfig = {
521
+ * ...
522
+ * };
523
+ * ```
524
+ *
525
+ * For more info: https://rindojs.web.app/docs/static-site-generation
526
+ */
527
+ export interface PrerenderConfig {
528
+ /**
529
+ * Run after each `document` is hydrated, but before it is serialized
530
+ * into an HTML string. Hook is passed the `document` and its `URL`.
531
+ */
532
+ afterHydrate?(document: Document, url: URL, results: PrerenderUrlResults): any | Promise<any>;
533
+ /**
534
+ * Run before each `document` is hydrated. Hook is passed the `document` it's `URL`.
535
+ */
536
+ beforeHydrate?(document: Document, url: URL): any | Promise<any>;
537
+ /**
538
+ * Runs after the template Document object has serialize into an
539
+ * HTML formatted string. Returns an HTML string to be used as the
540
+ * base template for all prerendered pages.
541
+ */
542
+ afterSerializeTemplate?(html: string): string | Promise<string>;
543
+ /**
544
+ * Runs before the template Document object is serialize into an
545
+ * HTML formatted string. Returns the Document to be serialized which
546
+ * will become the base template html for all prerendered pages.
547
+ */
548
+ beforeSerializeTemplate?(document: Document): Document | Promise<Document>;
549
+ /**
550
+ * A hook to be used to generate the canonical `<link>` tag
551
+ * which goes in the `<head>` of every prerendered page. Returning `null`
552
+ * will not add a canonical url tag to the page.
553
+ */
554
+ canonicalUrl?(url: URL): string | null;
555
+ /**
556
+ * While prerendering, crawl same-origin URLs found within `<a href>` elements.
557
+ * Defaults to `true`.
558
+ */
559
+ crawlUrls?: boolean;
560
+ /**
561
+ * URLs to start the prerendering from. By default the root URL of `/` is used.
562
+ */
563
+ entryUrls?: string[];
564
+ /**
565
+ * Return `true` the given `<a>` element should be crawled or not.
566
+ */
567
+ filterAnchor?(attrs: {
568
+ [attrName: string]: string;
569
+ }, base?: URL): boolean;
570
+ /**
571
+ * Return `true` if the given URL should be prerendered or not.
572
+ */
573
+ filterUrl?(url: URL, base: URL): boolean;
574
+ /**
575
+ * Returns the file path which the prerendered HTML content
576
+ * should be written to.
577
+ */
578
+ filePath?(url: URL, filePath: string): string;
579
+ /**
580
+ * Returns the hydrate options to use for each individual prerendered page.
581
+ */
582
+ hydrateOptions?(url: URL): PrerenderHydrateOptions;
583
+ /**
584
+ * Returns the template file's content. The template is the base
585
+ * HTML used for all prerendered pages.
586
+ */
587
+ loadTemplate?(filePath: string): string | Promise<string>;
588
+ /**
589
+ * Used to normalize the page's URL from a given a string and the current
590
+ * page's base URL. Largely used when reading an anchor's `href` attribute
591
+ * value and normalizing it into a `URL`.
592
+ */
593
+ normalizeUrl?(href: string, base: URL): URL;
594
+ robotsTxt?(opts: RobotsTxtOpts): string | RobotsTxtResults;
595
+ sitemapXml?(opts: SitemapXmpOpts): string | SitemapXmpResults;
596
+ /**
597
+ * Static Site Generated (SSG). Does not include Rindo's clientside
598
+ * JavaScript, custom elements or preload modules.
599
+ */
600
+ staticSite?: boolean;
601
+ /**
602
+ * If the prerenndered URLs should have a trailing "/"" or not. Defaults to `false`.
603
+ */
604
+ trailingSlash?: boolean;
605
+ }
606
+ export interface HydrateDocumentOptions {
607
+ /**
608
+ * Build ID that will be added to `<html data-rindo-build="BUILD_ID">`. By default
609
+ * a random ID will be generated
610
+ */
611
+ buildId?: string;
612
+ /**
613
+ * Sets the `href` attribute on the `<link rel="canonical">`
614
+ * tag within the `<head>`. If the value is not defined it will
615
+ * ensure a canonical link tag is no included in the `<head>`.
616
+ */
617
+ canonicalUrl?: string;
618
+ /**
619
+ * Include the HTML comments and attributes used by the clientside
620
+ * JavaScript to read the structure of the HTML and rebuild each
621
+ * component. Defaults to `true`.
622
+ */
623
+ clientHydrateAnnotations?: boolean;
624
+ /**
625
+ * Constrain `setTimeout()` to 1ms, but still async. Also
626
+ * only allows `setInterval()` to fire once, also constrained to 1ms.
627
+ * Defaults to `true`.
628
+ */
629
+ constrainTimeouts?: boolean;
630
+ /**
631
+ * Sets `document.cookie`
632
+ */
633
+ cookie?: string;
634
+ /**
635
+ * Sets the `dir` attribute on the top level `<html>`.
636
+ */
637
+ direction?: string;
638
+ /**
639
+ * Component tag names listed here will not be prerendered, nor will
640
+ * hydrated on the clientside. Components listed here will be ignored
641
+ * as custom elements and treated no differently than a `<div>`.
642
+ */
643
+ excludeComponents?: string[];
644
+ /**
645
+ * Sets the `lang` attribute on the top level `<html>`.
646
+ */
647
+ language?: string;
648
+ /**
649
+ * Maximum number of components to hydrate on one page. Defaults to `300`.
650
+ */
651
+ maxHydrateCount?: number;
652
+ /**
653
+ * Sets `document.referrer`
654
+ */
655
+ referrer?: string;
656
+ /**
657
+ * Removes every `<script>` element found in the `document`. Defaults to `false`.
658
+ */
659
+ removeScripts?: boolean;
660
+ /**
661
+ * Removes CSS not used by elements within the `document`. Defaults to `true`.
662
+ */
663
+ removeUnusedStyles?: boolean;
664
+ /**
665
+ * The url the runtime uses for the resources, such as the assets directory.
666
+ */
667
+ resourcesUrl?: string;
668
+ /**
669
+ * Prints out runtime console logs to the NodeJS process. Defaults to `false`.
670
+ */
671
+ runtimeLogging?: boolean;
672
+ /**
673
+ * Component tags listed here will only be prerendered or serverside-rendered
674
+ * and will not be clientside hydrated. This is useful for components that
675
+ * are not dynamic and do not need to be defined as a custom element within the
676
+ * browser. For example, a header or footer component would be a good example that
677
+ * may not require any clientside JavaScript.
678
+ */
679
+ staticComponents?: string[];
680
+ /**
681
+ * The amount of milliseconds to wait for a page to finish rendering until
682
+ * a timeout error is thrown. Defaults to `15000`.
683
+ */
684
+ timeout?: number;
685
+ /**
686
+ * Sets `document.title`.
687
+ */
688
+ title?: string;
689
+ /**
690
+ * Sets `location.href`
691
+ */
692
+ url?: string;
693
+ /**
694
+ * Sets `navigator.userAgent`
695
+ */
696
+ userAgent?: string;
697
+ }
698
+ export interface SerializeDocumentOptions extends HydrateDocumentOptions {
699
+ /**
700
+ * Runs after the `document` has been hydrated.
701
+ */
702
+ afterHydrate?(document: any): any | Promise<any>;
703
+ /**
704
+ * Sets an approximate line width the HTML should attempt to stay within.
705
+ * Note that this is "approximate", in that HTML may often not be able
706
+ * to be split at an exact line width. Additionally, new lines created
707
+ * is where HTML naturally already has whitespce, such as before an
708
+ * attribute or spaces between words. Defaults to `100`.
709
+ */
710
+ approximateLineWidth?: number;
711
+ /**
712
+ * Runs before the `document` has been hydrated.
713
+ */
714
+ beforeHydrate?(document: any): any | Promise<any>;
715
+ /**
716
+ * Format the HTML in a nicely indented format.
717
+ * Defaults to `false`.
718
+ */
719
+ prettyHtml?: boolean;
720
+ /**
721
+ * Remove quotes from attribute values when possible.
722
+ * Defaults to `true`.
723
+ */
724
+ removeAttributeQuotes?: boolean;
725
+ /**
726
+ * Remove the `=""` from standardized `boolean` attributes,
727
+ * such as `hidden` or `checked`. Defaults to `true`.
728
+ */
729
+ removeBooleanAttributeQuotes?: boolean;
730
+ /**
731
+ * Remove these standardized attributes when their value is empty:
732
+ * `class`, `dir`, `id`, `lang`, and `name`, `title`. Defaults to `true`.
733
+ */
734
+ removeEmptyAttributes?: boolean;
735
+ /**
736
+ * Remove HTML comments. Defaults to `true`.
737
+ */
738
+ removeHtmlComments?: boolean;
739
+ }
740
+ export interface HydrateFactoryOptions extends SerializeDocumentOptions {
741
+ serializeToHtml: boolean;
742
+ destroyWindow: boolean;
743
+ destroyDocument: boolean;
744
+ }
745
+ export interface PrerenderHydrateOptions extends SerializeDocumentOptions {
746
+ /**
747
+ * Adds `<link rel="modulepreload">` for modules that will eventually be requested.
748
+ * Defaults to `true`.
749
+ */
750
+ addModulePreloads?: boolean;
751
+ /**
752
+ * Hash the content of assets, such as images, fonts and css files,
753
+ * and add the hashed value as `v` querystring. For example,
754
+ * `/assets/image.png?v=abcd1234`. This allows for assets to be
755
+ * heavily cached by setting the server's response header with
756
+ * `Cache-Control: max-age=31536000, immutable`.
757
+ */
758
+ hashAssets?: 'querystring';
759
+ /**
760
+ * External stylesheets from `<link rel="stylesheet">` are instead inlined
761
+ * into `<style>` elements. Defaults to `false`.
762
+ */
763
+ inlineExternalStyleSheets?: boolean;
764
+ /**
765
+ * Minify CSS content within `<style>` elements. Defaults to `true`.
766
+ */
767
+ minifyStyleElements?: boolean;
768
+ /**
769
+ * Minify JavaScript content within `<script>` elements. Defaults to `true`.
770
+ */
771
+ minifyScriptElements?: boolean;
772
+ /**
773
+ * Entire `document` should be static. This is useful for specific pages that
774
+ * should be static, rather than the entire site. If the whole site should be static,
775
+ * use the `staticSite` property on the prerender config instead. If only certain
776
+ * components should be static then use `staticComponents` instead.
777
+ */
778
+ staticDocument?: boolean;
779
+ }
780
+ export interface RobotsTxtOpts {
781
+ urls: string[];
782
+ sitemapUrl: string;
783
+ baseUrl: string;
784
+ dir: string;
785
+ }
786
+ export interface RobotsTxtResults {
787
+ content: string;
788
+ filePath: string;
789
+ url: string;
790
+ }
791
+ export interface SitemapXmpOpts {
792
+ urls: string[];
793
+ baseUrl: string;
794
+ dir: string;
795
+ }
796
+ export interface SitemapXmpResults {
797
+ content: string;
798
+ filePath: string;
799
+ url: string;
800
+ }
801
+ /**
802
+ * Common system used by the compiler. All file reads, writes, access, etc. will all use
803
+ * this system. Additionally, throughout each build, the compiler will use an internal
804
+ * in-memory file system as to prevent unnecessary fs reads and writes. At the end of each
805
+ * build all actions the in-memory fs performed will be written to disk using this system.
806
+ * A NodeJS based system will use APIs such as `fs` and `crypto`, and a web-based system
807
+ * will use in-memory Maps and browser APIs. Either way, the compiler itself is unaware
808
+ * of the actual platform it's being ran ontop of.
809
+ */
810
+ export interface CompilerSystem {
811
+ name: 'deno' | 'node' | 'in-memory';
812
+ version: string;
813
+ events?: BuildEvents;
814
+ details?: SystemDetails;
815
+ /**
816
+ * Add a callback which will be ran when destroy() is called.
817
+ */
818
+ addDestory(cb: () => void): void;
819
+ /**
820
+ * Always returns a boolean, does not throw.
821
+ */
822
+ access(p: string): Promise<boolean>;
823
+ /**
824
+ * SYNC! Always returns a boolean, does not throw.
825
+ */
826
+ accessSync(p: string): boolean;
827
+ applyGlobalPatch?(fromDir: string): Promise<void>;
828
+ applyPrerenderGlobalPatch?(opts: {
829
+ devServerHostUrl: string;
830
+ window: any;
831
+ }): void;
832
+ cacheStorage?: CacheStorage;
833
+ checkVersion?: (logger: Logger, currentVersion: string) => Promise<() => void>;
834
+ copy?(copyTasks: Required<CopyTask>[], srcDir: string): Promise<CopyResults>;
835
+ /**
836
+ * Always returns a boolean if the files were copied or not. Does not throw.
837
+ */
838
+ copyFile(src: string, dst: string): Promise<boolean>;
839
+ /**
840
+ * Used to destroy any listeners, file watchers or child processes.
841
+ */
842
+ destroy(): Promise<void>;
843
+ /**
844
+ * Does not throw.
845
+ */
846
+ createDir(p: string, opts?: CompilerSystemCreateDirectoryOptions): Promise<CompilerSystemCreateDirectoryResults>;
847
+ /**
848
+ * SYNC! Does not throw.
849
+ */
850
+ createDirSync(p: string, opts?: CompilerSystemCreateDirectoryOptions): CompilerSystemCreateDirectoryResults;
851
+ /**
852
+ * Each plaform as a different way to dynamically import modules.
853
+ */
854
+ dynamicImport?(p: string): Promise<any>;
855
+ /**
856
+ * Creates the worker controller for the current system.
857
+ */
858
+ createWorkerController?(maxConcurrentWorkers: number): WorkerMainController;
859
+ encodeToBase64(str: string): string;
860
+ ensureDependencies?(opts: {
861
+ rootDir: string;
862
+ logger: Logger;
863
+ dependencies: CompilerDependency[];
864
+ }): Promise<{
865
+ rindoPath: string;
866
+ diagnostics: Diagnostic[];
867
+ }>;
868
+ ensureResources?(opts: {
869
+ rootDir: string;
870
+ logger: Logger;
871
+ dependencies: CompilerDependency[];
872
+ }): Promise<void>;
873
+ /**
874
+ * process.exit()
875
+ */
876
+ exit(exitCode: number): Promise<void>;
877
+ /**
878
+ * Optionally provide a fetch() function rather than using the built-in fetch().
879
+ * First arg is a url string or Request object (RequestInfo).
880
+ * Second arg is the RequestInit. Returns the Response object
881
+ */
882
+ fetch?(input: string | any, init?: any): Promise<any>;
883
+ /**
884
+ * Generates a sha1 digest encoded as HEX
885
+ */
886
+ generateContentHash?(content: string | any, length?: number): Promise<string>;
887
+ /**
888
+ * Generates a sha1 digest encoded as HEX from a file path
889
+ */
890
+ generateFileHash?(filePath: string | any, length?: number): Promise<string>;
891
+ /**
892
+ * Get the current directory.
893
+ */
894
+ getCurrentDirectory(): string;
895
+ /**
896
+ * The compiler's executing path.
897
+ */
898
+ getCompilerExecutingPath(): string;
899
+ /**
900
+ * The dev server's executing path.
901
+ */
902
+ getDevServerExecutingPath?(): string;
903
+ getEnvironmentVar?(key: string): string;
904
+ /**
905
+ * Gets the absolute file path when for a dependency module.
906
+ */
907
+ getLocalModulePath(opts: {
908
+ rootDir: string;
909
+ moduleId: string;
910
+ path: string;
911
+ }): string;
912
+ /**
913
+ * Gets the full url when requesting a dependency module to fetch from a CDN.
914
+ */
915
+ getRemoteModuleUrl(opts: {
916
+ moduleId: string;
917
+ path?: string;
918
+ version?: string;
919
+ }): string;
920
+ /**
921
+ * Aync glob task. Only available in NodeJS compiler system.
922
+ */
923
+ glob?(pattern: string, options: {
924
+ cwd?: string;
925
+ nodir?: boolean;
926
+ [key: string]: any;
927
+ }): Promise<string[]>;
928
+ /**
929
+ * The number of logical processors available to run threads on the user's computer (cpus).
930
+ */
931
+ hardwareConcurrency: number;
932
+ /**
933
+ * Tests if the path is a symbolic link or not. Always resolves a boolean. Does not throw.
934
+ */
935
+ isSymbolicLink(p: string): Promise<boolean>;
936
+ lazyRequire?: LazyRequire;
937
+ nextTick(cb: () => void): void;
938
+ /**
939
+ * Normalize file system path.
940
+ */
941
+ normalizePath(p: string): string;
942
+ onProcessInterrupt?(cb: () => void): void;
943
+ platformPath: PlatformPath;
944
+ /**
945
+ * All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
946
+ */
947
+ readDir(p: string): Promise<string[]>;
948
+ /**
949
+ * SYNC! All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
950
+ */
951
+ readDirSync(p: string): string[];
952
+ /**
953
+ * Returns undefined if file is not found. Does not throw.
954
+ */
955
+ readFile(p: string): Promise<string>;
956
+ readFile(p: string, encoding: 'utf8'): Promise<string>;
957
+ readFile(p: string, encoding: 'binary'): Promise<any>;
958
+ /**
959
+ * SYNC! Returns undefined if file is not found. Does not throw.
960
+ */
961
+ readFileSync(p: string, encoding?: string): string;
962
+ /**
963
+ * Does not throw.
964
+ */
965
+ realpath(p: string): Promise<CompilerSystemRealpathResults>;
966
+ /**
967
+ * SYNC! Does not throw.
968
+ */
969
+ realpathSync(p: string): CompilerSystemRealpathResults;
970
+ /**
971
+ * Remove a callback which will be ran when destroy() is called.
972
+ */
973
+ removeDestory(cb: () => void): void;
974
+ /**
975
+ * Rename old path to new path. Does not throw.
976
+ */
977
+ rename(oldPath: string, newPath: string): Promise<CompilerSystemRenameResults>;
978
+ resolveModuleId?(opts: ResolveModuleIdOptions): Promise<ResolveModuleIdResults>;
979
+ resolvePath(p: string): string;
980
+ /**
981
+ * Does not throw.
982
+ */
983
+ removeDir(p: string, opts?: CompilerSystemRemoveDirectoryOptions): Promise<CompilerSystemRemoveDirectoryResults>;
984
+ /**
985
+ * SYNC! Does not throw.
986
+ */
987
+ removeDirSync(p: string, opts?: CompilerSystemRemoveDirectoryOptions): CompilerSystemRemoveDirectoryResults;
988
+ /**
989
+ * Does not throw.
990
+ */
991
+ removeFile(p: string): Promise<CompilerSystemRemoveFileResults>;
992
+ /**
993
+ * SYNC! Does not throw.
994
+ */
995
+ removeFileSync(p: string): CompilerSystemRemoveFileResults;
996
+ setupCompiler?: (c: {
997
+ ts: any;
998
+ }) => void;
999
+ /**
1000
+ * Always returns an object. Does not throw. Check for "error" property if there's an error.
1001
+ */
1002
+ stat(p: string): Promise<CompilerFsStats>;
1003
+ /**
1004
+ * SYNC! Always returns an object. Does not throw. Check for "error" property if there's an error.
1005
+ */
1006
+ statSync(p: string): CompilerFsStats;
1007
+ tmpDirSync(): string;
1008
+ watchDirectory?(p: string, callback: CompilerFileWatcherCallback, recursive?: boolean): CompilerFileWatcher;
1009
+ watchFile?(p: string, callback: CompilerFileWatcherCallback): CompilerFileWatcher;
1010
+ /**
1011
+ * How many milliseconds to wait after a change before calling watch callbacks.
1012
+ */
1013
+ watchTimeout?: number;
1014
+ /**
1015
+ * Does not throw.
1016
+ */
1017
+ writeFile(p: string, content: string): Promise<CompilerSystemWriteFileResults>;
1018
+ /**
1019
+ * SYNC! Does not throw.
1020
+ */
1021
+ writeFileSync(p: string, content: string): CompilerSystemWriteFileResults;
1022
+ }
1023
+ export interface TranspileOnlyResults {
1024
+ diagnostics: Diagnostic[];
1025
+ output: string;
1026
+ sourceMap: any;
1027
+ }
1028
+ export interface ParsedPath {
1029
+ root: string;
1030
+ dir: string;
1031
+ base: string;
1032
+ ext: string;
1033
+ name: string;
1034
+ }
1035
+ export interface PlatformPath {
1036
+ normalize(p: string): string;
1037
+ join(...paths: string[]): string;
1038
+ resolve(...pathSegments: string[]): string;
1039
+ isAbsolute(p: string): boolean;
1040
+ relative(from: string, to: string): string;
1041
+ dirname(p: string): string;
1042
+ basename(p: string, ext?: string): string;
1043
+ extname(p: string): string;
1044
+ parse(p: string): ParsedPath;
1045
+ sep: string;
1046
+ delimiter: string;
1047
+ posix: any;
1048
+ win32: any;
1049
+ }
1050
+ export interface CompilerDependency {
1051
+ name: string;
1052
+ version: string;
1053
+ main: string;
1054
+ resources?: string[];
1055
+ }
1056
+ export interface ResolveModuleIdOptions {
1057
+ moduleId: string;
1058
+ containingFile?: string;
1059
+ exts?: string[];
1060
+ packageFilter?: (pkg: any) => void;
1061
+ }
1062
+ export interface ResolveModuleIdResults {
1063
+ moduleId: string;
1064
+ resolveId: string;
1065
+ pkgData: {
1066
+ name: string;
1067
+ version: string;
1068
+ [key: string]: any;
1069
+ };
1070
+ pkgDirPath: string;
1071
+ }
1072
+ export interface WorkerMainController {
1073
+ send(...args: any[]): Promise<any>;
1074
+ handler(name: string): (...args: any[]) => Promise<any>;
1075
+ destroy(): void;
1076
+ maxWorkers: number;
1077
+ }
1078
+ export interface CopyResults {
1079
+ diagnostics: Diagnostic[];
1080
+ filePaths: string[];
1081
+ dirPaths: string[];
1082
+ }
1083
+ export interface SystemDetails {
1084
+ cpuModel: string;
1085
+ freemem(): number;
1086
+ platform: 'darwin' | 'windows' | 'linux' | '';
1087
+ release: string;
1088
+ totalmem: number;
1089
+ }
1090
+ export interface BuildOnEvents {
1091
+ on(cb: (eventName: CompilerEventName, data: any) => void): BuildOnEventRemove;
1092
+ on(eventName: CompilerEventFileAdd, cb: (path: string) => void): BuildOnEventRemove;
1093
+ on(eventName: CompilerEventFileDelete, cb: (path: string) => void): BuildOnEventRemove;
1094
+ on(eventName: CompilerEventFileUpdate, cb: (path: string) => void): BuildOnEventRemove;
1095
+ on(eventName: CompilerEventDirAdd, cb: (path: string) => void): BuildOnEventRemove;
1096
+ on(eventName: CompilerEventDirDelete, cb: (path: string) => void): BuildOnEventRemove;
1097
+ on(eventName: CompilerEventBuildStart, cb: (buildStart: CompilerBuildStart) => void): BuildOnEventRemove;
1098
+ on(eventName: CompilerEventBuildFinish, cb: (buildResults: CompilerBuildResults) => void): BuildOnEventRemove;
1099
+ on(eventName: CompilerEventBuildLog, cb: (buildLog: BuildLog) => void): BuildOnEventRemove;
1100
+ on(eventName: CompilerEventBuildNoChange, cb: () => void): BuildOnEventRemove;
1101
+ }
1102
+ export interface BuildEmitEvents {
1103
+ emit(eventName: CompilerEventFileAdd, path: string): void;
1104
+ emit(eventName: CompilerEventFileDelete, path: string): void;
1105
+ emit(eventName: CompilerEventFileUpdate, path: string): void;
1106
+ emit(eventName: CompilerEventDirAdd, path: string): void;
1107
+ emit(eventName: CompilerEventDirDelete, path: string): void;
1108
+ emit(eventName: CompilerEventBuildStart, buildStart: CompilerBuildStart): void;
1109
+ emit(eventName: CompilerEventBuildFinish, buildResults: CompilerBuildResults): void;
1110
+ emit(eventName: CompilerEventBuildNoChange, buildNoChange: BuildNoChangeResults): void;
1111
+ emit(eventName: CompilerEventBuildLog, buildLog: BuildLog): void;
1112
+ emit(eventName: CompilerEventFsChange, fsWatchResults: FsWatchResults): void;
1113
+ }
1114
+ export interface FsWatchResults {
1115
+ dirsAdded: string[];
1116
+ dirsDeleted: string[];
1117
+ filesUpdated: string[];
1118
+ filesAdded: string[];
1119
+ filesDeleted: string[];
1120
+ }
1121
+ export interface BuildLog {
1122
+ buildId: number;
1123
+ messages: string[];
1124
+ progress: number;
1125
+ }
1126
+ export interface BuildNoChangeResults {
1127
+ buildId: number;
1128
+ noChange: boolean;
1129
+ }
1130
+ export interface CompilerBuildResults {
1131
+ buildId: number;
1132
+ componentGraph?: BuildResultsComponentGraph;
1133
+ diagnostics: Diagnostic[];
1134
+ dirsAdded: string[];
1135
+ dirsDeleted: string[];
1136
+ duration: number;
1137
+ filesAdded: string[];
1138
+ filesChanged: string[];
1139
+ filesDeleted: string[];
1140
+ filesUpdated: string[];
1141
+ hasError: boolean;
1142
+ hasSuccessfulBuild: boolean;
1143
+ hmr?: HotModuleReplacement;
1144
+ hydrateAppFilePath?: string;
1145
+ isRebuild: boolean;
1146
+ namespace: string;
1147
+ outputs: BuildOutput[];
1148
+ rootDir: string;
1149
+ srcDir: string;
1150
+ timestamp: string;
1151
+ }
1152
+ export interface BuildResultsComponentGraph {
1153
+ [scopeId: string]: string[];
1154
+ }
1155
+ export interface BuildOutput {
1156
+ type: string;
1157
+ files: string[];
1158
+ }
1159
+ export interface HotModuleReplacement {
1160
+ componentsUpdated?: string[];
1161
+ excludeHmr?: string[];
1162
+ externalStylesUpdated?: string[];
1163
+ imagesUpdated?: string[];
1164
+ indexHtmlUpdated?: boolean;
1165
+ inlineStylesUpdated?: HmrStyleUpdate[];
1166
+ reloadStrategy: PageReloadStrategy;
1167
+ scriptsAdded?: string[];
1168
+ scriptsDeleted?: string[];
1169
+ serviceWorkerUpdated?: boolean;
1170
+ versionId?: string;
1171
+ }
1172
+ export interface HmrStyleUpdate {
1173
+ styleId: string;
1174
+ styleTag: string;
1175
+ styleText: string;
1176
+ }
1177
+ export declare type BuildOnEventRemove = () => boolean;
1178
+ export interface BuildEvents extends BuildOnEvents, BuildEmitEvents {
1179
+ unsubscribeAll(): void;
1180
+ }
1181
+ export interface CompilerBuildStart {
1182
+ buildId: number;
1183
+ timestamp: string;
1184
+ }
1185
+ export declare type CompilerFileWatcherCallback = (fileName: string, eventKind: CompilerFileWatcherEvent) => void;
1186
+ export declare type CompilerFileWatcherEvent = CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventFileUpdate | CompilerEventDirAdd | CompilerEventDirDelete;
1187
+ export declare type CompilerEventName = CompilerEventFsChange | CompilerEventFileUpdate | CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventDirAdd | CompilerEventDirDelete | CompilerEventBuildStart | CompilerEventBuildFinish | CompilerEventBuildNoChange | CompilerEventBuildLog;
1188
+ export declare type CompilerEventFsChange = 'fsChange';
1189
+ export declare type CompilerEventFileUpdate = 'fileUpdate';
1190
+ export declare type CompilerEventFileAdd = 'fileAdd';
1191
+ export declare type CompilerEventFileDelete = 'fileDelete';
1192
+ export declare type CompilerEventDirAdd = 'dirAdd';
1193
+ export declare type CompilerEventDirDelete = 'dirDelete';
1194
+ export declare type CompilerEventBuildStart = 'buildStart';
1195
+ export declare type CompilerEventBuildFinish = 'buildFinish';
1196
+ export declare type CompilerEventBuildLog = 'buildLog';
1197
+ export declare type CompilerEventBuildNoChange = 'buildNoChange';
1198
+ export interface CompilerFileWatcher {
1199
+ close(): void | Promise<void>;
1200
+ }
1201
+ export interface CompilerFsStats {
1202
+ /**
1203
+ * If it's a directory. `false` if there was an error.
1204
+ */
1205
+ isDirectory: boolean;
1206
+ /**
1207
+ * If it's a file. `false` if there was an error.
1208
+ */
1209
+ isFile: boolean;
1210
+ /**
1211
+ * If it's a symlink. `false` if there was an error.
1212
+ */
1213
+ isSymbolicLink: boolean;
1214
+ /**
1215
+ * The size of the file in bytes. `0` for directories or if there was an error.
1216
+ */
1217
+ size: number;
1218
+ /**
1219
+ * The timestamp indicating the last time this file was modified expressed in milliseconds since the POSIX Epoch.
1220
+ */
1221
+ mtimeMs?: number;
1222
+ /**
1223
+ * Error if there was one, otherwise `null`. `stat` and `statSync` do not throw errors but always returns this interface.
1224
+ */
1225
+ error: any;
1226
+ }
1227
+ export interface CompilerSystemCreateDirectoryOptions {
1228
+ /**
1229
+ * Indicates whether parent directories should be created.
1230
+ * @default false
1231
+ */
1232
+ recursive?: boolean;
1233
+ /**
1234
+ * A file mode. If a string is passed, it is parsed as an octal integer. If not specified
1235
+ * @default 0o777.
1236
+ */
1237
+ mode?: number;
1238
+ }
1239
+ export interface CompilerSystemCreateDirectoryResults {
1240
+ basename: string;
1241
+ dirname: string;
1242
+ path: string;
1243
+ newDirs: string[];
1244
+ error: any;
1245
+ }
1246
+ export interface CompilerSystemRemoveDirectoryOptions {
1247
+ /**
1248
+ * Indicates whether child files and subdirectories should be removed.
1249
+ * @default false
1250
+ */
1251
+ recursive?: boolean;
1252
+ }
1253
+ export interface CompilerSystemRemoveDirectoryResults {
1254
+ basename: string;
1255
+ dirname: string;
1256
+ path: string;
1257
+ removedDirs: string[];
1258
+ removedFiles: string[];
1259
+ error: any;
1260
+ }
1261
+ export interface CompilerSystemRenameResults extends CompilerSystemRenamedPath {
1262
+ renamed: CompilerSystemRenamedPath[];
1263
+ oldDirs: string[];
1264
+ oldFiles: string[];
1265
+ newDirs: string[];
1266
+ newFiles: string[];
1267
+ error: any;
1268
+ }
1269
+ export interface CompilerSystemRenamedPath {
1270
+ oldPath: string;
1271
+ newPath: string;
1272
+ isFile: boolean;
1273
+ isDirectory: boolean;
1274
+ }
1275
+ export interface CompilerSystemRealpathResults {
1276
+ path: string;
1277
+ error: any;
1278
+ }
1279
+ export interface CompilerSystemRemoveFileResults {
1280
+ basename: string;
1281
+ dirname: string;
1282
+ path: string;
1283
+ error: any;
1284
+ }
1285
+ export interface CompilerSystemWriteFileResults {
1286
+ path: string;
1287
+ error: any;
1288
+ }
1289
+ export interface Credentials {
1290
+ key: string;
1291
+ cert: string;
1292
+ }
1293
+ export interface ConfigBundle {
1294
+ components: string[];
1295
+ }
1296
+ export interface CopyTask {
1297
+ src: string;
1298
+ dest?: string;
1299
+ warn?: boolean;
1300
+ keepDirStructure?: boolean;
1301
+ }
1302
+ export interface BundlingConfig {
1303
+ namedExports?: {
1304
+ [key: string]: string[];
1305
+ };
1306
+ }
1307
+ export interface NodeResolveConfig {
1308
+ module?: boolean;
1309
+ jsnext?: boolean;
1310
+ main?: boolean;
1311
+ browser?: boolean;
1312
+ extensions?: string[];
1313
+ preferBuiltins?: boolean;
1314
+ jail?: string;
1315
+ only?: Array<string | RegExp>;
1316
+ modulesOnly?: boolean;
1317
+ /**
1318
+ * @see https://github.com/browserify/resolve#resolveid-opts-cb
1319
+ */
1320
+ customResolveOptions?: {
1321
+ basedir?: string;
1322
+ package?: string;
1323
+ extensions?: string[];
1324
+ readFile?: Function;
1325
+ isFile?: Function;
1326
+ isDirectory?: Function;
1327
+ packageFilter?: Function;
1328
+ pathFilter?: Function;
1329
+ paths?: Function | string[];
1330
+ moduleDirectory?: string | string[];
1331
+ preserveSymlinks?: boolean;
1332
+ };
1333
+ }
1334
+ export interface RollupConfig {
1335
+ inputOptions?: RollupInputOptions;
1336
+ outputOptions?: RollupOutputOptions;
1337
+ }
1338
+ export interface RollupInputOptions {
1339
+ context?: string;
1340
+ moduleContext?: ((id: string) => string) | {
1341
+ [id: string]: string;
1342
+ };
1343
+ treeshake?: boolean;
1344
+ }
1345
+ export interface RollupOutputOptions {
1346
+ globals?: {
1347
+ [name: string]: string;
1348
+ } | ((name: string) => string);
1349
+ }
1350
+ export interface Testing {
1351
+ run(opts: TestingRunOptions): Promise<boolean>;
1352
+ destroy(): Promise<void>;
1353
+ }
1354
+ export interface TestingRunOptions {
1355
+ e2e?: boolean;
1356
+ screenshot?: boolean;
1357
+ spec?: boolean;
1358
+ updateScreenshot?: boolean;
1359
+ }
1360
+ export interface JestConfig {
1361
+ /**
1362
+ * This option tells Jest that all imported modules in your tests should be mocked automatically.
1363
+ * All modules used in your tests will have a replacement implementation, keeping the API surface. Default: false
1364
+ */
1365
+ automock?: boolean;
1366
+ /**
1367
+ * By default, Jest runs all tests and produces all errors into the console upon completion.
1368
+ * The bail config option can be used here to have Jest stop running tests after the first failure. Default: false
1369
+ */
1370
+ bail?: boolean;
1371
+ /**
1372
+ * The directory where Jest should store its cached dependency information. Jest attempts to scan your dependency tree once (up-front)
1373
+ * and cache it in order to ease some of the filesystem raking that needs to happen while running tests. This config option lets you
1374
+ * customize where Jest stores that cache data on disk. Default: "/tmp/<path>"
1375
+ */
1376
+ cacheDirectory?: string;
1377
+ /**
1378
+ * Automatically clear mock calls and instances between every test. Equivalent to calling jest.clearAllMocks()
1379
+ * between each test. This does not remove any mock implementation that may have been provided. Default: false
1380
+ */
1381
+ clearMocks?: boolean;
1382
+ /**
1383
+ * Indicates whether the coverage information should be collected while executing the test. Because this retrofits all
1384
+ * executed files with coverage collection statements, it may significantly slow down your tests. Default: false
1385
+ */
1386
+ collectCoverage?: boolean;
1387
+ /**
1388
+ * An array of glob patterns indicating a set of files for which coverage information should be collected.
1389
+ * If a file matches the specified glob pattern, coverage information will be collected for it even if no tests exist
1390
+ * for this file and it's never required in the test suite. Default: undefined
1391
+ */
1392
+ collectCoverageFrom?: any[];
1393
+ /**
1394
+ * The directory where Jest should output its coverage files. Default: undefined
1395
+ */
1396
+ coverageDirectory?: string;
1397
+ /**
1398
+ * An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path matches
1399
+ * any of the patterns, coverage information will be skipped. These pattern strings match against the full path.
1400
+ * Use the <rootDir> string token to include the path to your project's root directory to prevent it from accidentally
1401
+ * ignoring all of your files in different environments that may have different root directories.
1402
+ * Example: ["<rootDir>/build/", "<rootDir>/node_modules/"]. Default: ["/node_modules/"]
1403
+ */
1404
+ coveragePathIgnorePatterns?: any[];
1405
+ /**
1406
+ * A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter can be used.
1407
+ * Default: ["json", "lcov", "text"]
1408
+ */
1409
+ coverageReporters?: any[];
1410
+ /**
1411
+ * This will be used to configure minimum threshold enforcement for coverage results. Thresholds can be specified as global,
1412
+ * as a glob, and as a directory or file path. If thresholds aren't met, jest will fail. Thresholds specified as a positive
1413
+ * number are taken to be the minimum percentage required. Thresholds specified as a negative number represent the maximum
1414
+ * number of uncovered entities allowed. Default: undefined
1415
+ */
1416
+ coverageThreshold?: any;
1417
+ errorOnDeprecated?: boolean;
1418
+ forceCoverageMatch?: any[];
1419
+ globals?: any;
1420
+ globalSetup?: string;
1421
+ globalTeardown?: string;
1422
+ /**
1423
+ * An array of directory names to be searched recursively up from the requiring module's location. Setting this option will
1424
+ * override the default, if you wish to still search node_modules for packages include it along with any other
1425
+ * options: ["node_modules", "bower_components"]. Default: ["node_modules"]
1426
+ */
1427
+ moduleDirectories?: string[];
1428
+ /**
1429
+ * An array of file extensions your modules use. If you require modules without specifying a file extension,
1430
+ * these are the extensions Jest will look for. Default: ['ts', 'tsx', 'js', 'json']
1431
+ */
1432
+ moduleFileExtensions?: string[];
1433
+ moduleNameMapper?: any;
1434
+ modulePaths?: any[];
1435
+ modulePathIgnorePatterns?: any[];
1436
+ notify?: boolean;
1437
+ notifyMode?: string;
1438
+ preset?: string;
1439
+ prettierPath?: string;
1440
+ projects?: any;
1441
+ reporters?: any;
1442
+ resetMocks?: boolean;
1443
+ resetModules?: boolean;
1444
+ resolver?: string;
1445
+ restoreMocks?: string;
1446
+ rootDir?: string;
1447
+ roots?: any[];
1448
+ runner?: string;
1449
+ /**
1450
+ * The paths to modules that run some code to configure or set up the testing environment before each test.
1451
+ * Since every test runs in its own environment, these scripts will be executed in the testing environment
1452
+ * immediately before executing the test code itself. Default: []
1453
+ */
1454
+ setupFiles?: string[];
1455
+ setupFilesAfterEnv?: string[];
1456
+ snapshotSerializers?: any[];
1457
+ testEnvironment?: string;
1458
+ testEnvironmentOptions?: any;
1459
+ testMatch?: string[];
1460
+ testPathIgnorePatterns?: string[];
1461
+ testPreset?: string;
1462
+ testRegex?: string;
1463
+ testResultsProcessor?: string;
1464
+ testRunner?: string;
1465
+ testURL?: string;
1466
+ timers?: string;
1467
+ transform?: {
1468
+ [key: string]: string;
1469
+ };
1470
+ transformIgnorePatterns?: any[];
1471
+ unmockedModulePathPatterns?: any[];
1472
+ verbose?: boolean;
1473
+ watchPathIgnorePatterns?: any[];
1474
+ }
1475
+ export interface TestingConfig extends JestConfig {
1476
+ /**
1477
+ * The `allowableMismatchedPixels` value is used to determine an acceptable
1478
+ * number of pixels that can be mismatched before the image is considered
1479
+ * to have changes. Realistically, two screenshots representing the same
1480
+ * content may have a small number of pixels that are not identical due to
1481
+ * anti-aliasing, which is perfectly normal. If the `allowableMismatchedRatio`
1482
+ * is provided it will take precedence, otherwise `allowableMismatchedPixels`
1483
+ * will be used.
1484
+ */
1485
+ allowableMismatchedPixels?: number;
1486
+ /**
1487
+ * The `allowableMismatchedRatio` ranges from `0` to `1` and is used to
1488
+ * determine an acceptable ratio of pixels that can be mismatched before
1489
+ * the image is considered to have changes. Realistically, two screenshots
1490
+ * representing the same content may have a small number of pixels that
1491
+ * are not identical due to anti-aliasing, which is perfectly normal. The
1492
+ * `allowableMismatchedRatio` is the number of pixels that were mismatched,
1493
+ * divided by the total number of pixels in the screenshot. For example,
1494
+ * a ratio value of `0.06` means 6% of the pixels can be mismatched before
1495
+ * the image is considered to have changes. If the `allowableMismatchedRatio`
1496
+ * is provided it will take precedence, otherwise `allowableMismatchedPixels`
1497
+ * will be used.
1498
+ */
1499
+ allowableMismatchedRatio?: number;
1500
+ /**
1501
+ * Matching threshold while comparing two screenshots. Value ranges from `0` to `1`.
1502
+ * Smaller values make the comparison more sensitive. The `pixelmatchThreshold`
1503
+ * value helps to ignore anti-aliasing. Default: `0.1`
1504
+ */
1505
+ pixelmatchThreshold?: number;
1506
+ /**
1507
+ * Additional arguments to pass to the browser instance.
1508
+ */
1509
+ browserArgs?: string[];
1510
+ /**
1511
+ * Path to a Chromium or Chrome executable to run instead of the bundled Chromium.
1512
+ */
1513
+ browserExecutablePath?: string;
1514
+ /**
1515
+ * Url of remote Chrome instance to use instead of local Chrome.
1516
+ */
1517
+ browserWSEndpoint?: string;
1518
+ /**
1519
+ * Whether to run browser e2e tests in headless mode. Defaults to true.
1520
+ */
1521
+ browserHeadless?: boolean;
1522
+ /**
1523
+ * Slows down e2e browser operations by the specified amount of milliseconds.
1524
+ * Useful so that you can see what is going on.
1525
+ */
1526
+ browserSlowMo?: number;
1527
+ /**
1528
+ * By default, all E2E pages wait until the "load" event, this global setting can be used
1529
+ * to change the default `waitUntil` behaviour.
1530
+ */
1531
+ browserWaitUntil?: 'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2';
1532
+ /**
1533
+ * Whether to auto-open a DevTools panel for each tab.
1534
+ * If this option is true, the headless option will be set false
1535
+ */
1536
+ browserDevtools?: boolean;
1537
+ /**
1538
+ * Array of browser emulations to be using during e2e tests. A full e2e
1539
+ * test is ran for each emulation.
1540
+ */
1541
+ emulate?: EmulateConfig[];
1542
+ /**
1543
+ * Path to the Screenshot Connector module.
1544
+ */
1545
+ screenshotConnector?: string;
1546
+ /**
1547
+ * Amount of time in milliseconds to wait before a screenshot is taken.
1548
+ */
1549
+ waitBeforeScreenshot?: number;
1550
+ }
1551
+ export interface EmulateConfig {
1552
+ /**
1553
+ * Predefined device descriptor name, such as "iPhone X" or "Nexus 10".
1554
+ * For a complete list please see: https://github.com/GoogleChrome/puppeteer/blob/master/DeviceDescriptors.js
1555
+ */
1556
+ device?: string;
1557
+ /**
1558
+ * User-Agent to be used. Defaults to the user-agent of the installed Puppeteer version.
1559
+ */
1560
+ userAgent?: string;
1561
+ viewport?: EmulateViewport;
1562
+ }
1563
+ export interface EmulateViewport {
1564
+ /**
1565
+ * Page width in pixels.
1566
+ */
1567
+ width: number;
1568
+ /**
1569
+ * page height in pixels.
1570
+ */
1571
+ height: number;
1572
+ /**
1573
+ * Specify device scale factor (can be thought of as dpr). Defaults to 1.
1574
+ */
1575
+ deviceScaleFactor?: number;
1576
+ /**
1577
+ * Whether the meta viewport tag is taken into account. Defaults to false.
1578
+ */
1579
+ isMobile?: boolean;
1580
+ /**
1581
+ * Specifies if viewport supports touch events. Defaults to false
1582
+ */
1583
+ hasTouch?: boolean;
1584
+ /**
1585
+ * Specifies if viewport is in landscape mode. Defaults to false.
1586
+ */
1587
+ isLandscape?: boolean;
1588
+ }
1589
+ export declare type LogLevel = 'debug' | 'info' | 'warn' | 'error' | string;
1590
+ /**
1591
+ * Common logger to be used by the compiler, dev-server and CLI. The CLI will use a
1592
+ * NodeJS based console logging and colors, and the web will use browser based
1593
+ * logs and colors.
1594
+ */
1595
+ export interface Logger {
1596
+ enableColors: (useColors: boolean) => void;
1597
+ setLevel: (level: LogLevel) => void;
1598
+ getLevel: () => LogLevel;
1599
+ debug: (...msg: any[]) => void;
1600
+ info: (...msg: any[]) => void;
1601
+ warn: (...msg: any[]) => void;
1602
+ error: (...msg: any[]) => void;
1603
+ createTimeSpan: (startMsg: string, debug?: boolean, appendTo?: string[]) => LoggerTimeSpan;
1604
+ printDiagnostics: (diagnostics: Diagnostic[], cwd?: string) => void;
1605
+ red: (msg: string) => string;
1606
+ green: (msg: string) => string;
1607
+ yellow: (msg: string) => string;
1608
+ blue: (msg: string) => string;
1609
+ magenta: (msg: string) => string;
1610
+ cyan: (msg: string) => string;
1611
+ gray: (msg: string) => string;
1612
+ bold: (msg: string) => string;
1613
+ dim: (msg: string) => string;
1614
+ bgRed: (msg: string) => string;
1615
+ emoji: (e: string) => string;
1616
+ setLogFilePath?: (p: string) => void;
1617
+ writeLogs?: (append: boolean) => void;
1618
+ createLineUpdater?: () => Promise<LoggerLineUpdater>;
1619
+ }
1620
+ export interface LoggerLineUpdater {
1621
+ update(text: string): Promise<void>;
1622
+ stop(): Promise<void>;
1623
+ }
1624
+ export interface LoggerTimeSpan {
1625
+ duration(): number;
1626
+ finish(finishedMsg: string, color?: string, bold?: boolean, newLineSuffix?: boolean): number;
1627
+ }
1628
+ export interface OutputTargetDist extends OutputTargetBase {
1629
+ type: 'dist';
1630
+ buildDir?: string;
1631
+ dir?: string;
1632
+ collectionDir?: string | null;
1633
+ typesDir?: string;
1634
+ esmLoaderPath?: string;
1635
+ copy?: CopyTask[];
1636
+ polyfills?: boolean;
1637
+ empty?: boolean;
1638
+ }
1639
+ export interface OutputTargetDistCollection extends OutputTargetBase {
1640
+ type: 'dist-collection';
1641
+ dir: string;
1642
+ collectionDir: string;
1643
+ }
1644
+ export interface OutputTargetDistTypes extends OutputTargetBase {
1645
+ type: 'dist-types';
1646
+ dir: string;
1647
+ typesDir: string;
1648
+ }
1649
+ export interface OutputTargetDistLazy extends OutputTargetBase {
1650
+ type: 'dist-lazy';
1651
+ dir?: string;
1652
+ esmDir?: string;
1653
+ esmEs5Dir?: string;
1654
+ systemDir?: string;
1655
+ cjsDir?: string;
1656
+ polyfills?: boolean;
1657
+ isBrowserBuild?: boolean;
1658
+ esmIndexFile?: string;
1659
+ cjsIndexFile?: string;
1660
+ systemLoaderFile?: string;
1661
+ empty?: boolean;
1662
+ }
1663
+ export interface OutputTargetDistGlobalStyles extends OutputTargetBase {
1664
+ type: 'dist-global-styles';
1665
+ file: string;
1666
+ }
1667
+ export interface OutputTargetDistLazyLoader extends OutputTargetBase {
1668
+ type: 'dist-lazy-loader';
1669
+ dir: string;
1670
+ esmDir: string;
1671
+ esmEs5Dir: string;
1672
+ cjsDir: string;
1673
+ componentDts: string;
1674
+ empty: boolean;
1675
+ }
1676
+ export interface OutputTargetHydrate extends OutputTargetBase {
1677
+ type: 'dist-hydrate-script';
1678
+ dir?: string;
1679
+ /**
1680
+ * Module IDs that should not be bundled into the script.
1681
+ * By default, all node builtin's, such as `fs` or `path`
1682
+ * will be considered "external" and not bundled.
1683
+ */
1684
+ external?: string[];
1685
+ empty?: boolean;
1686
+ }
1687
+ export interface OutputTargetCustom extends OutputTargetBase {
1688
+ type: 'custom';
1689
+ name: string;
1690
+ validate?: (config: Config, diagnostics: Diagnostic[]) => void;
1691
+ generator: (config: Config, compilerCtx: any, buildCtx: any, docs: any) => Promise<void>;
1692
+ copy?: CopyTask[];
1693
+ }
1694
+ export interface OutputTargetDocsVscode extends OutputTargetBase {
1695
+ type: 'docs-vscode';
1696
+ file: string;
1697
+ sourceCodeBaseUrl?: string;
1698
+ }
1699
+ export interface OutputTargetDocsReadme extends OutputTargetBase {
1700
+ type: 'docs-readme';
1701
+ dir?: string;
1702
+ dependencies?: boolean;
1703
+ footer?: string;
1704
+ strict?: boolean;
1705
+ }
1706
+ export interface OutputTargetDocsJson extends OutputTargetBase {
1707
+ type: 'docs-json';
1708
+ file: string;
1709
+ typesFile?: string | null;
1710
+ strict?: boolean;
1711
+ }
1712
+ export interface OutputTargetDocsCustom extends OutputTargetBase {
1713
+ type: 'docs-custom';
1714
+ generator: (docs: JsonDocs, config: Config) => void | Promise<void>;
1715
+ strict?: boolean;
1716
+ }
1717
+ export interface OutputTargetStats extends OutputTargetBase {
1718
+ type: 'stats';
1719
+ file?: string;
1720
+ }
1721
+ export interface OutputTargetBaseNext {
1722
+ type: string;
1723
+ dir?: string;
1724
+ }
1725
+ export interface OutputTargetDistCustomElements extends OutputTargetBaseNext {
1726
+ type: 'dist-custom-elements';
1727
+ empty?: boolean;
1728
+ externalRuntime?: boolean;
1729
+ copy?: CopyTask[];
1730
+ inlineDynamicImports?: boolean;
1731
+ includeGlobalScripts?: boolean;
1732
+ minify?: boolean;
1733
+ }
1734
+ export interface OutputTargetDistCustomElementsBundle extends OutputTargetBaseNext {
1735
+ type: 'dist-custom-elements-bundle';
1736
+ empty?: boolean;
1737
+ externalRuntime?: boolean;
1738
+ copy?: CopyTask[];
1739
+ inlineDynamicImports?: boolean;
1740
+ includeGlobalScripts?: boolean;
1741
+ minify?: boolean;
1742
+ }
1743
+ export interface OutputTargetBase {
1744
+ type: string;
1745
+ }
1746
+ export declare type OutputTargetBuild = OutputTargetDistCollection | OutputTargetDistLazy;
1747
+ export interface OutputTargetAngular extends OutputTargetBase {
1748
+ type: 'angular';
1749
+ componentCorePackage: string;
1750
+ directivesProxyFile?: string;
1751
+ directivesArrayFile?: string;
1752
+ directivesUtilsFile?: string;
1753
+ excludeComponents?: string[];
1754
+ }
1755
+ export interface OutputTargetCopy extends OutputTargetBase {
1756
+ type: 'copy';
1757
+ dir: string;
1758
+ copy?: CopyTask[];
1759
+ copyAssets?: 'collection' | 'dist';
1760
+ }
1761
+ export interface OutputTargetWww extends OutputTargetBase {
1762
+ /**
1763
+ * Webapp output target.
1764
+ */
1765
+ type: 'www';
1766
+ /**
1767
+ * The directory to write the app's JavaScript and CSS build
1768
+ * files to. The default is to place this directory as a child
1769
+ * to the `dir` config. Default: `build`
1770
+ */
1771
+ buildDir?: string;
1772
+ /**
1773
+ * The directory to write the entire application to.
1774
+ * Note, the `buildDir` is where the app's JavaScript and CSS build
1775
+ * files are written. Default: `www`
1776
+ */
1777
+ dir?: string;
1778
+ /**
1779
+ * Empty the build directory of all files and directories on first build.
1780
+ * Default: `true`
1781
+ */
1782
+ empty?: boolean;
1783
+ /**
1784
+ * The default index html file of the app, commonly found at the
1785
+ * root of the `src` directory.
1786
+ * Default: `index.html`
1787
+ */
1788
+ indexHtml?: string;
1789
+ /**
1790
+ * The copy config is an array of objects that defines any files or folders that should
1791
+ * be copied over to the build directory.
1792
+ *
1793
+ * Each object in the array must include a src property which can be either an absolute path,
1794
+ * a relative path or a glob pattern. The config can also provide an optional dest property
1795
+ * which can be either an absolute path or a path relative to the build directory.
1796
+ * Also note that any files within src/assets are automatically copied to www/assets for convenience.
1797
+ *
1798
+ * In the copy config below, it will copy the entire directory from src/docs-content over to www/docs-content.
1799
+ */
1800
+ copy?: CopyTask[];
1801
+ /**
1802
+ * The base url of the app, it's required during prerendering to be the absolute path
1803
+ * of your app, such as: `https://my.app.com/app`.
1804
+ *
1805
+ * Default: `/`
1806
+ */
1807
+ baseUrl?: string;
1808
+ /**
1809
+ * By default, rindo will include all the polyfills required by legacy browsers in the ES5 build.
1810
+ * If it's `false`, rindo will not emit this polyfills anymore and it's your responsability to provide them before
1811
+ * rindo initializes.
1812
+ */
1813
+ polyfills?: boolean;
1814
+ /**
1815
+ * Path to an external node module which has exports of the prerender config object.
1816
+ * ```
1817
+ * module.exports = {
1818
+ * afterHydrate(document, url) {
1819
+ * document.title = `URL: ${url.href}`;
1820
+ * }
1821
+ * }
1822
+ * ```
1823
+ */
1824
+ prerenderConfig?: string;
1825
+ /**
1826
+ * Service worker config for production builds. During development builds
1827
+ * service worker script will be injected to automatically unregister existing
1828
+ * service workers. When set to `false` neither a service worker registration
1829
+ * or unregistration will be added to the index.html.
1830
+ */
1831
+ serviceWorker?: ServiceWorkerConfig | null | false;
1832
+ appDir?: string;
1833
+ }
1834
+ export declare type OutputTarget = OutputTargetAngular | OutputTargetCopy | OutputTargetCustom | OutputTargetDist | OutputTargetDistCollection | OutputTargetDistCustomElements | OutputTargetDistCustomElementsBundle | OutputTargetDistLazy | OutputTargetDistGlobalStyles | OutputTargetDistLazyLoader | OutputTargetDocsJson | OutputTargetDocsCustom | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetWww | OutputTargetHydrate | OutputTargetStats | OutputTargetDistTypes;
1835
+ export interface ServiceWorkerConfig {
1836
+ unregister?: boolean;
1837
+ swDest?: string;
1838
+ swSrc?: string;
1839
+ globPatterns?: string[];
1840
+ globDirectory?: string | string[];
1841
+ globIgnores?: string | string[];
1842
+ templatedUrls?: any;
1843
+ maximumFileSizeToCacheInBytes?: number;
1844
+ manifestTransforms?: any;
1845
+ modifyUrlPrefix?: any;
1846
+ dontCacheBustURLsMatching?: RegExp;
1847
+ navigateFallback?: string;
1848
+ navigateFallbackWhitelist?: RegExp[];
1849
+ navigateFallbackBlacklist?: RegExp[];
1850
+ cacheId?: string;
1851
+ skipWaiting?: boolean;
1852
+ clientsClaim?: boolean;
1853
+ directoryIndex?: string;
1854
+ runtimeCaching?: any[];
1855
+ ignoreUrlParametersMatching?: any[];
1856
+ handleFetch?: boolean;
1857
+ }
1858
+ export interface LoadConfigInit {
1859
+ /**
1860
+ * User config object to merge into default config and
1861
+ * config loaded from a file path.
1862
+ */
1863
+ config?: Config;
1864
+ /**
1865
+ * Absolute path to a Rindo config file. This path cannot be
1866
+ * relative and it does not resolve config files within a directory.
1867
+ */
1868
+ configPath?: string;
1869
+ logger?: Logger;
1870
+ sys?: CompilerSystem;
1871
+ /**
1872
+ * When set to true, if the "tsconfig.json" file is not found
1873
+ * it'll automatically generate and save a default tsconfig
1874
+ * within the root directory.
1875
+ */
1876
+ initTsConfig?: boolean;
1877
+ }
1878
+ export interface LoadConfigResults {
1879
+ config: Config;
1880
+ diagnostics: Diagnostic[];
1881
+ tsconfig: {
1882
+ path: string;
1883
+ compilerOptions: any;
1884
+ files: string[];
1885
+ include: string[];
1886
+ exclude: string[];
1887
+ extends: string;
1888
+ };
1889
+ }
1890
+ export interface Diagnostic {
1891
+ level: 'error' | 'warn' | 'info' | 'log' | 'debug';
1892
+ type: string;
1893
+ header?: string;
1894
+ language?: string;
1895
+ messageText: string;
1896
+ debugText?: string;
1897
+ code?: string;
1898
+ absFilePath?: string;
1899
+ relFilePath?: string;
1900
+ lineNumber?: number;
1901
+ columnNumber?: number;
1902
+ lines?: {
1903
+ lineIndex: number;
1904
+ lineNumber: number;
1905
+ text?: string;
1906
+ errorCharStart: number;
1907
+ errorLength?: number;
1908
+ }[];
1909
+ }
1910
+ export interface CacheStorage {
1911
+ get(key: string): Promise<any>;
1912
+ set(key: string, value: any): Promise<void>;
1913
+ }
1914
+ export interface WorkerOptions {
1915
+ maxConcurrentWorkers?: number;
1916
+ maxConcurrentTasksPerWorker?: number;
1917
+ logger?: Logger;
1918
+ }
1919
+ export interface RollupInterface {
1920
+ rollup: {
1921
+ (config: any): Promise<any>;
1922
+ };
1923
+ plugins: {
1924
+ nodeResolve(opts: any): any;
1925
+ replace(opts: any): any;
1926
+ commonjs(opts: any): any;
1927
+ json(): any;
1928
+ };
1929
+ }
1930
+ export interface ResolveModuleOptions {
1931
+ manuallyResolve?: boolean;
1932
+ packageJson?: boolean;
1933
+ }
1934
+ export interface PrerenderStartOptions {
1935
+ buildId?: string;
1936
+ hydrateAppFilePath: string;
1937
+ componentGraph: BuildResultsComponentGraph;
1938
+ srcIndexHtmlPath: string;
1939
+ }
1940
+ export interface PrerenderResults {
1941
+ buildId: string;
1942
+ diagnostics: Diagnostic[];
1943
+ urls: number;
1944
+ duration: number;
1945
+ average: number;
1946
+ }
1947
+ export interface OptimizeCssInput {
1948
+ input: string;
1949
+ filePath?: string;
1950
+ autoprefixer?: any;
1951
+ minify?: boolean;
1952
+ sourceMap?: boolean;
1953
+ resolveUrl?: (url: string) => Promise<string> | string;
1954
+ }
1955
+ export interface OptimizeCssOutput {
1956
+ output: string;
1957
+ diagnostics: Diagnostic[];
1958
+ }
1959
+ export interface OptimizeJsInput {
1960
+ input: string;
1961
+ filePath?: string;
1962
+ target?: 'es5' | 'latest';
1963
+ pretty?: boolean;
1964
+ sourceMap?: boolean;
1965
+ }
1966
+ export interface OptimizeJsOutput {
1967
+ output: string;
1968
+ sourceMap: any;
1969
+ diagnostics: Diagnostic[];
1970
+ }
1971
+ export interface LazyRequire {
1972
+ ensure(fromDir: string, moduleIds: string[]): Promise<Diagnostic[]>;
1973
+ require(fromDir: string, moduleId: string): any;
1974
+ getModulePath(fromDir: string, moduleId: string): string;
1975
+ }
1976
+ export interface FsWatcherItem {
1977
+ close(): void;
1978
+ }
1979
+ export interface MakeDirectoryOptions {
1980
+ /**
1981
+ * Indicates whether parent folders should be created.
1982
+ * @default false
1983
+ */
1984
+ recursive?: boolean;
1985
+ /**
1986
+ * A file mode. If a string is passed, it is parsed as an octal integer. If not specified
1987
+ * @default 0o777.
1988
+ */
1989
+ mode?: number;
1990
+ }
1991
+ export interface FsStats {
1992
+ isFile(): boolean;
1993
+ isDirectory(): boolean;
1994
+ isBlockDevice(): boolean;
1995
+ isCharacterDevice(): boolean;
1996
+ isSymbolicLink(): boolean;
1997
+ isFIFO(): boolean;
1998
+ isSocket(): boolean;
1999
+ dev: number;
2000
+ ino: number;
2001
+ mode: number;
2002
+ nlink: number;
2003
+ uid: number;
2004
+ gid: number;
2005
+ rdev: number;
2006
+ size: number;
2007
+ blksize: number;
2008
+ blocks: number;
2009
+ atime: Date;
2010
+ mtime: Date;
2011
+ ctime: Date;
2012
+ birthtime: Date;
2013
+ }
2014
+ export interface FsWriteOptions {
2015
+ inMemoryOnly?: boolean;
2016
+ clearFileCache?: boolean;
2017
+ immediateWrite?: boolean;
2018
+ useCache?: boolean;
2019
+ outputTargetType?: string;
2020
+ }
2021
+ export interface Compiler {
2022
+ build(): Promise<CompilerBuildResults>;
2023
+ createWatcher(): Promise<CompilerWatcher>;
2024
+ destroy(): Promise<void>;
2025
+ sys: CompilerSystem;
2026
+ }
2027
+ export interface CompilerWatcher extends BuildOnEvents {
2028
+ start: () => Promise<WatcherCloseResults>;
2029
+ close: () => Promise<WatcherCloseResults>;
2030
+ request: (data: CompilerRequest) => Promise<CompilerRequestResponse>;
2031
+ }
2032
+ export interface CompilerRequest {
2033
+ path?: string;
2034
+ }
2035
+ export interface WatcherCloseResults {
2036
+ exitCode: number;
2037
+ }
2038
+ export interface CompilerRequestResponse {
2039
+ path: string;
2040
+ nodeModuleId: string;
2041
+ nodeModuleVersion: string;
2042
+ nodeResolvedPath: string;
2043
+ cachePath: string;
2044
+ cacheHit: boolean;
2045
+ content: string;
2046
+ status: number;
2047
+ }
2048
+ export interface TranspileOptions {
2049
+ /**
2050
+ * A component can be defined as a custom element by using `customelement`, or the
2051
+ * component class can be exported by using `module`. Default is `customelement`.
2052
+ */
2053
+ componentExport?: 'customelement' | 'module' | string | undefined;
2054
+ /**
2055
+ * Sets how and if component metadata should be assigned on the compiled
2056
+ * component output. The `compilerstatic` value will set the metadata to
2057
+ * a static `COMPILER_META` getter on the component class. This option
2058
+ * is useful for unit testing preprocessors. Default is `null`.
2059
+ */
2060
+ componentMetadata?: 'runtimestatic' | 'compilerstatic' | string | undefined;
2061
+ /**
2062
+ * The actual internal import path for any `@rindo/core` imports.
2063
+ * Default is `@rindo/core/internal/client`.
2064
+ */
2065
+ coreImportPath?: string;
2066
+ /**
2067
+ * The current working directory. Default is `/`.
2068
+ */
2069
+ currentDirectory?: string;
2070
+ /**
2071
+ * The filename of the code being compiled. Default is `module.tsx`.
2072
+ */
2073
+ file?: string;
2074
+ /**
2075
+ * Module format to use for the compiled code output, which can be either `esm` or `cjs`.
2076
+ * Default is `esm`.
2077
+ */
2078
+ module?: 'cjs' | 'esm' | string;
2079
+ /**
2080
+ * Sets how and if any properties, methods and events are proxied on the
2081
+ * component class. The `defineproperty` value sets the getters and setters
2082
+ * using Object.defineProperty. Default is `defineproperty`.
2083
+ */
2084
+ proxy?: 'defineproperty' | string | undefined;
2085
+ /**
2086
+ * How component styles should be associated to the component. The `static`
2087
+ * setting will assign the styles as a static getter on the component class.
2088
+ */
2089
+ style?: 'static' | string | undefined;
2090
+ /**
2091
+ * How style data should be added for imports. For example, the `queryparams` value
2092
+ * adds the component's tagname and encapsulation info as querystring parameter
2093
+ * to the style's import, such as `style.css?tag=my-tag&encapsulation=shadow`. This
2094
+ * style data can be used by bundlers to further optimize each component's css.
2095
+ * Set to `null` to not include the querystring parameters. Default is `queryparams`.
2096
+ */
2097
+ styleImportData?: 'queryparams' | string | undefined;
2098
+ /**
2099
+ * The JavaScript source target TypeScript should to transpile to. Values can be
2100
+ * `latest`, `esnext`, `es2017`, `es2015`, or `es5`. Defaults to `latest`.
2101
+ */
2102
+ target?: CompileTarget;
2103
+ /**
2104
+ * Create a source map. Using `inline` will inline the source map into the
2105
+ * code, otherwise the source map will be in the returned `map` property.
2106
+ * Default is `true`.
2107
+ */
2108
+ sourceMap?: boolean | 'inline';
2109
+ /**
2110
+ * Base directory to resolve non-relative module names. Same as the `baseUrl`
2111
+ * TypeScript compiler option: https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping
2112
+ */
2113
+ baseUrl?: string;
2114
+ /**
2115
+ * List of path mapping entries for module names to locations relative to the `baseUrl`.
2116
+ * Same as the `paths` TypeScript compiler option:
2117
+ * https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping
2118
+ */
2119
+ paths?: {
2120
+ [key: string]: string[];
2121
+ };
2122
+ /**
2123
+ * Passed in Rindo Compiler System, otherwise falls back to the internal in-memory only system.
2124
+ */
2125
+ sys?: CompilerSystem;
2126
+ }
2127
+ export declare type CompileTarget = 'latest' | 'esnext' | 'es2020' | 'es2019' | 'es2018' | 'es2017' | 'es2015' | 'es5' | string | undefined;
2128
+ export interface TranspileResults {
2129
+ code: string;
2130
+ data?: any[];
2131
+ diagnostics: Diagnostic[];
2132
+ imports?: {
2133
+ path: string;
2134
+ }[];
2135
+ inputFileExtension: string;
2136
+ inputFilePath: string;
2137
+ map: any;
2138
+ outputFilePath: string;
2139
+ }
2140
+ export interface TransformOptions {
2141
+ coreImportPath: string;
2142
+ componentExport: 'lazy' | 'module' | 'customelement' | null;
2143
+ componentMetadata: 'runtimestatic' | 'compilerstatic' | null;
2144
+ currentDirectory: string;
2145
+ file?: string;
2146
+ isolatedModules?: boolean;
2147
+ module?: 'cjs' | 'esm';
2148
+ proxy: 'defineproperty' | null;
2149
+ style: 'static' | null;
2150
+ styleImportData: 'queryparams' | null;
2151
+ target?: string;
2152
+ }
2153
+ export interface CompileScriptMinifyOptions {
2154
+ target?: CompileTarget;
2155
+ pretty?: boolean;
2156
+ }
2157
+ export interface DevServer extends BuildEmitEvents {
2158
+ address: string;
2159
+ basePath: string;
2160
+ browserUrl: string;
2161
+ protocol: string;
2162
+ port: number;
2163
+ root: string;
2164
+ close(): Promise<void>;
2165
+ }
2166
+ export interface CliInitOptions {
2167
+ args: string[];
2168
+ logger: Logger;
2169
+ sys: CompilerSystem;
2170
+ }