import { DomRenderFinalProxy } from '../types/Types'; export type ComponentSetConfig = {objPath?: string | null, beforeComponentSet?: ComponentSet}; export class ComponentSet { private _config: ComponentSetConfig; private _template?: string|((instance: T) => Promise); private _styles?: string[] | string|((instance: T) => Promise); constructor(public obj: T, source: {template?: string|((instance: T) => Promise), styles?: (string[]) | string|((instance: T) => Promise)}, config?: ComponentSetConfig) { this._template = source.template; this._styles = source.styles; this._config = DomRenderFinalProxy.final(Object.assign({objPath: 'obj'} as ComponentSetConfig, config)) } get template() { return this._template; } get styles() { return this._styles; } get config() { return this._config; } public setTemplateStyle(set: {template?: string, styles?: string | (string[])}) { this._template = set.template; this._styles = set.styles; } }