Free and Open source Web Builder Framework. Next generation tool for building templates without coding
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

28 lines
753 B

import Backbone from "backbone";
import Model from "./Model";
import Module, { IBaseModule } from "./Module";
export default class View<
TModel extends Model = Model,
TElement extends Element = HTMLElement
> extends Backbone.View<TModel, TElement> {
protected get pfx() {
return (this.model.em.config as any).stylePrefix || "";
}
protected get ppfx() {
return this.pfx + this.config.stylePrefix || "";
}
protected get module(): TModel extends Model<infer M>? M: unknown {
return this.model.module as any;
}
protected get em() {
return this.model.em;
}
protected get config(): TModel extends Model<infer M> ? (M extends IBaseModule<infer C> ? C : unknown) : unknown{
return this.module.config as any
}
}