Browse Source

Fix StyleManager.addProperty TS. Closes #5135

pull/5649/head
Artur Arseniev 3 years ago
parent
commit
bfeb9f63ec
  1. 7
      src/style_manager/index.ts

7
src/style_manager/index.ts

@ -79,6 +79,11 @@ import Component from '../dom_components/model/Component';
import CssRule from '../css_composer/model/CssRule';
import StyleableModel from '../domain_abstract/model/StyleableModel';
import { CustomPropertyView } from './view/PropertyView';
import { PropertySelectProps } from './model/PropertySelect';
import { PropertyNumberProps } from './model/PropertyNumber';
import { PropertyStackProps } from './model/PropertyStack';
export type PropertyTypes = PropertyStackProps | PropertySelectProps | PropertyNumberProps;
export type StyleManagerEvent =
| 'style:sector:add'
@ -301,7 +306,7 @@ export default class StyleManager extends ItemManagerModule<
* ],
* }, { at: 0 });
*/
addProperty(sectorId: string, property: PropertyProps, opts: AddOptions = {}): Property | undefined {
addProperty(sectorId: string, property: PropertyTypes, opts: AddOptions = {}): Property | undefined {
const sector = this.getSector(sectorId, { warn: true });
let prop = null;
if (sector) prop = sector.addProperty(property, opts);

Loading…
Cancel
Save