diff --git a/src/style_manager/model/Sectors.js b/src/style_manager/model/Sectors.ts similarity index 53% rename from src/style_manager/model/Sectors.js rename to src/style_manager/model/Sectors.ts index a26057b40..bd8d904f4 100644 --- a/src/style_manager/model/Sectors.js +++ b/src/style_manager/model/Sectors.ts @@ -1,21 +1,28 @@ import { Collection } from '../../common'; +import EditorModel from '../../editor/model/Editor'; import Sector from './Sector'; -export default class Sectors extends Collection { - initialize(prop, opts = {}) { +export default class Sectors extends Collection { + em!: EditorModel; + module!: any; + + initialize(prop: any, opts: { em?: EditorModel; module?: any } = {}) { const { module, em } = opts; - this.em = em; + this.em = em!; this.module = module; this.listenTo(this, 'reset', this.onReset); } + // @ts-ignore model(props, opts = {}) { + // @ts-ignore const { em } = opts.collection; return new Sector(props, { ...opts, em }); } - onReset(models, opts = {}) { + onReset(models: any, opts: { previousModels?: Sector[] } = {}) { const prev = opts.previousModels || []; + // @ts-ignore prev.forEach(sect => sect.get('properties').reset()); } }