@diegovelasquezweb/a11y-engine 0.1.4 → 0.1.5
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/package.json +6 -2
- package/scripts/index.d.mts +43 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diegovelasquezweb/a11y-engine",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "WCAG 2.2 AA accessibility audit engine — scanner, analyzer, and report builders",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,9 +13,13 @@
|
|
|
13
13
|
"node": ">=18"
|
|
14
14
|
},
|
|
15
15
|
"exports": {
|
|
16
|
-
".":
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./scripts/index.d.mts",
|
|
18
|
+
"default": "./scripts/index.mjs"
|
|
19
|
+
}
|
|
17
20
|
},
|
|
18
21
|
"main": "scripts/index.mjs",
|
|
22
|
+
"types": "scripts/index.d.mts",
|
|
19
23
|
"bin": {
|
|
20
24
|
"a11y-audit": "scripts/audit.mjs"
|
|
21
25
|
},
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface SeverityTotals {
|
|
2
|
+
Critical: number;
|
|
3
|
+
Serious: number;
|
|
4
|
+
Moderate: number;
|
|
5
|
+
Minor: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ScoreResult {
|
|
9
|
+
score: number;
|
|
10
|
+
label: string;
|
|
11
|
+
wcagStatus: "Pass" | "Conditional Pass" | "Fail";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface PersonaGroup {
|
|
15
|
+
label: string;
|
|
16
|
+
count: number;
|
|
17
|
+
icon: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface EngineAssets {
|
|
21
|
+
intelligence: Record<string, unknown>;
|
|
22
|
+
pa11yConfig: Record<string, unknown>;
|
|
23
|
+
complianceConfig: Record<string, unknown>;
|
|
24
|
+
wcagReference: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function getAssets(): EngineAssets;
|
|
28
|
+
|
|
29
|
+
export function mapPa11yRuleToCanonical(
|
|
30
|
+
ruleId: string,
|
|
31
|
+
sourceRuleId?: string | null,
|
|
32
|
+
checkData?: Record<string, unknown> | null
|
|
33
|
+
): string;
|
|
34
|
+
|
|
35
|
+
export function enrichFindings<T extends Record<string, unknown>>(
|
|
36
|
+
findings: T[]
|
|
37
|
+
): T[];
|
|
38
|
+
|
|
39
|
+
export function computeScore(totals: SeverityTotals): ScoreResult;
|
|
40
|
+
|
|
41
|
+
export function computePersonaGroups(
|
|
42
|
+
findings: Record<string, unknown>[]
|
|
43
|
+
): Record<string, PersonaGroup>;
|