import { l as TokenTypeValidator, L as LintRunner, m as TokenTypeValidatorMap, n as LintSeverity, o as LintIssue, p as BaseLintRule, q as CreateIssueFn, r as LintConfig, s as LintContext, t as LintResult, u as LintRule, v as TypeBasedRule, T as TokenBuilder, B as BuildTokensOptions, w as BuilderFormat, g as TokenDataMap, b as buildTokens, x as ProcessSetsOptions, a as ProcessResult, k as TokenData, y as ProcessOptions, h as TokenOperationResult, z as RefPath } from './types-DP2Xot0P.js';
export { C as CreateTokenParams, c as CreateTokenResult, D as DeleteTokenParams, d as DeleteTokenResult, I as IssuesMap, e as ProcessorOutput, f as ProcessorResult, R as ResolveIssue, i as TokenResolver, U as UpdateTokenParams, j as UpdateTokenResult } from './types-DP2Xot0P.js';
import { d as InterpreterResult } from './interpreter-C2GNrbRq.js';
import './types-CpUWRnTg.js';
import 'arktype/out/variants/object';

/**
 * Error codes for preset validators.
 * Used to identify specific validation failures.
 */
declare enum ValidatorCode {
    EXPECTED_NUMBER = "EXPECTED_NUMBER",
    EXPECTED_STRING = "EXPECTED_STRING",
    EXPECTED_BOOLEAN = "EXPECTED_BOOLEAN",
    EXPECTED_COLOR = "EXPECTED_COLOR",
    EXPECTED_NUMBER_WITH_UNIT = "EXPECTED_NUMBER_WITH_UNIT",
    EXPECTED_LIST = "EXPECTED_LIST",
    EXPECTED_STRUCTURED = "EXPECTED_STRUCTURED",
    VALUE_TOO_SMALL = "VALUE_TOO_SMALL",
    VALUE_TOO_LARGE = "VALUE_TOO_LARGE",
    VALUE_NOT_IN_ENUM = "VALUE_NOT_IN_ENUM",
    UNIT_NOT_ALLOWED = "UNIT_NOT_ALLOWED",
    UNIT_DISALLOWED = "UNIT_DISALLOWED",
    LIST_LENGTH_INVALID = "LIST_LENGTH_INVALID",
    REQUIRED_FIELD_MISSING = "REQUIRED_FIELD_MISSING",
    FIELD_MISSING = "FIELD_MISSING",
    UNKNOWN_FIELD = "UNKNOWN_FIELD"
}

/**
 * CSS border-radius: <length-percentage>{1,4}
 * https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius
 *
 * Accepts 1-4 non-negative length or percentage values:
 * - 1 value: all four corners
 * - 2 values: top-left/bottom-right, top-right/bottom-left
 * - 3 values: top-left, top-right/bottom-left, bottom-right
 * - 4 values: top-left, top-right, bottom-right, bottom-left
 *
 * Note: This validates simple border-radius, not the full syntax
 * with horizontal/vertical radii separated by "/".
 */
declare const borderRadius: ValueValidator;
declare const borderRadiusValidator: TokenTypeValidator;

/**
 * Single CSS box-shadow value
 * https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow
 *
 * Syntax: inset? <offset-x> <offset-y> <blur-radius>? <spread-radius>? <color>?
 *
 * Note: CSS allows negative blur (treated as 0) and negative spread.
 * We validate according to spec - negative values are allowed.
 */
declare const boxShadowSingle: ValueValidator;
/**
 * CSS box-shadow: <shadow>#
 * https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow
 *
 * One or more shadow definitions.
 * Note: "none" keyword is not handled here - that would be at the token level.
 */
declare const boxShadow: ValueValidator;
declare const boxShadowValidator: TokenTypeValidator;
declare const boxShadowSingleValidator: TokenTypeValidator;

/**
 * CSS font-family: string or list of strings (font stack)
 * https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
 *
 * Can be:
 * - A single font name: "Arial"
 * - A font stack (list): ["Helvetica", "Arial", "sans-serif"]
 */
declare const fontFamily: ValueValidator;
declare const fontFamilyValidator: TokenTypeValidator;

/**
 * CSS font-weight keywords
 */
declare const CSS_FONT_WEIGHT_KEYWORDS: string[];
/**
 * CSS font-weight: <number> 1-1000 or keywords
 * https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
 *
 * Numeric values:
 * - 100-900 are the traditional font weights
 * - CSS Fonts Level 4 extends this to 1-1000
 *
 * Keywords:
 * - normal = 400
 * - bold = 700
 * - lighter/bolder = relative to parent
 */
declare const fontWeight: ValueValidator;
declare const fontWeightValidator: TokenTypeValidator;

/**
 * CSS letter-spacing: normal | <length>
 * https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing
 *
 * Note: CSS spec does NOT allow percentage for letter-spacing.
 * Only "normal" keyword or <length> values are valid.
 */
declare const letterSpacing$1: ValueValidator;
declare const letterSpacingValidator$1: TokenTypeValidator;

/**
 * CSS line-height: normal | <number> | <length> | <percentage>
 * https://developer.mozilla.org/en-US/docs/Web/CSS/line-height
 *
 * - "normal" - browser default (typically 1.2)
 * - <number> - unitless multiplier (recommended)
 * - <length> - absolute length
 * - <percentage> - percentage of font-size
 *
 * All numeric values must be non-negative.
 */
declare const lineHeight$1: ValueValidator;
declare const lineHeightValidator: TokenTypeValidator;

/**
 * CSS opacity: <number> in range [0, 1]
 * https://developer.mozilla.org/en-US/docs/Web/CSS/opacity
 *
 * Note: CSS spec technically allows values outside 0-1, but they are clamped.
 * We validate for the clamped range as that's the practical valid range.
 */
declare const opacity: ValueValidator;
declare const opacityValidator: TokenTypeValidator;

/**
 * CSS token type to validator mapping.
 *
 * Maps token types to their CSS-spec compliant validators.
 * This can be used directly with TypeBasedRule or extended for
 * application-specific validation.
 */
declare const rules$1: TokenTypeValidatorMap;
/**
 * Creates a pre-configured LintRunner with all CSS rules.
 *
 * Use this as a base and extend with application-specific validators:
 *
 * @example
 * import { css, all } from "@tokenscript/processor/linter/presets";
 *
 * // Use CSS rules as-is
 * const linter = css.createLintRunner();
 *
 * // Extend with custom validators
 * const penpotLinter = css.createLintRunner().extend({
 *   "border-radius": all(css.borderRadius, customValidator),
 *   "stroke-width": penpot.strokeWidthValidator,
 * });
 */
declare function createLintRunner$1(): LintRunner;

/**
 * CSS text-decoration-line values
 */
declare const CSS_TEXT_DECORATION_LINE_VALUES: string[];
/**
 * CSS text-decoration-line
 * https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration-line
 *
 * Note: This validates a single value. CSS allows multiple values
 * like "underline overline", but design tokens typically use single values.
 */
declare const textDecorationLine: ValueValidator;
declare const textDecorationLineValidator: TokenTypeValidator;

/**
 * CSS text-transform values
 */
declare const CSS_TEXT_TRANSFORM_VALUES: string[];
/**
 * CSS text-transform
 * https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform
 */
declare const textTransform: ValueValidator;
declare const textTransformValidator: TokenTypeValidator;

/**
 * CSS <length> units
 * https://developer.mozilla.org/en-US/docs/Web/CSS/length
 */
declare const CSS_LENGTH_UNITS: string[];
/**
 * CSS <length> - number with length units or unitless 0
 * Unitless 0 is valid in CSS for length values.
 */
declare const length: ValueValidator;
/**
 * CSS <length> - non-negative values only
 */
declare const lengthNonNegative: ValueValidator;
declare const lengthValidator: TokenTypeValidator;
declare const lengthNonNegativeValidator: TokenTypeValidator;

/**
 * CSS <length-percentage> - either length or percentage
 * https://developer.mozilla.org/en-US/docs/Web/CSS/length-percentage
 */
declare const lengthPercentage: ValueValidator;
/**
 * CSS <length-percentage> - non-negative values only
 */
declare const lengthPercentageNonNegative: ValueValidator;
declare const lengthPercentageValidator: TokenTypeValidator;
declare const lengthPercentageNonNegativeValidator: TokenTypeValidator;

/**
 * CSS <percentage>
 * https://developer.mozilla.org/en-US/docs/Web/CSS/percentage
 */
declare const percentage: ValueValidator;
/**
 * CSS <percentage> - non-negative values only
 */
declare const percentageNonNegative: ValueValidator;
declare const percentageValidator: TokenTypeValidator;
declare const percentageNonNegativeValidator: TokenTypeValidator;

/**
+ * CSS Preset Validators
+ *
+ * Exports follow a consistent pattern:
+ * - `fooValidator` - TokenTypeValidator for use with TypeBasedRule
+ * - `foo` - Raw ValueValidator for composition with combinators
+ * - `FOO_VALUES` - Constants for allowed values (where applicable)
+ */

