From be99fb16aba7cc4854df3068f5d49e0f38c76264 Mon Sep 17 00:00:00 2001 From: Eric NGUYEN Date: Fri, 12 Aug 2022 12:01:07 +0200 Subject: [PATCH 1/2] Rename IAvailableSymbolModel to IAvailableSymbol --- src/Interfaces/IAvailableSymbol.ts | 2 +- src/Interfaces/IConfiguration.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Interfaces/IAvailableSymbol.ts b/src/Interfaces/IAvailableSymbol.ts index c8e9324..3f3176a 100644 --- a/src/Interfaces/IAvailableSymbol.ts +++ b/src/Interfaces/IAvailableSymbol.ts @@ -3,7 +3,7 @@ import { IImage } from './IImage'; /** * Model of available symbol to configure the application */ -export interface IAvailableSymbolModel { +export interface IAvailableSymbol { Name: string XPositionReference: XPositionReference Image: IImage diff --git a/src/Interfaces/IConfiguration.ts b/src/Interfaces/IConfiguration.ts index e6f1f44..a37647d 100644 --- a/src/Interfaces/IConfiguration.ts +++ b/src/Interfaces/IConfiguration.ts @@ -1,9 +1,9 @@ import { IAvailableContainer } from './IAvailableContainer'; -import { IAvailableSymbolModel } from './IAvailableSymbol'; +import { IAvailableSymbol } from './IAvailableSymbol'; /** Model of configuration for the application to configure it */ export interface IConfiguration { AvailableContainers: IAvailableContainer[] - AvailableSymbols: IAvailableSymbolModel[] + AvailableSymbols: IAvailableSymbol[] MainContainer: IAvailableContainer } From 6d7e04868e2b158830d0d809f7924d5fdfedf450 Mon Sep 17 00:00:00 2001 From: Eric NGUYEN Date: Fri, 12 Aug 2022 12:07:14 +0200 Subject: [PATCH 2/2] Create Interfaces.d.ts for public project using older version of typescript --- public/Interfaces.d.ts | 65 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 public/Interfaces.d.ts diff --git a/public/Interfaces.d.ts b/public/Interfaces.d.ts new file mode 100644 index 0000000..5a466a1 --- /dev/null +++ b/public/Interfaces.d.ts @@ -0,0 +1,65 @@ +declare interface IHistoryState { + LastAction: string + MainContainer: IContainerModel + SelectedContainer: IContainerModel | null + SelectedContainerId: string + TypeCounters: Record +} + +declare interface IAvailableContainer { + Type: string + Width: number + Height: number + XPositionReference?: XPositionReference + Style: React.CSSProperties +} + +declare interface IEditorState { + history: IHistoryState[] + historyCurrentStep: number + configuration: IConfiguration +} + +declare interface IConfiguration { + AvailableContainers: IAvailableContainer[] + AvailableSymbols: IAvailableSymbol[] + MainContainer: IAvailableContainer +} + +declare interface IContainerModel { + children: IContainerModel[] + parent: IContainerModel | null + properties: IProperties + userData: Record +} + +declare interface IProperties extends React.CSSProperties { + id: string + parentId: string | null + x: number + y: number + isRigidBody: boolean + XPositionReference?: XPositionReference +} + +declare enum XPositionReference { + Left, + Center, + Right +} + +declare interface IAvailableSymbol { + Name: string + XPositionReference: XPositionReference + Image: IImage + Width: number + Height: number +} + +declare interface IImage { + Name: string + Url: string + Base64Image: string + Svg: string +} +