Skip to content 

IFluidSerializer Interface

Packages > @fluidframework/core-interfaces > IFluidSerializer

Signature:

export interface IFluidSerializer extends IProvideFluidSerializer 

Extends: IProvideFluidSerializer

Methods

List of methods of this class
Method Description
parse(value, context) Parses the given JSON input string and returns the JavaScript object defined by it. Any Fluid handles will be realized as part of the parse
replaceHandles(value, context, bind) Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object where any embedded IFluidHandles have been replaced with a serializable form.The original input object is not mutated. This method will shallowly clones all objects in the path from the root to any replaced handles. (If no handles are found, returns the original object.)
stringify(value, context, bind) Stringifies a given value. Converts any IFluidHandle to its stringified equivalent.

Methods

parse

Parses the given JSON input string and returns the JavaScript object defined by it. Any Fluid handles will be realized as part of the parse

Signature:

parse(value: string, context: IFluidHandleContext): any;

Parameters

List of parameters
Parameter Type Description
value string
context IFluidHandleContext

Returns:

any

replaceHandles

Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object where any embedded IFluidHandles have been replaced with a serializable form.

The original input object is not mutated. This method will shallowly clones all objects in the path from the root to any replaced handles. (If no handles are found, returns the original object.)

Signature:

replaceHandles(value: any, context: IFluidHandleContext, bind: IFluidHandle): any;

Parameters

List of parameters
Parameter Type Description
value any
context IFluidHandleContext
bind IFluidHandle

Returns:

any

stringify

Stringifies a given value. Converts any IFluidHandle to its stringified equivalent.

Signature:

stringify(value: any, context: IFluidHandleContext, bind: IFluidHandle): string;

Parameters

List of parameters
Parameter Type Description
value any
context IFluidHandleContext
bind IFluidHandle

Returns:

string