@fluidframework/dds-interceptions Package

Packages > @fluidframework/dds-interceptions

Functions

List of functions contained in this package or namespace
Function Description
createDirectoryWithInterception(baseDirectory, context, setInterceptionCallback) - Create a new object from the passed IDirectory object. - Modify the set method to call the setInterceptionCallback before calling set on the underlying object. - The setInterceptionCallback and the call to the underlying object are wrapped around an orderSequentially call to batch any operations that might happen in the callback. - Modify the sub directory methods to create / return a wrapper object that in turn intercepts the set method and calls the setInterceptionCallback. - When a sub directory is created from this directory, this directory object is passed to it which is passed into the interception callback.
createSharedMapWithInterception(sharedMap, context, setInterceptionCallback) - Create a new object from the passed SharedMap. - Modify the set method to call the setInterceptionCallback before calling set on the underlying SharedMap. - The setInterceptionCallback and the call to the underlying SharedMap are wrapped around an orderSequentially call to batch any operations that might happen in the callback.
createSharedStringWithInterception(sharedString, context, propertyInterceptionCallback) - Create a new object from the passed SharedString. - Modify the methods that insert / remove / annotate the properties of the SharedString to call the propertyInterceptionCallback to get new properties. - Use these new properties to call the underlying SharedString. - The propertyInterceptionCallback and the call to the underlying SharedString are wrapped around an orderSequentially call to batch any operations that might happen in the callback.

Functions

createDirectoryWithInterception

  • Create a new object from the passed IDirectory object. - Modify the set method to call the setInterceptionCallback before calling set on the underlying object. - The setInterceptionCallback and the call to the underlying object are wrapped around an orderSequentially call to batch any operations that might happen in the callback. - Modify the sub directory methods to create / return a wrapper object that in turn intercepts the set method and calls the setInterceptionCallback. - When a sub directory is created from this directory, this directory object is passed to it which is passed into the interception callback.

Signature:

export declare function createDirectoryWithInterception<T extends IDirectory>(baseDirectory: T, context: IFluidDataStoreContext, setInterceptionCallback: (baseDirectory: IDirectory, subDirectory: IDirectory, key: string, value: any) => void): T;

Parameters

List of parameters
Parameter Type Description
baseDirectory T The underlying object that is to be intercepted
context IFluidDataStoreContext The IFluidDataStoreContext that will be used to call orderSequentially
setInterceptionCallback (baseDirectory: IDirectory, subDirectory: IDirectory, key: string, value: any) => void The interception callback to be called

Returns:

T

A new IDirectory object that intercepts the set method and calls the setInterceptionCallback.

createSharedMapWithInterception

  • Create a new object from the passed SharedMap. - Modify the set method to call the setInterceptionCallback before calling set on the underlying SharedMap. - The setInterceptionCallback and the call to the underlying SharedMap are wrapped around an orderSequentially call to batch any operations that might happen in the callback.

Signature:

export declare function createSharedMapWithInterception(sharedMap: SharedMap, context: IFluidDataStoreContext, setInterceptionCallback: (sharedMap: ISharedMap, key: string, value: any) => void): SharedMap;

Parameters

List of parameters
Parameter Type Description
sharedMap SharedMap The underlying SharedMap
context IFluidDataStoreContext The IFluidDataStoreContext that will be used to call orderSequentially
setInterceptionCallback (sharedMap: ISharedMap, key: string, value: any) => void The interception callback to be called

Returns:

SharedMap

A new SharedMap that intercepts the set method and calls the setInterceptionCallback.

createSharedStringWithInterception

  • Create a new object from the passed SharedString. - Modify the methods that insert / remove / annotate the properties of the SharedString to call the propertyInterceptionCallback to get new properties. - Use these new properties to call the underlying SharedString. - The propertyInterceptionCallback and the call to the underlying SharedString are wrapped around an orderSequentially call to batch any operations that might happen in the callback.

Signature:

export declare function createSharedStringWithInterception(sharedString: SharedString, context: IFluidDataStoreContext, propertyInterceptionCallback: (props?: MergeTree.PropertySet) => MergeTree.PropertySet): SharedString;

Parameters

List of parameters
Parameter Type Description
sharedString SharedString The underlying SharedString
context IFluidDataStoreContext The IFluidDataStoreContext that will be used to call orderSequentially
propertyInterceptionCallback (props?: MergeTree.PropertySet) => MergeTree.PropertySet The interception callback to be called

Returns:

SharedString

A new SharedString that intercepts the methods modifying the SharedString properties.