Implement events for external use + Rename interfaces with a I prefix + add some documentation (#26)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Implement events for external use Rename interfaces with a I prefix Add some documentation Co-authored-by: Eric NGUYEN <enguyen@techform.fr> Reviewed-on: https://git.siklos-chaneru.duckdns.org/Siklos/svg-layout-designer-react/pulls/26
This commit is contained in:
parent
6c601429b9
commit
c81a6fe44b
38 changed files with 228 additions and 116 deletions
65
public/Interfaces.d.ts
vendored
Normal file
65
public/Interfaces.d.ts
vendored
Normal file
|
@ -0,0 +1,65 @@
|
|||
declare interface IHistoryState {
|
||||
LastAction: string
|
||||
MainContainer: IContainerModel
|
||||
SelectedContainer: IContainerModel | null
|
||||
SelectedContainerId: string
|
||||
TypeCounters: Record<string, number>
|
||||
}
|
||||
|
||||
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<string, string | number>
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue