Remove usage of ContainerModel rather than IContainerModel

This commit is contained in:
Eric NGUYEN 2022-11-08 10:25:08 +01:00
parent 1116185b9f
commit a8723ffd27
6 changed files with 23 additions and 25 deletions

View file

@ -1,5 +1,5 @@
import { IHistoryState } from '../../../Interfaces/IHistoryState';
import { ContainerModel, IContainerModel } from '../../../Interfaces/IContainerModel';
import { IContainerModel } from '../../../Interfaces/IContainerModel';
import { FindContainerById, MakeDFSIterator } from '../../../utils/itertools';
import { GetCurrentHistory } from '../Editor';
import { ApplyBehaviors, ApplyBehaviorsOnSiblings, ApplyBehaviorsOnSiblingsChildren } from '../Behaviors/Behaviors';
@ -176,7 +176,7 @@ export function OnPropertyChange(
}
const containers = structuredClone(current.containers);
const container: ContainerModel | undefined = FindContainerById(containers, selected.properties.id);
const container: IContainerModel | undefined = FindContainerById(containers, selected.properties.id);
if (container === null || container === undefined) {
throw new Error('[OnPropertyChange] Container model was not found among children of the main container!');
@ -270,7 +270,7 @@ export function SortChildren(
*/
function SetContainer(
containers: Map<string, IContainerModel>,
container: ContainerModel,
container: IContainerModel,
key: string, value: string | number | boolean | number[],
type: PropertyType,
symbols: Map<string, ISymbolModel>
@ -310,7 +310,7 @@ function SetContainer(
* @param value Value of the property
* @param type Type of the property
*/
function AssignProperty(container: ContainerModel, key: string, value: string | number | boolean | number[], type: PropertyType): void {
function AssignProperty(container: IContainerModel, key: string, value: string | number | boolean | number[], type: PropertyType): void {
switch (type) {
case PropertyType.Style:
(container.properties.style as any)[key] = value;