react-blueprint-svg
Version:
Pannable, zoomable SVG with menu of displaying options inspired by maker.js.
41 lines (40 loc) • 1.16 kB
TypeScript
import * as makerjs from 'makerjs';
import * as React from 'react';
declare type ContentState = typeof initialContent;
declare type ViewState = typeof initialView;
declare type RootState = {
content: ContentState;
options: OptionState;
view: ViewState;
};
interface SVGProps {
width: string;
height: string;
viewBox: string;
xmlns: string;
children: any[];
}
declare const initialContent: {
measurement: makerjs.IMeasureWithCenter | null;
model: makerjs.IModel | null;
svgNode: React.ReactElement<SVGProps, any> | null;
};
declare type OptionState = {
fitOnScreen: boolean;
showGrid: boolean;
showPathNames: boolean;
showPathFlow: boolean;
yDirection: 'naturalUp' | 'computerScreenDow';
unitString?: string;
};
declare const initialView: {
cursor: makerjs.IPoint;
isMouseDown: boolean;
origin: makerjs.IPoint;
panOffset: makerjs.IPoint;
scale: number;
viewOffset: makerjs.IPoint;
viewSize: number[];
};
declare const initialState: RootState;
export { initialState, RootState, ContentState, ViewState, OptionState, SVGProps };