type CSSProperties<K extends string = string> = Record<K, CSSValue>;
type CSSValue = string | number | boolean | (string | number | boolean)[];
/**
 * Configuration options for CSS properties stringification.
 */
type CSSPropertiesOptions = {
    /** Indentation string, defaults to two spaces. */
    indent?: string;
    /** Prefix string added before each line, defaults to empty string. */
    prefix?: string;
    /** New line character, defaults to LF. */
    newLine?: string;
    /** Whether to format output on a single line, defaults to false. */
    inline?: boolean;
    /** Maximum number of properties to format on a single line, defaults to 1. */
    singleLineThreshold?: number;
};
/**
 * Converts a CSSProperties object into a formatted CSS string representation.
 *
 * @param object - The CSSProperties object to stringify.
 * @param options - Configuration options for string formatting.
 * @returns A string representing the CSS properties enclosed in curly braces.
 * @remarks no newLine at the end to aid composition.
 */
declare function stringifyCSSProperties<K extends string>(object: CSSProperties<K>, options?: CSSPropertiesOptions): string;
/**
 * Formats a CSSProperties object into an array of CSS property strings.
 *
 * @param object - The CSSProperties object to format.
 * @returns An array of strings, where each string is a CSS property in the format "key: value;".
 */
declare function formatCSSProperties<K extends string>(object: CSSProperties<K>): string[];
/**
 * Formats a CSS value into a string representation.
 *
 * @param value - The CSS value to format, which can be a single value or an array of values.
 * @param useComma - Flag to determine whether array values should be comma-separated (true)
 *                   or space-separated (false). Defaults to true.
 * @returns A formatted string representation of the CSS value.
 * @remarks

 * - For array values, elements are joined with commas or spaces based on the useComma parameter.
 * - The choice between commas and spaces depends on the CSS property being formatted.
 * - Properties like 'font-family' use commas while properties like 'margin' use spaces.
 */
declare function formatCSSValue(value: CSSValue, useComma?: boolean): string;
/**
 * Generates a sequence of valid CSS property key-value pairs from a CSSProperties object.
 *
 * @param object - The object containing CSS properties.
 * @returns A generator of valid key-value CSS property pairs.
 * @remarks Filters out invalid or empty CSS property values, returning only valid entries.
 */
declare function properties<K extends string>(object: CSSProperties<K>): Generator<[K, CSSValue]>;
/**
 * A set of CSS properties that typically have space-delimited values.
 * These properties often require multiple values to be specified in a single declaration.
 *
 * @remarks
 * When formatting CSS values for these properties, values are space-separated rather than comma-separated.
 * For example:
 * - margin: 10px 20px 30px 40px    (spaces between values)
 * - padding: 5px 10px              (spaces between values)
 * - font: bold 16px Arial          (spaces between values)
 *
 * This differs from comma-separated properties like font-family:
 * - font-family: Arial, Helvetica, sans-serif  (commas between values)
 */
declare const spaceDelimitedProperties: ReadonlySet<string>;

/**
 * Represents a structured CSS rule set that can contain nested rules.
 *
 * This type allows for representing complex CSS structures including:
 * - Simple property/value pairs
 * - At-rules (like `@media`, `@keyframes`)
 * - Nested rule sets
 * - Arrays of values or rule sets
 *
 * @example
 * ```
 * // Example CSS rule structure
 * const rules = {
 *   body: {
 *     color: 'red',
 *     fontSize: '16px',
 *     '@media (max-width: 768px)': {
 *       fontSize: '14px'
 *     }
 *   }
 * };
 * ```
 */
type CSSRules = {
    [name: string]: null | string | string[] | CSSRules | CSSRules[];
};
/**
 * Represents the possible value types that can be assigned to a CSS rule.
 *
 * This is a type alias for the union of all possible values in a CSSRules
 * object.
 */
type CSSRulesValue = CSSRules[string];
/**
 * Configuration options for formatting CSS rules.
 */
interface CSSRulesFormatOptions {
    /**
     * Indentation string to use for each level of nesting.
     * @defaultValue `'  '` (two spaces)
     */
    indent?: string;
    /**
     * Prefix string added before each line.
     * @defaultValue `''` (empty string)
     */
    prefix?: string;
    /**
     * Optional validation function to determine which rules to include.
     * @param key - The rule name/selector
     * @param value - The rule value
     * @returns `true` if the rule should be included, `false` otherwise
     */
    valid?: (key: string, value: CSSRulesValue) => boolean;
    /**
     * Whether to normalize CSS property names from camelCase to kebab-case.
     * Only applies to property names, not selectors.
     * @defaultValue `false`
     */
    normalizeProperties?: boolean;
}
/**
 * A subset of CSSRules that is compatible with tailwindcss plugin API.
 *
 * This type is more restrictive than CSSRules:
 * - It doesn't allow null values
 * - It uses itself for nested rules rather than the broader CSSRules type
 */
