Added back Remote Cursors
This commit is contained in:
@@ -22,6 +22,19 @@ export interface CanvasUpdate {
|
||||
pixels: Pixel[];
|
||||
}
|
||||
|
||||
export interface PaintRequest {
|
||||
pixels: Pixel[];
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export interface PaintAck {
|
||||
success: boolean;
|
||||
saved: number;
|
||||
conflicts: number;
|
||||
pixels?: Pixel[];
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface LoginRequest {
|
||||
username: string;
|
||||
password: string;
|
||||
@@ -40,9 +53,15 @@ export interface AuthResponse {
|
||||
export interface SocketEvents {
|
||||
'join-canvas': (token: string) => void;
|
||||
'cursor-move': (cursor: Cursor) => void;
|
||||
'paint-pixels': (pixels: Pixel[]) => void;
|
||||
'paint-pixels': (request: PaintRequest, callback: (ack: PaintAck) => void) => void;
|
||||
'canvas-update': (update: CanvasUpdate) => void;
|
||||
'cursor-update': (cursors: Cursor[]) => void;
|
||||
'canvas-state': (pixels: Pixel[]) => void;
|
||||
'error': (message: string) => void;
|
||||
}
|
||||
|
||||
export interface PendingPixel {
|
||||
pixel: Pixel;
|
||||
timestamp: number;
|
||||
retries: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user