UNPKG

@teambit/bundler

Version:
63 lines (62 loc) 1.72 kB
import type { Component } from '@teambit/component'; import type { ExecutionContext } from '@teambit/envs'; import type { PubsubMain } from '@teambit/pubsub'; import type { Server } from 'http'; import type { DevServer } from './dev-server'; export declare class ComponentServer { /** * browser runtime slot */ private pubsub; /** * components contained in the existing component server. */ readonly context: ExecutionContext; /** * port range of the component server. */ readonly portRange: number[]; /** * env dev server. */ readonly devServer: DevServer; errors?: Error[]; constructor( /** * browser runtime slot */ pubsub: PubsubMain, /** * components contained in the existing component server. */ context: ExecutionContext, /** * port range of the component server. */ portRange: number[], /** * env dev server. */ devServer: DevServer); hostname: string | undefined; private _server?; private _isRestarting; get server(): Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse> | undefined; get envId(): string; /** * determine whether component server contains a component. */ hasComponent(component: Component): Component | undefined; get port(): number; _port: number; listen(specificPort?: number): Promise<void>; close(): Promise<void>; restart(useNewPort?: boolean): Promise<void>; private getHostname; private onChange; private createComponentsServerStartedEvent; /** * get the url of the component server. */ get url(): string; }