@rindo/core 2.16.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/LICENSE.md +27 -0
  2. package/bin/rindo +57 -0
  3. package/cli/index.cjs +1784 -0
  4. package/cli/index.d.ts +15 -0
  5. package/cli/index.js +1758 -0
  6. package/cli/package.json +14 -0
  7. package/compiler/lib.d.ts +24 -0
  8. package/compiler/lib.dom.d.ts +17791 -0
  9. package/compiler/lib.dom.iterable.d.ts +323 -0
  10. package/compiler/lib.es2015.collection.d.ts +89 -0
  11. package/compiler/lib.es2015.core.d.ts +559 -0
  12. package/compiler/lib.es2015.d.ts +30 -0
  13. package/compiler/lib.es2015.generator.d.ts +79 -0
  14. package/compiler/lib.es2015.iterable.d.ts +497 -0
  15. package/compiler/lib.es2015.promise.d.ts +78 -0
  16. package/compiler/lib.es2015.proxy.d.ts +41 -0
  17. package/compiler/lib.es2015.reflect.d.ts +123 -0
  18. package/compiler/lib.es2015.symbol.d.ts +48 -0
  19. package/compiler/lib.es2015.symbol.wellknown.d.ts +324 -0
  20. package/compiler/lib.es2016.array.include.d.ts +118 -0
  21. package/compiler/lib.es2016.d.ts +22 -0
  22. package/compiler/lib.es2016.full.d.ts +25 -0
  23. package/compiler/lib.es2017.d.ts +26 -0
  24. package/compiler/lib.es2017.full.d.ts +25 -0
  25. package/compiler/lib.es2017.intl.d.ts +32 -0
  26. package/compiler/lib.es2017.object.d.ts +51 -0
  27. package/compiler/lib.es2017.sharedmemory.d.ts +137 -0
  28. package/compiler/lib.es2017.string.d.ts +47 -0
  29. package/compiler/lib.es2017.typedarrays.d.ts +55 -0
  30. package/compiler/lib.es2018.asyncgenerator.d.ts +79 -0
  31. package/compiler/lib.es2018.asynciterable.d.ts +45 -0
  32. package/compiler/lib.es2018.d.ts +26 -0
  33. package/compiler/lib.es2018.full.d.ts +25 -0
  34. package/compiler/lib.es2018.intl.d.ts +73 -0
  35. package/compiler/lib.es2018.promise.d.ts +32 -0
  36. package/compiler/lib.es2018.regexp.d.ts +39 -0
  37. package/compiler/lib.es2019.array.d.ts +85 -0
  38. package/compiler/lib.es2019.d.ts +25 -0
  39. package/compiler/lib.es2019.full.d.ts +25 -0
  40. package/compiler/lib.es2019.object.d.ts +35 -0
  41. package/compiler/lib.es2019.string.d.ts +39 -0
  42. package/compiler/lib.es2019.symbol.d.ts +26 -0
  43. package/compiler/lib.es2020.bigint.d.ts +728 -0
  44. package/compiler/lib.es2020.d.ts +27 -0
  45. package/compiler/lib.es2020.full.d.ts +25 -0
  46. package/compiler/lib.es2020.intl.d.ts +368 -0
  47. package/compiler/lib.es2020.promise.d.ts +49 -0
  48. package/compiler/lib.es2020.sharedmemory.d.ts +99 -0
  49. package/compiler/lib.es2020.string.d.ts +30 -0
  50. package/compiler/lib.es2020.symbol.wellknown.d.ts +39 -0
  51. package/compiler/lib.es2021.d.ts +25 -0
  52. package/compiler/lib.es2021.full.d.ts +25 -0
  53. package/compiler/lib.es2021.intl.d.ts +44 -0
  54. package/compiler/lib.es2021.promise.d.ts +50 -0
  55. package/compiler/lib.es2021.string.d.ts +35 -0
  56. package/compiler/lib.es2021.weakref.d.ts +75 -0
  57. package/compiler/lib.es5.d.ts +4495 -0
  58. package/compiler/lib.es6.d.ts +25 -0
  59. package/compiler/lib.esnext.d.ts +22 -0
  60. package/compiler/lib.esnext.full.d.ts +25 -0
  61. package/compiler/lib.esnext.intl.d.ts +23 -0
  62. package/compiler/lib.esnext.promise.d.ts +43 -0
  63. package/compiler/lib.esnext.string.d.ts +35 -0
  64. package/compiler/lib.esnext.weakref.d.ts +75 -0
  65. package/compiler/lib.scripthost.d.ts +327 -0
  66. package/compiler/lib.webworker.d.ts +5733 -0
  67. package/compiler/lib.webworker.importscripts.d.ts +26 -0
  68. package/compiler/lib.webworker.iterable.d.ts +160 -0
  69. package/compiler/package.json +8 -0
  70. package/compiler/rindo.d.ts +95 -0
  71. package/compiler/rindo.js +67222 -0
  72. package/compiler/rindo.min.js +4 -0
  73. package/dependencies.json +109 -0
  74. package/dev-server/client/app-error.d.ts +18 -0
  75. package/dev-server/client/events.d.ts +6 -0
  76. package/dev-server/client/hmr-components.d.ts +1 -0
  77. package/dev-server/client/hmr-external-styles.d.ts +1 -0
  78. package/dev-server/client/hmr-images.d.ts +1 -0
  79. package/dev-server/client/hmr-inline-styles.d.ts +1 -0
  80. package/dev-server/client/hmr-util.d.ts +9 -0
  81. package/dev-server/client/hmr-window.d.ts +10 -0
  82. package/dev-server/client/index.d.ts +6 -0
  83. package/dev-server/client/index.js +808 -0
  84. package/dev-server/client/logger.d.ts +5 -0
  85. package/dev-server/client/package.json +8 -0
  86. package/dev-server/client/progress.d.ts +3 -0
  87. package/dev-server/client/status.d.ts +4 -0
  88. package/dev-server/connector.html +6 -0
  89. package/dev-server/index.d.ts +3 -0
  90. package/dev-server/index.js +264 -0
  91. package/dev-server/open-in-editor-api.js +1 -0
  92. package/dev-server/package.json +8 -0
  93. package/dev-server/server-process.js +1763 -0
  94. package/dev-server/server-worker-thread.js +39 -0
  95. package/dev-server/static/favicon.ico +0 -0
  96. package/dev-server/templates/directory-index.html +132 -0
  97. package/dev-server/templates/initial-load.html +160 -0
  98. package/dev-server/visualstudio.vbs +82 -0
  99. package/dev-server/ws.js +1 -0
  100. package/dev-server/xdg-open +1066 -0
  101. package/internal/app-data/index.cjs +92 -0
  102. package/internal/app-data/index.d.ts +4 -0
  103. package/internal/app-data/index.js +88 -0
  104. package/internal/app-data/package.json +15 -0
  105. package/internal/client/css-shim.js +4 -0
  106. package/internal/client/dom.js +73 -0
  107. package/internal/client/index.js +3059 -0
  108. package/internal/client/package.json +8 -0
  109. package/internal/client/patch-browser.js +124 -0
  110. package/internal/client/patch-esm.js +23 -0
  111. package/internal/client/polyfills/core-js.js +11 -0
  112. package/internal/client/polyfills/css-shim.js +1 -0
  113. package/internal/client/polyfills/dom.js +79 -0
  114. package/internal/client/polyfills/es5-html-element.js +1 -0
  115. package/internal/client/polyfills/index.js +34 -0
  116. package/internal/client/polyfills/system.js +6 -0
  117. package/internal/client/shadow-css.js +387 -0
  118. package/internal/hydrate/index.js +1132 -0
  119. package/internal/hydrate/package.json +7 -0
  120. package/internal/hydrate/runner.d.ts +217 -0
  121. package/internal/hydrate/runner.js +777 -0
  122. package/internal/hydrate/shadow-css.js +143 -0
  123. package/internal/index.d.ts +4 -0
  124. package/internal/index.js +2 -0
  125. package/internal/package.json +9 -0
  126. package/internal/rindo-core/index.cjs +1 -0
  127. package/internal/rindo-core/index.d.ts +52 -0
  128. package/internal/rindo-core/index.js +16 -0
  129. package/internal/rindo-ext-modules.d.ts +41 -0
  130. package/internal/rindo-private.d.ts +2289 -0
  131. package/internal/rindo-public-compiler.d.ts +2273 -0
  132. package/internal/rindo-public-docs.d.ts +116 -0
  133. package/internal/rindo-public-runtime.d.ts +1565 -0
  134. package/internal/testing/index.js +1093 -0
  135. package/internal/testing/package.json +7 -0
  136. package/internal/testing/shadow-css.js +143 -0
  137. package/mock-doc/index.cjs +4658 -0
  138. package/mock-doc/index.d.ts +928 -0
  139. package/mock-doc/index.js +4622 -0
  140. package/mock-doc/package.json +15 -0
  141. package/package.json +151 -0
  142. package/readme.md +74 -0
  143. package/screenshot/compare/assets/favicon.ico +0 -0
  144. package/screenshot/compare/assets/logo.png +0 -0
  145. package/screenshot/compare/build/app.css +1 -0
  146. package/screenshot/compare/build/app.esm.js +1 -0
  147. package/screenshot/compare/build/app.js +33 -0
  148. package/screenshot/compare/build/index.esm.js +0 -0
  149. package/screenshot/compare/build/p-081b0641.js +1 -0
  150. package/screenshot/compare/build/p-227a1e18.entry.js +1 -0
  151. package/screenshot/compare/build/p-2c298727.entry.js +1 -0
  152. package/screenshot/compare/build/p-5479268c.entry.js +1 -0
  153. package/screenshot/compare/build/p-573ec8a4.entry.js +1 -0
  154. package/screenshot/compare/build/p-6ba08604.entry.js +1 -0
  155. package/screenshot/compare/build/p-6bc63295.entry.js +1 -0
  156. package/screenshot/compare/build/p-7a3759fd.entry.js +1 -0
  157. package/screenshot/compare/build/p-7b4e3ba7.js +1 -0
  158. package/screenshot/compare/build/p-988eb362.css +1 -0
  159. package/screenshot/compare/build/p-9b6a9315.js +1 -0
  160. package/screenshot/compare/build/p-b4cc611c.entry.js +1 -0
  161. package/screenshot/compare/build/p-d1bf53f5.entry.js +1 -0
  162. package/screenshot/compare/build/p-e2efe0df.js +1 -0
  163. package/screenshot/compare/build/p-e8ca6d97.entry.js +1 -0
  164. package/screenshot/compare/build/p-ec2f13e0.entry.js +1 -0
  165. package/screenshot/compare/build/p-f0b99977.entry.js +1 -0
  166. package/screenshot/compare/build/p-f4745c2f.entry.js +1 -0
  167. package/screenshot/compare/build/p-fbbae598.js +1 -0
  168. package/screenshot/compare/host.config.json +15 -0
  169. package/screenshot/compare/index.html +1 -0
  170. package/screenshot/compare/manifest.json +13 -0
  171. package/screenshot/connector-base.d.ts +42 -0
  172. package/screenshot/connector-local.d.ts +7 -0
  173. package/screenshot/connector.js +2 -0
  174. package/screenshot/index.d.ts +3 -0
  175. package/screenshot/index.js +659 -0
  176. package/screenshot/local-connector.js +2 -0
  177. package/screenshot/package.json +15 -0
  178. package/screenshot/pixel-match.d.ts +1 -0
  179. package/screenshot/pixel-match.js +2673 -0
  180. package/screenshot/screenshot-compare.d.ts +3 -0
  181. package/screenshot/screenshot-fs.d.ts +15 -0
  182. package/sys/node/autoprefixer.js +8 -0
  183. package/sys/node/glob.js +1 -0
  184. package/sys/node/graceful-fs.js +1 -0
  185. package/sys/node/index.d.ts +18 -0
  186. package/sys/node/index.js +6124 -0
  187. package/sys/node/node-fetch.js +1 -0
  188. package/sys/node/package.json +8 -0
  189. package/sys/node/prompts.js +1 -0
  190. package/sys/node/worker.js +52 -0
  191. package/testing/index.d.ts +12 -0
  192. package/testing/index.js +4232 -0
  193. package/testing/jest/jest-config.d.ts +16 -0
  194. package/testing/jest/jest-environment.d.ts +15 -0
  195. package/testing/jest/jest-preprocessor.d.ts +59 -0
  196. package/testing/jest/jest-runner.d.ts +9 -0
  197. package/testing/jest/jest-screenshot.d.ts +2 -0
  198. package/testing/jest/jest-serializer.d.ts +5 -0
  199. package/testing/jest/jest-setup-test-framework.d.ts +1 -0
  200. package/testing/jest-environment.js +3 -0
  201. package/testing/jest-preprocessor.js +3 -0
  202. package/testing/jest-preset.js +37 -0
  203. package/testing/jest-runner.js +3 -0
  204. package/testing/jest-setuptestframework.js +3 -0
  205. package/testing/matchers/attributes.d.ts +14 -0
  206. package/testing/matchers/class-list.d.ts +12 -0
  207. package/testing/matchers/events.d.ts +21 -0
  208. package/testing/matchers/html.d.ts +12 -0
  209. package/testing/matchers/index.d.ts +23 -0
  210. package/testing/matchers/screenshot.d.ts +5 -0
  211. package/testing/matchers/text.d.ts +4 -0
  212. package/testing/mock-fetch.d.ts +11 -0
  213. package/testing/mocks.d.ts +10 -0
  214. package/testing/package.json +8 -0
  215. package/testing/puppeteer/index.d.ts +2 -0
  216. package/testing/puppeteer/puppeteer-browser.d.ts +6 -0
  217. package/testing/puppeteer/puppeteer-declarations.d.ts +429 -0
  218. package/testing/puppeteer/puppeteer-element.d.ts +67 -0
  219. package/testing/puppeteer/puppeteer-emulate.d.ts +2 -0
  220. package/testing/puppeteer/puppeteer-events.d.ts +21 -0
  221. package/testing/puppeteer/puppeteer-page.d.ts +2 -0
  222. package/testing/puppeteer/puppeteer-screenshot.d.ts +4 -0
  223. package/testing/reset-build-conditionals.d.ts +2 -0
  224. package/testing/spec-page.d.ts +2 -0
  225. package/testing/test-transpile.d.ts +2 -0
  226. package/testing/testing-logger.d.ts +25 -0
  227. package/testing/testing-sys.d.ts +6 -0
  228. package/testing/testing-utils.d.ts +6 -0
  229. package/testing/testing.d.ts +2 -0
