UNPKG

uyem

Version:
45 lines 1.81 kB
/****************************************************************************************** * Repository: https://github.com/kolserdav/werift-sfu-react.git * File name: ws.ts * Author: Sergey Kolmiller * Email: <uyem.ru@gmail.com> * License: MIT * License text: See in LICENSE file * Copyright: kolserdav, All rights reserved (c) * Create Date: Wed Aug 24 2022 14:14:09 GMT+0700 (Krasnoyarsk Standard Time) ******************************************************************************************/ import { Server, WebSocket, ServerOptions } from 'ws'; import { WSInterface, UserItem, LocaleValue } from '../types/interfaces'; import DB from './db'; declare class WS extends DB implements WSInterface { connection: Server<WebSocket>; sockets: Record<string, WebSocket>; readonly delimiter = "_"; users: Record<number | string, UserItem>; rooms: Record<number | string, string>; private http; WebSocket: typeof import("ws"); constructor(connectionArgs: ServerOptions & { cloudPath: string; prisma: DB['prisma']; }); setSocket({ id: _id, ws, connId, isRoom, userName, locale, }: { id: number | string; ws: WebSocket; connId: string; isRoom: boolean; locale: LocaleValue; userName: string; }): Promise<void>; getSocketId(id: string | number, connId: string): string; findSocketId(id: string): string | null; createConnection: (args: ServerOptions | undefined) => Server<WebSocket>; parseMessage: WSInterface['parseMessage']; getMessage: WSInterface['getMessage']; getLocale({ userId }: { userId: string | number; }): import("../types/interfaces").Locale.Server; sendMessage: WSInterface['sendMessage']; } export default WS; //# sourceMappingURL=ws.d.ts.map