import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions" ; import { ISharedObject , ISharedObjectEvents } from "@fluidframework/shared-object-base" ; import { IEventThisPlaceHolder } from "@fluidframework/common-definitions" ; /**
 * Type of "valueChanged" event parameter.
 */ export interface IValueChanged { /**
     * The key storing the value that changed.
     */ key : string ; /**
     * The value that was stored at the key prior to the change.
     */ previousValue : any ; } /**
 * Value types are given an IValueOpEmitter to emit their ops through the container type that holds them.
 */ export interface IValueOpEmitter { param opName param previousValue param params alpha emit ( opName , previousValue , params ) : void ; } alpha export interface IValueFactory < T > { param emitter param raw returns alpha load ( emitter , raw ) : T ; param value returns alpha store ( value ) : any ; } alpha export interface IValueOperation < T > { param value param params param local param message alpha process ( value , params , local , message ) ; } /**
 * Defines a value type that can be registered on a container type.
 */ export interface IValueType < T > { alpha name : string ; alpha factory : IValueFactory < T > ; alpha ops : Map < string , IValueOperation < T > > ; } /**
 * Container types that are able to create value types as contained values.
 */ export interface IValueTypeCreator { param key param type param params alpha createValueType ( key , type , params ) : this ; } export interface ISharedMapEvents extends ISharedObjectEvents { ( event , listener ) ; ( event , listener ) ; } /**
 * Shared map interface
 */ export interface ISharedMap extends ISharedObject < ISharedMapEvents > , Map < string , any > { param key returns get < T = any > ( key ) : T | undefined ; param key returns wait < T = any > ( key ) : Promise < T > ; param key param value returns set < T = any > ( key , value ) : this ; } /**
 * The _ready-for-serialization_ format of values contained in DDS contents.  This allows us to use
 * ISerializableValue.type to understand whether they're storing a Plain JS object, a SharedObject, or a value type.
 * Note that the in-memory equivalent of ISerializableValue is ILocalValue (similarly holding a type, but with
 * the _in-memory representation_ of the value instead).  An ISerializableValue is what gets passed to
 * JSON.stringify and comes out of JSON.parse.  This format is used both for snapshots (loadCore/populate)
 * and ops (set).
 * If type is Plain, it must be a plain JS object that can survive a JSON.stringify/parse.  E.g. a URL object will
 * just get stringified to a URL string and not rehydrate as a URL object on the other side.  It may contain members
 * that are ISerializedHandle (the serialized form of a handle).
 * If type is a value type then it must be amongst the types registered via registerValueType or we won't know how
 * to serialize/deserialize it (we rely on its factory via .load() and .store()).  Its value will be type-dependent.
 * If type is Shared, then the in-memory value will just be a reference to the SharedObject.  Its value will be a
 * channel ID.  This type is legacy and deprecated.
 */ export interface ISerializableValue { /**
     * A type annotation to help indicate how the value serializes.
     */ type : string ; /**
     * The JSONable representation of the value.
     */ value : any ; } export interface ISerializedValue { /**
     * A type annotation to help indicate how the value serializes.
     */ type : string ; /**
     * String representation of the value.
     */ value : string | undefined ; } alpha export interface IValueTypeOperationValue { /**
     * The name of the operation.
     */ opName : string ; /**
     * The payload that is submitted along with the operation.
     */ value : any ; }