You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

parse.d.ts 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. export default parse;
  2. export interface Options {
  3. lowerCaseAttributeNames?: boolean;
  4. lowerCaseTags?: boolean;
  5. xmlMode?: boolean;
  6. }
  7. export declare type Selector = PseudoSelector | PseudoElement | AttributeSelector | TagSelector | UniversalSelector | Traversal;
  8. export interface AttributeSelector {
  9. type: "attribute";
  10. name: string;
  11. action: AttributeAction;
  12. value: string;
  13. ignoreCase: boolean;
  14. }
  15. declare type DataType = Selector[][] | null | string;
  16. export interface PseudoSelector {
  17. type: "pseudo";
  18. name: string;
  19. data: DataType;
  20. }
  21. export interface PseudoElement {
  22. type: "pseudo-element";
  23. name: string;
  24. }
  25. export interface TagSelector {
  26. type: "tag";
  27. name: string;
  28. }
  29. export interface UniversalSelector {
  30. type: "universal";
  31. }
  32. export interface Traversal {
  33. type: TraversalType;
  34. }
  35. export declare type AttributeAction = "any" | "element" | "end" | "equals" | "exists" | "hyphen" | "not" | "start";
  36. export declare type TraversalType = "adjacent" | "child" | "descendant" | "parent" | "sibling";
  37. declare function parse(selector: string, options?: Options): Selector[][];
  38. //# sourceMappingURL=parse.d.ts.map