declare const index$3_CSS_FONT_WEIGHT_KEYWORDS: typeof CSS_FONT_WEIGHT_KEYWORDS;
declare const index$3_CSS_LENGTH_UNITS: typeof CSS_LENGTH_UNITS;
declare const index$3_CSS_TEXT_DECORATION_LINE_VALUES: typeof CSS_TEXT_DECORATION_LINE_VALUES;
declare const index$3_CSS_TEXT_TRANSFORM_VALUES: typeof CSS_TEXT_TRANSFORM_VALUES;
declare const index$3_borderRadius: typeof borderRadius;
declare const index$3_borderRadiusValidator: typeof borderRadiusValidator;
declare const index$3_boxShadow: typeof boxShadow;
declare const index$3_boxShadowSingle: typeof boxShadowSingle;
declare const index$3_boxShadowSingleValidator: typeof boxShadowSingleValidator;
declare const index$3_boxShadowValidator: typeof boxShadowValidator;
declare const index$3_fontFamily: typeof fontFamily;
declare const index$3_fontFamilyValidator: typeof fontFamilyValidator;
declare const index$3_fontWeight: typeof fontWeight;
declare const index$3_fontWeightValidator: typeof fontWeightValidator;
declare const index$3_length: typeof length;
declare const index$3_lengthNonNegative: typeof lengthNonNegative;
declare const index$3_lengthNonNegativeValidator: typeof lengthNonNegativeValidator;
declare const index$3_lengthPercentage: typeof lengthPercentage;
declare const index$3_lengthPercentageNonNegative: typeof lengthPercentageNonNegative;
declare const index$3_lengthPercentageNonNegativeValidator: typeof lengthPercentageNonNegativeValidator;
declare const index$3_lengthPercentageValidator: typeof lengthPercentageValidator;
declare const index$3_lengthValidator: typeof lengthValidator;
declare const index$3_lineHeightValidator: typeof lineHeightValidator;
declare const index$3_opacity: typeof opacity;
declare const index$3_opacityValidator: typeof opacityValidator;
declare const index$3_percentage: typeof percentage;
declare const index$3_percentageNonNegative: typeof percentageNonNegative;
declare const index$3_percentageNonNegativeValidator: typeof percentageNonNegativeValidator;
declare const index$3_percentageValidator: typeof percentageValidator;
declare const index$3_textDecorationLine: typeof textDecorationLine;
declare const index$3_textDecorationLineValidator: typeof textDecorationLineValidator;
declare const index$3_textTransform: typeof textTransform;
declare const index$3_textTransformValidator: typeof textTransformValidator;
declare namespace index$3 {
  export { index$3_CSS_FONT_WEIGHT_KEYWORDS as CSS_FONT_WEIGHT_KEYWORDS, index$3_CSS_LENGTH_UNITS as CSS_LENGTH_UNITS, index$3_CSS_TEXT_DECORATION_LINE_VALUES as CSS_TEXT_DECORATION_LINE_VALUES, index$3_CSS_TEXT_TRANSFORM_VALUES as CSS_TEXT_TRANSFORM_VALUES, index$3_borderRadius as borderRadius, index$3_borderRadiusValidator as borderRadiusValidator, index$3_boxShadow as boxShadow, index$3_boxShadowSingle as boxShadowSingle, index$3_boxShadowSingleValidator as boxShadowSingleValidator, index$3_boxShadowValidator as boxShadowValidator, createLintRunner$1 as createLintRunner, index$3_fontFamily as fontFamily, index$3_fontFamilyValidator as fontFamilyValidator, index$3_fontWeight as fontWeight, index$3_fontWeightValidator as fontWeightValidator, index$3_length as length, index$3_lengthNonNegative as lengthNonNegative, index$3_lengthNonNegativeValidator as lengthNonNegativeValidator, index$3_lengthPercentage as lengthPercentage, index$3_lengthPercentageNonNegative as lengthPercentageNonNegative, index$3_lengthPercentageNonNegativeValidator as lengthPercentageNonNegativeValidator, index$3_lengthPercentageValidator as lengthPercentageValidator, index$3_lengthValidator as lengthValidator, letterSpacing$1 as letterSpacing, letterSpacingValidator$1 as letterSpacingValidator, lineHeight$1 as lineHeight, index$3_lineHeightValidator as lineHeightValidator, index$3_opacity as opacity, index$3_opacityValidator as opacityValidator, index$3_percentage as percentage, index$3_percentageNonNegative as percentageNonNegative, index$3_percentageNonNegativeValidator as percentageNonNegativeValidator, index$3_percentageValidator as percentageValidator, rules$1 as rules, index$3_textDecorationLine as textDecorationLine, index$3_textDecorationLineValidator as textDecorationLineValidator, index$3_textTransform as textTransform, index$3_textTransformValidator as textTransformValidator };
}

