HTML.d.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import type { CSSUnitValue } from '../css';
  2. import type { DisplayObjectConfig } from '../dom';
  3. import { AABB } from '../shapes';
  4. import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
  5. import { DisplayObject } from './DisplayObject';
  6. export interface HTMLStyleProps extends BaseStyleProps {
  7. x?: number | string;
  8. y?: number | string;
  9. innerHTML: string | HTMLElement;
  10. width?: number | string;
  11. height?: number | string;
  12. }
  13. export interface ParsedHTMLStyleProps extends ParsedBaseStyleProps {
  14. x: CSSUnitValue;
  15. y: CSSUnitValue;
  16. $el: HTMLElement;
  17. innerHTML: string | HTMLElement;
  18. width: CSSUnitValue;
  19. height: CSSUnitValue;
  20. }
  21. /**
  22. * HTML container
  23. * @see https://github.com/pmndrs/drei#html
  24. */
  25. export declare class HTML extends DisplayObject<HTMLStyleProps, ParsedHTMLStyleProps> {
  26. constructor({ style, ...rest }?: DisplayObjectConfig<HTMLStyleProps>);
  27. /**
  28. * return wrapper HTMLElement
  29. * * <div> in g-webgl/canvas
  30. * * <foreignObject> in g-svg
  31. */
  32. getDomElement(): HTMLElement;
  33. /**
  34. * override with $el.getBoundingClientRect
  35. * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Element/getBoundingClientRect
  36. */
  37. getBoundingClientRect(): DOMRect;
  38. getClientRects(): DOMRect[];
  39. getBounds(): AABB;
  40. getLocalBounds(): AABB;
  41. }
  42. //# sourceMappingURL=HTML.d.ts.map