SceneGraphSelector.d.ts 966 B

123456789101112131415161718192021222324
  1. import type { IElement } from '../dom/interfaces';
  2. export interface SceneGraphSelector {
  3. selectOne: <R extends IElement, T extends IElement>(query: string, root: R) => T | null;
  4. selectAll: <R extends IElement, T extends IElement>(query: string, root: R) => T[];
  5. is: <T extends IElement>(query: string, element: T) => boolean;
  6. }
  7. /**
  8. * support the following DOM API:
  9. * * getElementById
  10. * * getElementsByClassName
  11. * * getElementsByName
  12. * * getElementsByTag
  13. * * querySelector
  14. * * querySelectorAll
  15. */
  16. export declare class DefaultSceneGraphSelector implements SceneGraphSelector {
  17. selectOne<R extends IElement, T extends IElement>(query: string, root: R): T | null;
  18. selectAll<R extends IElement, T extends IElement>(query: string, root: R): T[];
  19. is<T extends IElement>(query: string, node: T): boolean;
  20. private getIdOrClassname;
  21. private getAttribute;
  22. private attributeToString;
  23. }
  24. //# sourceMappingURL=SceneGraphSelector.d.ts.map