websetup/ts/websetup.classes.websetup.ts

45 lines
1.1 KiB
TypeScript
Raw Permalink Normal View History

2020-11-04 18:01:04 +00:00
import * as plugins from './websetup.plugins';
import * as interfaces from './interfaces';
import { TagManager } from './websetup.classes.tagmanager';
import { TagLevel } from './websetup.classes.taglevel';
export interface IWebSetupConstructorOptions {
metaObject: interfaces.IMetaObject;
}
/**
* the main WebSetup class
*/
export class WebSetup {
public tagManager: TagManager = new TagManager();
public options: IWebSetupConstructorOptions;
private readyDeferred = plugins.smartpromise.defer();
public readyPromise = this.readyDeferred.promise;
constructor(optionsArg: IWebSetupConstructorOptions) {
this.options = optionsArg;
2020-11-04 18:09:07 +00:00
this.setup().then(() => {
this.readyDeferred.resolve();
});
2020-11-04 18:01:04 +00:00
}
/**
* an async setup called by the constructor
*/
private async setup() {
await this.tagManager.setup(this.options.metaObject);
}
/**
* reverts the active level and returns to the base level
*/
public revertToBaseLevel() {
this.tagManager.revertToBaseLevel();
}
/**
* sets a subpage
* @param metaObject
*/
2020-11-04 18:09:07 +00:00
public setSubLevel(metaObject: interfaces.IMetaObject) {}
2020-11-04 18:01:04 +00:00
}