@teambit/workspace
Version:
70 lines (69 loc) • 1.87 kB
TypeScript
import type { ComponentModelProps } from '@teambit/component';
import { ComponentID, ComponentModel } from '@teambit/component';
import { ComponentDescriptor } from '@teambit/component-descriptor';
import type { DeprecationInfo } from '@teambit/deprecation';
import type { Descriptor } from '@teambit/envs';
import type { ComponentStatus } from '../../workspace-component/component-status';
export type WorkspaceModelComponent = {
id: ComponentID;
status: ComponentStatus;
deprecation: DeprecationInfo;
env: Descriptor;
};
export type WorkspaceProps = {
name: string;
path: string;
components: (ComponentModelProps & {
aspects: Record<string, any>;
})[];
icon: string;
};
export declare class Workspace {
/**
* name of the workspace.
*/
readonly name: string;
/**
* absolute path of the workspace.
*/
readonly path: string;
/**
* icon of the workspace.
*/
readonly icon: string;
/**
* components container in the workspace.
*/
readonly components: ComponentModel[];
/**
* components contained in the workspace.
*/
readonly componentDescriptors: ComponentDescriptor[];
constructor(
/**
* name of the workspace.
*/
name: string,
/**
* absolute path of the workspace.
*/
path: string,
/**
* icon of the workspace.
*/
icon: string,
/**
* components container in the workspace.
*/
components: ComponentModel[],
/**
* components contained in the workspace.
*/
componentDescriptors: ComponentDescriptor[]);
/**
* return a component from the workspace.
*/
getComponent(id: ComponentID): ComponentModel | undefined;
static from({ name, path, components, icon }: WorkspaceProps): Workspace;
static empty(): Workspace;
}