@roots/bud-server
Version:
Development server for @roots/bud
91 lines (90 loc) • 2.21 kB
TypeScript
import type { Server as BudServer } from '@roots/bud-framework';
import type { Bud } from '@roots/bud-framework';
import type { Connection, Middleware, Watcher } from '@roots/bud-framework/services/server';
import { Service } from '@roots/bud-framework/service';
import { BudError } from '@roots/bud-support/errors';
/**
* {@link BudServer}
*/
export declare class Server extends Service implements BudServer {
/**
* {@link BudServer.application}
*/
application: {
set: any;
use: any;
} & Express.Application;
/**
* {@link BudServer.availableMiddleware}
*/
availableMiddleware: Record<string, string>;
/**
* {@link BudServer.connection}
*/
connection: Connection;
/**
* {@link BudServer.watcher}
*/
watcher: Watcher;
/**
* {@link BudServer.appliedMiddleware}
*/
appliedMiddleware: Partial<Record<keyof Middleware.Available, any>>;
/**
* {@link BudServer.proxyUrl}
* @readonly
*/
get proxyUrl(): URL;
/**
* {@link BudServer.publicProxyUrl}
* @readonly
*/
get publicProxyUrl(): URL;
/**
* {@link BudServer.publicUrl}
* @readonly
*/
get publicUrl(): URL;
/**
* {@link BudServer.url}
* @readonly
*/
get url(): URL;
/**
* {@link BudServer.applyMiddleware}
*/
applyMiddleware(): Promise<void>;
/**
* {@link Contract.catch}
*/
catch(error: BudError | string): never;
/**
* {@link BudServer.compilerBefore}
*/
compilerBefore?(bud: Bud): Promise<void>;
/**
* {@link BudServer.enabledMiddleware}
* @readonly
*/
get enabledMiddleware(): BudServer['enabledMiddleware'];
/**
* {@link BudServer.injectScripts}
*/
injectScripts(): Promise<void>;
/**
* {@link BudServer.register}
*/
register?(bud: Bud): Promise<void>;
/**
* {@link BudServer.run}
*/
run(): Promise<void>;
/**
* {@link BudServer.serverBefore}
*/
serverBefore?(bud: Bud): Promise<void>;
/**
* {@link BudServer.setConnection}
*/
setConnection(connection?: Connection): Promise<Connection>;
}