type CSSRuleObject = {
    [key: string]: string | string[] | CSSRuleObject;
};
/**
 * Converts a CSS rule object into a formatted string representation.
 *
 * This function takes a CSS rule object and returns a formatted string with
 * proper indentation and nesting.
 *
 * @param rules - The CSS rules to stringify
 * @param options - Configuration options for string formatting
 * @returns A string representing the CSS rules with proper formatting
 * @remarks a newLine is not appended at the end to aid composition.
 *
 * @example
 * ```
 * // Simple example of converting CSS rules to string format
 * const rules = {
 *   'body': {
 *     'color': 'red',
 *     'font-size': '16px'
 *   }
 * };
 *
 * const result = stringifyCSSRules(rules);
 * // Result will be:
 * // body {
 * //   color: red;
 * //   font-size: 16px;
 * // };
 * ```
 */
declare function stringifyCSSRules(rules?: CSSRules | CSSRuleObject, options?: CSSRulesFormatOptions & {
    /**
     * Character(s) to use for line breaks.
     * @defaultValue `'\n'`
     */
    newLine?: string;
}): string;
/**
 * Formats CSS rule objects into an array of formatted lines.
 *
 * This function processes a CSS rule object and returns an array of strings,
 * where each string represents a line in the formatted CSS output. It
 * handles various value types including strings, numbers, arrays, and nested
 * objects.
 *
 * @param rules - The CSS rules to format
 * @param options - Configuration options for formatting
 * @returns An array of strings, each representing a line in the formatted
 *   CSS
 *
 * @example
 * ```
 * const rules = {
 *   'body': {
 *     'color': 'red'
 *   }
 * };
 *
 * const lines = formatCSSRules(rules);
 * // Returns: ['body {', '  color: red;', '}']
 * ```
 */
declare function formatCSSRules(rules?: CSSRules | CSSRuleObject, options?: CSSRulesFormatOptions): string[];
/**
 * Formats an array of CSS rules into an array of formatted string lines.
 *
 * This function processes various CSS rule representations recursively and
 * converts them into strings representing CSS code with proper formatting.
 * It handles:
 *
 * - String values (treated as direct CSS with semicolons added)
 * - Empty strings (converted to blank lines for spacing if appropriate)
 * - CSS rule objects (recursively processed with formatCSSRules)
 * - Empty rule objects (possibly generating blank lines)
 *
 * The function maintains proper whitespace by tracking whether the last
 * inserted item was a blank line to avoid consecutive empty lines.
 *
 * @param rules - The array of CSS rules to format (strings or rule objects)
 * @param options - Configuration options for formatting
 * @returns An array of strings, each representing a line in the formatted
 *   CSS
 *
 * @example
 * ```
 * // Mixed strings and objects
 * formatCSSRulesArray([
 *   'display: block',
 *   { color: 'red' },
 *   '',
 *   { fontSize: '16px' }
 * ]);
 * // Returns: ['display: block;', 'color: red;', '', 'fontSize: 16px;']
 * ```
 */
declare function formatCSSRulesArray(rules?: (string | CSSRules | CSSRuleObject)[], options?: CSSRulesFormatOptions): string[];
/**
 * Default validation function for CSS rules.
 *
 * Determines if a CSS rule key-value pair should be included in the output.
 * By default, a rule is valid if:
 * - The key is not an empty string
 * - The value is neither undefined nor null
 *
 * @param key - The rule key/selector to validate
 * @param value - The rule value to validate
 * @returns `true` if the rule should be included, `false` otherwise
 */
declare function defaultValidCSSRule(key: string, value: CSSRulesValue): boolean;
/**
 * Generator version of formatCSSRulesArray that yields lines as they're
 * generated. This avoids building arrays in memory and is more efficient for
 * large files.
 *
 * @param rules - The array of CSS rules to format
 * @param options - Configuration options for formatting
 * @returns Generator that yields individual CSS lines without line
 *   endings
 */
