You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
parttimejob/node_modules/zrender/lib/tool/parseSVG.d.ts

37 lines
1.1 KiB

import Group from '../graphic/Group';
import Element from '../Element';
import { RectLike } from '../core/BoundingRect';
import { parseXML } from './parseXML';
interface SVGParserOption {
width?: number;
height?: number;
ignoreViewBox?: boolean;
ignoreRootClip?: boolean;
}
export interface SVGParserResult {
root: Group;
width: number;
height: number;
viewBoxRect: RectLike;
viewBoxTransform: {
x: number;
y: number;
scale: number;
};
named: SVGParserResultNamedItem[];
}
export interface SVGParserResultNamedItem {
name: string;
namedFrom: SVGParserResultNamedItem;
svgNodeTagLower: SVGNodeTagLower;
el: Element;
}
export declare type SVGNodeTagLower = 'g' | 'rect' | 'circle' | 'line' | 'ellipse' | 'polygon' | 'polyline' | 'image' | 'text' | 'tspan' | 'path' | 'defs' | 'switch';
export declare function makeViewBoxTransform(viewBoxRect: RectLike, boundingRect: RectLike): {
scale: number;
x: number;
y: number;
};
export declare function parseSVG(xml: string | Document | SVGElement, opt: SVGParserOption): SVGParserResult;
export { parseXML };