Painter.d.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import Displayable from '../graphic/Displayable';
  2. import Storage from '../Storage';
  3. import { PainterBase } from '../PainterBase';
  4. import { SVGVNode, BrushScope } from './core';
  5. interface SVGPainterOption {
  6. width?: number;
  7. height?: number;
  8. ssr?: boolean;
  9. }
  10. declare class SVGPainter implements PainterBase {
  11. type: string;
  12. storage: Storage;
  13. root: HTMLElement;
  14. private _svgDom;
  15. private _viewport;
  16. private _opts;
  17. private _oldVNode;
  18. private _bgVNode;
  19. private _mainVNode;
  20. private _width;
  21. private _height;
  22. private _backgroundColor;
  23. private _id;
  24. constructor(root: HTMLElement, storage: Storage, opts: SVGPainterOption);
  25. getType(): string;
  26. getViewportRoot(): HTMLElement;
  27. getViewportRootOffset(): {
  28. offsetLeft: number;
  29. offsetTop: number;
  30. };
  31. getSvgDom(): SVGElement;
  32. refresh(): void;
  33. renderOneToVNode(el: Displayable): SVGVNode;
  34. renderToVNode(opts?: {
  35. animation?: boolean;
  36. willUpdate?: boolean;
  37. compress?: boolean;
  38. useViewBox?: boolean;
  39. }): SVGVNode;
  40. renderToString(opts?: {
  41. cssAnimation?: boolean;
  42. useViewBox?: boolean;
  43. }): string;
  44. setBackgroundColor(backgroundColor: string): void;
  45. getSvgRoot(): SVGElement;
  46. _paintList(list: Displayable[], scope: BrushScope, out?: SVGVNode[]): void;
  47. resize(width: number, height: number): void;
  48. getWidth(): number;
  49. getHeight(): number;
  50. dispose(): void;
  51. clear(): void;
  52. toDataURL(base64?: boolean): string;
  53. refreshHover: () => void;
  54. configLayer: (zlevel: number, config: import("../core/types").Dictionary<any>) => void;
  55. }
  56. export default SVGPainter;