/**
 * Penpot letter-spacing: number or number with unit (no percentage)
 *
 * CSS spec already disallows %, but Penpot additionally:
 * - Allows plain numbers (not just "normal" keyword)
 * - Does not support the "normal" keyword (resolves to actual value)
 */
declare const letterSpacing: ValueValidator;
declare const letterSpacingValidator: TokenTypeValidator;

/**
 * Penpot token type to validator mapping.
 *
 * Extends CSS rules with Penpot-specific validators.
 * Override validators replace CSS validators for the same token type.
 */
declare const rules: TokenTypeValidatorMap;
/**
 * Creates a pre-configured LintRunner with all Penpot rules.
 *
 * Penpot rules extend CSS rules with application-specific validators:
 * - Typography uses Penpot's value types (unitless line-height, text-case, etc.)
 * - Shadow uses Penpot's structure (non-negative blur/spread)
 * - Adds stroke-width support
 *
 * @example
 * import { penpot, all } from "@tokenscript/processor/linter/presets";
 *
 * // Use Penpot rules as-is
 * const linter = penpot.createLintRunner();
 *
 * // Extend with additional custom validators
 * const customLinter = penpot.createLintRunner().extend({
 *   "border-radius": all(penpot.rules["border-radius"], customValidator),
 * });
 */
declare function createLintRunner(): LintRunner;

/**
 * Single Penpot shadow definition
 *
 * Fields:
 * - offsetX: horizontal offset (can be negative)
 * - offsetY: vertical offset (can be negative)
 * - blur: blur radius (must be >= 0)
 * - spread: spread radius (must be >= 0)
 * - color: shadow color
 * - inset: whether shadow is inset (inner shadow)
 */
declare const shadowSingle: ValueValidator;
/**
 * Penpot shadow token: array of one or more shadows
 */
declare const shadow: ValueValidator;
declare const shadowValidator: TokenTypeValidator;
declare const shadowSingleValidator: TokenTypeValidator;

/**
 * Penpot stroke-width: non-negative number or dimension
 *
 * Differs from CSS:
 * - Must be non-negative (>= 0)
 * - No percentage allowed (uses CSS length units only)
 * - Plain numbers are allowed (interpreted as px)
 */
declare const strokeWidth: ValueValidator;
declare const strokeWidthValidator: TokenTypeValidator;

/**
 * Penpot text-case values (maps to CSS text-transform)
 *
 * Penpot uses a subset of CSS text-transform values.
 */
declare const PENPOT_TEXT_CASE_VALUES: string[];
declare const textCase: ValueValidator;
/**
 * Penpot text-decoration values
 *
 * Penpot uses a subset of CSS text-decoration-line values.
 */
declare const PENPOT_TEXT_DECORATION_VALUES: string[];
declare const textDecoration: ValueValidator;
/**
 * Penpot font-size: non-negative number or dimension
 */
declare const fontSize: ValueValidator;
/**
 * Penpot line-height: non-negative number (multiplier)
 *
 * Penpot normalizes line-height to a unitless multiplier,
 * unlike CSS which supports various formats.
 */
declare const lineHeight: ValueValidator;
/**
 * Penpot typography composite token
 *
 * All fields are optional. Validators match Penpot's expected value types.
 */
declare const typography: ValueValidator;
declare const typographyValidator: TokenTypeValidator;

declare const index$2_PENPOT_TEXT_CASE_VALUES: typeof PENPOT_TEXT_CASE_VALUES;
declare const index$2_PENPOT_TEXT_DECORATION_VALUES: typeof PENPOT_TEXT_DECORATION_VALUES;
declare const index$2_createLintRunner: typeof createLintRunner;
declare const index$2_fontSize: typeof fontSize;
declare const index$2_letterSpacing: typeof letterSpacing;
declare const index$2_letterSpacingValidator: typeof letterSpacingValidator;
declare const index$2_lineHeight: typeof lineHeight;
declare const index$2_rules: typeof rules;
declare const index$2_shadow: typeof shadow;
declare const index$2_shadowSingle: typeof shadowSingle;
declare const index$2_shadowSingleValidator: typeof shadowSingleValidator;
declare const index$2_shadowValidator: typeof shadowValidator;
declare const index$2_strokeWidth: typeof strokeWidth;
declare const index$2_strokeWidthValidator: typeof strokeWidthValidator;
declare const index$2_textCase: typeof textCase;
declare const index$2_textDecoration: typeof textDecoration;
declare const index$2_typography: typeof typography;
declare const index$2_typographyValidator: typeof typographyValidator;
declare namespace index$2 {
  export { index$2_PENPOT_TEXT_CASE_VALUES as PENPOT_TEXT_CASE_VALUES, index$2_PENPOT_TEXT_DECORATION_VALUES as PENPOT_TEXT_DECORATION_VALUES, index$2_createLintRunner as createLintRunner, index$2_fontSize as fontSize, index$2_letterSpacing as letterSpacing, index$2_letterSpacingValidator as letterSpacingValidator, index$2_lineHeight as lineHeight, index$2_rules as rules, index$2_shadow as shadow, index$2_shadowSingle as shadowSingle, index$2_shadowSingleValidator as shadowSingleValidator, index$2_shadowValidator as shadowValidator, index$2_strokeWidth as strokeWidth, index$2_strokeWidthValidator as strokeWidthValidator, index$2_textCase as textCase, index$2_textDecoration as textDecoration, index$2_typography as typography, index$2_typographyValidator as typographyValidator };
}

