reorganize directory structure and converting to typescript

development
mcyph 2021-04-03 15:32:02 +11:00
parent e84c441c53
commit 1d29e57258
31 changed files with 126 additions and 90 deletions

View File

@ -1,6 +1,8 @@
{
"extends": "@ijsto",
"rules": {
"newIsCap": false
"newIsCap": 0,
"indent": ["error", 2, {"FunctionDeclaration": {"parameters": "first"},
"FunctionExpression": {"parameters": "first"}}]
}
}

View File

@ -14,17 +14,17 @@ import mxText from '../../shape/mxText';
class mxCellState extends mxRectangle {
// TODO: Document me!!
cellBounds: mxRectangle;
cellBounds: mxRectangle | undefined;
paintBounds: mxRectangle;
paintBounds: mxRectangle | undefined;
boundingBox: mxRectangle;
boundingBox: mxRectangle | undefined;
// Used by mxCellRenderer's createControl()
control: mxShape;
control: mxShape | undefined;
// Used by mxCellRenderer's createCellOverlays()
overlays: any[];
overlays: any[] | null | undefined;
/**
* Variable: view
@ -76,7 +76,7 @@ class mxCellState extends mxRectangle {
* Holds an array of <mxPoints> that represent the absolute points of an
* edge.
*/
absolutePoints: mxPoint[] | null = null;
absolutePoints: (mxPoint | null)[] | null = null;
/**
* Variable: absoluteOffset
@ -336,7 +336,7 @@ class mxCellState extends mxRectangle {
* Returns the unscaled, untranslated bounds.
*/
getCellBounds(): mxRectangle {
return this.cellBounds;
return <mxRectangle>this.cellBounds;
}
/**
@ -347,7 +347,7 @@ class mxCellState extends mxRectangle {
* isPaintBoundsInverted returns true.
*/
getPaintBounds(): mxRectangle {
return this.paintBounds;
return <mxRectangle>this.paintBounds;
}
/**
@ -356,8 +356,10 @@ class mxCellState extends mxRectangle {
* Updates the cellBounds and paintBounds.
*/
updateCachedBounds(): void {
const tr = this.view.translate;
const s = this.view.scale;
const view = <mxGraphView>this.view;
const tr = view.translate;
const s = view.scale;
this.cellBounds = new mxRectangle(
this.x / s - tr.x,
this.y / s - tr.y,
@ -401,14 +403,14 @@ class mxCellState extends mxRectangle {
* Returns a clone of this <mxPoint>.
*/
clone(): mxCellState {
const clone = new mxCellState(this.view, this.cell, this.style);
const clone = new mxCellState(<mxGraphView>this.view, <mxCell>this.cell, this.style);
// Clones the absolute points
if (this.absolutePoints != null) {
clone.absolutePoints = [];
for (let i = 0; i < this.absolutePoints.length; i += 1) {
clone.absolutePoints[i] = this.absolutePoints[i].clone();
clone.absolutePoints[i] = (<mxPoint[]>this.absolutePoints)[i].clone();
}
}
@ -443,7 +445,7 @@ class mxCellState extends mxRectangle {
* Destroys the state and all associated resources.
*/
destroy(): void {
this.view.graph.cellRenderer.destroy(this);
(<mxGraphView>this.view).graph.cellRenderer.destroy(this);
}
}

View File

@ -218,7 +218,7 @@ class mxCell {
*
* Returns the Id of the cell as a string.
*/
getId(): number {
getId(): number | null {
return this.id;
}
@ -279,7 +279,7 @@ class mxCell {
*
* Sets the <mxGeometry> to be used as the <geometry>.
*/
setGeometry(geometry: mxGeometry): void {
setGeometry(geometry: mxGeometry | null): void {
this.geometry = geometry;
}
@ -297,7 +297,7 @@ class mxCell {
*
* Sets the string to be used as the <style>.
*/
setStyle(style: string): void {
setStyle(style: string | null): void {
this.style = style;
}

View File

@ -92,11 +92,11 @@ class mxCellPath {
* path - String that defines the path.
*/
static resolve(root: mxCell, path: string): mxCell | null {
let parent = root;
let parent: mxCell | null | undefined = root;
if (path != null) {
const tokens = path.split(mxCellPath.PATH_SEPARATOR);
for (let i = 0; i < tokens.length; i += 1) {
parent = parent.getChildAt(parseInt(tokens[i]));
parent = parent?.getChildAt(parseInt(tokens[i])) || null;
}
}
return parent;

View File

@ -63,7 +63,7 @@ class mxCellRenderer {
*
* Defines the default shape for labels. Default is <mxText>.
*/
defaultTextShape: typeof mxShape = mxText;
defaultTextShape: typeof mxText = mxText;
/**
* Variable: legacyControlPosition
@ -1642,7 +1642,7 @@ class mxCellRenderer {
* Invokes redraw on the shape of the given state.
*/
doRedrawShape(state: mxCellState) {
state.shape.redraw();
state.shape?.redraw();
}
/**
@ -1650,7 +1650,8 @@ class mxCellRenderer {
*
* Returns true if the given shape must be repainted.
*/
isShapeInvalid(state, shape) {
isShapeInvalid(state: mxCellState,
shape: mxShape): boolean {
return (
shape.bounds == null ||
shape.scale !== state.view.scale ||

View File

@ -13,6 +13,7 @@ import mxDictionary from '../../util/datatypes/mxDictionary';
import mxGraphView from '../graph/mxGraphView';
import mxCell from './mxCell';
import mxCellState from '../../util/datatypes/mxCellState';
import mxShape from "../../shape/mxShape";
class mxTemporaryCellStates {
oldValidateCellState: Function | null;
@ -27,7 +28,7 @@ class mxTemporaryCellStates {
/**
* Variable: oldStates
*/
oldStates: mxCellState | null = null;
oldStates: mxDictionary | null = null;
/**
* Variable: oldBounds
@ -59,10 +60,11 @@ class mxTemporaryCellStates {
// Overrides doRedrawShape and paint shape to add links on shapes
if (getLinkForCellState != null) {
view.graph.cellRenderer.doRedrawShape = state => {
const oldPaint = state.shape.paint;
view.graph.cellRenderer.doRedrawShape = (state: mxCellState) => {
const shape = <mxShape>state?.shape;
const oldPaint = shape.paint;
state.shape.paint = c => {
shape.paint = c => {
const link = getLinkForCellState(state);
if (link != null) {
c.setLink(link);
@ -73,15 +75,15 @@ class mxTemporaryCellStates {
}
};
self.oldDoRedrawShape.apply(view.graph.cellRenderer, [state]);
state.shape.paint = oldPaint;
(<Function>self.oldDoRedrawShape).apply(view.graph.cellRenderer, [state]);
shape.paint = oldPaint;
};
}
// Overrides validateCellState to ignore invisible cells
view.validateCellState = (cell, recurse) => {
if (cell == null || isCellVisibleFn == null || isCellVisibleFn(cell)) {
return self.oldValidateCellState.apply(view, [cell, recurse]);
return (<Function>self.oldDoRedrawShape).apply(view, [cell, recurse]);
}
return null;
};
@ -116,11 +118,14 @@ class mxTemporaryCellStates {
* Returns the top, left corner as a new <mxPoint>.
*/
destroy(): void {
this.view.setScale(this.oldScale);
this.view.setStates(this.oldStates);
this.view.setGraphBounds(this.oldBounds);
this.view.validateCellState = this.oldValidateCellState;
this.view.graph.cellRenderer.doRedrawShape = this.oldDoRedrawShape;
const view = <mxGraphView>this.view;
view.setScale(this.oldScale);
view.setStates(this.oldStates);
view.setGraphBounds(<mxRectangle>this.oldBounds);
// @ts-ignore
view.validateCellState = <Function>this.oldValidateCellState;
// @ts-ignore
view.graph.cellRenderer.doRedrawShape = <Function>this.oldDoRedrawShape;
}
}

View File

@ -17,6 +17,7 @@ import mxEventObject from '../../util/event/mxEventObject';
import mxCell from '../cell/mxCell';
import mxGraph from './mxGraph';
import mxRectangle from '../../util/datatypes/mxRectangle';
import mxMouseEvent from "../../util/event/mxMouseEvent";
class mxLayoutManager extends mxEventSource {
/**
@ -97,21 +98,21 @@ class mxLayoutManager extends mxEventSource {
super();
// Executes the layout before the changes are dispatched
this.undoHandler = (sender, evt) => {
this.undoHandler = (sender: any, evt: mxEventObject) => {
if (this.isEnabled()) {
this.beforeUndo(evt.getProperty('edit'));
}
};
// Notifies the layout of a move operation inside a parent
this.moveHandler = (sender, evt) => {
this.moveHandler = (sender: any, evt: mxEventObject) => {
if (this.isEnabled()) {
this.cellsMoved(evt.getProperty('cells'), evt.getProperty('event'));
}
};
// Notifies the layout of a move operation inside a parent
this.resizeHandler = (sender, evt) => {
this.resizeHandler = (sender: any, evt: mxEventObject) => {
if (this.isEnabled()) {
this.cellsResized(
evt.getProperty('cells'),
@ -144,7 +145,7 @@ class mxLayoutManager extends mxEventSource {
*
* enabled - Boolean that specifies the new enabled state.
*/
setEnabled(enabled) {
setEnabled(enabled: boolean) {
this.enabled = enabled;
}
@ -155,7 +156,7 @@ class mxLayoutManager extends mxEventSource {
* should be executed whenever a cell layout (layout of the children of
* a cell) has been executed. This implementation returns <bubbling>.
*/
isBubbling() {
isBubbling(): boolean {
return this.bubbling;
}
@ -164,7 +165,7 @@ class mxLayoutManager extends mxEventSource {
*
* Sets <bubbling>.
*/
setBubbling(value) {
setBubbling(value: boolean): void {
this.bubbling = value;
}
@ -173,7 +174,7 @@ class mxLayoutManager extends mxEventSource {
*
* Returns the graph that this layout operates on.
*/
getGraph() {
getGraph(): mxGraph | null {
return this.graph;
}
@ -182,7 +183,7 @@ class mxLayoutManager extends mxEventSource {
*
* Sets the graph that the layouts operate on.
*/
setGraph(graph: mxGraph): void {
setGraph(graph: mxGraph | null): void {
if (this.graph != null) {
const model = this.graph.getModel();
model.removeListener(this.undoHandler);
@ -238,7 +239,7 @@ class mxLayoutManager extends mxEventSource {
* cell - Array of <mxCells> that have been moved.
* evt - Mouse event that represents the mousedown.
*/
beforeUndo(undoableEdit) {
beforeUndo(undoableEdit: any): void {
this.executeLayoutForCells(this.getCellsForChanges(undoableEdit.changes));
}
@ -252,14 +253,16 @@ class mxLayoutManager extends mxEventSource {
* cell - Array of <mxCells> that have been moved.
* evt - Mouse event that represents the mousedown.
*/
cellsMoved(cells, evt) {
cellsMoved(cells: mxCell[],
evt: mxMouseEvent): void {
if (cells != null && evt != null) {
const point = mxUtils.convertPoint(
this.getGraph().container,
(<mxGraph>this.getGraph()).container,
mxEvent.getClientX(evt),
mxEvent.getClientY(evt)
);
const model = this.getGraph().getModel();
const model = (<mxGraph>this.getGraph()).getModel();
for (let i = 0; i < cells.length; i += 1) {
const layout = this.getLayout(
@ -282,24 +285,23 @@ class mxLayoutManager extends mxEventSource {
* Parameters:
*
* cell - Array of <mxCells> that have been resized.
* bounds - <mxRectangle> taht represents the new bounds.
* bounds - <mxRectangle> that represents the new bounds.
*/
cellsResized(
cells: mxCell[] | null = null,
bounds: mxRectangle | null = null,
prev
) {
bounds: mxRectangle[] | null = null,
prev: mxCell[] | null = null
): void {
if (cells != null && bounds != null) {
const model = this.getGraph().getModel();
const model = (<mxGraph>this.getGraph()).getModel();
for (let i = 0; i < cells.length; i += 1) {
const layout = this.getLayout(
model.getParent(cells[i]),
mxEvent.RESIZE_CELLS
);
if (layout != null) {
layout.resizeCell(cells[i], bounds[i], prev[i]);
layout.resizeCell(cells[i], bounds[i], prev?.[i]);
}
}
}
@ -311,7 +313,7 @@ class mxLayoutManager extends mxEventSource {
* Returns the cells for which a layout should be executed.
*/
getCellsForChanges(changes: any[]): mxCell[] {
let result = [];
let result: mxCell[] = [];
for (const change of changes) {
if (change instanceof mxRootChange) {
return [];
@ -375,7 +377,7 @@ class mxLayoutManager extends mxEventSource {
}
if (this.isBubbling()) {
const model = this.getGraph().getModel();
const model = (<mxGraph>this.getGraph()).getModel();
this.addAncestorsWithLayout(model.getParent(cell), result);
}
}
@ -389,7 +391,7 @@ class mxLayoutManager extends mxEventSource {
*/
addDescendantsWithLayout(cell: mxCell, result: mxCell[] = []): mxCell[] {
if (cell != null && this.hasLayout(cell)) {
const model = this.getGraph().getModel();
const model = (<mxGraph>this.getGraph()).getModel();
for (let i = 0; i < model.getChildCount(cell); i += 1) {
const child = model.getChildAt(cell, i);
@ -425,7 +427,7 @@ class mxLayoutManager extends mxEventSource {
layoutCells(cells: mxCell[], bubble: boolean = false): void {
if (cells.length > 0) {
// Invokes the layouts while removing duplicates
const model = this.getGraph().getModel();
const model = (<mxGraph>this.getGraph()).getModel();
model.beginUpdate();
try {
@ -450,7 +452,8 @@ class mxLayoutManager extends mxEventSource {
*
* Executes the given layout on the given parent.
*/
executeLayout(cell: mxCell, bubble: boolean = false): void {
executeLayout(cell: mxCell,
bubble: boolean=false): void {
const layout = this.getLayout(
cell,
bubble ? mxEvent.BEGIN_UPDATE : mxEvent.END_UPDATE

View File

@ -12,7 +12,7 @@ import React from 'react';
import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxUtils from '../../mxgraph/util/mxUtils';
import mxCodec from '../../mxgraph/io/mxCodec';
import mxCodec from '../../mxgraph/serialization/mxCodec';
class Template extends React.Component {
constructor(props) {

View File

@ -11,7 +11,7 @@ import mxShape from '../../mxgraph/shape/mxShape';
import mxConnectionConstraint from '../../mxgraph/view/connection/mxConnectionConstraint';
import mxPoint from '../../mxgraph/util/datatypes/mxPoint';
import mxPolyline from '../../mxgraph/shape/edge/mxPolyline';
import mxCellState from '../../mxgraph/view/cell/mxCellState';
import mxCellState from '../../mxgraph/util/datatypes/mxCellState';
import mxGeometry from "../../mxgraph/util/datatypes/mxGeometry";
import mxConnectionHandler from "../../mxgraph/handler/mxConnectionHandler";

View File

@ -12,7 +12,7 @@ import mxConnectionHandler from '../../mxgraph/handler/mxConnectionHandler';
import mxEdgeHandler from '../../mxgraph/handler/mxEdgeHandler';
import mxConnectionConstraint from '../../mxgraph/view/connection/mxConnectionConstraint';
import mxPoint from '../../mxgraph/util/datatypes/mxPoint';
import mxCellState from '../../mxgraph/view/cell/mxCellState';
import mxCellState from '../../mxgraph/util/datatypes/mxCellState';
class FixedPoints extends React.Component {
constructor(props) {

View File

@ -8,9 +8,9 @@ import mxEvent from '../../mxgraph/util/event/mxEvent';
import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxConstants from '../../mxgraph/util/mxConstants';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle';
import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
import mxPoint from '../../mxgraph/util/datatypes/mxPoint';
import mxCodec from '../../mxgraph/io/mxCodec';
import mxCodec from '../../mxgraph/serialization/mxCodec';
import mxUtils from '../../mxgraph/util/mxUtils';
class HelloPort extends React.Component {

View File

@ -13,7 +13,7 @@ import mxEdgeHandler from '../../mxgraph/handler/mxEdgeHandler';
import mxConnectionHandler from '../../mxgraph/handler/mxConnectionHandler';
import mxGraphView from '../../mxgraph/view/graph/mxGraphView';
import mxPoint from '../../mxgraph/util/datatypes/mxPoint';
import mxCellState from '../../mxgraph/view/cell/mxCellState';
import mxCellState from '../../mxgraph/util/datatypes/mxCellState';
class Orthogonal extends React.Component {
constructor(props) {

View File

@ -10,7 +10,7 @@ import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxUtils from '../../mxgraph/util/mxUtils';
import mxClipboard from '../../mxgraph/util/storage/mxClipboard';
import mxClient from '../../mxgraph/mxClient';
import mxCodec from '../../mxgraph/io/mxCodec';
import mxCodec from '../../mxgraph/serialization/mxCodec';
import mxGraphModel from '../../mxgraph/view/graph/mxGraphModel';
class Clipboard extends React.Component {

View File

@ -9,7 +9,7 @@ import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxUtils from '../../mxgraph/util/mxUtils';
import mxConstants from '../../mxgraph/util/mxConstants';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle';
import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
import mxKeyHandler from '../../mxgraph/handler/mxKeyHandler';
import mxLayoutManager from '../../mxgraph/view/graph/mxLayoutManager';
import mxParallelEdgeLayout from '../../mxgraph/layout/mxParallelEdgeLayout';

View File

@ -11,7 +11,7 @@ import mxConstants from '../../mxgraph/util/mxConstants';
import mxUtils from '../../mxgraph/util/mxUtils';
import mxRectangle from '../../mxgraph/util/datatypes/mxRectangle';
import mxImage from '../../mxgraph/util/image/mxImage';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter';
import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
class Images extends React.Component {
constructor(props) {

View File

@ -6,7 +6,7 @@
import React from 'react';
import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxConstants from '../../mxgraph/util/mxConstants';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle';
import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
import mxKeyHandler from '../../mxgraph/handler/mxKeyHandler';
class Indicators extends React.Component {

View File

@ -6,7 +6,7 @@
import React from 'react';
import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxConstants from '../../mxgraph/util/mxConstants';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle';
import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
import mxLayoutManager from '../../mxgraph/view/graph/mxLayoutManager';
import mxStackLayout from '../../mxgraph/layout/mxStackLayout';

View File

@ -10,7 +10,7 @@ import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxHierarchicalLayout from '../../mxgraph/layout/hierarchical/mxHierarchicalLayout';
import mxFastOrganicLayout from '../../mxgraph/layout/mxFastOrganicLayout';
import mxConstants from '../../mxgraph/util/mxConstants';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter';
import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
import mxUtils from '../../mxgraph/util/mxUtils';
class HierarchicalLayout extends React.Component {

View File

@ -19,7 +19,7 @@ import mxConstants from '../../mxgraph/util/mxConstants';
import mxWindow from '../../mxgraph/util/gui/mxWindow';
import mxToolbar from '../../mxgraph/util/gui/mxToolbar';
import mxLayoutManager from '../../mxgraph/view/graph/mxLayoutManager';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle';
import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
import mxCompactTreeLayout from '../../mxgraph/layout/mxCompactTreeLayout';
import mxKeyHandler from '../../mxgraph/handler/mxKeyHandler';
import mxClient from '../../mxgraph/mxClient';

View File

@ -6,7 +6,7 @@
import React from 'react';
import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter';
import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
import mxConstants from '../../mxgraph/util/mxConstants';
import mxRadialTreeLayout from '../../mxgraph/layout/mxRadialTreeLayout';

View File

@ -12,13 +12,13 @@ import mxStackLayout from '../../mxgraph/layout/mxStackLayout';
import mxSwimlaneManager from '../../mxgraph/view/graph/mxSwimlaneManager';
import mxGraphModel from '../../mxgraph/view/graph/mxGraphModel';
import mxConstants from '../../mxgraph/util/mxConstants';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter';
import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
import mxUtils from '../../mxgraph/util/mxUtils';
import mxEditor from '../../mxgraph/editor/mxEditor';
import mxConnectionHandler from '../../mxgraph/handler/mxConnectionHandler';
import mxImage from '../../mxgraph/util/image/mxImage';
import mxLayoutManager from '../../mxgraph/view/graph/mxLayoutManager';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle';
import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
class SwimLanes extends React.Component {
constructor(props) {

View File

@ -17,7 +17,7 @@ import mxLayoutManager from '../../mxgraph/view/graph/mxLayoutManager';
import mxRectangle from '../../mxgraph/util/datatypes/mxRectangle';
import mxUtils from '../../mxgraph/util/mxUtils';
import mxClient from '../../mxgraph/mxClient';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle';
import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
class Tree extends React.Component {
constructor(props) {

View File

@ -9,9 +9,9 @@ import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxText from '../../mxgraph/shape/mxText';
import mxUtils from '../../mxgraph/util/mxUtils';
import mxConstants from '../../mxgraph/util/mxConstants';
import mxCodec from '../../mxgraph/io/mxCodec';
import mxCodec from '../../mxgraph/serialization/mxCodec';
import mxEffects from '../../mxgraph/util/animate/mxEffects';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter';
import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
class DynamicLoading extends React.Component {
constructor(props) {

View File

@ -10,7 +10,7 @@ import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxGraphHandler from '../../mxgraph/handler/mxGraphHandler';
import mxEdgeHandler from '../../mxgraph/handler/mxEdgeHandler';
import mxConstants from '../../mxgraph/util/mxConstants';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle';
import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
import mxKeyHandler from '../../mxgraph/handler/mxKeyHandler';
class Guides extends React.Component {

View File

@ -7,7 +7,7 @@ import React from 'react';
import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxConstants from '../../mxgraph/util/mxConstants';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter';
import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
class Merge extends React.Component {
constructor(props) {

View File

@ -9,9 +9,9 @@ import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxConstants from '../../mxgraph/util/mxConstants';
import mxCellOverlay from '../../mxgraph/view/cell/mxCellOverlay';
import mxUtils from '../../mxgraph/util/mxUtils';
import mxCodec from '../../mxgraph/io/mxCodec';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle';
import mxCodec from '../../mxgraph/serialization/mxCodec';
import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
class Monitor extends React.Component {
constructor(props) {

View File

@ -6,8 +6,8 @@
import React from 'react';
import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxConstants from '../../mxgraph/util/mxConstants';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter';
import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
class Stylesheet extends React.Component {
constructor(props) {

View File

@ -11,8 +11,8 @@ import mxConstants from '../../mxgraph/util/mxConstants';
import mxUtils from '../../mxgraph/util/mxUtils';
import mxFastOrganicLayout from '../../mxgraph/layout/mxFastOrganicLayout';
import mxEventObject from '../../mxgraph/util/event/mxEventObject';
import mxCodec from '../../mxgraph/io/mxCodec';
import mxPerimeter from '../../mxgraph/view/style/mxPerimeter';
import mxCodec from '../../mxgraph/serialization/mxCodec';
import mxPerimeter from '../../mxgraph/util/datatypes/style/mxPerimeter';
import mxClient from '../../mxgraph/mxClient';
class FileIO extends React.Component {

View File

@ -7,10 +7,10 @@ import React from 'react';
import mxEvent from '../../mxgraph/util/event/mxEvent';
import mxGraph from '../../mxgraph/view/graph/mxGraph';
import mxRubberband from '../../mxgraph/handler/mxRubberband';
import mxCodecRegistry from '../../mxgraph/io/mxCodecRegistry';
import mxObjectCodec from '../../mxgraph/io/mxObjectCodec';
import mxCodecRegistry from '../../mxgraph/serialization/mxCodecRegistry';
import mxObjectCodec from '../../mxgraph/serialization/mxObjectCodec';
import mxUtils from '../../mxgraph/util/mxUtils';
import mxCodec from '../../mxgraph/io/mxCodec';
import mxCodec from '../../mxgraph/serialization/mxCodec';
class JsonData extends React.Component {
// Adds an option to view the XML of the graph

View File

@ -13,7 +13,7 @@ import mxForm from '../../mxgraph/util/gui/mxForm';
import mxCellAttributeChange from '../../mxgraph/atomic_changes/mxCellAttributeChange';
import mxKeyHandler from '../../mxgraph/handler/mxKeyHandler';
import mxRectangle from '../../mxgraph/util/datatypes/mxRectangle';
import mxEdgeStyle from '../../mxgraph/view/style/mxEdgeStyle';
import mxEdgeStyle from '../../mxgraph/util/datatypes/style/mxEdgeStyle';
class UserObject extends React.Component {
constructor(props) {

23
src/tsconfig.json Normal file
View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"baseUrl": ".",
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "react-native",
"lib": ["es2020", "dom"],
"moduleResolution": "node",
"noEmit": true,
"strict": true,
"target": "es2020",
"resolveJsonModule": true, // Required for JSON files
"skipLibCheck": true
},
"exclude": [
"node_modules",
"e2e",
"**/*.json", // Don't try and check JSON files
"**/*.spec.ts",
]
}