import { ExtCssRuleData, RawCssRuleData } from './types'; import { ExtCssDocument } from '../selector'; /** * Parses CSS rule into rules data object: * 1. Find the last `{` mark in the rule * which supposed to be a divider between selector and style block. * 2. Validates found string part before the `{` via selector parser; and if: * - parsing failed – get the previous `{` in the rule, * and validates a new rule part again [2]; * - parsing successful — saves a found rule part as selector and parses the style block. * * @param rawCssRule Single CSS rule to parse. * @param extCssDoc ExtCssDocument which is used for selector ast caching. * * @returns Array of rules data which contains: * - selector as string; * - ast to query elements by; * - map of styles to apply. * @throws An error on invalid css rule syntax: * - unsupported CSS features – comments and at-rules * - invalid selector or style block. */ export declare const parseRule: (rawCssRule: string, extCssDoc: ExtCssDocument) => RawCssRuleData; /** * Parses array of CSS rules into array of rules data objects. * Invalid rules are skipped and not applied, * and the errors are logged. * * @param rawCssRules Array of rules to parse. * @param extCssDoc Needed for selector ast caching. * * @returns Array of parsed valid rules data. */ export declare const parseRules: (rawCssRules: string[], extCssDoc: ExtCssDocument) => ExtCssRuleData[];