import { StyleParser } from '../parser/parser';
import { Styles } from '../styles/types';
import type { ProcessedStyle, StyleDetails } from '../parser/types';
import type { AtRuleContext, ParsedAdvancedState } from '../states';
export type StyleValue<T = string> = T | boolean | number | null | undefined;
/**
 * Normalize a color token value.
 * - Boolean `true` is converted to `'transparent'`
 * - Boolean `false` returns `null` (signals the token should be skipped)
 * - Other values are returned as-is
 *
 * @param value - The raw token value
 * @returns Normalized value or null if the token should be skipped
 */
export declare function normalizeColorTokenValue<T>(value: T | boolean): T | 'transparent' | null;
export type StyleValueStateMap<T = string> = {
    [key: string]: StyleValue<T>;
};
/**
 * Combined type for style values that can be either a direct value or a state map.
 * Use this for component props that accept style values.
 */
export type StylePropValue<T = string> = StyleValue<T> | StyleValueStateMap<T>;
export type ComputeModel = string | number;
export type CSSMap = {
    $?: string | string[];
} & {
    [key: string]: string | string[];
};
export type StyleHandlerResult = CSSMap | CSSMap[] | void;
export type RawStyleHandler = (value: StyleValueStateMap) => StyleHandlerResult;
export type StyleHandler = RawStyleHandler & {
    __lookupStyles: string[];
};
/**
 * Handler definition forms for configure() and plugins.
 * - Function only: lookup styles inferred from key name
 * - Single property tuple: ['styleName', handler]
 * - Multi-property tuple: [['style1', 'style2'], handler]
 */
export type StyleHandlerDefinition = RawStyleHandler | [string, RawStyleHandler] | [string[], RawStyleHandler];
export interface StyleStateData {
    model?: ComputeModel;
    tokens?: string[];
    value: StyleValue | StyleValueStateMap;
    /** The list of mods to apply */
    mods: string[];
    /** The list of **not** mods to apply (e.g. `:not(:hover)`) */
    notMods: string[];
    /** Advanced states (media queries, container queries, etc.) */
    advancedStates?: ParsedAdvancedState[];
    /** At-rule context for CSS generation */
    atRuleContext?: AtRuleContext;
    /** Own mods for sub-element states (from @own()) - applied to sub-element selector */
    ownMods?: string[];
    /** Negated own mods for sub-element states */
    negatedOwnMods?: string[];
}
export interface ParsedColor {
    color?: string;
    name?: string;
    opacity?: number;
}
export type StyleStateDataList = StyleStateData[];
export type StyleStateDataListMap = {
    [key: string]: StyleStateDataList;
};
export type StyleMap = {
    [key: string]: StyleValue | StyleValueStateMap;
};
export type StyleStateMap = {
    [key: string]: StyleStateData;
};
export declare const CUSTOM_UNITS: {
    r: string;
    cr: string;
    bw: string;
    ow: string;
    x: string;
    fs: string;
    lh: string;
    sf: (num: any) => string;
};
export declare const DIRECTIONS: string[];
export declare function getModSelector(modName: string): string;
export declare function customFunc(name: string, fn: (groups: StyleDetails[]) => string): void;
/**
 * Get the global StyleParser instance.
 * Used by configure() to apply parser configuration.
 */
export declare function getGlobalParser(): StyleParser;
/**
 * Get the current custom functions registry.
 * Used by configure() to merge with new functions.
 */
export declare function getGlobalFuncs(): Record<string, (groups: StyleDetails[]) => string>;
/**
 * Set global predefined tokens.
 * Called from configure() after processing token values.
 * Merges with existing tokens (new tokens override existing ones with same key).
 * Keys are normalized to lowercase (parser lowercases input before classification).
 * @internal
 */
export declare function setGlobalPredefinedTokens(tokens: Record<string, string>): void;
/**
 * Get the current global predefined tokens.
 * Returns null if no tokens are configured.
 */
export declare function getGlobalPredefinedTokens(): Record<string, string> | null;
/**
 * Reset global predefined tokens.
 * Used for testing.
 * @internal
 */
export declare function resetGlobalPredefinedTokens(): void;
/**
 *
 * @param {String} value
 * @param {Number} mode
 * @returns {Object<String,String|Array>}
 */
export declare function parseStyle(value: StyleValue): ProcessedStyle;
/**
 * Parse color. Find it value, name and opacity.
 * Optimized to avoid heavy parseStyle calls for simple color patterns.
 */
export declare function parseColor(val: string, ignoreError?: boolean): ParsedColor;
export declare function strToRgb(color: any, ignoreAlpha?: boolean): any;
/**
 * Extract RGB values from an rgb()/rgba() string.
 * Supports all modern CSS syntax variations:
 * - Comma-separated: rgb(255, 128, 0)
 * - Space-separated: rgb(255 128 0)
 * - Fractional: rgb(128.5, 64.3, 32.1)
 * - Percentages: rgb(50%, 25%, 75%)
 * - Slash alpha notation: rgb(255 128 0 / 0.5)
 *
 * Returns array of RGB values (0-255 range), converting percentages as needed.
 */
export declare function getRgbValuesFromRgbaString(str: string): number[];
export declare function hexToRgb(hex: any): string | null;
export declare function filterMods(mods: any, allowedMods: any): any;
export declare function extendStyles(defaultStyles: any, newStyles: any): {};
/**
 * Split properties into style and non-style properties.
 * @param props - Component prop map.
 * @param [styleList] - List of all style properties.
 * @param [defaultStyles] - Default style map of the component.
 * @param [propMap] - Props to style alias map.
 * @param [ignoreList] - A list of properties to ignore.
 */
export declare function extractStyles(props: {
    [key: string]: any;
}, styleList?: readonly string[], defaultStyles?: Styles, propMap?: {
    [key: string]: string;
}, ignoreList?: readonly string[]): Styles;
/**
 * Check if a token is an advanced state (starts with @)
 */
export declare function isAdvancedStateToken(token: string): boolean;
export declare const STATE_OPERATORS: {
    NOT: string;
    AND: string;
    OR: string;
    XOR: string;
};
export declare const STATE_OPERATOR_LIST: string[];
/**
 * Parse state notation and return tokens, modifiers and compute model.
 */
declare function parseStateNotationInner(notation: string, value: any): StyleStateData;
export declare const parseStateNotation: typeof parseStateNotationInner;
/**
 * Build an AtRuleContext from parsed advanced states
 */
export declare function buildAtRuleContext(advancedStates: ParsedAdvancedState[], negatedStates: Set<string>): AtRuleContext | undefined;
/**
 * Parse state notation and return tokens, modifiers and compute model.
 * Enhanced to detect and extract advanced states.
 */
export declare function styleStateMapToStyleStateDataList(styleStateMap: StyleStateMap | StyleValue | StyleValueStateMap, parserContext?: import('../states').StateParserContext): {
    states: StyleStateDataList;
    mods: string[];
    hasAdvancedStates: boolean;
};
export declare const COMPUTE_FUNC_MAP: {
    '!': (a: any) => boolean;
    '^': (a: any, b: any) => any;
    '|': (a: any, b: any) => any;
    '&': (a: any, b: any) => any;
};
/**
 * Compute a result based on a model and incoming map.
 */
export declare function computeState(computeModel: ComputeModel, valueMap: (number | boolean)[] | {
    [key: string]: boolean;
} | Function): any;
export declare function stringifyStyles(styles: any): string;
export {};