declare function generateCSSRulesArray(rules?: (string | CSSRules | CSSRuleObject)[], options?: CSSRulesFormatOptions): Generator<string, void, unknown>;
/**
 * Generator version of formatCSSRules that yields lines as they're
 * generated.
 *
 * @param rules - The CSS rules to format
 * @param options - Configuration options for formatting
 * @returns Generator that yields individual CSS lines without line
 *   endings
 */
declare function generateCSSRules(rules?: CSSRules | CSSRuleObject, options?: CSSRulesFormatOptions): Generator<string, void, unknown>;
/**
 * Interleaves an array of CSS rule objects with empty objects.
 *
 * @param rules - An array of CSS rule objects to be interleaved
 * @returns An array with the original rules spaced out with empty objects
 *
 * @example
 * ```
 * // Input: [{ color: 'red' }, { background: 'blue' }]
 * // Output: [{ color: 'red' }, {}, { background: 'blue' }]
 * ```
 */
declare function interleavedRules(rules: CSSRules[]): CSSRules[];
/**
 * Renames the keys in a CSS rules object using the provided function.
 *
 * @param rules - The CSS rules object whose keys should be renamed
 * @param fn - A function that takes an original key name and returns a new
 *   key name (or falsy value to skip)
 * @returns A new CSS rules object with renamed keys
 *
 * @example
 * ```
 * // Input: { '.button': { color: 'blue' } }, key => `@utility
 * //   ${key.slice(1)}`
 * // Output: { '@utility button': { color: 'blue' } }
 * ```
 */
declare function renameRules(rules: CSSRules, fn: (name: string) => string): CSSRules;
/**
 * Sets a CSS rule object at a specified path within a target object,
 * merging with existing objects and creating intermediate objects as needed.
 *
 * This function allows for deep setting of CSS rules in a nested object
 * structure. It can handle both string paths for top-level assignments and
 * array paths for nested assignments. When the target path already contains
 * an object, the new object is merged with the existing one, with new values
 * taking precedence.
 *
 * The function is overloaded to provide type safety for both general
 * `CSSRules` objects and TailwindCSS-compatible `CSSRuleObject` types.
 *
 * @param target - The target CSS rules object to modify
 * @param path - Either a string key for direct assignment or an array of
 *   string keys for nested assignment
 * @param object - The CSS rule object to set at the specified path
 * @returns The modified target object (same type as input)
 * @remarks The target object is modified in place, returned reference is
 *   only a convenience.
 *
 * @example
 * ```
 * // Direct assignment
 * setDeepRule(rules, 'button', { color: 'blue' });
 * // Result: { button: { color: 'blue' } }
 *
 * // Nested assignment
 * setDeepRule(rules, ['components', 'button'], { color: 'blue' });
 * // Result: { components: { button: { color: 'blue' } } }
 *
 * // Merging with existing object (new values take precedence)
 * const rules = { button: { color: 'red', margin: '5px' } };
 * setDeepRule(rules, 'button', { color: 'blue', padding: '10px' });
 * // Result: { button: { color: 'blue', margin: '5px', padding: '10px' } }
 * ```
 */
declare function setDeepRule(target: CSSRuleObject, path: string | string[], object: CSSRuleObject): CSSRuleObject;
declare function setDeepRule(target: CSSRules, path: string | string[], object: CSSRules): CSSRules;
/**
 * Retrieves a CSS rule value from a specified path within a target object.
 *
 * This function allows for deep retrieval of CSS rules from a nested object
 * structure. It can handle both string paths for top-level access and array
 * paths for nested access.
 *
 * The function is overloaded to provide type safety for both general
 * `CSSRules` objects and TailwindCSS-compatible `CSSRuleObject` types.
 *
 * @param target - The target CSS rules object to search within
 * @param path - Either a string key for direct access or an array of
 *   string keys for nested access
 * @returns The value at the specified path, or `undefined` if the path
 *   does not exist
 *
 * @example
 * ```
 * const rules = {
 *   components: { button: { color: 'blue' } },
 *   utils: ['clearfix', 'sr-only']
 * };
 *
 * // Direct access
 * getDeepRule(rules, 'utils');
 * // Result: ['clearfix', 'sr-only']
 *
 * // Nested access
 * getDeepRule(rules, ['components', 'button', 'color']);
 * // Result: 'blue'
 *
 * // Non-existent path
 * getDeepRule(rules, ['components', 'header']);
 * // Result: undefined
 *
 * // Root access (empty array)
 * getDeepRule(rules, []);
 * // Result: { components: { ... }, utils: [...] }
 * ```
 */
