Skip to main content

@fluidframework/local-driver Package

Interfaces​

InterfaceAlertsModifiersDescription
EphemeralServiceAlphasealedAn in-memory Fluid service that can produce connected EphemeralServiceClients.
EphemeralServiceClientAlphasealedA ServiceClient connected to a specific EphemeralService.

Classes​

ClassAlertsDescription
LocalDocumentServiceFactoryLegacyImplementation of document service factory for local use.
LocalResolverLegacyResolves URLs by providing fake URLs which succeed with the other related local classes.

Functions​

FunctionAlertsReturn TypeDescription
cleanupEphemeralService(service)AlphaPromise<void>Cleans up the service passed in startEphemeralService(isDefault), or the default if none is passed.
createLocalResolverCreateNewRequest(documentId)LegacyIRequestCreates an IRequest for creating a new document with the local resolver.
getDefaultEphemeralService()AlphaEphemeralServiceGet the default EphemeralService if one has been started.
startEphemeralService(isDefault)AlphaEphemeralServiceStarts and returns a new EphemeralService.

Function Details​

cleanupEphemeralService​

Cleans up the service passed in startEphemeralService(isDefault), or the default if none is passed.

This API is provided as an alpha preview and may change without notice.

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

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

Signature​

export declare function cleanupEphemeralService(service?: EphemeralService): Promise<void>;

Remarks​

This closes the service, and all its containers. This is a good way to ensure the service and its containers leave no lingering timers which could leak memory, trigger asynchronous work or prevent a clean process exit.

Parameters​

ParameterModifiersTypeDescription
serviceoptionalEphemeralService

Returns​

Return type: Promise<void>

createLocalResolverCreateNewRequest​

Creates an IRequest for creating a new document with the local resolver.

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 function createLocalResolverCreateNewRequest(documentId: string): IRequest;

Parameters​

ParameterTypeDescription
documentIdstring

Returns​

Return type: IRequest

getDefaultEphemeralService​

Get the default EphemeralService if one has been started.

This API is provided as an alpha preview and may change without notice.

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

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

Signature​

export declare function getDefaultEphemeralService(): EphemeralService;

Returns​

Return type: EphemeralService

Error Handling​

If no default service is running.

startEphemeralService​

Starts and returns a new EphemeralService.

This API is provided as an alpha preview and may change without notice.

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

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

Signature​

export declare function startEphemeralService(isDefault?: boolean): EphemeralService;

Remarks​

The returned service owns an in-memory server and holds the documents created through clients connected to it. cleanupEphemeralService(service) can be used to ensure the service is properly cleaned up (a no-op if stopped/closed already).

As a service, it may start timers which may require an explicit close to fully free.

Parameters​

ParameterModifiersTypeDescription
isDefaultoptionalbooleanWhether this service should saved as the default service for cleanupEphemeralService(service) to cleanup. Defaults to true.

Returns​

Return type: EphemeralService