diff options
author | bobzel <zzzman@gmail.com> | 2024-08-13 15:14:05 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-08-13 15:14:05 -0400 |
commit | 4d45f8a046ce5300f0b046457a381d219eef3363 (patch) | |
tree | b4f1a2fcff857840e5b281b25729a8f378467ef6 /src/server/Message.ts | |
parent | 5c7964173d80752200727d8340825210c2704265 (diff) |
cleaning up database types
Diffstat (limited to 'src/server/Message.ts')
-rw-r--r-- | src/server/Message.ts | 66 |
1 files changed, 2 insertions, 64 deletions
diff --git a/src/server/Message.ts b/src/server/Message.ts index 03150c841..26b41539b 100644 --- a/src/server/Message.ts +++ b/src/server/Message.ts @@ -1,5 +1,6 @@ import * as uuid from 'uuid'; import { Point } from '../pen-gestures/ndollar'; +import { serverOpType } from '../fields/ObjectField'; function GenerateDeterministicGuid(seed: string): string { return uuid.v5(seed, uuid.v5.URL); @@ -22,52 +23,12 @@ export class Message<T> { } } -export enum Types { - Number, - List, - Key, - Image, - Web, - Document, - Text, - Icon, - RichText, - DocumentReference, - Html, - Video, - Audio, - Ink, - PDF, - Tuple, - Boolean, - Script, - Templates, -} - -export interface Transferable { - readonly id: string; - readonly type: Types; - readonly data?: any; -} - -export enum YoutubeQueryTypes { - Channels, - SearchVideo, - VideoDetails, -} - -export interface YoutubeQueryInput { - readonly type: YoutubeQueryTypes; - readonly userInput?: string; - readonly videoIds?: string; -} - export interface Reference { readonly id: string; } export interface Diff extends Reference { - readonly diff: any; + readonly diff: serverOpType; } export interface GestureContent { @@ -77,23 +38,6 @@ export interface GestureContent { readonly color?: string; } -export interface MobileInkOverlayContent { - readonly enableOverlay: boolean; - readonly width?: number; - readonly height?: number; - readonly text?: string; -} - -export interface UpdateMobileInkOverlayPositionContent { - readonly dx?: number; - readonly dy?: number; - readonly dsize?: number; -} - -export interface MobileDocumentUploadContent { - readonly docId: string; -} - export interface RoomMessage { readonly message: string; readonly room: string; @@ -102,17 +46,11 @@ export interface RoomMessage { export namespace MessageStore { export const Foo = new Message<string>('Foo'); export const Bar = new Message<string>('Bar'); - export const SetField = new Message<Transferable>('Set Field'); // send Transferable (no reply) - export const GetField = new Message<string>('Get Field'); // send string 'id' get Transferable back - export const GetFields = new Message<string[]>('Get Fields'); // send string[] of 'id' get Transferable[] back export const GetDocument = new Message<string>('Get Document'); export const DeleteAll = new Message<any>('Delete All'); export const ConnectionTerminated = new Message<string>('Connection Terminated'); export const GesturePoints = new Message<GestureContent>('Gesture Points'); - export const MobileInkOverlayTrigger = new Message<MobileInkOverlayContent>('Trigger Mobile Ink Overlay'); - export const UpdateMobileInkOverlayPosition = new Message<UpdateMobileInkOverlayPositionContent>('Update Mobile Ink Overlay Position'); - export const MobileDocumentUpload = new Message<MobileDocumentUploadContent>('Upload Document From Mobile'); export const GetRefField = new Message<string>('Get Ref Field'); export const GetRefFields = new Message<string[]>('Get Ref Fields'); |