IDocumentStorageService Interface

Packages > @fluidframework/driver-definitions > IDocumentStorageService

Interface to provide access to snapshots saved for a shared object

Signature:

export interface IDocumentStorageService 

Properties

List of properties of this interface
Property Type Description
policies IDocumentStorageServicePolicies Policies implemented/instructed by driver.
repositoryUrl string

Methods

List of methods of this class
Method Description
createBlob(file) Creates a blob out of the given buffer
downloadSummary(handle) Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the server has deleted it this call may result in a broken promise.
getSnapshotTree(version) Returns the snapshot tree.
getVersions(versionId, count) Retrieves all versions of the document starting at the specified versionId - or null if from the head
readBlob(id) Reads the object with the given ID, returns content in arrayBufferLike
uploadSummaryWithContext(summary, context) Uploads a summary tree to storage using the given context for reference of previous summary handle. The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are referencing from the previously acked summary. Returns the uploaded summary handle.
write(root, parents, message, ref) Writes to the object with the given ID

Events

policies

Policies implemented/instructed by driver.

Signature:

readonly policies?: IDocumentStorageServicePolicies;

repositoryUrl

Signature:

repositoryUrl: string;

Methods

createBlob

Creates a blob out of the given buffer

Signature:

createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;

Parameters

List of parameters
Parameter Type Description
file ArrayBufferLike

Returns:

Promise<ICreateBlobResponse>

downloadSummary

Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the server has deleted it this call may result in a broken promise.

Signature:

downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;

Parameters

List of parameters
Parameter Type Description
handle ISummaryHandle

Returns:

Promise<ISummaryTree>

getSnapshotTree

Returns the snapshot tree.

Signature:

getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;

Parameters

List of parameters
Parameter Type Description
version IVersion

Returns:

Promise<ISnapshotTree | null>

getVersions

Retrieves all versions of the document starting at the specified versionId - or null if from the head

Signature:

getVersions(versionId: string | null, count: number): Promise<IVersion[]>;

Parameters

List of parameters
Parameter Type Description
versionId string | null
count number

Returns:

Promise<IVersion[]>

readBlob

Reads the object with the given ID, returns content in arrayBufferLike

Signature:

readBlob(id: string): Promise<ArrayBufferLike>;

Parameters

List of parameters
Parameter Type Description
id string

Returns:

Promise<ArrayBufferLike>

uploadSummaryWithContext

Uploads a summary tree to storage using the given context for reference of previous summary handle. The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are referencing from the previously acked summary. Returns the uploaded summary handle.

Signature:

uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;

Parameters

List of parameters
Parameter Type Description
summary ISummaryTree
context ISummaryContext

Returns:

Promise<string>

write

Writes to the object with the given ID

Signature:

write(root: ITree, parents: string[], message: string, ref: string): Promise<IVersion>;

Parameters

List of parameters
Parameter Type Description
root ITree
parents string[]
message string
ref string

Returns:

Promise<IVersion>