import StaticDatabox from "../StaticDatabox"; import Socket from '../../Socket'; import { StaticDbContentAPI, StaticDataboxContentCompatible } from '../../../main/databox/dbContentAPI'; export default class StaticDataboxContainer implements StaticDataboxContentCompatible { private readonly _databoxes; private readonly _count; constructor(databoxes: StaticDatabox[]); get databoxes(): StaticDatabox[]; /** * @description * The content API provides a typesafe and readable way to * update, delete, or insert new data in the databox. * It is also possible to do multiple cud operations in one bundle. * Don't forget to update your database before updating the databox. */ readonly content: StaticDbContentAPI; /** * The close function will close the Databox for every client on every server. * You optionally can provide a code or any other information for the client. * Usually, the close function is used when the data is completely deleted from the system. * For example, a chat that doesn't exist anymore. * @param code * @param metadata * @param forEveryServer * @return The returned promise is resolved when * the close is fully processed on the current server. */ close(code?: number | string, metadata?: any, forEveryServer?: boolean): Promise; /** * The reload function will force all connected * clients of the Databox to reload the data. * @param forEveryServer */ forceReload(forEveryServer?: boolean): void; /** * With this function, you can kick out a socket from the Databox. * This method is used internally. * @param socket * @param code * @param metadata */ kickOut(socket: Socket, code?: number | string, metadata?: any): void; /** * **Not override this method.** * Transmit a signal to all client Databoxes connected with this Databox. * The clients can listen to any received signal. * You also can send additional data with the signal. * @param signal * @param data * @param forEveryServer */ transmitSignal(signal: string, data?: any, forEveryServer?: boolean): void; }