import { Serializable , IChannelStorageService } from "@fluidframework/datastore-definitions" ; import { BlobTreeEntry } from "@fluidframework/protocol-base" ; import { IFluidHandle } from "@fluidframework/core-interfaces" ; import { IFluidSerializer } from "@fluidframework/shared-object-base" ; import { bufferToString } from "@fluidframework/common-utils" ; export const serializeBlob = ( handle , path , snapshot , serializer ) => new BlobTreeEntry ( path , serializer . stringify ( snapshot , handle ) ) ; export async function deserializeBlob ( storage , path , serializer ) { const blob = await storage . readBlob ( path ) ; const utf8 = bufferToString ( blob , "utf8" ) ; return serializer . parse ( utf8 ) ; }