Created
February 27, 2021 13:09
-
-
Save phedkvist/2ac29ac5cee8e20d95c022f87f74e4a0 to your computer and use it in GitHub Desktop.
crdt-woot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface Site { | |
siteId: string; // unique id for each site | |
clock: number; | |
sequence: Char[]; | |
operationPool: Char[]; | |
} | |
export interface Char { | |
id: string; | |
charId: CharId; | |
value: string; | |
visible: boolean; | |
prevId: string; | |
nextId: string; | |
} | |
export interface CharId { | |
siteId: string; | |
clock: number; | |
} | |
export enum Operation { | |
Insert = 'insert', | |
Delete = 'delete', | |
} | |
export interface Payload { | |
char: Char; | |
operation: Operation; | |
id: string; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment