core.d.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. export declare type CSSSelectorVNode = Record<string, string>;
  2. export declare type CSSAnimationVNode = Record<string, Record<string, string>>;
  3. export declare const SVGNS = "http://www.w3.org/2000/svg";
  4. export declare const XLINKNS = "http://www.w3.org/1999/xlink";
  5. export declare const XMLNS = "http://www.w3.org/2000/xmlns/";
  6. export declare const XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
  7. export declare const META_DATA_PREFIX = "ecmeta_";
  8. export declare function createElement(name: string): SVGElement;
  9. export declare type SVGVNodeAttrs = Record<string, string | number | undefined | boolean>;
  10. export interface SVGVNode {
  11. tag: string;
  12. attrs: SVGVNodeAttrs;
  13. children?: SVGVNode[];
  14. text?: string;
  15. elm?: Node;
  16. key: string;
  17. }
  18. export declare function createVNode(tag: string, key: string, attrs?: SVGVNodeAttrs, children?: SVGVNode[], text?: string): SVGVNode;
  19. export declare function vNodeToString(el: SVGVNode, opts?: {
  20. newline?: boolean;
  21. }): string;
  22. export declare function getCssString(selectorNodes: Record<string, CSSSelectorVNode>, animationNodes: Record<string, CSSAnimationVNode>, opts?: {
  23. newline?: boolean;
  24. }): string;
  25. export interface BrushScope {
  26. zrId: string;
  27. shadowCache: Record<string, string>;
  28. gradientCache: Record<string, string>;
  29. patternCache: Record<string, string>;
  30. clipPathCache: Record<string, string>;
  31. defs: Record<string, SVGVNode>;
  32. cssNodes: Record<string, CSSSelectorVNode>;
  33. cssAnims: Record<string, Record<string, Record<string, string>>>;
  34. cssStyleCache: Record<string, string>;
  35. cssAnimIdx: number;
  36. shadowIdx: number;
  37. gradientIdx: number;
  38. patternIdx: number;
  39. clipPathIdx: number;
  40. animation?: boolean;
  41. emphasis?: boolean;
  42. willUpdate?: boolean;
  43. compress?: boolean;
  44. }
  45. export declare function createBrushScope(zrId: string): BrushScope;
  46. export declare function createSVGVNode(width: number | string, height: number | string, children?: SVGVNode[], useViewBox?: boolean): SVGVNode;