@bitzonegaming/roleplay-engine-framework
Version:
Roleplay Engine Framework
36 lines (35 loc) • 997 B
TypeScript
import 'reflect-metadata';
import { FastifyInstance } from 'fastify';
import { RPServerContext } from '../core/context';
import { ApiControllerCtor, ApiServerConfig } from './types';
/**
* API Server that manages HTTP endpoints using Fastify and decorators
*/
export declare class ApiServer<C = RPServerContext> {
private readonly fastify;
private readonly controllers;
private readonly context;
private readonly config;
private readonly logger;
constructor(context: C, config: ApiServerConfig);
/**
* Registers a controller with the API server
*/
registerController(ControllerCtor: ApiControllerCtor<C>): this;
/**
* Starts the API server
*/
start(): Promise<void>;
/**
* Stops the API server
*/
stop(): Promise<void>;
/**
* Gets the Fastify instance (for advanced configuration)
*/
getFastify(): FastifyInstance;
/**
* Joins paths ensuring proper slashes
*/
private joinPaths;
}