@jay-framework/compiler-jay-html 0.7.0 → 0.9.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 +19 -1
- package/dist/index.js +761 -148
- package/docs/contract-file-format.md +214 -0
- package/docs/jay-html-docs.md +61 -0
- package/package.json +8 -8
- package/test/fixtures/recursive-html/README.md +10 -1
package/dist/index.d.cts
CHANGED
|
@@ -28,6 +28,9 @@ interface JayHtmlSourceFile extends CompilerSourceFile {
|
|
|
28
28
|
headLinks: JayHtmlHeadLink[];
|
|
29
29
|
css?: string;
|
|
30
30
|
filename?: string;
|
|
31
|
+
contract?: any;
|
|
32
|
+
contractRef?: string;
|
|
33
|
+
hasInlineData?: boolean;
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
declare function generateElementDefinitionFile(parsedFile: WithValidations<JayHtmlSourceFile>): WithValidations<string>;
|
|
@@ -43,6 +46,7 @@ declare enum ContractTagType {
|
|
|
43
46
|
variant = 2,
|
|
44
47
|
subContract = 3
|
|
45
48
|
}
|
|
49
|
+
type RenderingPhase = 'slow' | 'fast' | 'fast+interactive';
|
|
46
50
|
interface ContractTag {
|
|
47
51
|
tag: string;
|
|
48
52
|
required?: boolean;
|
|
@@ -54,6 +58,7 @@ interface ContractTag {
|
|
|
54
58
|
repeated?: boolean;
|
|
55
59
|
link?: string;
|
|
56
60
|
async?: boolean;
|
|
61
|
+
phase?: RenderingPhase;
|
|
57
62
|
}
|
|
58
63
|
interface Contract {
|
|
59
64
|
name: string;
|
|
@@ -81,6 +86,19 @@ interface SubContractTraverseResult {
|
|
|
81
86
|
enumsToImport: EnumToImport[];
|
|
82
87
|
}
|
|
83
88
|
declare function contractToImportsViewStateAndRefs(contract: Contract, contractFilePath: string, jayImportResolver: JayImportResolver, isRepeated?: boolean, isAsync?: boolean): Promise<WithValidations<SubContractTraverseResult>>;
|
|
89
|
+
/**
|
|
90
|
+
* Generate phase-specific ViewState type
|
|
91
|
+
*/
|
|
92
|
+
declare function contractToPhaseViewState(contract: Contract, contractFilePath: string, jayImportResolver: JayImportResolver, phase: RenderingPhase, isRepeated?: boolean, isAsync?: boolean): Promise<WithValidations<SubContractTraverseResult>>;
|
|
93
|
+
interface PhaseViewStates {
|
|
94
|
+
slow: SubContractTraverseResult;
|
|
95
|
+
fast: SubContractTraverseResult;
|
|
96
|
+
interactive: SubContractTraverseResult;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Generate all three phase-specific ViewState types
|
|
100
|
+
*/
|
|
101
|
+
declare function contractToAllPhaseViewStates(contract: Contract, contractFilePath: string, jayImportResolver: JayImportResolver): Promise<WithValidations<PhaseViewStates>>;
|
|
84
102
|
|
|
85
103
|
interface JayImportResolver {
|
|
86
104
|
resolveLink(importingModuleDir: string, link: string): string;
|
|
@@ -102,4 +120,4 @@ declare function renderRefsType(refs: RefsTree, refsType: string, generateTarget
|
|
|
102
120
|
|
|
103
121
|
declare function generateTypes(types: JayType): string;
|
|
104
122
|
|
|
105
|
-
export { type Contract, type ContractTag, ContractTagType, type EnumToImport, JAY_IMPORT_RESOLVER, type JayContractImportLink, type JayHtmlSourceFile, type JayImportResolver, compileContract, contractToImportsViewStateAndRefs, generateElementBridgeFile, generateElementDefinitionFile, generateElementFile, generateElementFileReactTarget, generateSandboxRootFile, generateTypes, getJayHtmlImports, parseContract, parseEnumValues, parseIsEnum, parseJayFile, renderRefsType };
|
|
123
|
+
export { type Contract, type ContractTag, ContractTagType, type EnumToImport, JAY_IMPORT_RESOLVER, type JayContractImportLink, type JayHtmlSourceFile, type JayImportResolver, type PhaseViewStates, type RenderingPhase, compileContract, contractToAllPhaseViewStates, contractToImportsViewStateAndRefs, contractToPhaseViewState, generateElementBridgeFile, generateElementDefinitionFile, generateElementFile, generateElementFileReactTarget, generateSandboxRootFile, generateTypes, getJayHtmlImports, parseContract, parseEnumValues, parseIsEnum, parseJayFile, renderRefsType };
|