@fluidframework/protocol-base Package

Packages > @fluidframework/protocol-base

Interfaces

Interface Description
ILocalSequencedClient
IProtocolHandler
IQuorumSnapshot Snapshot format for a Quorum
IScribeProtocolState

Classes

Class Description
AttachmentTreeEntry Basic implementation of an attachment ITreeEntry
BlobTreeEntry Basic implementation of a blob ITreeEntry
ProtocolOpHandler Handles protocol specific ops.
Quorum A quorum represents all clients currently within the collaboration window. As well as the values they have agreed upon and any pending proposals.
QuorumClients The QuorumClients is used to track members joining and leaving the collaboration session.
QuorumProposals The QuorumProposals holds a key/value store. Proposed values become finalized in the store once all connected clients have seen the proposal.
TreeTreeEntry Basic implementation of a tree ITreeEntry

Types

TypeAlias Description
QuorumClientsSnapshot Snapshot format for a QuorumClients
QuorumProposalsSnapshot Snapshot format for a QuorumProposals

Functions

Function Return Type Description
addBlobToTree void
buildHierarchy ISnapshotTreeEx Build a tree hierarchy base on a flat tree
generateServiceProtocolEntries ITreeEntry[]
getGitMode string Take a summary object and returns its git mode.
getGitType "blob" | "tree" Take a summary object and returns its type.
getQuorumTreeEntries ITreeEntry[]
isSystemMessage boolean
mergeAppAndProtocolTree ICreateTreeEntry[]

Variables

Variable Description
isServiceMessageType Check if the string is a service message type, which includes MessageType.ClientJoin, MessageType.ClientLeave, MessageType.Control, MessageType.NoClient, MessageType.SummaryAck, and MessageType.SummaryNack

Type Details

QuorumClientsSnapshot

Snapshot format for a QuorumClients

Signature

export declare type QuorumClientsSnapshot = [string, ISequencedClient][];

QuorumProposalsSnapshot

Snapshot format for a QuorumProposals

Signature

export declare type QuorumProposalsSnapshot = {
    proposals: [number, ISequencedProposal, string[]][];
    values: [string, ICommittedProposal][];
};

Function Details

addBlobToTree

Signature

export declare function addBlobToTree(tree: ITree, blobName: string, content: object): void;

Parameters

Parameter Type Description
tree ITree
blobName string
content object

buildHierarchy

Build a tree hierarchy base on a flat tree

Signature

export declare function buildHierarchy(flatTree: git.ITree, blobsShaToPathCache?: Map<string, string>, removeAppTreePrefix?: boolean): ISnapshotTreeEx;

Parameters

Parameter Modifiers Type Description
flatTree git.ITree a flat tree
blobsShaToPathCache optional Map Map with blobs sha as keys and values as path of the blob.
removeAppTreePrefix optional boolean Remove .app/ from beginning of paths when present

Returns

the hierarchical tree

Return type: ISnapshotTreeEx

generateServiceProtocolEntries

Signature

export declare function generateServiceProtocolEntries(deli: string, scribe: string): ITreeEntry[];

Parameters

Parameter Type Description
deli string
scribe string

Returns

Return type: ITreeEntry[]

getGitMode

Take a summary object and returns its git mode.

Signature

export declare function getGitMode(value: SummaryObject): string;

Parameters

Parameter Type Description
value SummaryObject summary object

Returns

the git mode of summary object

Return type: string

getGitType

Take a summary object and returns its type.

Signature

export declare function getGitType(value: SummaryObject): "blob" | "tree";

Parameters

Parameter Type Description
value SummaryObject summary object

Returns

the type of summary object

Return type: “blob” | “tree”

getQuorumTreeEntries

Signature

export declare function getQuorumTreeEntries(documentId: string, minimumSequenceNumber: number, sequenceNumber: number, term: number, quorumSnapshot: IQuorumSnapshot): ITreeEntry[];

Parameters

Parameter Type Description
documentId string
minimumSequenceNumber number
sequenceNumber number
term number
quorumSnapshot IQuorumSnapshot

Returns

Return type: ITreeEntry[]

isSystemMessage

Signature

export declare function isSystemMessage(message: ISequencedDocumentMessage): boolean;

Parameters

Parameter Type Description
message ISequencedDocumentMessage

Returns

Return type: boolean

mergeAppAndProtocolTree

Signature

export declare function mergeAppAndProtocolTree(appSummaryTree: ITree, protocolTree: ITree): ICreateTreeEntry[];

Parameters

Parameter Type Description
appSummaryTree ITree
protocolTree ITree

Returns

Return type: ICreateTreeEntry[]

Variable Details

isServiceMessageType

Check if the string is a service message type, which includes MessageType.ClientJoin, MessageType.ClientLeave, MessageType.Control, MessageType.NoClient, MessageType.SummaryAck, and MessageType.SummaryNack

Signature

isServiceMessageType: (type: string) => boolean