mirror of https://github.com/artf/grapesjs.git
nocodeframeworkdrag-and-dropsite-buildersite-generatortemplate-builderui-builderweb-builderweb-builder-frameworkwebsite-builderno-codepage-builder
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.
32 lines
709 B
32 lines
709 B
import Backbone from 'backbone';
|
|
import Module, { IBaseModule } from './Module';
|
|
|
|
export default class Model<
|
|
TModule extends IBaseModule<any> = Module,
|
|
T extends Backbone.ObjectHash = any,
|
|
S = Backbone.ModelSetOptions,
|
|
E = any
|
|
> extends Backbone.Model<T, S, E> {
|
|
private _module: TModule;
|
|
|
|
constructor(
|
|
module: TModule,
|
|
attributes?: T,
|
|
options?: Backbone.CombinedModelConstructorOptions<E>
|
|
) {
|
|
super(attributes, options);
|
|
this._module = module;
|
|
}
|
|
|
|
public get module() {
|
|
return this._module;
|
|
}
|
|
|
|
public get config(): TModule extends IBaseModule<infer C> ? C : unknown {
|
|
return this._module.config;
|
|
}
|
|
|
|
protected get em() {
|
|
return this._module.em;
|
|
}
|
|
}
|
|
|