Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
bryzZz committed Oct 1, 2023
1 parent df7f46f commit abf8646
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 34 deletions.
10 changes: 0 additions & 10 deletions src/renderer/src/lib/data/EditorManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
CreateTransitionParameters,
ChangeTransitionParameters,
ChangeStateEventsParams,
SetStateEventsParams,
AddComponentParams,
} from '@renderer/types/EditorManager';
import { Either, makeLeft, makeRight } from '@renderer/types/Either';
Expand Down Expand Up @@ -380,15 +379,6 @@ export class EditorManager {
return true;
}

setStateEvents({ id, events }: SetStateEventsParams) {
const state = this.data.elements.states[id];
if (!state) return false;

state.events = events;

return true;
}

changeStateName(id: string, name: string) {
if (!this.data.elements.states.hasOwnProperty(id)) return false;

Expand Down
20 changes: 3 additions & 17 deletions src/renderer/src/lib/data/StateMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
ChangeStateEventsParams,
ChangeTransitionParameters,
CreateStateParameters,
SetStateEventsParams,
} from '@renderer/types/EditorManager';
import { Point } from '@renderer/types/graphics';
import {
Expand Down Expand Up @@ -196,19 +195,6 @@ export class StateMachine extends EventEmitter {
this.container.isDirty = true;
}

setStateEvents(args: SetStateEventsParams, canUndo = true) {
const { id } = args;

const state = this.states.get(id);
if (!state) return;

this.container.app.manager.setStateEvents(args);

state.eventBox.recalculate();

this.container.isDirty = true;
}

changeStateName = (id: string, name: string, canUndo = true) => {
const state = this.states.get(id);
if (!state) return;
Expand Down Expand Up @@ -518,7 +504,7 @@ export class StateMachine extends EventEmitter {

this.transitions.forEach((value) => {
if (value.condition.isSelected) {
killList.push(value.id!);
killList.push(value.id);
}
});

Expand Down Expand Up @@ -580,7 +566,7 @@ export class StateMachine extends EventEmitter {
this.container.isDirty = true;
}

createEvent(stateId: string, eventData: EventData, canUndo = true) {
createEvent(stateId: string, eventData: EventData) {
const state = this.states.get(stateId);
if (!state) return;

Expand All @@ -591,7 +577,7 @@ export class StateMachine extends EventEmitter {
this.container.isDirty = true;
}

createEventAction(stateId: string, event: EventSelection, value: Action, canUndo = true) {
createEventAction(stateId: string, event: EventSelection, value: Action) {
const state = this.states.get(stateId);
if (!state) return;

Expand Down
3 changes: 1 addition & 2 deletions src/renderer/src/lib/drawable/Transition.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Transition as TransitionType } from '@renderer/types/diagram';

import { BaseTransition } from './BaseTransition';
import { Condition } from './Condition';
import { State } from './State';

import { Container } from '../basic/Container';
import { transitionStyle } from '../styles';
import { degrees_to_radians, getTransitionLines } from '../utils';
import { BaseTransition } from './BaseTransition';

// interface TransitionProps {
// container: Container;
Expand Down
5 changes: 0 additions & 5 deletions src/renderer/src/types/EditorManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ export interface ChangeStateEventsParams {
triggerMethod: string;
}

export interface SetStateEventsParams {
id: string;
events: EventData[];
}

export interface AddComponentParams {
name: string;
type: string;
Expand Down

0 comments on commit abf8646

Please sign in to comment.