gpml2pvjson
Version:
convert GPML (XML) to pvjson (json)
62 lines (61 loc) • 2.28 kB
TypeScript
export declare const createSVGPathCalculator: any;
export declare type Direction = [number, number];
export interface ColinMeinkeSVGPoint {
x: number;
y: number;
curve?: any;
moveTo?: any;
}
export declare class SVGPointElement implements SVGPoint {
x: number;
y: number;
matrixTransform: any;
orientation: any;
constructor(x: number, y: number);
w: number;
z: number;
toJSON: () => {};
}
export declare type PathDataCommand = "M" | "m" | "Z" | "z" | "L" | "l" | "H" | "h" | "V" | "v" | "C" | "c" | "S" | "s" | "Q" | "q" | "T" | "t" | "A" | "a" | "B" | "b" | "R" | "r";
export declare class SVGPathSegment {
type: PathDataCommand;
values: number[];
constructor(type: PathDataCommand, values: number[]);
}
export interface SVGPathDataSettings {
normalize: boolean;
}
export interface SVGPathData {
getPathData: (settings?: SVGPathDataSettings) => SVGPathSegment[];
setPathData: (pathData: SVGPathSegment[]) => void;
}
export declare class SVGPath implements SVGPathData {
pathData: SVGPathSegment[];
pathCalculator: {
at: (length: number) => [number, number];
length: () => number;
};
getPathDataFromPoints: (points: SVGPointElement[], markerStart?: string, markerEnd?: string) => SVGPathSegment[];
d: string;
points: ColinMeinkeSVGPoint[];
constructor(points: SVGPointElement[], getPathDataFromPoints: any);
getPathStringFromPathData: (pathData: SVGPathSegment[]) => string;
getPointAtLength: (length: number) => SVGPointElement;
getTotalLength: () => number;
getPathData: (settings?: SVGPathDataSettings) => SVGPathSegment[];
setPathData: (pathData: SVGPathSegment[]) => void;
getPointAtPosition: (position: number) => SVGPointElement;
}
export declare function changeDirection(currentDirection: Direction): Direction;
export declare class StraightLine extends SVGPath {
constructor(points: SVGPointElement[]);
}
export declare class ElbowLine extends SVGPath {
constructor(points: SVGPointElement[]);
}
export declare class SegmentedLine extends SVGPath {
constructor(points: SVGPointElement[]);
}
export declare class CurvedLine extends SVGPath {
constructor(points: SVGPointElement[], markerStart: any, markerEnd: any);
}