/**
 * Context passed to value validators during validation.
 */
interface ValidatorContext {
    /** The token being validated */
    tokenName: string;
    /** Path to the current field within a structured token */
    path: (string | number)[];
    /** Default severity for issues */
    severity: LintSeverity;
}
/**
 * A value validator checks a resolved value and returns issues or null for valid.
 *
 * @param value - The resolved symbol value to validate
 * @param ctx - Validation context with token name, path, and severity
 * @returns LintIssue(s) if invalid, null if valid
 */
type ValueValidator = (value: unknown, ctx: ValidatorContext) => LintIssue | LintIssue[] | null;
/**
 * Constraints for numeric validators (number, numberWithUnit)
 */
interface NumericConstraints {
    /** Minimum allowed value (inclusive) */
    min?: number;
    /** Maximum allowed value (inclusive) */
    max?: number;
}
/**
 * Constraints for numberWithUnit validator
 */
interface UnitConstraints extends NumericConstraints {
    /** Only allow these units (e.g., ["px", "em", "%"]) */
    allowedUnits?: string[];
    /** Disallow these units (e.g., ["%"]) */
    disallowedUnits?: string[];
    /** Require a unit (reject plain numbers). Default: false */
    requireUnit?: boolean;
}
/**
 * Constraints for string validator
 */
interface StringConstraints {
    /** Only allow these exact values (enum validation) */
    allowedValues?: string[];
    /** Case-sensitive comparison (default: false) */
    caseSensitive?: boolean;
}
/**
 * Field definition for structured token validation
 */
interface FieldDef {
    /** Validator for this field */
    validator: ValueValidator;
    /** Whether the field is required (default: false) */
    required?: boolean;
}
/**
 * Options for struct validator
 */
interface StructOptions {
    /** Error on unknown fields not defined in schema (default: false) */
    strict?: boolean;
    /** Warn when optional fields are missing (default: false) */
    warnMissing?: boolean;
}
/**
 * Options for list validators
 */
interface ListOptions {
    /** Exact count required */
    count?: number;
    /** Minimum count (inclusive) */
    minCount?: number;
    /** Maximum count (inclusive) */
    maxCount?: number;
    /** Specific allowed counts (e.g., [1, 2, 4] for CSS shorthand) */
    allowedCounts?: number[];
}

/**
 * Union validator - value must match at least one validator.
 *
 * Returns the first validation error encountered when none of the validators match.
 *
 * @example
 * // font-weight: number 1-1000 OR keywords
 * or(
 *   number({ min: 1, max: 1000 }),
 *   string({ allowedValues: ["normal", "bold", "lighter", "bolder"] })
 * )
 *
 * // length-percentage
 * or(length, percentage)
 */
declare function or(...validators: ValueValidator[]): ValueValidator;
/**
 * Validates a single value OR a list of values.
 * Handles CSS shorthand patterns (1, 2, 3, or 4 values).
 *
 * @example
 * // border-radius: single value or 1/2/3/4 values
 * oneOrList(
 *   lengthPercentageNonNegative,
 *   { allowedCounts: [1, 2, 3, 4] }
 * )
 */
declare function oneOrList(itemValidator: ValueValidator, options?: ListOptions): ValueValidator;
/**
 * Validates a list with count constraints.
 *
 * @example
 * list(color(), { minCount: 1 })  // At least one color
 * list(number(), { count: 4 })    // Exactly 4 numbers
 * list(shadowSingle, { minCount: 1 }) // At least one shadow
 */
