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.

41 lines
926 B

  1. import HTMLElement from './nodes/html';
  2. /**
  3. * Matcher class to make CSS match
  4. *
  5. * @class Matcher
  6. */
  7. export default class Matcher {
  8. private matchers;
  9. private nextMatch;
  10. /**
  11. * Creates an instance of Matcher.
  12. * @param {string} selector
  13. *
  14. * @memberof Matcher
  15. */
  16. constructor(selector: string);
  17. /**
  18. * Trying to advance match pointer
  19. * @param {HTMLElement} el element to make the match
  20. * @return {bool} true when pointer advanced.
  21. */
  22. advance(el: HTMLElement): boolean;
  23. /**
  24. * Rewind the match pointer
  25. */
  26. rewind(): void;
  27. /**
  28. * Trying to determine if match made.
  29. * @return {bool} true when the match is made
  30. */
  31. get matched(): boolean;
  32. /**
  33. * Rest match pointer.
  34. * @return {[type]} [description]
  35. */
  36. reset(): void;
  37. /**
  38. * flush cache to free memory
  39. */
  40. flushCache(): void;
  41. }