@hyperframes/lint 0.7.16 → 0.7.17
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/browser.d.ts +55 -0
- package/dist/browser.js +3276 -0
- package/dist/browser.js.map +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +10 -7
- package/dist/index.js.map +1 -1
- package/package.json +7 -3
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
type HyperframeLintSeverity = "error" | "warning" | "info";
|
|
2
|
+
type HyperframeLintFinding = {
|
|
3
|
+
code: string;
|
|
4
|
+
severity: HyperframeLintSeverity;
|
|
5
|
+
message: string;
|
|
6
|
+
file?: string;
|
|
7
|
+
selector?: string;
|
|
8
|
+
elementId?: string;
|
|
9
|
+
fixHint?: string;
|
|
10
|
+
snippet?: string;
|
|
11
|
+
};
|
|
12
|
+
type HyperframeLintResult = {
|
|
13
|
+
ok: boolean;
|
|
14
|
+
errorCount: number;
|
|
15
|
+
warningCount: number;
|
|
16
|
+
infoCount: number;
|
|
17
|
+
findings: HyperframeLintFinding[];
|
|
18
|
+
};
|
|
19
|
+
type HyperframeLinterOptions = {
|
|
20
|
+
filePath?: string;
|
|
21
|
+
isSubComposition?: boolean;
|
|
22
|
+
externalStyles?: Array<{
|
|
23
|
+
href: string;
|
|
24
|
+
content: string;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Set to `true` when linting compositions destined for distributed / Lambda
|
|
28
|
+
* rendering, where system-font capture (`allowSystemFontCapture`) is
|
|
29
|
+
* disabled. When `true`, the `system_font_will_alias` rule is elevated from
|
|
30
|
+
* `"info"` to `"warning"` because the alias substitution will NOT happen at
|
|
31
|
+
* render time — the font will silently fall back to whatever the OS provides.
|
|
32
|
+
*/
|
|
33
|
+
distributed?: boolean;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
declare function lintHyperframeHtml(html: string, options?: HyperframeLinterOptions): Promise<HyperframeLintResult>;
|
|
37
|
+
/**
|
|
38
|
+
* Async lint pass: HEAD-checks every remote media URL in the HTML.
|
|
39
|
+
* Returns findings for URLs that are unreachable (non-2xx status or network error).
|
|
40
|
+
*
|
|
41
|
+
* Call this after `lintHyperframeHtml()` and merge the findings.
|
|
42
|
+
*
|
|
43
|
+
* @param timeoutMs - per-request timeout (default 8000ms)
|
|
44
|
+
*/
|
|
45
|
+
declare function lintMediaUrls(html: string, options?: {
|
|
46
|
+
timeoutMs?: number;
|
|
47
|
+
}): Promise<HyperframeLintFinding[]>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Pure render-gate decision — no Node.js dependencies, so it is safe to import
|
|
51
|
+
* from the browser entry alongside the rule engine.
|
|
52
|
+
*/
|
|
53
|
+
declare function shouldBlockRender(strictErrors: boolean, strictAll: boolean, totalErrors: number, totalWarnings: number): boolean;
|
|
54
|
+
|
|
55
|
+
export { type HyperframeLintFinding, type HyperframeLintResult, type HyperframeLintSeverity, type HyperframeLinterOptions, lintHyperframeHtml, lintMediaUrls, shouldBlockRender };
|