diff --git a/src/api/ApiManager.ts b/src/api/ApiManager.ts new file mode 100644 index 0000000..c1b8aec --- /dev/null +++ b/src/api/ApiManager.ts @@ -0,0 +1,12 @@ +import BaseApi from './BaseApi.ts' +import HttpServerLike from '../types/HttpServerLike.ts' + +export default class ApiManager { + declare httpServer: HttpServerLike + static init(httpServer: HttpServerLike) { + this.httpServer = httpServer + } + static getHttpServer() { + return this.httpServer + } +} diff --git a/src/api/BaseApi.ts b/src/api/BaseApi.ts new file mode 100644 index 0000000..4ec0e15 --- /dev/null +++ b/src/api/BaseApi.ts @@ -0,0 +1,12 @@ +import UnknownFunction from '../types/UnknownFunction.ts' + +export default abstract class BaseApi { + abstract getName(): string + constructor() { + this.init() + } + abstract init(): void + registerEvent(name: string, func: UnknownFunction) { + + } +}