Skip to main content

LocalDocumentServiceFactory Class

Implementation of document service factory for local use.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/local-driver/legacy.

For more information about our API support guarantees, see here.

Signature

export declare class LocalDocumentServiceFactory implements IDocumentServiceFactory

Implements: IDocumentServiceFactory

Constructors

ConstructorAlertsDescription
(constructor)(localDeltaConnectionServer, policies, innerDocumentService)BetaConstructs a new instance of the LocalDocumentServiceFactory class

Properties

PropertyAlertsModifiersTypeDescription
ILayerCompatDetailsBetaoptional, readonlyunknownThe compatibility details of the Local Driver layer that is exposed to the Loader layer for validating Loader-Driver compatibility.

Methods

MethodAlertsReturn TypeDescription
createContainer(createNewSummary, resolvedUrl, logger, clientIsSummarizer)BetaPromise<IDocumentService>
createDocumentService(resolvedUrl, logger, clientIsSummarizer)BetaPromise<IDocumentService>Creates and returns a document service for testing using the given resolved URL for the tenant ID, document ID, and token.
disconnectClient(clientId, disconnectReason)BetavoidGets the document delta connection for the clientId and asks it to disconnect the client.
nackClient(clientId, code, type, message)BetavoidGets the document delta connection for the clientId and asks it to nack the client.

Constructor Details

(constructor)

Constructs a new instance of the LocalDocumentServiceFactory class

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

constructor(localDeltaConnectionServer: ILocalDeltaConnectionServer, policies?: IDocumentServicePolicies | undefined, innerDocumentService?: IDocumentService | undefined);

Parameters

ParameterModifiersTypeDescription
localDeltaConnectionServerILocalDeltaConnectionServerdelta connection server for ops
policiesoptionalIDocumentServicePolicies | undefined
innerDocumentServiceoptionalIDocumentService | undefined

Property Details

ILayerCompatDetails

The compatibility details of the Local Driver layer that is exposed to the Loader layer for validating Loader-Driver compatibility.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

readonly ILayerCompatDetails?: unknown;

Type: unknown

Remarks

This is for internal use only. The type of this should be ILayerCompatDetails. However, ILayerCompatDetails is internal and this class is currently marked as legacy alpha. So, using unknown here.

Method Details

createContainer

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

createContainer(createNewSummary: ISummaryTree | undefined, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;

Parameters

ParameterModifiersTypeDescription
createNewSummaryISummaryTree | undefined
resolvedUrlIResolvedUrl
loggeroptionalITelemetryBaseLogger
clientIsSummarizeroptionalboolean

Returns

Return type: Promise<IDocumentService>

createDocumentService

Creates and returns a document service for testing using the given resolved URL for the tenant ID, document ID, and token.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;

Parameters

ParameterModifiersTypeDescription
resolvedUrlIResolvedUrlresolved URL of document
loggeroptionalITelemetryBaseLogger
clientIsSummarizeroptionalboolean

Returns

Return type: Promise<IDocumentService>

disconnectClient

Gets the document delta connection for the clientId and asks it to disconnect the client.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

disconnectClient(clientId: string, disconnectReason: string): void;

Parameters

ParameterTypeDescription
clientIdstringThe ID of the client to be disconnected.
disconnectReasonstringThe reason of the disconnection.

nackClient

Gets the document delta connection for the clientId and asks it to nack the client.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

nackClient(clientId: string, code?: number, type?: NackErrorType, message?: any): void;

Parameters

ParameterModifiersTypeDescription
clientIdstringThe ID of the client to be Nack'd.
codeoptionalnumberAn error code number that represents the error. It will be a valid HTTP error code.
typeoptionalNackErrorTypeType of the Nack.
messageoptionalanyA message about the nack for debugging/logging/telemetry purposes.