declare function list(itemValidator: ValueValidator, options?: ListOptions): ValueValidator;
/**
 * Validates a structured token (TokenSymbol with Map value).
 *
 * @param fields - Field validators. Can be ValueValidator or FieldDef with required flag.
 * @param options - Struct validation options
 *
 * @example
 * struct({
 *   fontSize: numberWithUnit({ min: 0 }),
 *   lineHeight: number({ min: 0 }),
 * })
 *
 * struct({
 *   fontSize: { validator: numberWithUnit({ min: 0 }), required: true },
 *   lineHeight: number({ min: 0 }),
 * }, { strict: true, warnMissing: true })
 */
declare function struct(fields: Record<string, FieldDef | ValueValidator>, options?: StructOptions): ValueValidator;
/**
 * Shorthand for list with minCount: 1.
 * Useful for array-of-objects patterns like shadow.
 *
 * @example
 * arrayOf(shadowSingle)  // At least one shadow object
 */
declare function arrayOf(itemValidator: ValueValidator): ValueValidator;
/**
 * Intersection validator - value must pass ALL validators.
 * Collects issues from all validators that fail.
 *
 * Use this to compose validators, e.g., combining a CSS base validator
 * with application-specific validation.
 *
 * @example
 * // Combine CSS border-radius with custom Penpot validation
 * all(css.borderRadius, customPenpotValidator)
 *
 * // Multiple constraints
 * all(
 *   number({ min: 0 }),
 *   customSafeIntValidator,
 *   customAllowedUnitsValidator
 * )
 */
declare function all(...validators: ValueValidator[]): ValueValidator;

/**
 * Wraps a ValueValidator to create a TokenTypeValidator for use with TypeBasedRule.
 *
 * @param validator - The value validator to wrap
 * @param options - Options for the wrapper
 *
 * @example
 * import { number, createValidator } from "@tokenscript/processor/linter/presets";
 *
 * const opacityValidator = createValidator(number({ min: 0, max: 1 }));
 *
 * const linter = new LintRunner().addRule(
 *   new TypeBasedRule().forType("opacity", opacityValidator)
 * );
 */
declare function createValidator(validator: ValueValidator, options?: {
    severity?: LintSeverity;
}): TokenTypeValidator;

/**
 * Validates NumberSymbol with optional min/max constraints.
 * NullSymbol and null values are accepted as valid.
 *
 * @example
 * number()                    // Any number
 * number({ min: 0 })          // >= 0
 * number({ min: 0, max: 1 })  // 0-1 range (opacity)
 * number({ min: 100, max: 900 }) // font-weight numeric
 */
declare function number(constraints?: NumericConstraints): ValueValidator;
/**
 * Validates StringSymbol with optional enum constraint.
 * NullSymbol and null values are accepted as valid.
 *
 * @example
 * string()  // Any non-null string
 * string({ allowedValues: ["none", "uppercase", "lowercase"] })
 * string({ allowedValues: ["A", "B"], caseSensitive: true })
 */
declare function string(constraints?: StringConstraints): ValueValidator;
/**
 * Validates BooleanSymbol.
 * NullSymbol and null values are accepted as valid.
 *
 * @example
 * boolean()  // true or false
 */
declare function boolean(): ValueValidator;
/**
 * Validates ColorSymbol.
 * NullSymbol and null values are accepted as valid.
 *
 * @example
 * color()  // Any valid color
 */
declare function color(): ValueValidator;

/**
 * Validates NumberWithUnitSymbol or plain NumberSymbol with unit and value constraints.
 * NullSymbol and null values are accepted as valid.
 *
 * @example
 * numberWithUnit()                                      // Any number with or without unit
 * numberWithUnit({ min: 0 })                            // >= 0
 * numberWithUnit({ allowedUnits: ["px", "em", "%"] })   // Only these units
 * numberWithUnit({ disallowedUnits: ["%"] })            // Any unit except %
 * numberWithUnit({ requireUnit: true })                 // Must have a unit
 * numberWithUnit({ min: 0, allowedUnits: ["px", "rem"] })
 */
declare function numberWithUnit(constraints?: UnitConstraints): ValueValidator;

