@rindo/core 2.17.4 → 2.22.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 (108) hide show
  1. package/cli/config-flags.d.ts +33 -21
  2. package/cli/index.cjs +693 -401
  3. package/cli/index.d.ts +3 -0
  4. package/cli/index.js +693 -401
  5. package/cli/package.json +1 -1
  6. package/compiler/lib.dom.d.ts +898 -184
  7. package/compiler/lib.dom.iterable.d.ts +22 -4
  8. package/compiler/lib.es2015.collection.d.ts +62 -1
  9. package/compiler/lib.es2015.core.d.ts +3 -3
  10. package/compiler/lib.es2015.iterable.d.ts +2 -1
  11. package/compiler/lib.es2015.promise.d.ts +9 -4
  12. package/compiler/lib.es2015.proxy.d.ts +91 -2
  13. package/compiler/lib.es2015.reflect.d.ts +26 -3
  14. package/compiler/lib.es2015.symbol.wellknown.d.ts +3 -3
  15. package/compiler/lib.es2017.intl.d.ts +16 -1
  16. package/compiler/lib.es2019.d.ts +1 -0
  17. package/compiler/lib.es2019.intl.d.ts +25 -0
  18. package/compiler/lib.es2020.bigint.d.ts +7 -5
  19. package/compiler/lib.es2020.d.ts +2 -0
  20. package/compiler/lib.es2020.date.d.ts +44 -0
  21. package/compiler/lib.es2020.intl.d.ts +81 -16
  22. package/compiler/lib.es2020.number.d.ts +30 -0
  23. package/compiler/lib.es2021.intl.d.ts +116 -6
  24. package/compiler/lib.es2022.array.d.ts +123 -0
  25. package/compiler/lib.es2022.d.ts +27 -0
  26. package/compiler/lib.es2022.error.d.ts +75 -0
  27. package/compiler/lib.es2022.full.d.ts +25 -0
  28. package/compiler/lib.es2022.intl.d.ts +111 -0
  29. package/compiler/lib.es2022.object.d.ts +28 -0
  30. package/compiler/lib.es2022.sharedmemory.d.ts +27 -0
  31. package/compiler/lib.es2022.string.d.ts +27 -0
  32. package/compiler/lib.es5.d.ts +62 -31
  33. package/compiler/lib.esnext.d.ts +1 -1
  34. package/compiler/lib.esnext.intl.d.ts +8 -1
  35. package/compiler/lib.webworker.d.ts +540 -81
  36. package/compiler/lib.webworker.iterable.d.ts +19 -4
  37. package/compiler/package.json +1 -1
  38. package/compiler/rindo.d.ts +3 -25
  39. package/compiler/rindo.js +54678 -52205
  40. package/compiler/rindo.min.js +2 -2
  41. package/compiler/sys/in-memory-fs.d.ts +218 -0
  42. package/compiler/transpile.d.ts +32 -0
  43. package/dependencies.json +12 -1
  44. package/dev-server/client/app-error.d.ts +1 -1
  45. package/dev-server/client/index.d.ts +2 -2
  46. package/dev-server/client/index.js +241 -241
  47. package/dev-server/client/package.json +1 -1
  48. package/dev-server/connector.html +3 -3
  49. package/dev-server/index.d.ts +1 -1
  50. package/dev-server/index.js +2 -2
  51. package/dev-server/open-in-editor-api.js +1 -1
  52. package/dev-server/package.json +1 -1
  53. package/dev-server/server-process.js +1192 -1158
  54. package/dev-server/ws.js +1 -1
  55. package/internal/app-data/package.json +1 -1
  56. package/internal/client/css-shim.js +2 -2
  57. package/internal/client/dom.js +1 -1
  58. package/internal/client/index.js +1130 -823
  59. package/internal/client/package.json +1 -1
  60. package/internal/client/patch-browser.js +19 -1
  61. package/internal/client/patch-esm.js +1 -1
  62. package/internal/client/polyfills/css-shim.js +1 -1
  63. package/internal/client/shadow-css.js +1 -1
  64. package/internal/hydrate/index.js +154 -143
  65. package/internal/hydrate/package.json +1 -1
  66. package/internal/hydrate/runner.d.ts +1 -1
  67. package/internal/hydrate/runner.js +106 -106
  68. package/internal/package.json +1 -1
  69. package/internal/rindo-core/index.d.ts +9 -10
  70. package/internal/rindo-private.d.ts +149 -184
  71. package/internal/rindo-public-compiler.d.ts +83 -38
  72. package/internal/rindo-public-docs.d.ts +24 -0
  73. package/internal/rindo-public-runtime.d.ts +79 -7
  74. package/internal/testing/index.js +187 -175
  75. package/internal/testing/package.json +1 -1
  76. package/mock-doc/index.cjs +526 -501
  77. package/mock-doc/index.d.ts +15 -14
  78. package/mock-doc/index.js +526 -501
  79. package/mock-doc/package.json +1 -1
  80. package/package.json +48 -59
  81. package/readme.md +44 -31
  82. package/screenshot/compare/build/p-f4745c2f.entry.js +1 -1
  83. package/screenshot/index.d.ts +1 -1
  84. package/screenshot/index.js +13 -13
  85. package/screenshot/package.json +1 -1
  86. package/screenshot/pixel-match.js +983 -849
  87. package/sys/node/autoprefixer.js +2 -2
  88. package/sys/node/glob.js +1 -1
  89. package/sys/node/index.d.ts +4 -0
  90. package/sys/node/index.js +399 -413
  91. package/sys/node/package.json +1 -1
  92. package/sys/node/prompts.js +1 -1
  93. package/sys/node/worker.js +1 -1
  94. package/testing/index.d.ts +6 -6
  95. package/testing/index.js +684 -839
  96. package/testing/jest/jest-config.d.ts +1 -1
  97. package/testing/jest/jest-preprocessor.d.ts +3 -3
  98. package/testing/jest/jest-serializer.d.ts +1 -2
  99. package/testing/matchers/index.d.ts +3 -3
  100. package/testing/mock-fetch.d.ts +1 -1
  101. package/testing/mocks.d.ts +2 -2
  102. package/testing/package.json +1 -1
  103. package/testing/puppeteer/puppeteer-declarations.d.ts +5 -5
  104. package/testing/puppeteer/puppeteer-element.d.ts +2 -2
  105. package/testing/puppeteer/puppeteer-events.d.ts +1 -1
  106. package/testing/testing-logger.d.ts +1 -1
  107. package/testing/testing-utils.d.ts +6 -5
  108. package/testing/testing.d.ts +1 -1