@@ -0,0 +1,2289 @@
1
+ import { BuildResultsComponentGraph } from '.';
2
+ import type { BuildEvents, BuildLog, BuildOutput, CompilerBuildResults, CompilerBuildStart, CompilerFsStats, CompilerRequestResponse, CompilerSystem, Config, CopyResults, DevServerConfig, DevServerEditor, Diagnostic, FsWriteOptions, Logger, LoggerTimeSpan, OptimizeCssInput, OptimizeCssOutput, OutputTargetWww, PageReloadStrategy, PrerenderConfig, StyleDoc, LoggerLineUpdater, TaskCommand } from './rindo-public-compiler';
3
+ import type { ComponentInterface, ListenOptions, ListenTargetOptions, VNode, VNodeData } from './rindo-public-runtime';
4
+ export interface SourceMap {
5
+ file: string;
6
+ mappings: string;
7
+ names: string[];
8
+ sourceRoot?: string;
9
+ sources: string[];
10
+ sourcesContent?: string[];
11
+ version: number;
12
+ }
13
+ export interface PrintLine {
14
+ lineIndex: number;
15
+ lineNumber: number;
16
+ text?: string;
17
+ errorCharStart: number;
18
+ errorLength?: number;
19
+ }
20
+ export interface AssetsMeta {
21
+ absolutePath: string;
22
+ cmpRelativePath: string;
23
+ originalComponentPath: string;
24
+ }
25
+ export interface ParsedImport {
26
+ importPath: string;
27
+ basename: string;
28
+ ext: string;
29
+ data: ImportData;
30
+ }
31
+ export interface ImportData {
32
+ tag?: string;
33
+ encapsulation?: string;
34
+ mode?: string;
35
+ }
36
+ export interface SerializeImportData extends ImportData {
37
+ importeePath: string;
38
+ importerPath?: string;
39
+ }
40
+ export interface BuildFeatures {
41
+ style: boolean;
42
+ mode: boolean;
43
+ shadowDom: boolean;
44
+ shadowDelegatesFocus: boolean;
45
+ scoped: boolean;
46
+ /**
47
+ * Every component has a render function
48
+ */
49
+ allRenderFn: boolean;
50
+ /**
51
+ * At least one component has a render function
52
+ */
53
+ hasRenderFn: boolean;
54
+ vdomRender: boolean;
55
+ vdomAttribute: boolean;
56
+ vdomClass: boolean;
57
+ vdomFunctional: boolean;
58
+ vdomKey: boolean;
59
+ vdomListener: boolean;
60
+ vdomPropOrAttr: boolean;
61
+ vdomRef: boolean;
62
+ vdomStyle: boolean;
63
+ vdomText: boolean;
64
+ vdomXlink: boolean;
65
+ slotRelocation: boolean;
66
+ slot: boolean;
67
+ svg: boolean;
68
+ element: boolean;
69
+ event: boolean;
70
+ hostListener: boolean;
71
+ hostListenerTargetWindow: boolean;
72
+ hostListenerTargetDocument: boolean;
73
+ hostListenerTargetBody: boolean;
74
+ /**
75
+ * @deprecated Prevented from new apps, but left in for older collections
76
+ */
77
+ hostListenerTargetParent: boolean;
78
+ hostListenerTarget: boolean;
79
+ method: boolean;
80
+ prop: boolean;
81
+ propMutable: boolean;
82
+ state: boolean;
83
+ watchCallback: boolean;
84
+ member: boolean;
85
+ updatable: boolean;
86
+ propBoolean: boolean;
87
+ propNumber: boolean;
88
+ propString: boolean;
89
+ lifecycle: boolean;
90
+ cmpDidLoad: boolean;
91
+ cmpShouldUpdate: boolean;
92
+ cmpWillLoad: boolean;
93
+ cmpDidUpdate: boolean;
94
+ cmpWillUpdate: boolean;
95
+ cmpWillRender: boolean;
96
+ cmpDidRender: boolean;
97
+ cmpDidUnload: boolean;
98
+ connectedCallback: boolean;
99
+ disconnectedCallback: boolean;
100
+ asyncLoading: boolean;
101
+ observeAttribute: boolean;
102
+ reflect: boolean;
103
+ taskQueue: boolean;
104
+ }
105
+ export interface BuildConditionals extends Partial<BuildFeatures> {
106
+ hotModuleReplacement?: boolean;
107
+ isDebug?: boolean;
108
+ isTesting?: boolean;
109
+ isDev?: boolean;
110
+ devTools?: boolean;
111
+ invisiblePrehydration?: boolean;
112
+ hydrateServerSide?: boolean;
113
+ hydrateClientSide?: boolean;
114
+ lifecycleDOMEvents?: boolean;
115
+ cssAnnotations?: boolean;
116
+ lazyLoad?: boolean;
117
+ profile?: boolean;
118
+ cssVarShim?: boolean;
119
+ constructableCSS?: boolean;
120
+ appendChildSlotFix?: boolean;
121
+ slotChildNodesFix?: boolean;
122
+ scopedSlotTextContentFix?: boolean;
123
+ cloneNodeFix?: boolean;
124
+ dynamicImportShim?: boolean;
125
+ hydratedAttribute?: boolean;
126
+ hydratedClass?: boolean;
127
+ initializeNextTick?: boolean;
128
+ safari10?: boolean;
129
+ scriptDataOpts?: boolean;
130
+ shadowDomShim?: boolean;
131
+ asyncQueue?: boolean;
132
+ transformTagName?: boolean;
133
+ attachStyles?: boolean;
134
+ }
135
+ export declare type ModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd' | 'commonjs' | 'esm' | 'module' | 'systemjs';
136
+ export interface RollupResultModule {
137
+ id: string;
138
+ }
139
+ export interface RollupResults {
140
+ modules: RollupResultModule[];
141
+ }
142
+ export interface UpdatedLazyBuildCtx {
143
+ name: 'esm-browser' | 'esm' | 'cjs' | 'system';
144
+ buildCtx: BuildCtx;
145
+ }
146
+ export interface BuildCtx {
147
+ buildId: number;
148
+ buildResults: CompilerBuildResults;
149
+ buildStats?: CompilerBuildStats | {
150
+ diagnostics: Diagnostic[];
151
+ };
152
+ buildMessages: string[];
153
+ bundleBuildCount: number;
154
+ collections: Collection[];
155
+ compilerCtx: CompilerCtx;
156
+ esmBrowserComponentBundle: ReadonlyArray<BundleModule>;
157
+ esmComponentBundle: ReadonlyArray<BundleModule>;
158
+ es5ComponentBundle: ReadonlyArray<BundleModule>;
159
+ systemComponentBundle: ReadonlyArray<BundleModule>;
160
+ commonJsComponentBundle: ReadonlyArray<BundleModule>;
161
+ components: ComponentCompilerMeta[];
162
+ componentGraph: Map<string, string[]>;
163
+ config: Config;
164
+ createTimeSpan(msg: string, debug?: boolean): LoggerTimeSpan;
165
+ data: any;
166
+ debug: (msg: string) => void;
167
+ diagnostics: Diagnostic[];
168
+ dirsAdded: string[];
169
+ dirsDeleted: string[];
170
+ entryModules: EntryModule[];
171
+ filesAdded: string[];
172
+ filesChanged: string[];
173
+ filesDeleted: string[];
174
+ filesUpdated: string[];
175
+ filesWritten: string[];
176
+ globalStyle: string | undefined;
177
+ hasConfigChanges: boolean;
178
+ hasError: boolean;
179
+ hasFinished: boolean;
180
+ hasHtmlChanges: boolean;
181
+ hasPrintedResults: boolean;
182
+ hasServiceWorkerChanges: boolean;
183
+ hasScriptChanges: boolean;
184
+ hasStyleChanges: boolean;
185
+ hasWarning: boolean;
186
+ hydrateAppFilePath: string;
187
+ indexBuildCount: number;
188
+ indexDoc: Document;
189
+ isRebuild: boolean;
190
+ moduleFiles: Module[];
191
+ packageJson: PackageJsonData;
192
+ pendingCopyTasks: Promise<CopyResults>[];
193
+ progress(task: BuildTask): void;
194
+ requiresFullBuild: boolean;
195
+ rollupResults?: RollupResults;
196
+ scriptsAdded: string[];
197
+ scriptsDeleted: string[];
198
+ startTime: number;
199
+ styleBuildCount: number;
200
+ stylesPromise: Promise<void>;
201
+ stylesUpdated: BuildStyleUpdate[];
202
+ timeSpan: LoggerTimeSpan;
203
+ timestamp: string;
204
+ transpileBuildCount: number;
205
+ validateTypesBuild?(): Promise<void>;
206
+ validateTypesHandler?: (results: any) => Promise<void>;
207
+ validateTypesPromise?: Promise<any>;
208
+ }
209
+ export interface BuildStyleUpdate {
210
+ styleTag: string;
211
+ styleText: string;
212
+ styleMode: string;
213
+ }
214
+ export declare type BuildTask = any;
215
+ export declare type BuildStatus = 'pending' | 'error' | 'disabled' | 'default';
216
+ export interface CompilerBuildStats {
217
+ timestamp: string;
218
+ compiler: {
219
+ name: string;
220
+ version: string;
221
+ };
222
+ app: {
223
+ namespace: string;
224
+ fsNamespace: string;
225
+ components: number;
226
+ entries: number;
227
+ bundles: number;
228
+ outputs: any;
229
+ };
230
+ options: {
231
+ minifyJs: boolean;
232
+ minifyCss: boolean;
233
+ hashFileNames: boolean;
234
+ hashedFileNameLength: number;
235
+ buildEs5: boolean | 'prod';
236
+ };
237
+ formats: {
238
+ esmBrowser: ReadonlyArray<CompilerBuildStatBundle>;
239
+ esm: ReadonlyArray<CompilerBuildStatBundle>;
240
+ es5: ReadonlyArray<CompilerBuildStatBundle>;
241
+ system: ReadonlyArray<CompilerBuildStatBundle>;
242
+ commonjs: ReadonlyArray<CompilerBuildStatBundle>;
243
+ };
244
+ components: BuildComponent[];
245
+ entries: EntryModule[];
246
+ rollupResults: RollupResults;
247
+ sourceGraph?: BuildSourceGraph;
248
+ componentGraph: BuildResultsComponentGraph;
249
+ collections: {
250
+ name: string;
251
+ source: string;
252
+ tags: string[];
253
+ }[];
254
+ }
255
+ export interface CompilerBuildStatBundle {
256
+ key: string;
257
+ components: string[];
258
+ bundleId: string;
259
+ fileName: string;
260
+ imports: string[];
261
+ originalByteSize: number;
262
+ }
263
+ export interface BuildEntry {
264
+ entryId: string;
265
+ components: BuildComponent[];
266
+ bundles: BuildBundle[];
267
+ inputs: string[];
268
+ modes?: string[];
269
+ encapsulations: Encapsulation[];
270
+ }
271
+ export interface BuildBundle {
272
+ fileName: string;
273
+ outputs: string[];
274
+ size?: number;
275
+ mode?: string;
276
+ scopedStyles?: boolean;
277
+ target?: string;
278
+ }
279
+ export interface BuildSourceGraph {
280
+ [filePath: string]: string[];
281
+ }
282
+ export interface BuildComponent {
283
+ tag: string;
284
+ dependencyOf?: string[];
285
+ dependencies?: string[];
286
+ }
287
+ export interface BundleOutputChunk {
288
+ code: string;
289
+ fileName: string;
290
+ isDynamicEntry: boolean;
291
+ isEntry: boolean;
292
+ map: any;
293
+ dynamicImports: string[];
294
+ imports: string[];
295
+ exports: string[];
296
+ modules: {
297
+ [modulePath: string]: {
298
+ renderedExports: string[];
299
+ removedExports: string[];
300
+ renderedLength: number;
301
+ originalLength: number;
302
+ };
303
+ };
304
+ name: string;
305
+ }
306
+ export declare type SourceTarget = 'es5' | 'es2017' | 'latest';
307
+ export interface BundleEntryInputs {
308
+ [entryKey: string]: string;
309
+ }
310
+ /**
311
+ * A note regarding Rollup types:
312
+ * As of this writing, there is no great way to import external types for packages that are directly embedded in the
313
+ * Rindo source. As a result, some types are duplicated here for Rollup that will be used within the codebase.
314
+ * Updates to rollup may require these typings to be updated.
315
+ */
316
+ export declare type RollupResult = RollupChunkResult | RollupAssetResult;
317
+ export interface RollupAssetResult {
318
+ type: 'asset';
319
+ fileName: string;
320
+ content: string;
321
+ }
322
+ export interface RollupChunkResult {
323
+ type: 'chunk';
324
+ entryKey: string;
325
+ fileName: string;
326
+ code: string;
327
+ isEntry: boolean;
328
+ isComponent: boolean;
329
+ isCore: boolean;
330
+ isIndex: boolean;
331
+ isBrowserLoader: boolean;
332
+ imports: string[];
333
+ moduleFormat: ModuleFormat;
334
+ map?: RollupSourceMap;
335
+ }
336
+ export interface RollupSourceMap {
337
+ file: string;
338
+ mappings: string;
339
+ names: string[];
340
+ sources: string[];
341
+ sourcesContent: string[];
342
+ version: number;
343
+ toString(): string;
344
+ toUrl(): string;
345
+ }
346
+ /**
347
+ * Result of Rindo compressing, mangling, and otherwise 'minifying' JavaScript
348
+ */
349
+ export declare type OptimizeJsResult = {
350
+ output: string;
351
+ diagnostics: Diagnostic[];
352
+ sourceMap?: SourceMap;
353
+ };
354
+ export interface BundleModule {
355
+ entryKey: string;
356
+ rollupResult: RollupChunkResult;
357
+ cmps: ComponentCompilerMeta[];
358
+ output: BundleModuleOutput;
359
+ }
360
+ export interface BundleModuleOutput {
361
+ bundleId: string;
362
+ fileName: string;
363
+ code: string;
364
+ }
365
+ export interface Cache {
366
+ get(key: string): Promise<string>;
367
+ put(key: string, value: string): Promise<boolean>;
368
+ has(key: string): Promise<boolean>;
369
+ createKey(domain: string, ...args: any[]): Promise<string>;
370
+ commit(): Promise<void>;
371
+ clear(): void;
372
+ clearDiskCache(): Promise<void>;
373
+ getMemoryStats(): string;
374
+ initCacheDir(): Promise<void>;
375
+ }
376
+ export interface CollectionCompilerMeta {
377
+ collectionName?: string;
378
+ moduleId?: string;
379
+ moduleDir?: string;
380
+ moduleFiles?: Module[];
381
+ global?: Module;
382
+ compiler?: CollectionCompilerVersion;
383
+ isInitialized?: boolean;
384
+ hasExports?: boolean;
385
+ dependencies?: string[];
386
+ bundles?: {
387
+ components: string[];
388
+ }[];
389
+ }
390
+ export interface CollectionCompilerVersion {
391
+ name: string;
392
+ version: string;
393
+ typescriptVersion?: string;
394
+ }
395
+ export interface CollectionManifest {
396
+ entries?: CollectionComponentEntryPath[];
397
+ collections?: CollectionDependencyManifest[];
398
+ global?: string;
399
+ compiler?: CollectionCompilerVersion;
400
+ bundles?: CollectionBundleManifest[];
401
+ }
402
+ export declare type CollectionComponentEntryPath = string;
403
+ export interface CollectionBundleManifest {
404
+ components: string[];
405
+ }
406
+ export interface CollectionDependencyManifest {
407
+ name: string;
408
+ tags: string[];
409
+ }
410
+ /** OLD WAY */
411
+ export interface Collection {
412
+ collectionName?: string;
413
+ moduleDir?: string;
414
+ moduleFiles?: any[];
415
+ global?: any;
416
+ compiler?: CollectionCompiler;
417
+ isInitialized?: boolean;
418
+ hasExports?: boolean;
419
+ dependencies?: string[];
420
+ bundles?: {
421
+ components: string[];
422
+ }[];
423
+ }
424
+ export interface CollectionCompiler {
425
+ name: string;
426
+ version: string;
427
+ typescriptVersion?: string;
428
+ }
429
+ export interface AppRegistry {
430
+ namespace?: string;
431
+ fsNamespace?: string;
432
+ loader?: string;
433
+ core?: string;
434
+ corePolyfilled?: string;
435
+ global?: string;
436
+ components?: AppRegistryComponents;
437
+ }
438
+ export interface AppRegistryComponents {
439
+ [tagName: string]: {
440
+ bundleIds: ModeBundleIds;
441
+ encapsulation?: 'shadow' | 'scoped';
442
+ };
443
+ }
444
+ /** OLD WAY */
445
+ export interface ModuleFile {
446
+ sourceFilePath: string;
447
+ jsFilePath?: string;
448
+ dtsFilePath?: string;
449
+ cmpMeta?: any;
450
+ isCollectionDependency?: boolean;
451
+ excludeFromCollection?: boolean;
452
+ originalCollectionComponentPath?: string;
453
+ externalImports?: string[];
454
+ localImports?: string[];
455
+ potentialCmpRefs?: string[];
456
+ hasSlot?: boolean;
457
+ hasSvg?: boolean;
458
+ }
459
+ export interface ModuleBundles {
460
+ [bundleId: string]: string;
461
+ }
462
+ export interface CollectionData {
463
+ components?: ComponentData[];
464
+ collections?: CollectionDependencyData[];
465
+ global?: string;
466
+ modules?: string[];
467
+ compiler?: {
468
+ name: string;
469
+ version: string;
470
+ typescriptVersion?: string;
471
+ };
472
+ bundles?: CollectionBundle[];
473
+ }
474
+ export interface CollectionBundle {
475
+ components: string[];
476
+ }
477
+ export interface CollectionDependencyData {
478
+ name: string;
479
+ tags: string[];
480
+ }
481
+ export interface ComponentData {
482
+ tag?: string;
483
+ componentPath?: string;
484
+ componentClass?: string;
485
+ dependencies?: string[];
486
+ styles?: StylesData;
487
+ props?: PropData[];
488
+ states?: StateData[];
489
+ listeners?: ListenerData[];
490
+ methods?: MethodData[];
491
+ events?: EventData[];
492
+ connect?: ConnectData[];
493
+ context?: ContextData[];
494
+ hostElement?: HostElementData;
495
+ host?: any;
496
+ assetPaths?: string[];
497
+ slot?: 'hasSlots' | 'hasNamedSlots';
498
+ shadow?: boolean;
499
+ scoped?: boolean;
500
+ priority?: 'low';
501
+ }
502
+ export interface StylesData {
503
+ [modeName: string]: StyleData;
504
+ }
505
+ export interface StyleData {
506
+ stylePaths?: string[];
507
+ style?: string;
508
+ }
509
+ export interface PropData {
510
+ name?: string;
511
+ type?: 'Boolean' | 'Number' | 'String' | 'Any';
512
+ mutable?: boolean;
513
+ attr?: string;
514
+ reflectToAttr?: boolean;
515
+ watch?: string[];
516
+ }
517
+ export interface StateData {
518
+ name: string;
519
+ }
520
+ export interface ListenerData {
521
+ event: string;
522
+ method: string;
523
+ capture?: boolean;
524
+ passive?: boolean;
525
+ enabled?: boolean;
526
+ }
527
+ export interface MethodData {
528
+ name: string;
529
+ }
530
+ export interface EventData {
531
+ event: string;
532
+ method?: string;
533
+ bubbles?: boolean;
534
+ cancelable?: boolean;
535
+ composed?: boolean;
536
+ }
537
+ export interface ConnectData {
538
+ name: string;
539
+ tag?: string;
540
+ }
541
+ export interface ContextData {
542
+ name: string;
543
+ id?: string;
544
+ }
545
+ export interface HostElementData {
546
+ name: string;
547
+ }
548
+ export interface BuildOutputFile {
549
+ name: string;
550
+ content: string;
551
+ }
552
+ export declare type OnCallback = (buildStart: CompilerBuildStart) => void;
553
+ export declare type RemoveCallback = () => boolean;
554
+ export interface CompilerCtx {
555
+ version: number;
556
+ activeBuildId: number;
557
+ activeDirsAdded: string[];
558
+ activeDirsDeleted: string[];
559
+ activeFilesAdded: string[];
560
+ activeFilesDeleted: string[];
561
+ activeFilesUpdated: string[];
562
+ addWatchDir: (path: string, recursive: boolean) => void;
563
+ addWatchFile: (path: string) => void;
564
+ cache: Cache;
565
+ cssModuleImports: Map<string, string[]>;
566
+ cachedGlobalStyle: string;
567
+ collections: CollectionCompilerMeta[];
568
+ compilerOptions: any;
569
+ events: BuildEvents;
570
+ fs: InMemoryFileSystem;
571
+ hasSuccessfulBuild: boolean;
572
+ isActivelyBuilding: boolean;
573
+ lastBuildResults: CompilerBuildResults;
574
+ moduleMap: ModuleMap;
575
+ nodeMap: NodeMap;
576
+ resolvedCollections: Set<string>;
577
+ rollupCacheHydrate: any;
578
+ rollupCacheLazy: any;
579
+ rollupCacheNative: any;
580
+ styleModeNames: Set<string>;
581
+ changedModules: Set<string>;
582
+ changedFiles: Set<string>;
583
+ worker?: CompilerWorkerContext;
584
+ rollupCache: Map<string, any>;
585
+ reset(): void;
586
+ }
587
+ export declare type NodeMap = WeakMap<any, ComponentCompilerMeta>;
588
+ /** Must be serializable to JSON!! */
589
+ export interface ComponentCompilerFeatures {
590
+ hasAttribute: boolean;
591
+ hasAttributeChangedCallbackFn: boolean;
592
+ hasComponentWillLoadFn: boolean;
593
+ hasComponentDidLoadFn: boolean;
594
+ hasComponentShouldUpdateFn: boolean;
595
+ hasComponentWillUpdateFn: boolean;
596
+ hasComponentDidUpdateFn: boolean;
597
+ hasComponentWillRenderFn: boolean;
598
+ hasComponentDidRenderFn: boolean;
599
+ hasComponentDidUnloadFn: boolean;
600
+ hasConnectedCallbackFn: boolean;
601
+ hasDisconnectedCallbackFn: boolean;
602
+ hasElement: boolean;
603
+ hasEvent: boolean;
604
+ hasLifecycle: boolean;
605
+ hasListener: boolean;
606
+ hasListenerTarget: boolean;
607
+ hasListenerTargetWindow: boolean;
608
+ hasListenerTargetDocument: boolean;
609
+ hasListenerTargetBody: boolean;
610
+ /**
611
+ * @deprecated Prevented from new apps, but left in for older collections
612
+ */
613
+ hasListenerTargetParent: boolean;
614
+ hasMember: boolean;
615
+ hasMethod: boolean;
616
+ hasMode: boolean;
617
+ hasProp: boolean;
618
+ hasPropBoolean: boolean;
619
+ hasPropNumber: boolean;
620
+ hasPropString: boolean;
621
+ hasPropMutable: boolean;
622
+ hasReflect: boolean;
623
+ hasRenderFn: boolean;
624
+ hasState: boolean;
625
+ hasStyle: boolean;
626
+ hasVdomAttribute: boolean;
627
+ hasVdomClass: boolean;
628
+ hasVdomFunctional: boolean;
629
+ hasVdomKey: boolean;
630
+ hasVdomListener: boolean;
631
+ hasVdomPropOrAttr: boolean;
632
+ hasVdomRef: boolean;
633
+ hasVdomRender: boolean;
634
+ hasVdomStyle: boolean;
635
+ hasVdomText: boolean;
636
+ hasVdomXlink: boolean;
637
+ hasWatchCallback: boolean;
638
+ htmlAttrNames: string[];
639
+ htmlTagNames: string[];
640
+ htmlParts: string[];
641
+ isUpdateable: boolean;
642
+ isPlain: boolean;
643
+ potentialCmpRefs: string[];
644
+ }
645
+ /** Must be serializable to JSON!! */
646
+ export interface ComponentCompilerMeta extends ComponentCompilerFeatures {
647
+ assetsDirs: CompilerAssetDir[];
648
+ componentClassName: string;
649
+ elementRef: string;
650
+ encapsulation: Encapsulation;
651
+ shadowDelegatesFocus: boolean;
652
+ excludeFromCollection: boolean;
653
+ isCollectionDependency: boolean;
654
+ docs: CompilerJsDoc;
655
+ jsFilePath: string;
656
+ sourceMapPath: string;
657
+ listeners: ComponentCompilerListener[];
658
+ events: ComponentCompilerEvent[];
659
+ methods: ComponentCompilerMethod[];
660
+ virtualProperties: ComponentCompilerVirtualProperty[];
661
+ properties: ComponentCompilerProperty[];
662
+ watchers: ComponentCompilerWatch[];
663
+ sourceFilePath: string;
664
+ states: ComponentCompilerState[];
665
+ styleDocs: CompilerStyleDoc[];
666
+ styles: StyleCompiler[];
667
+ tagName: string;
668
+ internal: boolean;
669
+ legacyConnect: ComponentCompilerLegacyConnect[];
670
+ legacyContext: ComponentCompilerLegacyContext[];
671
+ dependencies?: string[];
672
+ dependents?: string[];
673
+ directDependencies?: string[];
674
+ directDependents?: string[];
675
+ }
676
+ export interface ComponentCompilerLegacyConnect {
677
+ name: string;
678
+ connect: string;
679
+ }
680
+ export interface ComponentCompilerLegacyContext {
681
+ name: string;
682
+ context: string;
683
+ }
684
+ export declare type Encapsulation = 'shadow' | 'scoped' | 'none';
685
+ export interface ComponentCompilerStaticProperty {
686
+ mutable: boolean;
687
+ optional: boolean;
688
+ required: boolean;
689
+ type: ComponentCompilerPropertyType;
690
+ complexType: ComponentCompilerPropertyComplexType;
691
+ attribute?: string;
692
+ reflect?: boolean;
693
+ docs: CompilerJsDoc;
694
+ defaultValue?: string;
695
+ }
696
+ export interface ComponentCompilerProperty extends ComponentCompilerStaticProperty {
697
+ name: string;
698
+ internal: boolean;
699
+ }
700
+ export interface ComponentCompilerVirtualProperty {
701
+ name: string;
702
+ type: string;
703
+ docs: string;
704
+ }
705
+ export declare type ComponentCompilerPropertyType = 'any' | 'string' | 'boolean' | 'number' | 'unknown';
706
+ export interface ComponentCompilerPropertyComplexType {
707
+ original: string;
708
+ resolved: string;
709
+ references: ComponentCompilerTypeReferences;
710
+ }
711
+ /**
712
+ * A record of `ComponentCompilerTypeReference` entities.
713
+ *
714
+ * Each key in this record is intended to be the names of the types used by a component. However, this is not enforced
715
+ * by the type system (I.E. any string can be used as a key).
716
+ *
717
+ * Note any key can be a user defined type or a TypeScript standard type.
718
+ */
719
+ export declare type ComponentCompilerTypeReferences = Record<string, ComponentCompilerTypeReference>;
720
+ /**
721
+ * Describes a reference to a type used by a component.
722
+ */
723
+ export interface ComponentCompilerTypeReference {
724
+ /**
725
+ * A type may be defined:
726
+ * - locally (in the same file as the component that uses it)
727
+ * - globally
728
+ * - by importing it into a file (and is defined elsewhere)
729
+ */
730
+ location: 'local' | 'global' | 'import';
731
+ /**
732
+ * The path to the type reference, if applicable (global types should not need a path associated with them)
733
+ */
734
+ path?: string;
735
+ }
736
+ export interface ComponentCompilerStaticEvent {
737
+ name: string;
738
+ method: string;
739
+ bubbles: boolean;
740
+ cancelable: boolean;
741
+ composed: boolean;
742
+ docs: CompilerJsDoc;
743
+ complexType: ComponentCompilerEventComplexType;
744
+ }
745
+ export interface ComponentCompilerEvent extends ComponentCompilerStaticEvent {
746
+ internal: boolean;
747
+ }
748
+ export interface ComponentCompilerEventComplexType {
749
+ original: string;
750
+ resolved: string;
751
+ references: ComponentCompilerTypeReferences;
752
+ }
753
+ export interface ComponentCompilerListener {
754
+ name: string;
755
+ method: string;
756
+ capture: boolean;
757
+ passive: boolean;
758
+ target: ListenTargetOptions | undefined;
759
+ }
760
+ export interface ComponentCompilerStaticMethod {
761
+ docs: CompilerJsDoc;
762
+ complexType: ComponentCompilerMethodComplexType;
763
+ }
764
+ export interface ComponentCompilerMethodComplexType {
765
+ signature: string;
766
+ parameters: CompilerJsDoc[];
767
+ references: ComponentCompilerTypeReferences;
768
+ return: string;
769
+ }
770
+ export interface ComponentCompilerWatch {
771
+ propName: string;
772
+ methodName: string;
773
+ }
774
+ export interface ComponentCompilerMethod extends ComponentCompilerStaticMethod {
775
+ name: string;
776
+ internal: boolean;
777
+ }
778
+ export interface ComponentCompilerState {
779
+ name: string;
780
+ }
781
+ export interface CompilerJsDoc {
782
+ text: string;
783
+ tags: CompilerJsDocTagInfo[];
784
+ }
785
+ export interface CompilerJsDocTagInfo {
786
+ name: string;
787
+ text?: string;
788
+ }
789
+ export interface CompilerStyleDoc {
790
+ name: string;
791
+ docs: string;
792
+ annotation: 'prop';
793
+ }
794
+ export interface CompilerAssetDir {
795
+ absolutePath?: string;
796
+ cmpRelativePath?: string;
797
+ originalComponentPath?: string;
798
+ }
799
+ export interface ComponentCompilerData {
800
+ exportLine: string;
801
+ filePath: string;
802
+ cmp: ComponentCompilerMeta;
803
+ uniqueComponentClassName?: string;
804
+ importLine?: string;
805
+ }
806
+ export interface ComponentConstructor {
807
+ is?: string;
808
+ properties?: ComponentConstructorProperties;
809
+ watchers?: ComponentConstructorWatchers;
810
+ events?: ComponentConstructorEvent[];
811
+ listeners?: ComponentConstructorListener[];
812
+ style?: string;
813
+ styleId?: string;
814
+ encapsulation?: ComponentConstructorEncapsulation;
815
+ observedAttributes?: string[];
816
+ cmpMeta?: ComponentRuntimeMeta;
817
+ isProxied?: boolean;
818
+ isStyleRegistered?: boolean;
819
+ }
820
+ export interface ComponentConstructorWatchers {
821
+ [propName: string]: string[];
822
+ }
823
+ export interface ComponentTestingConstructor extends ComponentConstructor {
824
+ COMPILER_META: ComponentCompilerMeta;
825
+ prototype?: {
826
+ componentWillLoad?: Function;
827
+ componentWillUpdate?: Function;
828
+ componentWillRender?: Function;
829
+ __componentWillLoad?: Function;
830
+ __componentWillUpdate?: Function;
831
+ __componentWillRender?: Function;
832
+ };
833
+ }
834
+ export interface ComponentNativeConstructor extends ComponentConstructor {
835
+ cmpMeta: ComponentRuntimeMeta;
836
+ }
837
+ export declare type ComponentConstructorEncapsulation = 'shadow' | 'scoped' | 'none';
838
+ export interface ComponentConstructorProperties {
839
+ [propName: string]: ComponentConstructorProperty;
840
+ }
841
+ export interface ComponentConstructorProperty {
842
+ attribute?: string;
843
+ elementRef?: boolean;
844
+ method?: boolean;
845
+ mutable?: boolean;
846
+ reflect?: boolean;
847
+ state?: boolean;
848
+ type?: ComponentConstructorPropertyType;
849
+ watchCallbacks?: string[];
850
+ }
851
+ export declare type ComponentConstructorPropertyType = StringConstructor | BooleanConstructor | NumberConstructor | 'string' | 'boolean' | 'number';
852
+ export interface ComponentConstructorEvent {
853
+ name: string;
854
+ method: string;
855
+ bubbles: boolean;
856
+ cancelable: boolean;
857
+ composed: boolean;
858
+ }
859
+ export interface ComponentConstructorListener {
860
+ name: string;
861
+ method: string;
862
+ capture?: boolean;
863
+ passive?: boolean;
864
+ }
865
+ export interface HostConfig {
866
+ hosting?: {
867
+ rules?: HostRule[];
868
+ };
869
+ }
870
+ export interface HostRule {
871
+ include: string;
872
+ headers: HostRuleHeader[];
873
+ }
874
+ export interface HostRuleHeader {
875
+ name?: string;
876
+ value?: string;
877
+ }
878
+ export interface CssVarShim {
879
+ i(): Promise<any>;
880
+ addLink(linkEl: HTMLLinkElement): Promise<any>;
881
+ addGlobalStyle(styleEl: HTMLStyleElement): void;
882
+ createHostStyle(hostEl: HTMLElement, templateName: string, cssText: string, isScoped: boolean): HTMLStyleElement;
883
+ removeHost(hostEl: HTMLElement): void;
884
+ updateHost(hostEl: HTMLElement): void;
885
+ updateGlobal(): void;
886
+ }
887
+ export interface DevClientWindow extends Window {
888
+ ['s-dev-server']: boolean;
889
+ ['s-initial-load']: boolean;
890
+ ['s-build-id']: number;
891
+ WebSocket: new (socketUrl: string, protos: string[]) => WebSocket;
892
+ devServerConfig?: DevClientConfig;
893
+ }
894
+ export interface DevClientConfig {
895
+ basePath: string;
896
+ editors: DevServerEditor[];
897
+ reloadStrategy: PageReloadStrategy;
898
+ socketUrl?: string;
899
+ }
900
+ export interface HttpRequest {
901
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS';
902
+ acceptHeader: string;
903
+ url: URL;
904
+ searchParams: URLSearchParams;
905
+ pathname?: string;
906
+ filePath?: string;
907
+ stats?: CompilerFsStats;
908
+ headers?: {
909
+ [name: string]: string;
910
+ };
911
+ host?: string;
912
+ }
913
+ export interface DevServerMessage {
914
+ startServer?: DevServerConfig;
915
+ closeServer?: boolean;
916
+ serverStarted?: DevServerConfig;
917
+ serverClosed?: boolean;
918
+ buildStart?: boolean;
919
+ buildLog?: BuildLog;
920
+ buildResults?: CompilerBuildResults;
921
+ requestBuildResults?: boolean;
922
+ error?: {
923
+ message?: string;
924
+ type?: string;
925
+ stack?: any;
926
+ };
927
+ isActivelyBuilding?: boolean;
928
+ compilerRequestPath?: string;
929
+ compilerRequestResults?: CompilerRequestResponse;
930
+ requestLog?: {
931
+ method: string;
932
+ url: string;
933
+ status: number;
934
+ };
935
+ }
936
+ export declare type DevServerSendMessage = (msg: DevServerMessage) => void;
937
+ export interface DevServerContext {
938
+ connectorHtml: string;
939
+ dirTemplate: string;
940
+ getBuildResults: () => Promise<CompilerBuildResults>;
941
+ getCompilerRequest: (path: string) => Promise<CompilerRequestResponse>;
942
+ isServerListening: boolean;
943
+ logRequest: (req: {
944
+ method: string;
945
+ pathname?: string;
946
+ }, status: number) => void;
947
+ prerenderConfig: PrerenderConfig;
948
+ serve302: (req: any, res: any, pathname?: string) => void;
949
+ serve404: (req: any, res: any, xSource: string, content?: string) => void;
950
+ serve500: (req: any, res: any, error: any, xSource: string) => void;
951
+ sys: CompilerSystem;
952
+ }
953
+ export declare type InitServerProcess = (sendMsg: (msg: DevServerMessage) => void) => (msg: DevServerMessage) => void;
954
+ export interface DevResponseHeaders {
955
+ 'cache-control'?: string;
956
+ expires?: string;
957
+ 'content-type'?: string;
958
+ 'content-length'?: number;
959
+ date?: string;
960
+ 'access-control-allow-origin'?: string;
961
+ 'access-control-expose-headers'?: string;
962
+ 'content-encoding'?: 'gzip';
963
+ vary?: 'Accept-Encoding';
964
+ server?: string;
965
+ 'x-directory-index'?: string;
966
+ 'x-source'?: string;
967
+ }
968
+ export interface OpenInEditorData {
969
+ file?: string;
970
+ line?: number;
971
+ column?: number;
972
+ open?: string;
973
+ editor?: string;
974
+ exists?: boolean;
975
+ error?: string;
976
+ }
977
+ export interface EntryModule {
978
+ entryKey: string;
979
+ cmps: ComponentCompilerMeta[];
980
+ }
981
+ export interface EntryBundle {
982
+ fileName: string;
983
+ text: string;
984
+ outputs: string[];
985
+ modeName: string;
986
+ isScopedStyles: boolean;
987
+ sourceTarget: string;
988
+ }
989
+ export interface EntryComponent {
990
+ tag: string;
991
+ dependencyOf?: string[];
992
+ }
993
+ export interface ComponentRef {
994
+ tag: string;
995
+ filePath: string;
996
+ }
997
+ export interface ModuleGraph {
998
+ filePath: string;
999
+ importPaths: string[];
1000
+ }
1001
+ export interface AddEventListener {
1002
+ (elm: Element | Document | Window, eventName: string, cb: EventListenerCallback, opts?: ListenOptions): Function;
1003
+ }
1004
+ export interface EventListenerCallback {
1005
+ (ev?: any): void;
1006
+ }
1007
+ export interface EventEmitterData<T = any> {
1008
+ detail?: T;
1009
+ bubbles?: boolean;
1010
+ cancelable?: boolean;
1011
+ composed?: boolean;
1012
+ }
1013
+ export interface FsReadOptions {
1014
+ useCache?: boolean;
1015
+ setHash?: boolean;
1016
+ }
1017
+ export interface FsReaddirOptions {
1018
+ inMemoryOnly?: boolean;
1019
+ recursive?: boolean;
1020
+ /**
1021
+ * Directory names to exclude. Just the basename,
1022
+ * not the entire path. Basically for "node_moduels".
1023
+ */
1024
+ excludeDirNames?: string[];
1025
+ /**
1026
+ * Extensions we know we can avoid. Each extension
1027
+ * should include the `.` so that we can test for both
1028
+ * `.d.ts.` and `.ts`. If `excludeExtensions` isn't provided it
1029
+ * doesn't try to exclude anything. This only checks against
1030
+ * the filename, not directory names when recursive.
1031
+ */
1032
+ excludeExtensions?: string[];
1033
+ }
1034
+ export interface FsReaddirItem {
1035
+ absPath: string;
1036
+ relPath: string;
1037
+ isDirectory: boolean;
1038
+ isFile: boolean;
1039
+ }
1040
+ export interface FsWriteResults {
1041
+ changedContent: boolean;
1042
+ queuedWrite: boolean;
1043
+ ignored: boolean;
1044
+ }
1045
+ export declare type FsItems = Map<string, FsItem>;
1046
+ export interface FsItem {
1047
+ fileText: string;
1048
+ isFile: boolean;
1049
+ isDirectory: boolean;
1050
+ size: number;
1051
+ mtimeMs: number;
1052
+ exists: boolean;
1053
+ queueCopyFileToDest: string;
1054
+ queueWriteToDisk: boolean;
1055
+ queueDeleteFromDisk?: boolean;
1056
+ useCache: boolean;
1057
+ }
1058
+ export interface HostElement extends HTMLElement {
1059
+ connectedCallback?: () => void;
1060
+ attributeChangedCallback?: (attribName: string, oldVal: string, newVal: string, namespace: string) => void;
1061
+ disconnectedCallback?: () => void;
1062
+ host?: Element;
1063
+ forceUpdate?: () => void;
1064
+ /**
1065
+ * Unique rindo id for this element
1066
+ */
1067
+ ['s-id']?: string;
1068
+ /**
1069
+ * Content Reference:
1070
+ * Reference to the HTML Comment that's placed inside of the
1071
+ * host element's original content. This comment is used to
1072
+ * always represent where host element's light dom is.
1073
+ */
1074
+ ['s-cr']?: RenderNode;
1075
+ /**
1076
+ * Lifecycle ready
1077
+ */
1078
+ ['s-lr']?: boolean;
1079
+ /**
1080
+ * On Render Callbacks:
1081
+ * Array of callbacks to fire off after it has rendered.
1082
+ */
1083
+ ['s-rc']?: (() => void)[];
1084
+ /**
1085
+ * Scope Id
1086
+ * The scope id of this component when using scoped css encapsulation
1087
+ * or using shadow dom but the browser doesn't support it
1088
+ */
1089
+ ['s-sc']?: string;
1090
+ /**
1091
+ * Hot Module Replacement, dev mode only
1092
+ */
1093
+ ['s-hmr']?: (versionId: string) => void;
1094
+ /**
1095
+ * Callback method for when HMR finishes
1096
+ */
1097
+ ['s-hmr-load']?: () => void;
1098
+ ['s-p']?: Promise<void>[];
1099
+ componentOnReady?: () => Promise<this>;
1100
+ }
1101
+ export interface InMemoryFileSystem {
1102
+ sys?: CompilerSystem;
1103
+ accessData(filePath: string): Promise<{
1104
+ exists: boolean;
1105
+ isDirectory: boolean;
1106
+ isFile: boolean;
1107
+ }>;
1108
+ access(filePath: string): Promise<boolean>;
1109
+ /**
1110
+ * Synchronous!!! Do not use!!!
1111
+ * (Only typescript transpiling is allowed to use)
1112
+ * @param filePath
1113
+ */
1114
+ accessSync(filePath: string): boolean;
1115
+ copyFile(srcFile: string, dest: string): Promise<void>;
1116
+ emptyDirs(dirPaths: string[]): Promise<void>;
1117
+ readdir(dirPath: string, opts?: FsReaddirOptions): Promise<FsReaddirItem[]>;
1118
+ readFile(filePath: string, opts?: FsReadOptions): Promise<string>;
1119
+ /**
1120
+ * Synchronous!!! Do not use!!!
1121
+ * (Only typescript transpiling is allowed to use)
1122
+ * @param filePath
1123
+ */
1124
+ readFileSync(filePath: string, opts?: FsReadOptions): string;
1125
+ remove(itemPath: string): Promise<void>;
1126
+ stat(itemPath: string): Promise<{
1127
+ isFile: boolean;
1128
+ isDirectory: boolean;
1129
+ }>;
1130
+ /**
1131
+ * Synchronous!!! Do not use!!!
1132
+ * (Only typescript transpiling is allowed to use)
1133
+ * @param itemPath
1134
+ */
1135
+ statSync(itemPath: string): {
1136
+ exists: boolean;
1137
+ isFile: boolean;
1138
+ isDirectory: boolean;
1139
+ };
1140
+ writeFile(filePath: string, content: string, opts?: FsWriteOptions): Promise<FsWriteResults>;
1141
+ writeFiles(files: {
1142
+ [filePath: string]: string;
1143
+ } | Map<string, String>, opts?: FsWriteOptions): Promise<FsWriteResults[]>;
1144
+ commit(): Promise<{
1145
+ filesWritten: string[];
1146
+ filesDeleted: string[];
1147
+ filesCopied: string[][];
1148
+ dirsDeleted: string[];
1149
+ dirsAdded: string[];
1150
+ }>;
1151
+ cancelDeleteFilesFromDisk(filePaths: string[]): void;
1152
+ cancelDeleteDirectoriesFromDisk(filePaths: string[]): void;
1153
+ clearDirCache(dirPath: string): void;
1154
+ clearFileCache(filePath: string): void;
1155
+ getItem(itemPath: string): FsItem;
1156
+ getBuildOutputs(): BuildOutput[];
1157
+ clearCache(): void;
1158
+ keys(): string[];
1159
+ getMemoryStats(): string;
1160
+ }
1161
+ export interface HydrateResults {
1162
+ buildId: string;
1163
+ diagnostics: Diagnostic[];
1164
+ url: string;
1165
+ host: string;
1166
+ hostname: string;
1167
+ href: string;
1168
+ port: string;
1169
+ pathname: string;
1170
+ search: string;
1171
+ hash: string;
1172
+ html: string;
1173
+ components: HydrateComponent[];
1174
+ anchors: HydrateAnchorElement[];
1175
+ imgs: HydrateImgElement[];
1176
+ scripts: HydrateScriptElement[];
1177
+ styles: HydrateStyleElement[];
1178
+ staticData: HydrateStaticData[];
1179
+ title: string;
1180
+ hydratedCount: number;
1181
+ httpStatus: number;
1182
+ }
1183
+ export interface HydrateComponent {
1184
+ tag: string;
1185
+ mode: string;
1186
+ count: number;
1187
+ depth: number;
1188
+ }
1189
+ export interface HydrateElement {
1190
+ [attrName: string]: string | undefined;
1191
+ }
1192
+ export interface HydrateAnchorElement extends HydrateElement {
1193
+ href?: string;
1194
+ target?: string;
1195
+ }
1196
+ export interface HydrateImgElement extends HydrateElement {
1197
+ src?: string;
1198
+ }
1199
+ export interface HydrateScriptElement extends HydrateElement {
1200
+ src?: string;
1201
+ type?: string;
1202
+ }
1203
+ export interface HydrateStyleElement extends HydrateElement {
1204
+ href?: string;
1205
+ }
1206
+ export interface HydrateStaticData {
1207
+ id: string;
1208
+ type: string;
1209
+ content: string;
1210
+ }
1211
+ export interface JsDoc {
1212
+ name: string;
1213
+ documentation: string;
1214
+ type: string;
1215
+ tags: JSDocTagInfo[];
1216
+ default?: string;
1217
+ parameters?: JsDoc[];
1218
+ returns?: {
1219
+ type: string;
1220
+ documentation: string;
1221
+ };
1222
+ }
1223
+ export interface JSDocTagInfo {
1224
+ name: string;
1225
+ text?: string;
1226
+ }
1227
+ export interface MinifyJsResult {
1228
+ code: string;
1229
+ sourceMap: any;
1230
+ error: {
1231
+ message: string;
1232
+ filename: string;
1233
+ line: number;
1234
+ col: number;
1235
+ pos: number;
1236
+ };
1237
+ }
1238
+ export declare type ModuleMap = Map<string, Module>;
1239
+ /**
1240
+ * Module gets serialized/parsed as JSON
1241
+ * cannot use Map or Set
1242
+ */
1243
+ export interface Module {
1244
+ cmps: ComponentCompilerMeta[];
1245
+ coreRuntimeApis: string[];
1246
+ collectionName: string;
1247
+ dtsFilePath: string;
1248
+ excludeFromCollection: boolean;
1249
+ externalImports: string[];
1250
+ htmlAttrNames: string[];
1251
+ htmlTagNames: string[];
1252
+ htmlParts: string[];
1253
+ isCollectionDependency: boolean;
1254
+ isLegacy: boolean;
1255
+ jsFilePath: string;
1256
+ localImports: string[];
1257
+ originalImports: string[];
1258
+ originalCollectionComponentPath: string;
1259
+ potentialCmpRefs: string[];
1260
+ sourceFilePath: string;
1261
+ staticSourceFile: any;
1262
+ staticSourceFileText: string;
1263
+ sourceMapPath: string;
1264
+ sourceMapFileText: string;
1265
+ hasVdomAttribute: boolean;
1266
+ hasVdomClass: boolean;
1267
+ hasVdomFunctional: boolean;
1268
+ hasVdomKey: boolean;
1269
+ hasVdomListener: boolean;
1270
+ hasVdomPropOrAttr: boolean;
1271
+ hasVdomRef: boolean;
1272
+ hasVdomRender: boolean;
1273
+ hasVdomStyle: boolean;
1274
+ hasVdomText: boolean;
1275
+ hasVdomXlink: boolean;
1276
+ }
1277
+ export interface Plugin {
1278
+ name?: string;
1279
+ pluginType?: string;
1280
+ load?: (id: string, context: PluginCtx) => Promise<string> | string;
1281
+ resolveId?: (importee: string, importer: string, context: PluginCtx) => Promise<string> | string;
1282
+ transform?: (sourceText: string, id: string, context: PluginCtx) => Promise<PluginTransformResults> | PluginTransformResults | string;
1283
+ }
1284
+ export interface PluginTransformResults {
1285
+ code?: string;
1286
+ map?: string;
1287
+ id?: string;
1288
+ diagnostics?: Diagnostic[];
1289
+ dependencies?: string[];
1290
+ }
1291
+ export interface PluginCtx {
1292
+ config: Config;
1293
+ sys: CompilerSystem;
1294
+ fs: InMemoryFileSystem;
1295
+ cache: Cache;
1296
+ diagnostics: Diagnostic[];
1297
+ }
1298
+ export interface PrerenderUrlResults {
1299
+ anchorUrls: string[];
1300
+ diagnostics: Diagnostic[];
1301
+ filePath: string;
1302
+ }
1303
+ export interface PrerenderUrlRequest {
1304
+ appDir: string;
1305
+ buildId: string;
1306
+ baseUrl: string;
1307
+ componentGraphPath: string;
1308
+ devServerHostUrl: string;
1309
+ hydrateAppFilePath: string;
1310
+ isDebug: boolean;
1311
+ prerenderConfigPath: string;
1312
+ staticSite: boolean;
1313
+ templateId: string;
1314
+ url: string;
1315
+ writeToFilePath: string;
1316
+ }
1317
+ export interface PrerenderManager {
1318
+ config: Config;
1319
+ prerenderUrlWorker: (prerenderRequest: PrerenderUrlRequest) => Promise<PrerenderUrlResults>;
1320
+ devServerHostUrl: string;
1321
+ diagnostics: Diagnostic[];
1322
+ hydrateAppFilePath: string;
1323
+ isDebug: boolean;
1324
+ logCount: number;
1325
+ outputTarget: OutputTargetWww;
1326
+ prerenderConfig: PrerenderConfig;
1327
+ prerenderConfigPath: string;
1328
+ progressLogger?: LoggerLineUpdater;
1329
+ resolve: Function;
1330
+ staticSite: boolean;
1331
+ templateId: string;
1332
+ componentGraphPath: string;
1333
+ urlsProcessing: Set<string>;
1334
+ urlsPending: Set<string>;
1335
+ urlsCompleted: Set<string>;
1336
+ maxConcurrency: number;
1337
+ }
1338
+ /**
1339
+ * Generic node that represents all of the
1340
+ * different types of nodes we'd see when rendering
1341
+ */
1342
+ export interface RenderNode extends HostElement {
1343
+ /**
1344
+ * Shadow root's host
1345
+ */
1346
+ host?: Element;
1347
+ /**
1348
+ * Is Content Reference Node:
1349
+ * This node is a content reference node.
1350
+ */
1351
+ ['s-cn']?: boolean;
1352
+ /**
1353
+ * Is a slot reference node:
1354
+ * This is a node that represents where a slot
1355
+ * was originally located.
1356
+ */
1357
+ ['s-sr']?: boolean;
1358
+ /**
1359
+ * Slot name
1360
+ */
1361
+ ['s-sn']?: string;
1362
+ /**
1363
+ * Host element tag name:
1364
+ * The tag name of the host element that this
1365
+ * node was created in.
1366
+ */
1367
+ ['s-hn']?: string;
1368
+ /**
1369
+ * Original Location Reference:
1370
+ * A reference pointing to the comment
1371
+ * which represents the original location
1372
+ * before it was moved to its slot.
1373
+ */
1374
+ ['s-ol']?: RenderNode;
1375
+ /**
1376
+ * Node reference:
1377
+ * This is a reference for a original location node
1378
+ * back to the node that's been moved around.
1379
+ */
1380
+ ['s-nr']?: RenderNode;
1381
+ /**
1382
+ * Scope Id
1383
+ */
1384
+ ['s-si']?: string;
1385
+ /**
1386
+ * Host Id (hydrate only)
1387
+ */
1388
+ ['s-host-id']?: number;
1389
+ /**
1390
+ * Node Id (hydrate only)
1391
+ */
1392
+ ['s-node-id']?: number;
1393
+ /**
1394
+ * Used to know the components encapsulation.
1395
+ * empty "" for shadow, "c" from scoped
1396
+ */
1397
+ ['s-en']?: '' | /*shadow*/ 'c';
1398
+ }
1399
+ export declare type LazyBundlesRuntimeData = LazyBundleRuntimeData[];
1400
+ export declare type LazyBundleRuntimeData = [
1401
+ /** bundleIds */
1402
+ string,
1403
+ ComponentRuntimeMetaCompact[]
1404
+ ];
1405
+ export declare type ComponentRuntimeMetaCompact = [
1406
+ /** flags */
1407
+ number,
1408
+ /** tagname */
1409
+ string,
1410
+ /** members */
1411
+ {
1412
+ [memberName: string]: ComponentRuntimeMember;
1413
+ }?,
1414
+ /** listeners */
1415
+ ComponentRuntimeHostListener[]?
1416
+ ];
1417
+ export interface ComponentRuntimeMeta {
1418
+ $flags$: number;
1419
+ $tagName$: string;
1420
+ $members$?: ComponentRuntimeMembers;
1421
+ $listeners$?: ComponentRuntimeHostListener[];
1422
+ $attrsToReflect$?: [string, string][];
1423
+ $watchers$?: ComponentConstructorWatchers;
1424
+ $lazyBundleId$?: string;
1425
+ }
1426
+ export interface ComponentRuntimeMembers {
1427
+ [memberName: string]: ComponentRuntimeMember;
1428
+ }
1429
+ export declare type ComponentRuntimeMember = [
1430
+ /**
1431
+ * flags data
1432
+ */
1433
+ number,
1434
+ /**
1435
+ * attribute name to observe
1436
+ */
1437
+ string?
1438
+ ];
1439
+ export declare type ComponentRuntimeHostListener = [
1440
+ /**
1441
+ * event flags
1442
+ */
1443
+ number,
1444
+ /**
1445
+ * event name,
1446
+ */
1447
+ string,
1448
+ /**
1449
+ * event method,
1450
+ */
1451
+ string
1452
+ ];
1453
+ export declare type ModeBundleId = ModeBundleIds | string;
1454
+ export interface ModeBundleIds {
1455
+ [modeName: string]: string;
1456
+ }
1457
+ export declare type RuntimeRef = HostElement | {};
1458
+ /**
1459
+ * Interface used to track an Element, it's virtual Node (`VNode`), and other data
1460
+ */
1461
+ export interface HostRef {
1462
+ $ancestorComponent$?: HostElement;
1463
+ $flags$: number;
1464
+ $cmpMeta$: ComponentRuntimeMeta;
1465
+ $hostElement$?: HostElement;
1466
+ $instanceValues$?: Map<string, any>;
1467
+ $lazyInstance$?: ComponentInterface;
1468
+ $onReadyPromise$?: Promise<any>;
1469
+ $onReadyResolve$?: (elm: any) => void;
1470
+ $onInstancePromise$?: Promise<any>;
1471
+ $onInstanceResolve$?: (elm: any) => void;
1472
+ $onRenderResolve$?: () => void;
1473
+ $vnode$?: VNode;
1474
+ $queuedListeners$?: [string, any][];
1475
+ $rmListeners$?: (() => void)[];
1476
+ $modeName$?: string;
1477
+ $renderCount$?: number;
1478
+ }
1479
+ export interface PlatformRuntime {
1480
+ $cssShim$?: CssVarShim;
1481
+ $flags$: number;
1482
+ $orgLocNodes$?: Map<string, RenderNode>;
1483
+ $resourcesUrl$: string;
1484
+ jmp: (c: Function) => any;
1485
+ raf: (c: FrameRequestCallback) => number;
1486
+ ael: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
1487
+ rel: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
1488
+ ce: (eventName: string, opts?: any) => CustomEvent;
1489
+ }
1490
+ export declare type RefMap = WeakMap<any, HostRef>;
1491
+ export declare type StyleMap = Map<string, CSSStyleSheet | string>;
1492
+ export declare type RootAppliedStyleMap = WeakMap<Element, Set<string>>;
1493
+ export declare type AppliedStyleMap = Set<string>;
1494
+ export declare type ActivelyProcessingCmpMap = Set<Element>;
1495
+ export interface ScreenshotConnector {
1496
+ initBuild(opts: ScreenshotConnectorOptions): Promise<void>;
1497
+ completeBuild(masterBuild: ScreenshotBuild): Promise<ScreenshotBuildResults>;
1498
+ getMasterBuild(): Promise<ScreenshotBuild>;
1499
+ pullMasterBuild(): Promise<void>;
1500
+ publishBuild(buildResults: ScreenshotBuildResults): Promise<ScreenshotBuildResults>;
1501
+ getScreenshotCache(): Promise<ScreenshotCache>;
1502
+ updateScreenshotCache(screenshotCache: ScreenshotCache, buildResults: ScreenshotBuildResults): Promise<ScreenshotCache>;
1503
+ generateJsonpDataUris(build: ScreenshotBuild): Promise<void>;
1504
+ sortScreenshots(screenshots: Screenshot[]): Screenshot[];
1505
+ toJson(masterBuild: ScreenshotBuild, screenshotCache: ScreenshotCache): string;
1506
+ }
1507
+ export interface ScreenshotBuildResults {
1508
+ appNamespace: string;
1509
+ masterBuild: ScreenshotBuild;
1510
+ currentBuild: ScreenshotBuild;
1511
+ compare: ScreenshotCompareResults;
1512
+ }
1513
+ export interface ScreenshotCompareResults {
1514
+ id: string;
1515
+ a: {
1516
+ id: string;
1517
+ message: string;
1518
+ author: string;
1519
+ url: string;
1520
+ previewUrl: string;
1521
+ };
1522
+ b: {
1523
+ id: string;
1524
+ message: string;
1525
+ author: string;
1526
+ url: string;
1527
+ previewUrl: string;
1528
+ };
1529
+ timestamp: number;
1530
+ url: string;
1531
+ appNamespace: string;
1532
+ diffs: ScreenshotDiff[];
1533
+ }
1534
+ export interface ScreenshotConnectorOptions {
1535
+ buildId: string;
1536
+ buildMessage: string;
1537
+ buildAuthor?: string;
1538
+ buildUrl?: string;
1539
+ previewUrl?: string;
1540
+ appNamespace: string;
1541
+ buildTimestamp: number;
1542
+ logger: Logger;
1543
+ rootDir: string;
1544
+ cacheDir: string;
1545
+ packageDir: string;
1546
+ screenshotDirName?: string;
1547
+ imagesDirName?: string;
1548
+ buildsDirName?: string;
1549
+ currentBuildDir?: string;
1550
+ updateMaster?: boolean;
1551
+ allowableMismatchedPixels?: number;
1552
+ allowableMismatchedRatio?: number;
1553
+ pixelmatchThreshold?: number;
1554
+ waitBeforeScreenshot?: number;
1555
+ pixelmatchModulePath?: string;
1556
+ }
1557
+ export interface ScreenshotBuildData {
1558
+ buildId: string;
1559
+ rootDir: string;
1560
+ screenshotDir: string;
1561
+ imagesDir: string;
1562
+ buildsDir: string;
1563
+ currentBuildDir: string;
1564
+ updateMaster: boolean;
1565
+ allowableMismatchedPixels: number;
1566
+ allowableMismatchedRatio: number;
1567
+ pixelmatchThreshold: number;
1568
+ masterScreenshots: {
1569
+ [screenshotId: string]: string;
1570
+ };
1571
+ cache: {
1572
+ [cacheKey: string]: number;
1573
+ };
1574
+ timeoutBeforeScreenshot: number;
1575
+ pixelmatchModulePath: string;
1576
+ }
1577
+ export interface PixelMatchInput {
1578
+ imageAPath: string;
1579
+ imageBPath: string;
1580
+ width: number;
1581
+ height: number;
1582
+ pixelmatchThreshold: number;
1583
+ }
1584
+ export interface ScreenshotBuild {
1585
+ id: string;
1586
+ message: string;
1587
+ author?: string;
1588
+ url?: string;
1589
+ previewUrl?: string;
1590
+ appNamespace: string;
1591
+ timestamp: number;
1592
+ screenshots: Screenshot[];
1593
+ }
1594
+ export interface ScreenshotCache {
1595
+ timestamp?: number;
1596
+ lastBuildId?: string;
1597
+ size?: number;
1598
+ items?: {
1599
+ /**
1600
+ * Cache key
1601
+ */
1602
+ key: string;
1603
+ /**
1604
+ * Timestamp used to remove the oldest data
1605
+ */
1606
+ ts: number;
1607
+ /**
1608
+ * Mismatched pixels
1609
+ */
1610
+ mp: number;
1611
+ }[];
1612
+ }
1613
+ export interface Screenshot {
1614
+ id: string;
1615
+ desc?: string;
1616
+ image: string;
1617
+ device?: string;
1618
+ userAgent?: string;
1619
+ width?: number;
1620
+ height?: number;
1621
+ deviceScaleFactor?: number;
1622
+ hasTouch?: boolean;
1623
+ isLandscape?: boolean;
1624
+ isMobile?: boolean;
1625
+ testPath?: string;
1626
+ diff?: ScreenshotDiff;
1627
+ }
1628
+ export interface ScreenshotDiff {
1629
+ mismatchedPixels: number;
1630
+ id?: string;
1631
+ desc?: string;
1632
+ imageA?: string;
1633
+ imageB?: string;
1634
+ device?: string;
1635
+ userAgent?: string;
1636
+ width?: number;
1637
+ height?: number;
1638
+ deviceScaleFactor?: number;
1639
+ hasTouch?: boolean;
1640
+ isLandscape?: boolean;
1641
+ isMobile?: boolean;
1642
+ allowableMismatchedPixels: number;
1643
+ allowableMismatchedRatio: number;
1644
+ testPath?: string;
1645
+ cacheKey?: string;
1646
+ }
1647
+ export interface ScreenshotOptions {
1648
+ /**
1649
+ * When true, takes a screenshot of the full scrollable page.
1650
+ * Default: `false`
1651
+ */
1652
+ fullPage?: boolean;
1653
+ /**
1654
+ * An object which specifies clipping region of the page.
1655
+ */
1656
+ clip?: ScreenshotBoundingBox;
1657
+ /**
1658
+ * Hides default white background and allows capturing screenshots with transparency.
1659
+ * Default: `false`
1660
+ */
1661
+ omitBackground?: boolean;
1662
+ /**
1663
+ * Matching threshold, ranges from `0` to 1. Smaller values make the comparison
1664
+ * more sensitive. Defaults to the testing config `pixelmatchThreshold` value;
1665
+ */
1666
+ pixelmatchThreshold?: number;
1667
+ }
1668
+ export interface ScreenshotBoundingBox {
1669
+ /**
1670
+ * The x-coordinate of top-left corner.
1671
+ */
1672
+ x: number;
1673
+ /**
1674
+ * The y-coordinate of top-left corner.
1675
+ */
1676
+ y: number;
1677
+ /**
1678
+ * The width in pixels.
1679
+ */
1680
+ width: number;
1681
+ /**
1682
+ * The height in pixels.
1683
+ */
1684
+ height: number;
1685
+ }
1686
+ export interface ServerConfigInput {
1687
+ app: ExpressApp;
1688
+ configPath?: string;
1689
+ }
1690
+ export interface ServerConfigOutput {
1691
+ config: Config;
1692
+ logger: Logger;
1693
+ wwwDir: string;
1694
+ destroy?: () => void;
1695
+ }
1696
+ export interface ExpressApp {
1697
+ use?: Function;
1698
+ }
1699
+ export interface MiddlewareConfig {
1700
+ config: string | Config;
1701
+ destroy?: () => void;
1702
+ }
1703
+ export interface StyleCompiler {
1704
+ modeName: string;
1705
+ styleId: string;
1706
+ styleStr: string;
1707
+ styleIdentifier: string;
1708
+ externalStyles: ExternalStyleCompiler[];
1709
+ }
1710
+ export interface ExternalStyleCompiler {
1711
+ absolutePath: string;
1712
+ relativePath: string;
1713
+ originalComponentPath: string;
1714
+ }
1715
+ export interface CompilerModeStyles {
1716
+ [modeName: string]: string[];
1717
+ }
1718
+ export interface CssImportData {
1719
+ srcImport: string;
1720
+ updatedImport?: string;
1721
+ url: string;
1722
+ filePath?: string;
1723
+ altFilePath?: string;
1724
+ styleText?: string;
1725
+ }
1726
+ export interface CssToEsmImportData {
1727
+ srcImportText: string;
1728
+ varName: string;
1729
+ url: string;
1730
+ filePath: string;
1731
+ }
1732
+ export interface TransformCssToEsmInput {
1733
+ input: string;
1734
+ module?: 'cjs' | 'esm' | string;
1735
+ file?: string;
1736
+ tag?: string;
1737
+ encapsulation?: string;
1738
+ mode?: string;
1739
+ commentOriginalSelector?: boolean;
1740
+ sourceMap?: boolean;
1741
+ minify?: boolean;
1742
+ docs?: boolean;
1743
+ autoprefixer?: any;
1744
+ styleImportData?: string;
1745
+ }
1746
+ export interface TransformCssToEsmOutput {
1747
+ styleText: string;
1748
+ output: string;
1749
+ map: any;
1750
+ diagnostics: Diagnostic[];
1751
+ defaultVarName: string;
1752
+ styleDocs: StyleDoc[];
1753
+ imports: {
1754
+ varName: string;
1755
+ importPath: string;
1756
+ }[];
1757
+ }
1758
+ export interface PackageJsonData {
1759
+ name?: string;
1760
+ version?: string;
1761
+ main?: string;
1762
+ description?: string;
1763
+ bin?: {
1764
+ [key: string]: string;
1765
+ };
1766
+ browser?: string;
1767
+ module?: string;
1768
+ 'jsnext:main'?: string;
1769
+ 'collection:main'?: string;
1770
+ unpkg?: string;
1771
+ collection?: string;
1772
+ types?: string;
1773
+ files?: string[];
1774
+ ['dist-tags']?: {
1775
+ latest: string;
1776
+ };
1777
+ dependencies?: {
1778
+ [moduleId: string]: string;
1779
+ };
1780
+ devDependencies?: {
1781
+ [moduleId: string]: string;
1782
+ };
1783
+ repository?: {
1784
+ type?: string;
1785
+ url?: string;
1786
+ };
1787
+ private?: boolean;
1788
+ scripts?: {
1789
+ [runName: string]: string;
1790
+ };
1791
+ license?: string;
1792
+ keywords?: string[];
1793
+ }
1794
+ export interface Workbox {
1795
+ generateSW(swConfig: any): Promise<any>;
1796
+ generateFileManifest(): Promise<any>;
1797
+ getFileManifestEntries(): Promise<any>;
1798
+ injectManifest(swConfig: any): Promise<any>;
1799
+ copyWorkboxLibraries(wwwDir: string): Promise<any>;
1800
+ }
1801
+ export interface Url {
1802
+ href?: string;
1803
+ protocol?: string;
1804
+ auth?: string;
1805
+ hostname?: string;
1806
+ host?: string;
1807
+ port?: string;
1808
+ pathname?: string;
1809
+ path?: string;
1810
+ search?: string;
1811
+ query?: string | any;
1812
+ hash?: string;
1813
+ }
1814
+ declare global {
1815
+ namespace jest {
1816
+ interface Matchers<R, T> {
1817
+ /**
1818
+ * Compares HTML, but first normalizes the HTML so all
1819
+ * whitespace, attribute order and css class order are
1820
+ * the same. When given an element, it will compare
1821
+ * the element's `outerHTML`. When given a Document Fragment,
1822
+ * such as a Shadow Root, it'll compare its `innerHTML`.
1823
+ * Otherwise it'll compare two strings representing HTML.
1824
+ */
1825
+ toEqualHtml(expectHtml: string): void;
1826
+ /**
1827
+ * Compares HTML light DOKM only, but first normalizes the HTML so all
1828
+ * whitespace, attribute order and css class order are
1829
+ * the same. When given an element, it will compare
1830
+ * the element's `outerHTML`. When given a Document Fragment,
1831
+ * such as a Shadow Root, it'll compare its `innerHTML`.
1832
+ * Otherwise it'll compare two strings representing HTML.
1833
+ */
1834
+ toEqualLightHtml(expectLightHtml: string): void;
1835
+ /**
1836
+ * When given an element, it'll compare the element's
1837
+ * `textContent`. Otherwise it'll compare two strings. This
1838
+ * matcher will also `trim()` each string before comparing.
1839
+ */
1840
+ toEqualText(expectTextContent: string): void;
1841
+ /**
1842
+ * Checks if an element simply has the attribute. It does
1843
+ * not check any values of the attribute
1844
+ */
1845
+ toHaveAttribute(expectAttrName: string): void;
1846
+ /**
1847
+ * Checks if an element's attribute value equals the expect value.
1848
+ */
1849
+ toEqualAttribute(expectAttrName: string, expectAttrValue: any): void;
1850
+ /**
1851
+ * Checks if an element's has each of the expected attribute
1852
+ * names and values.
1853
+ */
1854
+ toEqualAttributes(expectAttrs: {
1855
+ [attrName: string]: any;
1856
+ }): void;
1857
+ /**
1858
+ * Checks if an element has the expected css class.
1859
+ */
1860
+ toHaveClass(expectClassName: string): void;
1861
+ /**
1862
+ * Checks if an element has each of the expected css classes
1863
+ * in the array.
1864
+ */
1865
+ toHaveClasses(expectClassNames: string[]): void;
1866
+ /**
1867
+ * Checks if an element has the exact same css classes
1868
+ * as the expected array of css classes.
1869
+ */
1870
+ toMatchClasses(expectClassNames: string[]): void;
1871
+ /**
1872
+ * When given an EventSpy, checks if the event has been
1873
+ * received or not.
1874
+ */
1875
+ toHaveReceivedEvent(): void;
1876
+ /**
1877
+ * When given an EventSpy, checks how many times the
1878
+ * event has been received.
1879
+ */
1880
+ toHaveReceivedEventTimes(count: number): void;
1881
+ /**
1882
+ * When given an EventSpy, checks the event has
1883
+ * received the correct custom event `detail` data.
1884
+ */
1885
+ toHaveReceivedEventDetail(eventDetail: any): void;
1886
+ /**
1887
+ * When given an EventSpy, checks the first event has
1888
+ * received the correct custom event `detail` data.
1889
+ */
1890
+ toHaveFirstReceivedEventDetail(eventDetail: any): void;
1891
+ /**
1892
+ * When given an EventSpy, checks the event at an index
1893
+ * has received the correct custom event `detail` data.
1894
+ */
1895
+ toHaveNthReceivedEventDetail(index: number, eventDetail: any): void;
1896
+ /**
1897
+ * Used to evaluate the results of `compareScreenshot()`, such as
1898
+ * `expect(compare).toMatchScreenshot()`. The `allowableMismatchedRatio`
1899
+ * value from the testing config is used by default if
1900
+ * `MatchScreenshotOptions` were not provided.
1901
+ */
1902
+ toMatchScreenshot(opts?: MatchScreenshotOptions): void;
1903
+ }
1904
+ }
1905
+ }
1906
+ export interface MatchScreenshotOptions {
1907
+ /**
1908
+ * The `allowableMismatchedPixels` value is the total number of pixels
1909
+ * that can be mismatched until the test fails. For example, if the value
1910
+ * is `100`, and if there were `101` pixels that were mismatched then the
1911
+ * test would fail. If the `allowableMismatchedRatio` is provided it will
1912
+ * take precedence, otherwise `allowableMismatchedPixels` will be used.
1913
+ */
1914
+ allowableMismatchedPixels?: number;
1915
+ /**
1916
+ * The `allowableMismatchedRatio` ranges from `0` to `1` and is used to
1917
+ * determine an acceptable ratio of pixels that can be mismatched before
1918
+ * the image is considered to have changes. Realistically, two screenshots
1919
+ * representing the same content may have a small number of pixels that
1920
+ * are not identical due to anti-aliasing, which is perfectly normal. The
1921
+ * `allowableMismatchedRatio` is the number of pixels that were mismatched,
1922
+ * divided by the total number of pixels in the screenshot. For example,
1923
+ * a ratio value of `0.06` means 6% of the pixels can be mismatched before
1924
+ * the image is considered to have changes. If the `allowableMismatchedRatio`
1925
+ * is provided it will take precedence, otherwise `allowableMismatchedPixels`
1926
+ * will be used.
1927
+ */
1928
+ allowableMismatchedRatio?: number;
1929
+ }
1930
+ export interface EventSpy {
1931
+ events: SerializedEvent[];
1932
+ eventName: string;
1933
+ firstEvent: SerializedEvent;
1934
+ lastEvent: SerializedEvent;
1935
+ length: number;
1936
+ next(): Promise<{
1937
+ done: boolean;
1938
+ value: SerializedEvent;
1939
+ }>;
1940
+ }
1941
+ export interface SerializedEvent {
1942
+ bubbles: boolean;
1943
+ cancelBubble: boolean;
1944
+ cancelable: boolean;
1945
+ composed: boolean;
1946
+ currentTarget: any;
1947
+ defaultPrevented: boolean;
1948
+ detail: any;
1949
+ eventPhase: any;
1950
+ isTrusted: boolean;
1951
+ returnValue: any;
1952
+ srcElement: any;
1953
+ target: any;
1954
+ timeStamp: number;
1955
+ type: string;
1956
+ isSerializedEvent: boolean;
1957
+ }
1958
+ export interface EventInitDict {
1959
+ bubbles?: boolean;
1960
+ cancelable?: boolean;
1961
+ composed?: boolean;
1962
+ detail?: any;
1963
+ }
1964
+ export interface JestEnvironmentGlobal {
1965
+ __NEW_TEST_PAGE__: () => Promise<any>;
1966
+ __CLOSE_OPEN_PAGES__: () => Promise<any>;
1967
+ Context: any;
1968
+ loadTestWindow: (testWindow: any) => Promise<void>;
1969
+ h: any;
1970
+ resourcesUrl: string;
1971
+ currentSpec?: {
1972
+ id: string;
1973
+ description: string;
1974
+ fullName: string;
1975
+ testPath: string;
1976
+ };
1977
+ env: {
1978
+ [prop: string]: string;
1979
+ };
1980
+ screenshotDescriptions: Set<string>;
1981
+ }
1982
+ export interface E2EProcessEnv {
1983
+ RINDO_COMMIT_ID?: string;
1984
+ RINDO_COMMIT_MESSAGE?: string;
1985
+ RINDO_REPO_URL?: string;
1986
+ RINDO_SCREENSHOT_CONNECTOR?: string;
1987
+ RINDO_SCREENSHOT_SERVER?: string;
1988
+ __RINDO_EMULATE_CONFIGS__?: string;
1989
+ __RINDO_ENV__?: string;
1990
+ __RINDO_EMULATE__?: string;
1991
+ __RINDO_BROWSER_URL__?: string;
1992
+ __RINDO_APP_SCRIPT_URL__?: string;
1993
+ __RINDO_APP_STYLE_URL__?: string;
1994
+ __RINDO_BROWSER_WS_ENDPOINT__?: string;
1995
+ __RINDO_BROWSER_WAIT_UNTIL?: string;
1996
+ __RINDO_SCREENSHOT__?: 'true';
1997
+ __RINDO_SCREENSHOT_BUILD__?: string;
1998
+ __RINDO_E2E_TESTS__?: 'true';
1999
+ __RINDO_E2E_DEVTOOLS__?: 'true';
2000
+ __RINDO_SPEC_TESTS__?: 'true';
2001
+ __RINDO_PUPPETEER_MODULE__?: string;
2002
+ __RINDO_DEFAULT_TIMEOUT__?: string;
2003
+ }
2004
+ export interface AnyHTMLElement extends HTMLElement {
2005
+ [key: string]: any;
2006
+ }
2007
+ export interface SpecPage {
2008
+ /**
2009
+ * Mocked testing `document.body`.
2010
+ */
2011
+ body: HTMLBodyElement;
2012
+ /**
2013
+ * Mocked testing `document`.
2014
+ */
2015
+ doc: HTMLDocument;
2016
+ /**
2017
+ * The first component found within the mocked `document.body`. If a component isn't found, then it'll return `document.body.firstElementChild`.
2018
+ */
2019
+ root?: AnyHTMLElement;
2020
+ /**
2021
+ * Similar to `root`, except returns the component instance. If a root component was not found it'll return `null`.
2022
+ */
2023
+ rootInstance?: any;
2024
+ /**
2025
+ * Convenience function to set `document.body.innerHTML` and `waitForChanges()`. Function argument should be an html string.
2026
+ */
2027
+ setContent: (html: string) => Promise<any>;
2028
+ /**
2029
+ * After changes have been made to a component, such as a update to a property or attribute, the test page does not automatically apply the changes. In order to wait for, and apply the update, call `await page.waitForChanges()`.
2030
+ */
2031
+ waitForChanges: () => Promise<any>;
2032
+ /**
2033
+ * Mocked testing `window`.
2034
+ */
2035
+ win: Window;
2036
+ build: BuildConditionals;
2037
+ flushLoadModule: (bundleId?: string) => Promise<any>;
2038
+ flushQueue: () => Promise<any>;
2039
+ styles: Map<string, string>;
2040
+ }
2041
+ export interface NewSpecPageOptions {
2042
+ /**
2043
+ * An array of components to test. Component classes can be imported into the spec file, then their reference should be added to the `component` array in order to be used throughout the test.
2044
+ */
2045
+ components: any[];
2046
+ /**
2047
+ * Sets the mocked `document.cookie`.
2048
+ */
2049
+ cookie?: string;
2050
+ /**
2051
+ * Sets the mocked `dir` attribute on `<html>`.
2052
+ */
2053
+ direction?: string;
2054
+ flushQueue?: boolean;
2055
+ /**
2056
+ * The initial HTML used to generate the test. This can be useful to construct a collection of components working together, and assign HTML attributes. This value sets the mocked `document.body.innerHTML`.
2057
+ */
2058
+ html?: string;
2059
+ /**
2060
+ * The initial JSX used to generate the test.
2061
+ * Use `template` when you want to initialize a component using their properties, instead of their HTML attributes.
2062
+ * It will render the specified template (JSX) into `document.body`.
2063
+ */
2064
+ template?: () => any;
2065
+ /**
2066
+ * Sets the mocked `lang` attribute on `<html>`.
2067
+ */
2068
+ language?: string;
2069
+ /**
2070
+ * Useful for debugging hydrating components client-side. Sets that the `html` option already includes annotated prerender attributes and comments.
2071
+ */
2072
+ hydrateClientSide?: boolean;
2073
+ /**
2074
+ * Useful for debugging hydrating components server-side. The output HTML will also include prerender annotations.
2075
+ */
2076
+ hydrateServerSide?: boolean;
2077
+ /**
2078
+ * Sets the mocked `document.referrer`.
2079
+ */
2080
+ referrer?: string;
2081
+ /**
2082
+ * Manually set if the mocked document supports Shadow DOM or not. Default is `true`.
2083
+ */
2084
+ supportsShadowDom?: boolean;
2085
+ /**
2086
+ * When a component is prerendered it includes HTML annotations, such as `s-id` attributes and `<!-t.0->` comments. This information is used by clientside hydrating. Default is `false`.
2087
+ */
2088
+ includeAnnotations?: boolean;
2089
+ /**
2090
+ * Sets the mocked browser's `location.href`.
2091
+ */
2092
+ url?: string;
2093
+ /**
2094
+ * Sets the mocked browser's `navigator.userAgent`.
2095
+ */
2096
+ userAgent?: string;
2097
+ /**
2098
+ * By default, any changes to component properties and attributes must `page.waitForChanges()` in order to test the updates. As an option, `autoAppluChanges` continuously flushes the queue on the background. Default is `false`.
2099
+ */
2100
+ autoApplyChanges?: boolean;
2101
+ /**
2102
+ * By default, styles are not attached to the DOM and they are not reflected in the serialized HTML.
2103
+ * Setting this option to `true` will include the component's styles in the serializable output.
2104
+ */
2105
+ attachStyles?: boolean;
2106
+ strictBuild?: boolean;
2107
+ }
2108
+ /**
2109
+ * A record of `TypesMemberNameData` entities.
2110
+ *
2111
+ * Each key in this record is intended to be the path to a file that declares one or more types used by a component.
2112
+ * However, this is not enforced by the type system - users of this interface should not make any assumptions regarding
2113
+ * the format of the path used as a key (relative vs. absolute)
2114
+ */
2115
+ export interface TypesImportData {
2116
+ [key: string]: TypesMemberNameData[];
2117
+ }
2118
+ /**
2119
+ * A type describing how Rindo may alias an imported type to avoid naming collisions when performing operations such
2120
+ * as generating `components.d.ts` files.
2121
+ */
2122
+ export interface TypesMemberNameData {
2123
+ /**
2124
+ * The name of the type as it's used within a file.
2125
+ */
2126
+ localName: string;
2127
+ /**
2128
+ * An alias that Rindo may apply to the `localName` to avoid naming collisions. This name does not appear in the
2129
+ * file that is using `localName`.
2130
+ */
2131
+ importName?: string;
2132
+ }
2133
+ export interface TypesModule {
2134
+ isDep: boolean;
2135
+ tagName: string;
2136
+ tagNameAsPascal: string;
2137
+ htmlElementName: string;
2138
+ component: string;
2139
+ jsx: string;
2140
+ element: string;
2141
+ }
2142
+ export declare type TypeInfo = {
2143
+ name: string;
2144
+ type: string;
2145
+ optional: boolean;
2146
+ required: boolean;
2147
+ internal: boolean;
2148
+ jsdoc?: string;
2149
+ }[];
2150
+ export interface Hyperscript {
2151
+ (sel: any): VNode;
2152
+ (sel: Node, data: VNodeData): VNode;
2153
+ (sel: any, data: VNodeData): VNode;
2154
+ (sel: any, text: string): VNode;
2155
+ (sel: any, children: Array<VNode | undefined | null>): VNode;
2156
+ (sel: any, data: VNodeData, text: string): VNode;
2157
+ (sel: any, data: VNodeData, children: Array<VNode | undefined | null>): VNode;
2158
+ (sel: any, data: VNodeData, children: VNode): VNode;
2159
+ }
2160
+ export declare type ChildType = VNode | number | string;
2161
+ export declare type PropsType = VNodeProdData | number | string | null;
2162
+ export interface VNodeProdData {
2163
+ key?: string | number;
2164
+ class?: {
2165
+ [className: string]: boolean;
2166
+ } | string;
2167
+ className?: {
2168
+ [className: string]: boolean;
2169
+ } | string;
2170
+ style?: any;
2171
+ [key: string]: any;
2172
+ }
2173
+ export interface CompilerWorkerContext {
2174
+ optimizeCss(inputOpts: OptimizeCssInput): Promise<OptimizeCssOutput>;
2175
+ prepareModule(input: string, minifyOpts: any, transpile: boolean, inlineHelpers: boolean): Promise<{
2176
+ output: string;
2177
+ diagnostics: Diagnostic[];
2178
+ sourceMap?: SourceMap;
2179
+ }>;
2180
+ prerenderWorker(prerenderRequest: PrerenderUrlRequest): Promise<PrerenderUrlResults>;
2181
+ transformCssToEsm(input: TransformCssToEsmInput): Promise<TransformCssToEsmOutput>;
2182
+ }
2183
+ export interface MsgToWorker {
2184
+ rindoId: number;
2185
+ args: any[];
2186
+ }
2187
+ export interface MsgFromWorker {
2188
+ rindoId?: number;
2189
+ rindoRtnValue: any;
2190
+ rindoRtnError: string;
2191
+ }
2192
+ export interface CompilerWorkerTask {
2193
+ rindoId?: number;
2194
+ inputArgs?: any[];
2195
+ resolve: (val: any) => any;
2196
+ reject: (msg: string) => any;
2197
+ retries?: number;
2198
+ }
2199
+ export declare type WorkerMsgHandler = (msgToWorker: MsgToWorker) => Promise<any>;
2200
+ export interface WorkerTask {
2201
+ taskId: number;
2202
+ method: string;
2203
+ args: any[];
2204
+ resolve: (val: any) => any;
2205
+ reject: (msg: string) => any;
2206
+ retries: number;
2207
+ isLongRunningTask: boolean;
2208
+ workerKey: string;
2209
+ }
2210
+ export interface WorkerMessage {
2211
+ taskId?: number;
2212
+ method?: string;
2213
+ args?: any[];
2214
+ value?: any;
2215
+ error?: string;
2216
+ exit?: boolean;
2217
+ }
2218
+ export declare type WorkerRunner = (methodName: string, args: any[]) => Promise<any>;
2219
+ export interface WorkerRunnerOptions {
2220
+ isLongRunningTask?: boolean;
2221
+ workerKey?: string;
2222
+ }
2223
+ export interface WorkerContext {
2224
+ tsHost?: any;
2225
+ tsProgram?: any;
2226
+ }
2227
+ export interface TranspileModuleResults {
2228
+ sourceFilePath: string;
2229
+ code: string;
2230
+ map: any;
2231
+ diagnostics: Diagnostic[];
2232
+ moduleFile: Module;
2233
+ }
2234
+ export interface ValidateTypesResults {
2235
+ diagnostics: Diagnostic[];
2236
+ dirPaths: string[];
2237
+ filePaths: string[];
2238
+ }
2239
+ export interface TerminalInfo {
2240
+ /**
2241
+ * Whether this is in CI or not.
2242
+ */
2243
+ readonly ci: boolean;
2244
+ /**
2245
+ * Whether the terminal is an interactive TTY or not.
2246
+ */
2247
+ readonly tty: boolean;
2248
+ }
2249
+ /**
2250
+ * The task to run in order to collect the duration data point.
2251
+ */
2252
+ export declare type TelemetryCallback = (...args: any[]) => void | Promise<void>;
2253
+ /**
2254
+ * The model for the data that's tracked.
2255
+ */
2256
+ export interface TrackableData {
2257
+ yarn: boolean;
2258
+ component_count?: number;
2259
+ arguments: string[];
2260
+ targets: string[];
2261
+ task: TaskCommand;
2262
+ duration_ms: number;
2263
+ packages: string[];
2264
+ packages_no_versions?: string[];
2265
+ os_name: string;
2266
+ os_version: string;
2267
+ cpu_model: string;
2268
+ typescript: string;
2269
+ rollup: string;
2270
+ system: string;
2271
+ system_major?: string;
2272
+ build: string;
2273
+ rindo: string;
2274
+ has_app_pwa_config: boolean;
2275
+ }
2276
+ /**
2277
+ * Used as the object sent to the server. Value is the data tracked.
2278
+ */
2279
+ export interface Metric {
2280
+ name: string;
2281
+ timestamp: string;
2282
+ source: 'rindo_cli';
2283
+ value: TrackableData;
2284
+ session_id: string;
2285
+ }
2286
+ export interface TelemetryConfig {
2287
+ 'telemetry.rindo'?: boolean;
2288
+ 'tokens.telemetry'?: string;
2289
+ }