BasicElement.ts 770 B

1234567891011121314151617181920212223242526272829303132
  1. module INSPECTOR {
  2. /**
  3. * Represents a html div element.
  4. * The div is built when an instance of BasicElement is created.
  5. */
  6. export abstract class BasicElement {
  7. protected _div : HTMLElement;
  8. constructor() {
  9. this._div = Helpers.CreateDiv();
  10. }
  11. /**
  12. * Returns the div element
  13. */
  14. public toHtml() : HTMLElement {
  15. return this._div;
  16. }
  17. /**
  18. * Build the html element
  19. */
  20. protected _build(){};
  21. public abstract update(data?:any): void;
  22. /** Default dispose method if needed */
  23. public dispose() {};
  24. }
  25. }