feat(reactflowInstance): add toObject function closes #603

This commit is contained in:
moklick
2020-11-09 18:17:36 +01:00
parent 2db5a7bce2
commit 7cc2306975
4 changed files with 45 additions and 6 deletions
+9
View File
@@ -229,8 +229,16 @@ export interface WrapNodeProps {
export type FitViewParams = {
padding: number;
};
export type FlowExportObject = {
elements: Elements;
position: [number, number];
zoom: number;
};
export type FitViewFunc = (fitViewOptions?: FitViewParams) => void;
export type ProjectFunc = (position: XYPosition) => XYPosition;
export type ToObjectFunc = () => FlowExportObject;
export type OnLoadParams = {
zoomIn: () => void;
@@ -240,6 +248,7 @@ export type OnLoadParams = {
project: ProjectFunc;
getElements: () => Elements;
setTransform: (transform: FlowTransform) => void;
toObject: ToObjectFunc;
};
export type OnLoadFunc = (params: OnLoadParams) => void;