@@ -1,5 +1,5 @@
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';
1
+ import type { InMemoryFileSystem } from '../compiler/sys/in-memory-fs';
2
+ import type { BuildEvents, BuildLog, BuildResultsComponentGraph, CompilerBuildResults, CompilerBuildStart, CompilerFsStats, CompilerRequestResponse, CompilerSystem, Config, CopyResults, DevServerConfig, DevServerEditor, Diagnostic, Logger, LoggerLineUpdater, LoggerTimeSpan, OptimizeCssInput, OptimizeCssOutput, OutputTargetWww, PageReloadStrategy, PrerenderConfig, StyleDoc, TaskCommand } from './rindo-public-compiler';
3
3
  import type { ComponentInterface, ListenOptions, ListenTargetOptions, VNode, VNodeData } from './rindo-public-runtime';
4
4
  export interface SourceMap {
5
5
  file: string;
@@ -132,7 +132,7 @@ export interface BuildConditionals extends Partial<BuildFeatures> {
132
132
  transformTagName?: boolean;
133
133
  attachStyles?: boolean;
134
134
  }
135
- export declare type ModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd' | 'commonjs' | 'esm' | 'module' | 'systemjs';
135
+ export type ModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd' | 'commonjs' | 'esm' | 'module' | 'systemjs';
136
136
  export interface RollupResultModule {
137
137
  id: string;
138
138
  }
@@ -211,8 +211,8 @@ export interface BuildStyleUpdate {
211
211
  styleText: string;
212
212
  styleMode: string;
213
213
  }
214
- export declare type BuildTask = any;
215
- export declare type BuildStatus = 'pending' | 'error' | 'disabled' | 'default';
214
+ export type BuildTask = any;
215
+ export type BuildStatus = 'pending' | 'error' | 'disabled' | 'default';
216
216
  export interface CompilerBuildStats {
217
217
  timestamp: string;
218
218
  compiler: {
@@ -303,7 +303,7 @@ export interface BundleOutputChunk {
303
303
  };
304
304
  name: string;
305
305
  }
306
- export declare type SourceTarget = 'es5' | 'es2017' | 'latest';
306
+ export type SourceTarget = 'es5' | 'es2017' | 'latest';
307
307
  export interface BundleEntryInputs {
308
308
  [entryKey: string]: string;
309
309
  }
@@ -313,7 +313,7 @@ export interface BundleEntryInputs {
313
313
  * Rindo source. As a result, some types are duplicated here for Rollup that will be used within the codebase.
314
314
  * Updates to rollup may require these typings to be updated.
315
315
  */
316
- export declare type RollupResult = RollupChunkResult | RollupAssetResult;
316
+ export type RollupResult = RollupChunkResult | RollupAssetResult;
317
317
  export interface RollupAssetResult {
318
318
  type: 'asset';
319
319
  fileName: string;
@@ -346,7 +346,7 @@ export interface RollupSourceMap {
346
346
  /**
347
347
  * Result of Rindo compressing, mangling, and otherwise 'minifying' JavaScript
348
348
  */
349
- export declare type OptimizeJsResult = {
349
+ export type OptimizeJsResult = {
350
350
  output: string;
351
351
  diagnostics: Diagnostic[];
352
352
  sourceMap?: SourceMap;
@@ -399,7 +399,7 @@ export interface CollectionManifest {
399
399
  compiler?: CollectionCompilerVersion;
400
400
  bundles?: CollectionBundleManifest[];
401
401
  }
402
- export declare type CollectionComponentEntryPath = string;
402
+ export type CollectionComponentEntryPath = string;
403
403
  export interface CollectionBundleManifest {
404
404
  components: string[];
405
405
  }
@@ -549,8 +549,8 @@ export interface BuildOutputFile {
549
549
  name: string;
550
550
  content: string;
551
551
  }
552
- export declare type OnCallback = (buildStart: CompilerBuildStart) => void;
553
- export declare type RemoveCallback = () => boolean;
552
+ export type OnCallback = (buildStart: CompilerBuildStart) => void;
553
+ export type RemoveCallback = () => boolean;
554
554
  export interface CompilerCtx {
555
555
  version: number;
556
556
  activeBuildId: number;
@@ -584,7 +584,7 @@ export interface CompilerCtx {
584
584
  rollupCache: Map<string, any>;
585
585
  reset(): void;
586
586
  }
587
- export declare type NodeMap = WeakMap<any, ComponentCompilerMeta>;
587
+ export type NodeMap = WeakMap<any, ComponentCompilerMeta>;
588
588
  /** Must be serializable to JSON!! */
589
589
  export interface ComponentCompilerFeatures {
590
590
  hasAttribute: boolean;
@@ -681,7 +681,7 @@ export interface ComponentCompilerLegacyContext {
681
681
  name: string;
682
682
  context: string;
683
683
  }
684
- export declare type Encapsulation = 'shadow' | 'scoped' | 'none';
684
+ export type Encapsulation = 'shadow' | 'scoped' | 'none';
685
685
  /**
686
686
  * Intermediate Representation (IR) of a static property on a Rindo component
687
687
  */
@@ -708,7 +708,7 @@ export interface ComponentCompilerVirtualProperty {
708
708
  type: string;
709
709
  docs: string;
710
710
  }
711
- export declare type ComponentCompilerPropertyType = 'any' | 'string' | 'boolean' | 'number' | 'unknown';
711
+ export type ComponentCompilerPropertyType = 'any' | 'string' | 'boolean' | 'number' | 'unknown';
712
712
  export interface ComponentCompilerPropertyComplexType {
713
713
  original: string;
714
714
  resolved: string;
@@ -722,7 +722,7 @@ export interface ComponentCompilerPropertyComplexType {
722
722
  *
723
723
  * Note any key can be a user defined type or a TypeScript standard type.
724
724
  */
725
- export declare type ComponentCompilerTypeReferences = Record<string, ComponentCompilerTypeReference>;
725
+ export type ComponentCompilerTypeReferences = Record<string, ComponentCompilerTypeReference>;
726
726
  /**
727
727
  * Describes a reference to a type used by a component.
728
728
  */
@@ -784,12 +784,30 @@ export interface ComponentCompilerMethod extends ComponentCompilerStaticMethod {
784
784
  export interface ComponentCompilerState {
785
785
  name: string;
786
786
  }
787
+ /**
788
+ * Representation of JSDoc that is pulled off a node in the AST
789
+ */
787
790
  export interface CompilerJsDoc {
791
+ /**
792
+ * The text associated with the JSDoc
793
+ */
788
794
  text: string;
795
+ /**
796
+ * Tags included in the JSDoc
797
+ */
789
798
  tags: CompilerJsDocTagInfo[];
790
799
  }
800
+ /**
801
+ * Representation of a tag that exists in a JSDoc
802
+ */
791
803
  export interface CompilerJsDocTagInfo {
804
+ /**
805
+ * The name of the tag - e.g. `@deprecated`
806
+ */
792
807
  name: string;
808
+ /**
809
+ * Additional text that is associated with the tag - e.g. `@deprecated use v2 of this API`
810
+ */
793
811
  text?: string;
794
812
  }
795
813
  export interface CompilerStyleDoc {
@@ -823,6 +841,10 @@ export interface ComponentConstructor {
823
841
  isProxied?: boolean;
824
842
  isStyleRegistered?: boolean;
825
843
  }
844
+ /**
845
+ * A mapping from class member names to a list of methods which are watching
846
+ * them.
847
+ */
826
848
  export interface ComponentConstructorWatchers {
827
849
  [propName: string]: string[];
828
850
  }
@@ -832,15 +854,15 @@ export interface ComponentTestingConstructor extends ComponentConstructor {
832
854
  componentWillLoad?: Function;
833
855
  componentWillUpdate?: Function;
834
856
  componentWillRender?: Function;
835
- __componentWillLoad?: Function;
836
- __componentWillUpdate?: Function;
837
- __componentWillRender?: Function;
857
+ __componentWillLoad?: Function | null;
858
+ __componentWillUpdate?: Function | null;
859
+ __componentWillRender?: Function | null;
838
860
  };
839
861
  }
840
862
  export interface ComponentNativeConstructor extends ComponentConstructor {
841
863
  cmpMeta: ComponentRuntimeMeta;
842
864
  }
843
- export declare type ComponentConstructorEncapsulation = 'shadow' | 'scoped' | 'none';
865
+ export type ComponentConstructorEncapsulation = 'shadow' | 'scoped' | 'none';
844
866
  export interface ComponentConstructorProperties {
845
867
  [propName: string]: ComponentConstructorProperty;
846
868
  }
@@ -854,7 +876,7 @@ export interface ComponentConstructorProperty {
854
876
  type?: ComponentConstructorPropertyType;
855
877
  watchCallbacks?: string[];
856
878
  }
857
- export declare type ComponentConstructorPropertyType = StringConstructor | BooleanConstructor | NumberConstructor | 'string' | 'boolean' | 'number';
879
+ export type ComponentConstructorPropertyType = StringConstructor | BooleanConstructor | NumberConstructor | 'string' | 'boolean' | 'number';
858
880
  export interface ComponentConstructorEvent {
859
881
  name: string;
860
882
  method: string;
@@ -939,24 +961,21 @@ export interface DevServerMessage {
939
961
  status: number;
940
962
  };
941
963
  }
942
- export declare type DevServerSendMessage = (msg: DevServerMessage) => void;
964
+ export type DevServerSendMessage = (msg: DevServerMessage) => void;
943
965
  export interface DevServerContext {
944
966
  connectorHtml: string;
945
967
  dirTemplate: string;
946
968
  getBuildResults: () => Promise<CompilerBuildResults>;
947
969
  getCompilerRequest: (path: string) => Promise<CompilerRequestResponse>;
948
970
  isServerListening: boolean;
949
- logRequest: (req: {
950
- method: string;
951
- pathname?: string;
952
- }, status: number) => void;
971
+ logRequest: (req: HttpRequest, status: number) => void;
953
972
  prerenderConfig: PrerenderConfig;
954
973
  serve302: (req: any, res: any, pathname?: string) => void;
955
974
  serve404: (req: any, res: any, xSource: string, content?: string) => void;
956
975
  serve500: (req: any, res: any, error: any, xSource: string) => void;
957
976
  sys: CompilerSystem;
958
977
  }
959
- export declare type InitServerProcess = (sendMsg: (msg: DevServerMessage) => void) => (msg: DevServerMessage) => void;
978
+ export type InitServerProcess = (sendMsg: (msg: DevServerMessage) => void) => (msg: DevServerMessage) => void;
960
979
  export interface DevResponseHeaders {
961
980
  'cache-control'?: string;
962
981
  expires?: string;
@@ -1016,51 +1035,6 @@ export interface EventEmitterData<T = any> {
1016
1035
  cancelable?: boolean;
1017
1036
  composed?: boolean;
1018
1037
  }
1019
- export interface FsReadOptions {
1020
- useCache?: boolean;
1021
- setHash?: boolean;
1022
- }
1023
- export interface FsReaddirOptions {
1024
- inMemoryOnly?: boolean;
1025
- recursive?: boolean;
1026
- /**
1027
- * Directory names to exclude. Just the basename,
1028
- * not the entire path. Basically for "node_moduels".
1029
- */
1030
- excludeDirNames?: string[];
1031
- /**
1032
- * Extensions we know we can avoid. Each extension
1033
- * should include the `.` so that we can test for both
1034
- * `.d.ts.` and `.ts`. If `excludeExtensions` isn't provided it
1035
- * doesn't try to exclude anything. This only checks against
1036
- * the filename, not directory names when recursive.
1037
- */
1038
- excludeExtensions?: string[];
1039
- }
1040
- export interface FsReaddirItem {
1041
- absPath: string;
1042
- relPath: string;
1043
- isDirectory: boolean;
1044
- isFile: boolean;
1045
- }
1046
- export interface FsWriteResults {
1047
- changedContent: boolean;
1048
- queuedWrite: boolean;
1049
- ignored: boolean;
1050
- }
1051
- export declare type FsItems = Map<string, FsItem>;
1052
- export interface FsItem {
1053
- fileText: string;
1054
- isFile: boolean;
1055
- isDirectory: boolean;
1056
- size: number;
1057
- mtimeMs: number;
1058
- exists: boolean;
1059
- queueCopyFileToDest: string;
1060
- queueWriteToDisk: boolean;
1061
- queueDeleteFromDisk?: boolean;
1062
- useCache: boolean;
1063
- }
1064
1038
  export interface HostElement extends HTMLElement {
1065
1039
  connectedCallback?: () => void;
1066
1040
  attributeChangedCallback?: (attribName: string, oldVal: string, newVal: string, namespace: string) => void;
@@ -1104,66 +1078,6 @@ export interface HostElement extends HTMLElement {
1104
1078
  ['s-p']?: Promise<void>[];
1105
1079
  componentOnReady?: () => Promise<this>;
1106
1080
  }
1107
- export interface InMemoryFileSystem {
1108
- sys?: CompilerSystem;
1109
- accessData(filePath: string): Promise<{
1110
- exists: boolean;
1111
- isDirectory: boolean;
1112
- isFile: boolean;
1113
- }>;
1114
- access(filePath: string): Promise<boolean>;
1115
- /**
1116
- * Synchronous!!! Do not use!!!
1117
- * (Only typescript transpiling is allowed to use)
1118
- * @param filePath
1119
- */
1120
- accessSync(filePath: string): boolean;
1121
- copyFile(srcFile: string, dest: string): Promise<void>;
1122
- emptyDirs(dirPaths: string[]): Promise<void>;
1123
- readdir(dirPath: string, opts?: FsReaddirOptions): Promise<FsReaddirItem[]>;
1124
- readFile(filePath: string, opts?: FsReadOptions): Promise<string>;
1125
- /**
1126
- * Synchronous!!! Do not use!!!
1127
- * (Only typescript transpiling is allowed to use)
1128
- * @param filePath
1129
- */
1130
- readFileSync(filePath: string, opts?: FsReadOptions): string;
1131
- remove(itemPath: string): Promise<void>;
1132
- stat(itemPath: string): Promise<{
1133
- isFile: boolean;
1134
- isDirectory: boolean;
1135
- }>;
1136
- /**
1137
- * Synchronous!!! Do not use!!!
1138
- * (Only typescript transpiling is allowed to use)
1139
- * @param itemPath
1140
- */
1141
- statSync(itemPath: string): {
1142
- exists: boolean;
1143
- isFile: boolean;
1144
- isDirectory: boolean;
1145
- };
1146
- writeFile(filePath: string, content: string, opts?: FsWriteOptions): Promise<FsWriteResults>;
1147
- writeFiles(files: {
1148
- [filePath: string]: string;
1149
- } | Map<string, String>, opts?: FsWriteOptions): Promise<FsWriteResults[]>;
1150
- commit(): Promise<{
1151
- filesWritten: string[];
1152
- filesDeleted: string[];
1153
- filesCopied: string[][];
1154
- dirsDeleted: string[];
1155
- dirsAdded: string[];
1156
- }>;
1157
- cancelDeleteFilesFromDisk(filePaths: string[]): void;
1158
- cancelDeleteDirectoriesFromDisk(filePaths: string[]): void;
1159
- clearDirCache(dirPath: string): void;
1160
- clearFileCache(filePath: string): void;
1161
- getItem(itemPath: string): FsItem;
1162
- getBuildOutputs(): BuildOutput[];
1163
- clearCache(): void;
1164
- keys(): string[];
1165
- getMemoryStats(): string;
1166
- }
1167
1081
  export interface HydrateResults {
1168
1082
  buildId: string;
1169
1083
  diagnostics: Diagnostic[];
@@ -1241,7 +1155,7 @@ export interface MinifyJsResult {
1241
1155
  pos: number;
1242
1156
  };
1243
1157
  }
1244
- export declare type ModuleMap = Map<string, Module>;
1158
+ export type ModuleMap = Map<string, Module>;
1245
1159
  /**
1246
1160
  * Rindo's Intermediate Representation (IR) of a module, bundling together
1247
1161
  * various pieces of information like the classes declared within it, the path
@@ -1406,13 +1320,13 @@ export interface RenderNode extends HostElement {
1406
1320
  */
1407
1321
  ['s-en']?: '' | /*shadow*/ 'c';
1408
1322
  }
1409
- export declare type LazyBundlesRuntimeData = LazyBundleRuntimeData[];
1410
- export declare type LazyBundleRuntimeData = [
1323
+ export type LazyBundlesRuntimeData = LazyBundleRuntimeData[];
1324
+ export type LazyBundleRuntimeData = [
1411
1325
  /** bundleIds */
1412
1326
  string,
1413
1327
  ComponentRuntimeMetaCompact[]
1414
1328
  ];
1415
- export declare type ComponentRuntimeMetaCompact = [
1329
+ export type ComponentRuntimeMetaCompact = [
1416
1330
  /** flags */
1417
1331
  number,
1418
1332
  /** tagname */
@@ -1424,47 +1338,87 @@ export declare type ComponentRuntimeMetaCompact = [
1424
1338
  /** listeners */
1425
1339
  ComponentRuntimeHostListener[]?
1426
1340
  ];
1341
+ /**
1342
+ * Runtime metadata for a Rindo component
1343
+ */
1427
1344
  export interface ComponentRuntimeMeta {
1345
+ /**
1346
+ * This number is used to hold a series of bitflags for various features we
1347
+ * support on components. The flags which this value is intended to store are
1348
+ * documented in the {@link CMP_FLAGS} enum.
1349
+ */
1428
1350
  $flags$: number;
1351
+ /**
1352
+ * Just what it says on the tin - the tag name for the component, as set in
1353
+ * the `@Component` decorator.
1354
+ */
1429
1355
  $tagName$: string;
1430
- $members$?: ComponentRuntimeMembers;
1431
- $listeners$?: ComponentRuntimeHostListener[];
1432
- $attrsToReflect$?: [string, string][];
1433
- $watchers$?: ComponentConstructorWatchers;
1434
- $lazyBundleId$?: string;
1435
- }
1436
- export interface ComponentRuntimeMembers {
1437
- [memberName: string]: ComponentRuntimeMember;
1438
- }
1439
- export declare type ComponentRuntimeMember = [
1440
1356
  /**
1441
- * flags data
1357
+ * A map of the component's members, which could include fields decorated
1358
+ * with `@Prop`, `@State`, etc as well as methods.
1442
1359
  */
1443
- number,
1360
+ $members$?: ComponentRuntimeMembers;
1444
1361
  /**
1445
- * attribute name to observe
1362
+ * Information about listeners on the component.
1446
1363
  */
1447
- string?
1448
- ];
1449
- export declare type ComponentRuntimeHostListener = [
1364
+ $listeners$?: ComponentRuntimeHostListener[];
1450
1365
  /**
1451
- * event flags
1366
+ * Tuples containing information about `@Prop` fields on the component which
1367
+ * are set to be reflected (i.e. kept in sync) as HTML attributes when
1368
+ * updated.
1452
1369
  */
1453
- number,
1370
+ $attrsToReflect$?: ComponentRuntimeReflectingAttr[];
1454
1371
  /**
1455
- * event name,
1372
+ * Information about which class members have watchers attached on the component.
1456
1373
  */
1457
- string,
1374
+ $watchers$?: ComponentConstructorWatchers;
1458
1375
  /**
1459
- * event method,
1376
+ * A bundle ID used for lazy loading.
1460
1377
  */
1461
- string
1462
- ];
1463
- export declare type ModeBundleId = ModeBundleIds | string;
1378
+ $lazyBundleId$?: string;
1379
+ }
1380
+ /**
1381
+ * A mapping of the names of members on the component to some runtime-specific
1382
+ * information about them.
1383
+ */
1384
+ export interface ComponentRuntimeMembers {
1385
+ [memberName: string]: ComponentRuntimeMember;
1386
+ }
1387
+ /**
1388
+ * A tuple with information about a class member that's relevant at runtime.
1389
+ * The fields are:
1390
+ *
1391
+ * 1. A number used to hold bitflags for component members. The bit flags which
1392
+ * this is intended to store are documented in the {@link MEMBER_FLAGS} enum.
1393
+ * 2. The attribute name to observe.
1394
+ */
1395
+ export type ComponentRuntimeMember = [number, string?];
1396
+ /**
1397
+ * A tuple holding information about a host listener which is relevant at
1398
+ * runtime. The field are:
1399
+ *
1400
+ * 1. A number used to hold bitflags for listeners. The bit flags which this is
1401
+ * intended to store are documented in the {@link LISTENER_FLAGS} enum.
1402
+ * 2. The event name.
1403
+ * 3. The method name.
1404
+ */
1405
+ export type ComponentRuntimeHostListener = [number, string, string];
1406
+ /**
1407
+ * A tuple containing information about props which are "reflected" at runtime,
1408
+ * meaning that HTML attributes on the component instance are kept in sync with
1409
+ * the prop value.
1410
+ *
1411
+ * The fields are:
1412
+ *
1413
+ * 1. the prop name
1414
+ * 2. the prop attribute.
1415
+ */
1416
+ export type ComponentRuntimeReflectingAttr = [string, string | undefined];
1417
+ export type ModeBundleId = ModeBundleIds | string;
1464
1418
  export interface ModeBundleIds {
1465
1419
  [modeName: string]: string;
1466
1420
  }
1467
- export declare type RuntimeRef = HostElement | {};
1421
+ export type RuntimeRef = HostElement | {};
1468
1422
  /**
1469
1423
  * Interface used to track an Element, it's virtual Node (`VNode`), and other data
1470
1424
  */
@@ -1491,17 +1445,22 @@ export interface PlatformRuntime {
1491
1445
  $flags$: number;
1492
1446
  $orgLocNodes$?: Map<string, RenderNode>;
1493
1447
  $resourcesUrl$: string;
1448
+ /**
1449
+ * The nonce value to be applied to all script/style tags at runtime.
1450
+ * If `null`, the nonce attribute will not be applied.
1451
+ */
1452
+ $nonce$?: string | null;
1494
1453
  jmp: (c: Function) => any;
1495
1454
  raf: (c: FrameRequestCallback) => number;
1496
1455
  ael: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
1497
1456
  rel: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
1498
1457
  ce: (eventName: string, opts?: any) => CustomEvent;
1499
1458
  }
1500
- export declare type RefMap = WeakMap<any, HostRef>;
1501
- export declare type StyleMap = Map<string, CSSStyleSheet | string>;
1502
- export declare type RootAppliedStyleMap = WeakMap<Element, Set<string>>;
1503
- export declare type AppliedStyleMap = Set<string>;
1504
- export declare type ActivelyProcessingCmpMap = Set<Element>;
1459
+ export type RefMap = WeakMap<any, HostRef>;
1460
+ export type StyleMap = Map<string, CSSStyleSheet | string>;
1461
+ export type RootAppliedStyleMap = WeakMap<Element, Set<string>>;
1462
+ export type AppliedStyleMap = Set<string>;
1463
+ export type ActivelyProcessingCmpMap = Set<Element>;
1505
1464
  export interface ScreenshotConnector {
1506
1465
  initBuild(opts: ScreenshotConnectorOptions): Promise<void>;
1507
1466
  completeBuild(masterBuild: ScreenshotBuild): Promise<ScreenshotBuildResults>;
@@ -2117,6 +2076,11 @@ export interface NewSpecPageOptions {
2117
2076
  */
2118
2077
  attachStyles?: boolean;
2119
2078
  strictBuild?: boolean;
2079
+ /**
2080
+ * Default values to be set on the platform runtime object (@see PlatformRuntime) when creating
2081
+ * the spec page.
2082
+ */
2083
+ platform?: Partial<PlatformRuntime>;
2120
2084
  }
2121
2085
  /**
2122
2086
  * A record of `TypesMemberNameData` entities.
@@ -2152,7 +2116,7 @@ export interface TypesModule {
2152
2116
  jsx: string;
2153
2117
  element: string;
2154
2118
  }
2155
- export declare type TypeInfo = {
2119
+ export type TypeInfo = {
2156
2120
  name: string;
2157
2121
  type: string;
2158
2122
  optional: boolean;
@@ -2170,8 +2134,8 @@ export interface Hyperscript {
2170
2134
  (sel: any, data: VNodeData, children: Array<VNode | undefined | null>): VNode;
2171
2135
  (sel: any, data: VNodeData, children: VNode): VNode;
2172
2136
  }
2173
- export declare type ChildType = VNode | number | string;
2174
- export declare type PropsType = VNodeProdData | number | string | null;
2137
+ export type ChildType = VNode | number | string;
2138
+ export type PropsType = VNodeProdData | number | string | null;
2175
2139
  export interface VNodeProdData {
2176
2140
  key?: string | number;
2177
2141
  class?: {
@@ -2209,7 +2173,7 @@ export interface CompilerWorkerTask {
2209
2173
  reject: (msg: string) => any;
2210
2174
  retries?: number;
2211
2175
  }
2212
- export declare type WorkerMsgHandler = (msgToWorker: MsgToWorker) => Promise<any>;
2176
+ export type WorkerMsgHandler = (msgToWorker: MsgToWorker) => Promise<any>;
2213
2177
  export interface WorkerTask {
2214
2178
  taskId: number;
2215
2179
  method: string;
@@ -2228,7 +2192,7 @@ export interface WorkerMessage {
2228
2192
  error?: string;
2229
2193
  exit?: boolean;
2230
2194
  }
2231
- export declare type WorkerRunner = (methodName: string, args: any[]) => Promise<any>;
2195
+ export type WorkerRunner = (methodName: string, args: any[]) => Promise<any>;
2232
2196
  export interface WorkerRunnerOptions {
2233
2197
  isLongRunningTask?: boolean;
2234
2198
  workerKey?: string;
@@ -2262,30 +2226,31 @@ export interface TerminalInfo {
2262
2226
  /**
2263
2227
  * The task to run in order to collect the duration data point.
2264
2228
  */
2265
- export declare type TelemetryCallback = (...args: any[]) => void | Promise<void>;
2229
+ export type TelemetryCallback = (...args: any[]) => void | Promise<void>;
2266
2230
  /**
2267
2231
  * The model for the data that's tracked.
2268
2232
  */
2269
2233
  export interface TrackableData {
2270
- yarn: boolean;
2271
- component_count?: number;
2272
2234
  arguments: string[];
2273
- targets: string[];
2274
- task: TaskCommand;
2275
- duration_ms: number;
2235
+ build: string;
2236
+ component_count?: number;
2237
+ config: Config;
2238
+ cpu_model: string | undefined;
2239
+ duration_ms: number | undefined;
2240
+ has_app_pwa_config: boolean;
2241
+ is_browser_env: boolean;
2242
+ os_name: string | undefined;
2243
+ os_version: string | undefined;
2276
2244
  packages: string[];
2277
2245
  packages_no_versions?: string[];
2278
- os_name: string;
2279
- os_version: string;
2280
- cpu_model: string;
2281
- typescript: string;
2282
2246
  rollup: string;
2247
+ rindo: string;
2283
2248
  system: string;
2284
2249
  system_major?: string;
2285
- build: string;
2286
- rindo: string;
2287
- has_app_pwa_config: boolean;
2288
- config: Config;
2250
+ targets: string[];
2251
+ task: TaskCommand | null;
2252
+ typescript: string;
2253
+ yarn: boolean;
2289
2254
  }
2290
2255
  /**
2291
2256
  * Used as the object sent to the server. Value is the data tracked.