declare const index$1_BaseLintRule: typeof BaseLintRule;
declare const index$1_CreateIssueFn: typeof CreateIssueFn;
type index$1_FieldDef = FieldDef;
declare const index$1_LintConfig: typeof LintConfig;
declare const index$1_LintContext: typeof LintContext;
declare const index$1_LintIssue: typeof LintIssue;
declare const index$1_LintResult: typeof LintResult;
declare const index$1_LintRule: typeof LintRule;
declare const index$1_LintRunner: typeof LintRunner;
declare const index$1_LintSeverity: typeof LintSeverity;
type index$1_ListOptions = ListOptions;
type index$1_NumericConstraints = NumericConstraints;
type index$1_StringConstraints = StringConstraints;
type index$1_StructOptions = StructOptions;
declare const index$1_TokenTypeValidator: typeof TokenTypeValidator;
declare const index$1_TokenTypeValidatorMap: typeof TokenTypeValidatorMap;
declare const index$1_TypeBasedRule: typeof TypeBasedRule;
type index$1_UnitConstraints = UnitConstraints;
type index$1_ValidatorCode = ValidatorCode;
declare const index$1_ValidatorCode: typeof ValidatorCode;
type index$1_ValidatorContext = ValidatorContext;
type index$1_ValueValidator = ValueValidator;
declare const index$1_all: typeof all;
declare const index$1_arrayOf: typeof arrayOf;
declare const index$1_boolean: typeof boolean;
declare const index$1_color: typeof color;
declare const index$1_createValidator: typeof createValidator;
declare const index$1_list: typeof list;
declare const index$1_number: typeof number;
declare const index$1_numberWithUnit: typeof numberWithUnit;
declare const index$1_oneOrList: typeof oneOrList;
declare const index$1_or: typeof or;
declare const index$1_string: typeof string;
declare const index$1_struct: typeof struct;
declare namespace index$1 {
  export { index$1_BaseLintRule as BaseLintRule, index$1_CreateIssueFn as CreateIssueFn, type index$1_FieldDef as FieldDef, index$1_LintConfig as LintConfig, index$1_LintContext as LintContext, index$1_LintIssue as LintIssue, index$1_LintResult as LintResult, index$1_LintRule as LintRule, index$1_LintRunner as LintRunner, index$1_LintSeverity as LintSeverity, type index$1_ListOptions as ListOptions, type index$1_NumericConstraints as NumericConstraints, type index$1_StringConstraints as StringConstraints, type index$1_StructOptions as StructOptions, index$1_TokenTypeValidator as TokenTypeValidator, index$1_TokenTypeValidatorMap as TokenTypeValidatorMap, index$1_TypeBasedRule as TypeBasedRule, type index$1_UnitConstraints as UnitConstraints, index$1_ValidatorCode as ValidatorCode, type index$1_ValidatorContext as ValidatorContext, type index$1_ValueValidator as ValueValidator, index$1_all as all, index$1_arrayOf as arrayOf, index$1_boolean as boolean, index$1_color as color, index$1_createValidator as createValidator, index$3 as css, index$1_list as list, index$1_number as number, index$1_numberWithUnit as numberWithUnit, index$1_oneOrList as oneOrList, index$1_or as or, index$2 as penpot, index$1_string as string, index$1_struct as struct };
}

type FlattenCallback<T> = (key: string, value: InterpreterResult) => T;
/**
 * Flatten a DictionarySymbol into key-value pairs
 *
 * @param result - The InterpreterResult to flatten (only DictionarySymbol will be flattened)
 * @param prefix - The prefix to prepend to keys
 * @param callback - Callback function that receives each flattened key-value pair
 *
 * @example
 * const result: Record<string, unknown> = {};
 * flattenChildrenObject(dictionarySymbol, "root", (key, value) => {
 *   result[key] = value;
 * });
 */
declare function flattenChildrenObject<T>(result: InterpreterResult, prefix: string, callback: FlattenCallback<T>): void;
/**
 * Flatten a Map structure into key-value pairs
 *
 * @param map - The map to flatten (from Dictionary.value)
 * @param prefix - The prefix to prepend to keys
 * @param callback - Callback function that receives each flattened key-value pair
 *
 * @example
 * const result = new Map<string, unknown>();
 * flattenChildrenMap(dictionarySymbol.value, "root", (key, value) => {
 *   result.set(key, value);
 * });
 */
declare function flattenChildrenMap<T>(map: Map<string, InterpreterResult>, prefix: string, callback: FlattenCallback<T>): void;

declare class MapBuilder implements TokenBuilder<Map<string, string | InterpreterResult>> {
    readonly name = "map";
    protected result: Map<string, string | InterpreterResult>;
    private successfullyResolved;
    onResolve(tokenName: string, value: InterpreterResult): void;
    onError(tokenName: string, _error: Error, originalValue: string | unknown): void;
    getResult(): Map<string, string | InterpreterResult>;
    getResolvedTokens(): Map<string, InterpreterResult>;
}

/**
 * Nested Object Builder
 *
 * Builds a nested object structure incrementally as tokens are resolved.
 * Converts flat token paths to nested structure.
 * Example: "color.primary" -> { color: { primary: value } }
 */
