UNPKG

@oobleck/fluid-backend

Version:

Fluid Framework backend for nteract RTC

82 lines (81 loc) 2.39 kB
import { CellOutputDef, MetadataEntryDef, PeerLocationDef } from "./types"; export declare type CellSourceEdit = { __typename: "TextInserted"; id: string; diff: string; start: number; } | { __typename: "TextReplaced"; id: string; diff: string; start: number; len: number; } | { __typename: "TextDeleted"; id: string; start: number; len: number; }; interface ICellOrderEvent { id: string; sequenceNumber: number; } export interface ICellInsertedEvent extends ICellOrderEvent { __typename: "CellInsertedEvent"; pos: number; after?: string; before?: string; } export interface ICellRemovedEvent extends ICellOrderEvent { __typename: "CellRemovedEvent"; pos: number; } export interface ICellMovedEvent extends ICellOrderEvent { __typename: "CellMovedEvent"; from: number; to: number; } export interface ICellReplacedEvent extends ICellOrderEvent { __typename: "CellReplacedEvent"; replacedBy: string; pos: number; } declare type CellOrderEvent = ICellInsertedEvent | ICellRemovedEvent | ICellMovedEvent | ICellReplacedEvent; export interface INotebookMetadataEvent { __typename: "NotebookMetadataEvent"; entry: MetadataEntryDef; } export declare type NotebookEvent = INotebookMetadataEvent | CellOrderEvent; export interface ICellMetadataEvent { __typename: "CellMetadataEvent"; id: string; entry: MetadataEntryDef; } export interface IOutputAppendedEvent { __typename: "OutputAppendedEvent"; id: string; output: CellOutputDef; } export interface IOutputsClearedEvent { __typename: "OutputsClearedEvent"; id: string; } declare type CellOutputEvent = IOutputAppendedEvent | IOutputsClearedEvent; export declare type CellEvent = ICellMetadataEvent | CellOutputEvent; export interface IPeerConnectedEvent { __typename: "PeerConnectedEvent"; id: string; userId: string; userName: string; } export interface IPeerDisconnectedEvent { __typename: "PeerDisconnectedEvent"; id: string; } export interface IPeerLocationUpdatedEvent { __typename: "PeerLocationUpdatedEvent"; id: string; location?: PeerLocationDef; } export declare type PresenceEvent = IPeerConnectedEvent | IPeerDisconnectedEvent | IPeerLocationUpdatedEvent; export {};