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) 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, 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, 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): any;

Parameters

List of parameters
Parameter Type Description
value string

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, bind: IFluidHandle): any;

Parameters

List of parameters
Parameter Type Description
value any
bind IFluidHandle

Returns:

any

stringify

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

Signature:

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

Parameters

List of parameters
Parameter Type Description
value any
bind IFluidHandle

Returns:

string