declare class NestedObjectBuilder implements TokenBuilder<Record<string, unknown>> {
    readonly name = "nested";
    private result;
    onResolve(tokenName: string, value: InterpreterResult): void;
    onError(tokenName: string, _error: Error, originalValue: string | unknown): void;
    getResult(): Record<string, unknown>;
}
/**
 * Flat Object Builder
 *
 * Builds a flat key-value object incrementally as tokens are resolved.
 * Example: "color.primary" -> { "color.primary": value }
 */
declare class FlatObjectBuilder implements TokenBuilder<Record<string, unknown>> {
    readonly name = "flat";
    private result;
    onResolve(tokenName: string, value: InterpreterResult): void;
    onError(tokenName: string, _error: Error, originalValue: string | unknown): void;
    getResult(): Record<string, unknown>;
}

declare class StringMapBuilder extends MapBuilder {
    onResolve(tokenName: string, value: InterpreterResult): void;
    getResult(): Map<string, string>;
}

declare const index_BuildTokensOptions: typeof BuildTokensOptions;
declare const index_BuilderFormat: typeof BuilderFormat;
type index_FlatObjectBuilder = FlatObjectBuilder;
declare const index_FlatObjectBuilder: typeof FlatObjectBuilder;
type index_FlattenCallback<T> = FlattenCallback<T>;
type index_MapBuilder = MapBuilder;
declare const index_MapBuilder: typeof MapBuilder;
type index_NestedObjectBuilder = NestedObjectBuilder;
declare const index_NestedObjectBuilder: typeof NestedObjectBuilder;
type index_StringMapBuilder = StringMapBuilder;
declare const index_StringMapBuilder: typeof StringMapBuilder;
declare const index_TokenBuilder: typeof TokenBuilder;
declare const index_TokenDataMap: typeof TokenDataMap;
declare const index_buildTokens: typeof buildTokens;
declare const index_flattenChildrenMap: typeof flattenChildrenMap;
declare const index_flattenChildrenObject: typeof flattenChildrenObject;
declare namespace index {
  export { index_BuildTokensOptions as BuildTokensOptions, index_BuilderFormat as BuilderFormat, index_FlatObjectBuilder as FlatObjectBuilder, type index_FlattenCallback as FlattenCallback, index_MapBuilder as MapBuilder, index_NestedObjectBuilder as NestedObjectBuilder, index_StringMapBuilder as StringMapBuilder, index_TokenBuilder as TokenBuilder, index_TokenDataMap as TokenDataMap, index_buildTokens as buildTokens, index_flattenChildrenMap as flattenChildrenMap, index_flattenChildrenObject as flattenChildrenObject };
}

/**
 * Process flat token collection.
 *
 * @param tokens - Token input in various formats (Map or Record)
 * @param options - Processing options
 * @returns Processed tokens with resolved values
 *
 * @note Performance optimization: If you already have a `Map<string, TokenData>`,
 * you can skip this function and call `buildTokens` directly to avoid unnecessary flattening.
 */
declare function processTokens<T = Map<string, string | InterpreterResult>>(tokens: Map<string, TokenData> | Map<string, string> | Record<string, any>, options?: ProcessOptions): ProcessResult<T>;
/**
 * Process token sets with theme or set selection.
 */
declare function processTokenSets<T = Map<string, string | InterpreterResult>>(normalizedFiles: Record<string, unknown>, options?: ProcessSetsOptions): ProcessResult<T>;

/**
 * Get all affected token paths from the dependants graph.
 * Returns the set of all tokens that depend on the changed token.
 */
declare function getAffectedTokens(result: TokenOperationResult): Set<RefPath>;
/**
 * Get broken references from issues.
 * Filters issues for TOKEN_NOT_FOUND or DEPENDENCY_ERROR codes.
 */
declare function getBrokenReferences(result: TokenOperationResult): Set<RefPath>;
/**
 * For rename operations: get tokens whose references were updated.
 * Pass the set of tokens that were modified during rename.
 */
declare function getRenamedReferences(_result: TokenOperationResult, modifiedTokens: Set<RefPath>): Set<RefPath>;
/**
 * Get tokens from the dependants graph whose values actually changed.
 * Compares the old token values with the new result to filter only modified tokens.
 */
declare function getModifiedDependants(oldTokens: Map<RefPath, any>, result: TokenOperationResult): Set<RefPath>;

export { BuildTokensOptions, type FlattenCallback, TokenBuilder, TokenData, TokenDataMap, TokenOperationResult, buildTokens, index as builders, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, index$1 as linter, processTokenSets, processTokens };
