Files
partey_workadventure/pusher/src/Model/Websocket/ExSocketInterface.ts
T
David Négrier 705c75e3c7 Adding wokalist type checking on front
Additionally, we are making superLoad.json accept a new "immediateCallback" parameter that resolves during the event handler (and not after)
2022-03-21 11:29:18 +01:00

43 lines
1.5 KiB
TypeScript

import { PointInterface } from "./PointInterface";
import { Identificable } from "./Identificable";
import { ViewportInterface } from "_Model/Websocket/ViewportMessage";
import {
BatchMessage,
CompanionMessage,
PusherToBackMessage,
ServerToClientMessage,
SubMessage,
} from "../../Messages/generated/messages_pb";
import { ClientDuplexStream } from "grpc";
import { Zone } from "_Model/Zone";
import { compressors } from "hyper-express";
import { WokaDetail } from "../../Messages/JsonMessages/PlayerTextures";
export type BackConnection = ClientDuplexStream<PusherToBackMessage, ServerToClientMessage>;
export interface ExSocketInterface extends compressors.WebSocket, Identificable {
token: string;
roomId: string;
//userId: number; // A temporary (autoincremented) identifier for this user
userUuid: string; // A unique identifier for this user
IPAddress: string; // IP address
name: string;
characterLayers: WokaDetail[];
position: PointInterface;
viewport: ViewportInterface;
companion?: CompanionMessage;
/**
* Pushes an event that will be sent in the next batch of events
*/
emitInBatch: (payload: SubMessage) => void;
batchedMessages: BatchMessage;
batchTimeout: NodeJS.Timeout | null;
disconnecting: boolean;
messages: unknown;
tags: string[];
visitCardUrl: string | null;
backConnection: BackConnection;
listenedZones: Set<Zone>;
userRoomToken: string | undefined;
}