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

Constructor Alerts Description
(constructor)(localDeltaConnectionServer, policies, innerDocumentService) Beta Constructs a new instance of the LocalDocumentServiceFactory class

Properties

Property Alerts Modifiers Type Description
ILayerCompatDetails Beta optional, readonly unknown The compatibility details of the Local Driver layer that is exposed to the Loader layer for validating Loader-Driver compatibility.

Methods

Method Alerts Return Type Description
createContainer(createNewSummary, resolvedUrl, logger, clientIsSummarizer) Beta Promise<IDocumentService>
createDocumentService(resolvedUrl, logger, clientIsSummarizer) Beta Promise<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) Beta void Gets the document delta connection for the clientId and asks it to disconnect the client.
nackClient(clientId, code, type, message) Beta void Gets 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

Parameter Modifiers Type Description
localDeltaConnectionServer ILocalDeltaConnectionServer delta connection server for ops
policies optional IDocumentServicePolicies | undefined
innerDocumentService optional IDocumentService | 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

Parameter Modifiers Type Description
createNewSummary ISummaryTree | undefined
resolvedUrl IResolvedUrl
logger optional ITelemetryBaseLogger
clientIsSummarizer optional boolean

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

Parameter Modifiers Type Description
resolvedUrl IResolvedUrl resolved URL of document
logger optional ITelemetryBaseLogger
clientIsSummarizer optional boolean

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

Parameter Type Description
clientId string The ID of the client to be disconnected.
disconnectReason string The 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

Parameter Modifiers Type Description
clientId string The ID of the client to be Nack'd.
code optional number An error code number that represents the error. It will be a valid HTTP error code.
type optional NackErrorType Type of the Nack.
message optional any A message about the nack for debugging/logging/telemetry purposes.