@jay-framework/compiler-jay-html 0.9.0 → 0.10.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.
package/dist/index.d.cts CHANGED
@@ -1,45 +1,7 @@
1
- import { CompilerSourceFile, SourceFileFormat, JayType, RefsTree, JayImportLink, WithValidations, MainRuntimeModes, JayEnumType, GenerateTarget, Imports } from '@jay-framework/compiler-shared';
1
+ import { JayType, WithValidations, PluginComponentResolution, JayEnumType, RefsTree, CompilerSourceFile, SourceFileFormat, JayImportLink, MainRuntimeModes, GenerateTarget, Imports } from '@jay-framework/compiler-shared';
2
2
  import { HTMLElement } from 'node-html-parser';
3
3
  import { ResolveTsConfigOptions } from '@jay-framework/compiler-analyze-exported-types';
4
4
 
5
- interface JayHtmlNamespace {
6
- prefix: string;
7
- namespace: string;
8
- }
9
- interface JayHeadlessImports {
10
- key: string;
11
- refs: RefsTree;
12
- rootType: JayType;
13
- contractLinks: JayImportLink[];
14
- codeLink: JayImportLink;
15
- }
16
- interface JayHtmlHeadLink {
17
- rel: string;
18
- href: string;
19
- attributes: Record<string, string>;
20
- }
21
- interface JayHtmlSourceFile extends CompilerSourceFile {
22
- format: SourceFileFormat.JayHtml;
23
- baseElementName: string;
24
- types: JayType;
25
- body: HTMLElement;
26
- namespaces: JayHtmlNamespace[];
27
- headlessImports: JayHeadlessImports[];
28
- headLinks: JayHtmlHeadLink[];
29
- css?: string;
30
- filename?: string;
31
- contract?: any;
32
- contractRef?: string;
33
- hasInlineData?: boolean;
34
- }
35
-
36
- declare function generateElementDefinitionFile(parsedFile: WithValidations<JayHtmlSourceFile>): WithValidations<string>;
37
- declare function generateElementFile(jayFile: JayHtmlSourceFile, importerMode: MainRuntimeModes): WithValidations<string>;
38
- declare function generateElementBridgeFile(jayFile: JayHtmlSourceFile): string;
39
- declare function generateSandboxRootFile(jayFile: JayHtmlSourceFile): string;
40
-
41
- declare function generateElementFileReactTarget(jayFile: JayHtmlSourceFile, importerMode: MainRuntimeModes): WithValidations<string>;
42
-
43
5
  declare enum ContractTagType {
44
6
  data = 0,
45
7
  interactive = 1,
@@ -56,6 +18,7 @@ interface ContractTag {
56
18
  description?: Array<string>;
57
19
  tags?: Array<ContractTag>;
58
20
  repeated?: boolean;
21
+ trackBy?: string;
59
22
  link?: string;
60
23
  async?: boolean;
61
24
  phase?: RenderingPhase;
@@ -69,6 +32,14 @@ declare function compileContract(contractWithValidations: WithValidations<Contra
69
32
 
70
33
  declare function parseContract(contractYaml: string, fileName: string): WithValidations<Contract>;
71
34
 
35
+ interface JayImportResolver {
36
+ resolveLink(importingModuleDir: string, link: string): string;
37
+ loadContract(fullPath: string): WithValidations<Contract>;
38
+ analyzeExportedTypes(fullPath: string, options: ResolveTsConfigOptions): JayType[];
39
+ resolvePluginComponent(pluginName: string, contractName: string, projectRoot: string): WithValidations<PluginComponentResolution>;
40
+ }
41
+ declare const JAY_IMPORT_RESOLVER: JayImportResolver;
42
+
72
43
  interface JayContractImportLink {
73
44
  module: string;
74
45
  viewState: string;
@@ -100,14 +71,56 @@ interface PhaseViewStates {
100
71
  */
101
72
  declare function contractToAllPhaseViewStates(contract: Contract, contractFilePath: string, jayImportResolver: JayImportResolver): Promise<WithValidations<PhaseViewStates>>;
102
73
 
103
- interface JayImportResolver {
104
- resolveLink(importingModuleDir: string, link: string): string;
105
- loadContract(fullPath: string): WithValidations<Contract>;
106
- analyzeExportedTypes(fullPath: string, options: ResolveTsConfigOptions): JayType[];
74
+ interface JayHtmlNamespace {
75
+ prefix: string;
76
+ namespace: string;
107
77
  }
108
- declare const JAY_IMPORT_RESOLVER: JayImportResolver;
78
+ interface JayHeadlessImports {
79
+ key: string;
80
+ refs: RefsTree;
81
+ rootType: JayType;
82
+ contractLinks: JayImportLink[];
83
+ codeLink: JayImportLink;
84
+ contract?: Contract;
85
+ }
86
+ interface JayHtmlHeadLink {
87
+ rel: string;
88
+ href: string;
89
+ attributes: Record<string, string>;
90
+ }
91
+ interface JayHtmlSourceFile extends CompilerSourceFile {
92
+ format: SourceFileFormat.JayHtml;
93
+ baseElementName: string;
94
+ types: JayType;
95
+ body: HTMLElement;
96
+ namespaces: JayHtmlNamespace[];
97
+ headlessImports: JayHeadlessImports[];
98
+ headLinks: JayHtmlHeadLink[];
99
+ css?: string;
100
+ filename?: string;
101
+ contract?: Contract;
102
+ contractRef?: string;
103
+ hasInlineData?: boolean;
104
+ /**
105
+ * TrackBy map for server-side merge (slow → fast).
106
+ * Includes all tracked arrays.
107
+ */
108
+ serverTrackByMap?: Record<string, string>;
109
+ /**
110
+ * TrackBy map for client-side merge (fast → interactive).
111
+ * Excludes arrays with phase 'fast+interactive' (dynamic arrays that can be fully replaced).
112
+ */
113
+ clientTrackByMap?: Record<string, string>;
114
+ }
115
+
116
+ declare function generateElementDefinitionFile(parsedFile: WithValidations<JayHtmlSourceFile>): WithValidations<string>;
117
+ declare function generateElementFile(jayFile: JayHtmlSourceFile, importerMode: MainRuntimeModes): WithValidations<string>;
118
+ declare function generateElementBridgeFile(jayFile: JayHtmlSourceFile): string;
119
+ declare function generateSandboxRootFile(jayFile: JayHtmlSourceFile): string;
120
+
121
+ declare function generateElementFileReactTarget(jayFile: JayHtmlSourceFile, importerMode: MainRuntimeModes): WithValidations<string>;
109
122
 
110
- declare function parseJayFile(html: string, filename: string, filePath: string, options: ResolveTsConfigOptions, linkedContractResolver: JayImportResolver): Promise<WithValidations<JayHtmlSourceFile>>;
123
+ declare function parseJayFile(html: string, filename: string, filePath: string, options: ResolveTsConfigOptions, linkedContractResolver: JayImportResolver, projectRoot: string): Promise<WithValidations<JayHtmlSourceFile>>;
111
124
  declare function getJayHtmlImports(html: string): string[];
112
125
 
113
126
  declare function parseIsEnum(expression: string): boolean;