fix(tests): Correct Figma ingest test
This commit is contained in:
79
packages/dss-rules/lib/index.d.ts
vendored
Normal file
79
packages/dss-rules/lib/index.d.ts
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* Type definitions for @dss/rules
|
||||
*/
|
||||
|
||||
export interface Rule {
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
severity?: 'error' | 'warning' | 'info';
|
||||
wcag?: string;
|
||||
patterns?: {
|
||||
forbidden?: string[];
|
||||
allowed?: string[];
|
||||
};
|
||||
validation?: Record<string, unknown>;
|
||||
exceptions?: string[];
|
||||
guidelines?: string[];
|
||||
components?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface RuleSet {
|
||||
id: string;
|
||||
version: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
category: 'tokens' | 'components' | 'accessibility' | 'patterns' | 'naming';
|
||||
severity?: 'error' | 'warning' | 'info';
|
||||
rules: Rule[];
|
||||
tokens?: {
|
||||
required?: string[];
|
||||
optional?: string[];
|
||||
scale?: Record<string, string>;
|
||||
};
|
||||
components?: Record<string, unknown>;
|
||||
compliance?: Record<string, unknown>;
|
||||
adoption?: {
|
||||
thresholds?: {
|
||||
minimum?: number;
|
||||
target?: number;
|
||||
excellent?: number;
|
||||
};
|
||||
metrics?: string[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface ValidationResult {
|
||||
valid: boolean;
|
||||
violations: Violation[];
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface Violation {
|
||||
rule: string;
|
||||
pattern: string;
|
||||
matches: string[];
|
||||
severity: 'error' | 'warning' | 'info';
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface CIConfig {
|
||||
version: string;
|
||||
categories: string[];
|
||||
errorSeverities: string[];
|
||||
warningSeverities: string[];
|
||||
blockingRules: string[];
|
||||
advisoryRules: string[];
|
||||
}
|
||||
|
||||
export const CATEGORIES: string[];
|
||||
|
||||
export function loadRules(): Record<string, RuleSet | null>;
|
||||
export function getRulesByCategory(category: string): RuleSet | null;
|
||||
export function getAllRuleIds(): string[];
|
||||
export function getRule(ruleId: string): Rule | null;
|
||||
export function validateValue(ruleId: string, value: string): ValidationResult;
|
||||
export function getRuleSeverity(ruleId: string): 'error' | 'warning' | 'info';
|
||||
export function getRequiredTokens(): Record<string, string[]>;
|
||||
export function getVersion(): string;
|
||||
export function getCIConfig(): CIConfig;
|
||||
Reference in New Issue
Block a user