declare function getDeepRule(target: CSSRuleObject, path: string | string[]): CSSRuleObject | undefined;
declare function getDeepRule(target: CSSRules, path: string | string[]): CSSRulesValue | undefined;

/**
 * Expands selector aliases into their full forms
 * @param selector - The selector to potentially expand
 * @param aliases - Custom aliases to use (defaults to built-in ones)
 * @returns Expanded selector or original if no alias found
 */
declare function expandSelectorAlias(selector: string, aliases?: Record<string, string>): string;
interface ProcessCSSSelectorOptions {
    /** Whether to add "selector *" variants to each selector */
    addStarVariants?: boolean;
    /** Whether to allow comma-separated selectors to pass through */
    allowCommaPassthrough?: boolean;
    /** Custom selector aliases to use for expansion */
    aliases?: Record<string, string>;
}
/**
 * Processes CSS selectors and at-rules, handling both strings and arrays.
 * Merges consecutive selectors with OR and adds * variants,
 * while keeping at-rules stacked separately.
 *
 * @param selectors - CSS selector(s) and at-rules
 * @param options - Processing options
 * @returns Array of processed selector strings or undefined
 */
declare function processCSSSelectors(selectors: string | string[], options?: ProcessCSSSelectorOptions): string[] | undefined;

/**
 * A type-safe wrapper around Object.keys that preserves the object's key types.
 *
 * @returns a typed array of keys of the object
 */
declare const unsafeKeys: <T>(object: T) => Array<keyof T>;
/**
 * A generator function that yields keys of an object that pass an optional validation function.
 *
 * Iterates through all own properties of the given object and yields
 * each key that passes the optional validation function.
 *
 * @param object - The object to iterate over
 * @param valid - Optional validation function that determines which keys to yield
 * @returns A generator of valid keys from the object
 */
declare function keys<T, K extends keyof T>(object: T, valid?: (key: keyof T) => boolean): Generator<K>;
/**
 * Validates if a key-value pair meets default criteria.
 *
 * A key-value pair is considered valid when:
 * - The value is neither null nor undefined
 * - The key doesn't contain spaces
 * - The key doesn't start with an underscore (_)
 *
 * @param key - The key to validate
 * @param value - The value to validate
 * @returns true if the key-value pair is valid, false otherwise
 *
 */
declare function defaultValidPair<K extends string, T = unknown>(key: K, value: T): boolean;
/**
 * A generator function that yields valid key-value pairs from an object.
 *
 * Iterates through all own properties of the given object and yields
 * each key-value pair that passes the validation function.
 *
 * @param object - The object to iterate over
 * @param valid - Optional validation function that determines which key-value pairs to yield
 * @returns A generator of valid key-value pairs from the object
 */
declare function pairs<K extends string = string, T = unknown>(object: Record<K, T>, valid?: (k: K, v: T) => boolean): Generator<[K, T]>;
declare function kebabCase(s: string): string;
/**
 * Converts a given string to camelCase.
 *
 * Transforms various string formats (kebab-case, PascalCase, snake_case)
 * into a camelCase string. Properly handles vendor prefixes and internal
 * capitalization patterns.
 *
 * @param s - The input string to convert
 * @returns A camelCase representation of the input string
 *
 * @example
 * camelCase('xml-http-request') // returns 'xmlHttpRequest'
 * camelCase('PascalCase') // returns 'pascalCase'
 * camelCase('snake_case') // returns 'snakeCase'
 * camelCase('-webkit-transition') // returns 'webkitTransition'
 * camelCase('BGColor') // returns 'bgColor'
 * camelCase('HTMLElement') // returns 'htmlElement'
 */
declare function camelCase(s: string): string;

export { type CSSProperties, type CSSPropertiesOptions, type CSSRuleObject, type CSSRules, type CSSRulesFormatOptions, type CSSRulesValue, type CSSValue, type ProcessCSSSelectorOptions, camelCase, defaultValidCSSRule, defaultValidPair, expandSelectorAlias, formatCSSProperties, formatCSSRules, formatCSSRulesArray, formatCSSValue, generateCSSRules, generateCSSRulesArray, getDeepRule, interleavedRules, kebabCase, keys, pairs, processCSSSelectors, properties, renameRules, setDeepRule, spaceDelimitedProperties, stringifyCSSProperties, stringifyCSSRules, unsafeKeys };
