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
26 lines
702 B
TypeScript
26 lines
702 B
TypeScript
import IProperties from './IProperties';
|
|
|
|
export interface IContainerModel {
|
|
children: IContainerModel[]
|
|
parent: IContainerModel | null
|
|
properties: IProperties
|
|
userData: Record<string, string | number>
|
|
}
|
|
|
|
export class ContainerModel implements IContainerModel {
|
|
public children: IContainerModel[];
|
|
public parent: IContainerModel | null;
|
|
public properties: IProperties;
|
|
public userData: Record<string, string | number>;
|
|
|
|
constructor(
|
|
parent: IContainerModel | null,
|
|
properties: IProperties,
|
|
children: IContainerModel[] = [],
|
|
userData = {}) {
|
|
this.parent = parent;
|
|
this.properties = properties;
|
|
this.children = children;
|
|
this.userData = userData;
|
|
}
|
|
};
|