import type { Rule, RuleContext, Severity } from "../types.js"; import { type DtcgDocument, type DtcgToken, type DtcgType } from "../tokens/dtcg-model.js"; /** * Discovers DTCG-shaped JSON files under the repo: * - `**\/*.tokens.json` * - `tokens/**\/*.json` * - any `*.json` whose top-level value contains a `$value` somewhere (heuristic) * * Files larger than 1 MB are skipped to avoid pathological cases. Files * matched by `ctx.excludePaths` are skipped. */ declare function discoverDtcgFiles(ctx: RuleContext): string[]; declare function looksLikeDtcg(data: unknown): boolean; /** * Heuristic that infers a likely `$type` from a token's value, used to flag * tokens that have `$value` but no `$type` when one is clearly inferable. */ declare function inferTypeFromValue(value: unknown): DtcgType | null; interface ValueShape { ok: boolean; reason?: string; } declare function validateColorValue(value: unknown): ValueShape; declare function validateDimensionValue(value: unknown): ValueShape; declare function validateFontWeightValue(value: unknown): ValueShape; declare function validateDurationValue(value: unknown): ValueShape; declare function validateCubicBezierValue(value: unknown): ValueShape; declare function validateNumberValue(value: unknown): ValueShape; declare function validateFontFamilyValue(value: unknown): ValueShape; declare function validateStrokeStyleValue(value: unknown): ValueShape; declare function validateShadowValue(value: unknown): ValueShape; declare function validateTypographyValue(value: unknown): ValueShape; declare function validateBorderValue(value: unknown): ValueShape; declare function validateTransitionValue(value: unknown): ValueShape; declare function validateGradientValue(value: unknown): ValueShape; /** * Dispatches to the right type-specific validator for a non-alias value. * Returns null when the type has no validator or the value is an alias. */ declare function validateTypedValue(type: DtcgType, value: unknown): ValueShape | null; /** * Per-token allowlist: a token may opt out of dtcg-conformance checks via * * "$extensions": { "lyse": { "disable": ["tokens/dtcg-conformance"] } } * * This is the standard DTCG escape hatch — `$extensions` is reserved for * tool-specific metadata. */ declare function isTokenDisabled(token: DtcgToken): boolean; interface TokenIssue { path: string; severity: Severity; message: string; suggestion?: string; } interface WalkOutcome { tokenCount: number; issues: TokenIssue[]; } declare function walkDocument(doc: DtcgDocument): WalkOutcome; export declare const rule: Rule; export declare const _internal: { discoverDtcgFiles: typeof discoverDtcgFiles; walkDocument: typeof walkDocument; looksLikeDtcg: typeof looksLikeDtcg; inferTypeFromValue: typeof inferTypeFromValue; validateColorValue: typeof validateColorValue; validateDimensionValue: typeof validateDimensionValue; validateFontWeightValue: typeof validateFontWeightValue; validateDurationValue: typeof validateDurationValue; validateCubicBezierValue: typeof validateCubicBezierValue; validateNumberValue: typeof validateNumberValue; validateFontFamilyValue: typeof validateFontFamilyValue; validateStrokeStyleValue: typeof validateStrokeStyleValue; validateShadowValue: typeof validateShadowValue; validateTypographyValue: typeof validateTypographyValue; validateBorderValue: typeof validateBorderValue; validateTransitionValue: typeof validateTransitionValue; validateGradientValue: typeof validateGradientValue; validateTypedValue: typeof validateTypedValue; isTokenDisabled: typeof isTokenDisabled; }; export {};