import { SelectorNode, Combinator, PseudoElement } from '@tokey/css-selector-parser'; export declare const DOMLocationBasedPseudoClasses: Set; /** This function splits a selector to all chunks that requires states in order to select the DOM structure and apply force states to each node E.g: .x:hover .y:focus will output two selectors .x and .x .y and for each selector the relevant force states names for .x -> hover for .y -> focus usage in DOM tree: // loop over all selectors createForceStateMatchers('.x:hover .y:focus').forEach((selectorChunksWithStates)=>{ // loop over all chunks selectorChunksWithStates.forEach(({selector, states})=>{ // find matching DOM nodes document.querySelectorAll(selector).forEach((node)=>{ // apply all force states states.forEach(({name})=>{ node.setAttribute('data-force-state-' + name); }); }); }); }); */ export type SelectorWithStatesMatcher = { states: State[]; selector: string; }; export declare function createForceStateMatchers(selector: string): SelectorWithStatesMatcher[][]; interface State { type: 'pseudo-class'; name: string; } export interface SelectorChunkWithStates { cause: Combinator | PseudoElement | null; before: string; nodes: SelectorNode[]; states: State[]; } export {}; //# sourceMappingURL=create-forcestate-matchers.d.ts.map