fixup ts errors

This commit is contained in:
Spencer Pogorzelski 2023-08-14 13:59:27 -07:00
parent e94cb17857
commit 8d8e5bbf2e

View file

@ -6,8 +6,8 @@ import {
HTTPResponsePayload, HTTPResponsePayload,
S2CRequestType, S2CRequestType,
S2CRequestTypes, S2CRequestTypes,
S2CWSClosePayload,
Transport, Transport,
WSClosePayload,
} from "protocol"; } from "protocol";
type OpenWSMeta = { type OpenWSMeta = {
@ -96,7 +96,7 @@ export class Connection {
case S2CRequestTypes.WSClose: { case S2CRequestTypes.WSClose: {
const socketMeta = this.openSockets[requestID]; const socketMeta = this.openSockets[requestID];
if (!socketMeta) return; if (!socketMeta) return;
const payload: S2CWSClosePayload = JSON.parse( const payload: WSClosePayload = JSON.parse(
new TextDecoder().decode(data.slice(cursor)) new TextDecoder().decode(data.slice(cursor))
); );
socketMeta.onclose( socketMeta.onclose(