UNPKG

@teambit/workspace

Version:
59 lines (56 loc) 1.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WorkspaceComponent = void 0; function _component() { const data = require("@teambit/component"); _component = function () { return data; }; return data; } // TODO: refactor this to a composition rather than to use inheritance class WorkspaceComponent extends _component().Component { constructor( /** * component ID represented by the `ComponentId` type. */ id, /** * head version of the component. can be `null` for new components. */ head = null, /** * state of the component. */ workspaceState, /** * tags of the component. */ tags = new (_component().TagMap)(), /** * workspace extension. */ workspace) { super(id, head, workspaceState, tags, workspace); this.id = id; this.head = head; this.tags = tags; this.workspace = workspace; } async getStatus() { return this.workspace.getComponentStatus(this); } /** * get all issues reported on the component. */ getIssues() { return this.workspace.getComponentIssues(this); } static fromComponent(component, workspace) { return new WorkspaceComponent(component.id, component.head, component.state, component.tags, workspace); } } exports.WorkspaceComponent = WorkspaceComponent; //# sourceMappingURL=workspace-component.js.map