import { Plugin, ConfigLoader, RPCExporter } from "./Plugin"; import * as Knex from 'knex'; import { SubscriptionResponse, SuccessResponse, ErrorResponse } from "./Types"; import { socketioRPC } from "./RPC"; import { RepoFolderStatus } from './GitUpdater'; export interface EventBus { pushNotification(notification: Notification): Promise; subscribeNotifications(callback: (notification: Notification) => any): Promise; } export declare type NotificationSeverity = 'Info' | 'Important' | 'Error'; export declare type Notification = { ID?: number; severity: NotificationSeverity; topic: string; message: string; time?: number; }; declare type DbConf = ParentConfT & { dbConf: Knex.Config; eventBusConf: { [topic in string]: NotificationSeverity; }; }; export declare type TableDefiniton = { name: string; tableBuilder: (table: Knex.CreateTableBuilder) => void; }; export declare abstract class KnexBase extends ConfigLoader> implements EventBus { private notificiationSubscriptions; knex: Knex; exportRPCs(): socketioRPC[]; insert(table: string, data: any[], topic?: string, severity?: NotificationSeverity): Promise; subscribeNotifications(callback: any): Promise; getNotificationLog(): Promise; unsubscribeNotifications(uid: string): Promise; pushNotification(notification: Notification): Promise; protected makeKnex(conf: Knex.Config): Promise; setConfig(conf: DbConf): DbConf; setConfigKey(key: string, value: any): DbConf; protected initialize(): Promise; protected getTableDefinitions(): TableDefiniton[]; } declare type AdminBaseConf = { httpPort: number; } & ParentConf; export declare abstract class AdminBase extends KnexBase> { private runningPlugins; private express; private httpServer; private io; private wsServer; private publicIo; private publicWsServer; private pluginUpdaters; constructor(runningPlugins: Plugin[]); exportRPCs(): socketioRPC[]; protected initialize(): Promise; protected destroy(): void; private startWebserver; private stopWebserver; private startWebsocket; private startPublicWebsocket; protected initApis(socket: any, rpcExporters?: RPCExporter[]): void; protected initPublicApis(socket: any): void; private selfUpdate; installPlugin(name: string, force?: boolean): Promise; startPlugin(name: string): Promise; updatePlugin(name: string): Promise; setPluginVersion(pluginName: string, tag: string): Promise; addPlugin(plugin: Plugin): void; removePlugin(plugin: Plugin): void; getPlugins(): Plugin[]; getTableDefinitions(): TableDefiniton[]; } export {};