Skip to main content
Version: v1

IDocumentService Interface

Signature

export interface IDocumentService

Properties

PropertyModifiersTypeDescription
policiesoptionalIDocumentServicePoliciesPolicies implemented/instructed by driver.
resolvedUrlIResolvedUrl

Methods

MethodReturn TypeDescription
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)voidDispose 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

ParameterTypeDescription
clientIClient

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

ParameterModifiersTypeDescription
erroroptionalanytells 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.