UNPKG

@gorpacrate/core-graphics

Version:

A core library for creating shape-based graphic editors

32 lines (31 loc) 1.46 kB
import * as React from 'react'; import { ContextMenuRendererComponent, IGraphicalContextData, IPoint, IShapesDeclarations } from '../declarations'; import { IEditorAction } from '../editor-state/editor-action'; import { IEditorEvent } from '../editor-state/editor-events'; import { IPersistedHistoryEvent } from '../history/history-event'; export interface IRootPropTypes { contextMenuRenderer: ContextMenuRendererComponent; author: string; shapesDeclarations: IShapesDeclarations; initialGraphicalContextData: IGraphicalContextData; history: IPersistedHistoryEvent[]; width: string; height: string; children: React.ReactElement<any> | Array<React.ReactElement<any>>; pushEvent(ev: IPersistedHistoryEvent): any; updateEvent(id: string, newEv: IPersistedHistoryEvent): any; deleteEvent(id: string): any; getNewHistoryEventId(): string; onViewportPositionChange(pos: IPoint): void; } export default class RootComponent extends React.Component<IRootPropTypes, any> { constructor(props: any, context: any); getEditorState: () => any; componentWillReceiveProps(nextProps: IRootPropTypes): void; performHistoryAction(action: IEditorAction): any; onEditorEvent: (ev: IEditorEvent) => void; getViewportPosition(): IPoint; getPNGBlob(cb: ((data: Blob) => void)): void; render(): JSX.Element; protected onContextMenu: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void; }