🎨 rewrite imports

This commit is contained in:
Flam3rboy
2021-09-20 23:34:54 +02:00
parent 16a3d1b334
commit 912d1c31d8
26 changed files with 2636 additions and 398 deletions
+2 -4
View File
@@ -2,9 +2,7 @@ var erlpack: any;
try {
erlpack = require("erlpack");
} catch (error) {}
import { Payload } from "@fosscord/gateway/util/Constants";
import WebSocket from "./WebSocket";
import { Payload, WebSocket } from "@fosscord/gateway";
export async function Send(socket: WebSocket, data: Payload) {
let buffer: Buffer | string;
@@ -20,7 +18,7 @@ export async function Send(socket: WebSocket, data: Payload) {
}
return new Promise((res, rej) => {
socket.send(buffer, (err) => {
socket.send(buffer, (err: any) => {
if (err) return rej(err);
return res(null);
});
+1 -3
View File
@@ -3,7 +3,7 @@ import WS from "ws";
import { Deflate } from "zlib";
import { Channel } from "amqplib";
interface WebSocket extends WS {
export interface WebSocket extends WS {
version: number;
user_id: string;
session_id: string;
@@ -19,5 +19,3 @@ interface WebSocket extends WS {
permissions: Record<string, Permissions>;
events: Record<string, Function>;
}
export default WebSocket;
+1 -1
View File
@@ -1,5 +1,5 @@
import { CLOSECODES } from "./Constants";
import WebSocket from "./WebSocket";
import { WebSocket } from "./WebSocket";
// TODO: make heartbeat timeout configurable
export function setHeartbeat(socket: WebSocket) {