Skip to content 

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
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.
getRawUrl(blobId) Fetch blob Data url
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
read(id) Reads the object with the given ID
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

repositoryUrl

Signature:

repositoryUrl: string;

Methods

createBlob

Creates a blob out of the given buffer

Signature:

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

Parameters

List of parameters
Parameter Type Description
file Uint8Array

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>

getRawUrl

Fetch blob Data url

Signature:

getRawUrl(blobId: string): string;

Parameters

List of parameters
Parameter Type Description
blobId string

Returns:

string

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[]>

read

Reads the object with the given ID

Signature:

read(id: string): Promise<string>;

Parameters

List of parameters
Parameter Type Description
id string

Returns:

Promise<string>

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>