From 2a313f28fcb8675223708b0657de7517a3281095 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 17 Apr 2024 12:27:21 -0400 Subject: restoring eslint - updates not complete yet --- src/server/Message.ts | 91 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 59 insertions(+), 32 deletions(-) (limited to 'src/server/Message.ts') diff --git a/src/server/Message.ts b/src/server/Message.ts index 8f0af08bc..03150c841 100644 --- a/src/server/Message.ts +++ b/src/server/Message.ts @@ -1,22 +1,47 @@ -import { Point } from "../pen-gestures/ndollar"; -import { Utils } from "../Utils"; +import * as uuid from 'uuid'; +import { Point } from '../pen-gestures/ndollar'; +function GenerateDeterministicGuid(seed: string): string { + return uuid.v5(seed, uuid.v5.URL); +} +// eslint-disable-next-line @typescript-eslint/no-unused-vars export class Message { private _name: string; private _guid: string; constructor(name: string) { this._name = name; - this._guid = Utils.GenerateDeterministicGuid(name); + this._guid = GenerateDeterministicGuid(name); } - get Name(): string { return this._name; } - get Message(): string { return this._guid; } + get Name(): string { + return this._name; + } + get Message(): string { + return this._guid; + } } export enum Types { - Number, List, Key, Image, Web, Document, Text, Icon, RichText, DocumentReference, - Html, Video, Audio, Ink, PDF, Tuple, Boolean, Script, Templates + Number, + List, + Key, + Image, + Web, + Document, + Text, + Icon, + RichText, + DocumentReference, + Html, + Video, + Audio, + Ink, + PDF, + Tuple, + Boolean, + Script, + Templates, } export interface Transferable { @@ -26,7 +51,9 @@ export interface Transferable { } export enum YoutubeQueryTypes { - Channels, SearchVideo, VideoDetails + Channels, + SearchVideo, + VideoDetails, } export interface YoutubeQueryInput { @@ -45,7 +72,7 @@ export interface Diff extends Reference { export interface GestureContent { readonly points: Array; - readonly bounds: { right: number, left: number, bottom: number, top: number, width: number, height: number }; + readonly bounds: { right: number; left: number; bottom: number; top: number; width: number; height: number }; readonly width?: string; readonly color?: string; } @@ -73,27 +100,27 @@ export interface RoomMessage { } export namespace MessageStore { - export const Foo = new Message("Foo"); - export const Bar = new Message("Bar"); - export const SetField = new Message("Set Field"); // send Transferable (no reply) - export const GetField = new Message("Get Field"); // send string 'id' get Transferable back - export const GetFields = new Message("Get Fields"); // send string[] of 'id' get Transferable[] back - export const GetDocument = new Message("Get Document"); - export const DeleteAll = new Message("Delete All"); - export const ConnectionTerminated = new Message("Connection Terminated"); - - export const GesturePoints = new Message("Gesture Points"); - export const MobileInkOverlayTrigger = new Message("Trigger Mobile Ink Overlay"); - export const UpdateMobileInkOverlayPosition = new Message("Update Mobile Ink Overlay Position"); - export const MobileDocumentUpload = new Message("Upload Document From Mobile"); - - export const GetRefField = new Message("Get Ref Field"); - export const GetRefFields = new Message("Get Ref Fields"); - export const UpdateField = new Message("Update Ref Field"); - export const CreateField = new Message("Create Ref Field"); - export const YoutubeApiQuery = new Message("Youtube Api Query"); - export const DeleteField = new Message("Delete field"); - export const DeleteFields = new Message("Delete fields"); - - export const UpdateStats = new Message("updatestats"); + export const Foo = new Message('Foo'); + export const Bar = new Message('Bar'); + export const SetField = new Message('Set Field'); // send Transferable (no reply) + export const GetField = new Message('Get Field'); // send string 'id' get Transferable back + export const GetFields = new Message('Get Fields'); // send string[] of 'id' get Transferable[] back + export const GetDocument = new Message('Get Document'); + export const DeleteAll = new Message('Delete All'); + export const ConnectionTerminated = new Message('Connection Terminated'); + + export const GesturePoints = new Message('Gesture Points'); + export const MobileInkOverlayTrigger = new Message('Trigger Mobile Ink Overlay'); + export const UpdateMobileInkOverlayPosition = new Message('Update Mobile Ink Overlay Position'); + export const MobileDocumentUpload = new Message('Upload Document From Mobile'); + + export const GetRefField = new Message('Get Ref Field'); + export const GetRefFields = new Message('Get Ref Fields'); + export const UpdateField = new Message('Update Ref Field'); + export const CreateField = new Message('Create Ref Field'); + export const YoutubeApiQuery = new Message('Youtube Api Query'); + export const DeleteField = new Message('Delete field'); + export const DeleteFields = new Message('Delete fields'); + + export const UpdateStats = new Message('updatestats'); } -- cgit v1.2.3-70-g09d2