Skip to main content
Version: v1

IDocumentService Interface

Signature

export interface IDocumentService

Properties

Property Modifiers Type Description
policies optional IDocumentServicePolicies Policies implemented/instructed by driver.
resolvedUrl IResolvedUrl

Methods

Method Return Type Description
connectToDeltaStorage() Promise<IDocumentDeltaStorageService> Access to delta storage associated with the document
connectToDeltaStream(client) Promise<IDocumentDeltaConnection> Subscribes to the document delta stream
connectToStorage() Promise<IDocumentStorageService> Access to storage associated with the document...
dispose(error) void Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed). Useful for storage to commit any pending state if any (including any local caching). Please note that it does not remove the need for caller to close all active delta connections, as storage may not be tracking such objects.

Property Details

policies

Policies implemented/instructed by driver.

Signature

policies?: IDocumentServicePolicies;

Type: IDocumentServicePolicies

resolvedUrl

Signature

resolvedUrl: IResolvedUrl;

Type: IResolvedUrl

Method Details

connectToDeltaStorage

Access to delta storage associated with the document

Signature

connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;

Returns

Return type: Promise<IDocumentDeltaStorageService>

connectToDeltaStream

Subscribes to the document delta stream

Signature

connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;

Parameters

Parameter Type Description
client IClient

Returns

Return type: Promise<IDocumentDeltaConnection>

connectToStorage

Access to storage associated with the document...

Signature

connectToStorage(): Promise<IDocumentStorageService>;

Returns

Return type: Promise<IDocumentStorageService>

dispose

Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed). Useful for storage to commit any pending state if any (including any local caching). Please note that it does not remove the need for caller to close all active delta connections, as storage may not be tracking such objects.

Signature

dispose(error?: any): void;

Parameters

Parameter Modifiers Type Description
error optional any tells if container (and storage) are closed due to critical error. Error might be due to disconnect between client & server knowlege about file, like file being overwritten in storage, but client having stale local cache. If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.