import type { Type, Result, List, CustomSyntax, CustomCssSyntax, Enum, KeywordDefinedType, Number, Directive, Defs } from './types.js'; import type { ReadonlyDeep } from 'type-fest'; /** * Validates a string value against a specified type definition using the provided * set of custom type definitions. This is the core type-checking dispatcher that * routes validation to the appropriate checker based on the type's structure * (keyword, list, enum, number, or directive). * * @param value - The string value to validate * @param type - The type definition to validate against * @param defs - A map of custom type definitions (both CSS syntax and custom syntax) used for resolving keyword types * @param ref - An optional reference identifier used for error reporting context * @param cache - Whether to use cached results for repeated checks with the same inputs * @returns A result indicating whether the value matches the type, or details about the mismatch * @throws Error if the type does not match any known type structure */ export declare function checkBase(value: string, type: ReadonlyDeep, defs: Defs, ref?: string, cache?: boolean): Result; /** * Determines whether a type definition is a keyword-based type. * Keyword types are represented as plain strings (e.g., CSS syntax names * like `""` or extended types like `"URL"`). * * @param type - The type definition to test * @returns True if the type is a keyword-defined type string */ export declare function isKeyword(type: ReadonlyDeep): type is ReadonlyDeep; /** * Determines whether a type definition represents a list type. * List types define space-separated or comma-separated token sequences * and are identified by having a `separator` property. * * @param type - The type definition to test * @returns True if the type is a list definition */ export declare function isList(type: ReadonlyDeep): type is ReadonlyDeep; /** * Determines whether a type definition represents an enumerated type. * Enum types define a fixed set of allowed string values and are * identified by having an `enum` property. * * @param type - The type definition to test * @returns True if the type is an enum definition */ export declare function isEnum(type: ReadonlyDeep): type is ReadonlyDeep; /** * Determines whether a type definition represents a numeric type. * Number types specify either `float` or `integer` validation with * optional range constraints, and are identified by having a `type` * property set to one of those values. * * @param type - The type definition to test * @returns True if the type is a number definition */ export declare function isNumber(type: ReadonlyDeep): type is ReadonlyDeep; /** * Determines whether a type definition represents a directive type. * Directive types allow separating and individually validating parts of * an attribute value, and are identified by having a `directive` property. * * @param type - The type definition to test * @returns True if the type is a directive definition */ export declare function isDirective(type: ReadonlyDeep): type is ReadonlyDeep; /** * Determines whether a custom type definition uses CSS syntax matching. * CSS syntax definitions are either plain strings or objects with a `syntax` * property that specifies CSS value definition syntax for matching. * * @param type - The custom type definition to test * @returns True if the definition uses CSS syntax matching */ export declare function isCSSSyntax(type: CustomSyntax | CustomCssSyntax): type is CustomCssSyntax; /** * Determines whether a custom type definition uses a programmatic custom * syntax checker rather than CSS syntax matching. This is the inverse * of {@link isCSSSyntax}. * * @param type - The custom type definition to test * @returns True if the definition uses a custom programmatic checker function */ export declare function isCustomSyntax(type: CustomSyntax | CustomCssSyntax): type is CustomSyntax;