core.d.ts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 function createElement(name: string): SVGElement;
  8. export declare type SVGVNodeAttrs = Record<string, string | number | undefined | boolean>;
  9. export interface SVGVNode {
  10. tag: string;
  11. attrs: SVGVNodeAttrs;
  12. children?: SVGVNode[];
  13. text?: string;
  14. elm?: Node;
  15. key: string;
  16. }
  17. export declare function createVNode(tag: string, key: string, attrs?: SVGVNodeAttrs, children?: SVGVNode[], text?: string): SVGVNode;
  18. export declare function vNodeToString(el: SVGVNode, opts?: {
  19. newline?: boolean;
  20. }): string;
  21. export declare function getCssString(selectorNodes: Record<string, CSSSelectorVNode>, animationNodes: Record<string, CSSAnimationVNode>, opts?: {
  22. newline?: boolean;
  23. }): string;
  24. export interface BrushScope {
  25. zrId: string;
  26. shadowCache: Record<string, string>;
  27. gradientCache: Record<string, string>;
  28. patternCache: Record<string, string>;
  29. clipPathCache: Record<string, string>;
  30. defs: Record<string, SVGVNode>;
  31. cssNodes: Record<string, CSSSelectorVNode>;
  32. cssAnims: Record<string, Record<string, Record<string, string>>>;
  33. cssClassIdx: number;
  34. cssAnimIdx: number;
  35. shadowIdx: number;
  36. gradientIdx: number;
  37. patternIdx: number;
  38. clipPathIdx: number;
  39. animation?: boolean;
  40. willUpdate?: boolean;
  41. compress?: boolean;
  42. }
  43. export declare function createBrushScope(zrId: string): BrushScope;
  44. export declare function createSVGVNode(width: number | string, height: number | string, children?: SVGVNode[], useViewBox?: boolean): SVGVNode;