@vscubing/cubing
Version:
A collection of JavaScript cubing libraries.
57 lines (52 loc) • 1.99 kB
TypeScript
import '../PuzzleLoader-lDTuf9C3.js';
import { A as AlgLeafEvent, O as OrientationEvent } from '../bluetooth-puzzle-Dgnw9moX.js';
import 'three/src/Three.js';
interface ProxyMoveEvent {
event: "move";
data: AlgLeafEvent;
}
interface ProxyOrientationEvent {
event: "orientation";
data: OrientationEvent;
}
interface ProxyResetEvent {
event: "reset";
}
type ProxyEvent = ProxyMoveEvent | ProxyOrientationEvent | ProxyResetEvent;
declare class TwizzleStream extends EventTarget {
socket: WebSocket;
constructor(url: string);
onMessage(msg: MessageEvent): void;
}
type StreamsField = {
streamID: string;
senders: {
name: string;
twizzleUserID: string;
wcaID: string | null;
}[];
}[];
declare class TwizzleStreamServer {
streams(): Promise<StreamsField>;
connect(streamID: string): TwizzleStream;
}
declare class WebSocketProxySender {
protected websocket: WebSocket;
constructor(url: string);
sendMoveEvent(e: AlgLeafEvent): void;
sendOrientationEvent(e: OrientationEvent): void;
sendResetEvent(): void;
protected sendProxyEvent(proxyEvent: ProxyEvent): void;
protected onopen(): void;
protected onerror(error: any): void;
protected onmessage(_e: MessageEvent): void;
}
declare abstract class WebSocketProxyReceiver {
protected websocket?: WebSocket;
constructor(url: string, socketOrigin?: string);
protected onopen(): void;
protected onerror(error: any): void;
protected onmessage(e: MessageEvent): void;
abstract onProxyEvent(e: ProxyEvent): void;
}
export { type ProxyEvent as ExperimentalProxyEvent, type ProxyMoveEvent as ExperimentalProxyMoveEvent, type ProxyOrientationEvent as ExperimentalProxyOrientationEvent, type ProxyResetEvent as ExperimentalProxyResetEvent, TwizzleStreamServer as ExperimentalTwizzleStreamServer, WebSocketProxyReceiver as ExperimentalWebSocketProxyReceiver, WebSocketProxySender as ExperimentalWebSocketProxySender };