import { IFluidHandle , IFluidLoadable } from "@fluidframework/core-interfaces" ; import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions" ; import { IGarbageCollectionData , ISummaryTreeWithStats } from "@fluidframework/runtime-definitions" ; import { IChannelAttributes } from "./storage" ; import { IFluidDataStoreRuntime } from "./dataStoreRuntime" ; export interface IChannel extends IFluidLoadable { /**
     * A readonly identifier for the channel
     */ readonly id : string ; readonly owner ? : string ; readonly attributes : IChannelAttributes ; returns getAttachSummary ( fullTree ? , trackState ? ) : ISummaryTreeWithStats ; returns summarize ( fullTree ? , trackState ? ) : Promise < ISummaryTreeWithStats > ; /**
     * True if the data structure is attached to storage.
     */ isAttached ( ) : boolean ; /**
     * Enables the channel to send and receive ops
     */ connect ( services ) : void ; param fullGC getGCData ( fullGC ? ) : IGarbageCollectionData ; } /**
 * Handler provided by shared data structure to process requests from the runtime.
 */ export interface IDeltaHandler { param message param local param localOpMetadata process : ( message : ISequencedDocumentMessage , local : boolean , localOpMetadata : unknown ) => void ; param connected setConnectionState ( connected ) : void ; param message param localOpMetadata reSubmit ( message , localOpMetadata ) : void ; applyStashedOp ( message ) : unknown ; } /**
 * Interface to represent a connection to a delta notification stream.
 */ export interface IDeltaConnection { connected : boolean ; param messageContent param localOpMetadata submit ( messageContent , localOpMetadata ) : void ; /**
     * Attaches a message handler to the delta connection
     */ attach ( handler ) : void ; /**
     * Indicates that the channel is dirty and needs to be part of the summary. It is called by a SharedSummaryBlock
     * that needs to be part of the summary but does not generate ops.
     */ dirty ( ) : void ; param srcHandle param outboundHandle addedGCOutboundReference ? ( srcHandle , outboundHandle ) : void ; } /**
 * Storage services to read the objects at a given path.
 */ export interface IChannelStorageService { /**
     * Reads the object contained at the given path. Returns a buffer representation for the object.
     */ readBlob ( path ) : Promise < ArrayBufferLike > ; /**
     * Determines if there is an object contained at the given path.
     */ contains ( path ) : Promise < boolean > ; /**
     * Lists the blobs that exist at a specific path.
     */ list ( path ) : Promise < string [ ] > ; } /**
 * Storage services to read the objects at a given path using the given delta connection.
 */ export interface IChannelServices { deltaConnection : IDeltaConnection ; objectStorage : IChannelStorageService ; } /**
 * Definitions of a channel factory. Factories follow a common model but enable custom behavior.
 */ export interface IChannelFactory { /**
     * String representing the type of the factory.
     */ readonly type : string ; /**
     * Attributes of the channel.
     */ readonly attributes : IChannelAttributes ; param runtime param id param services param channelAttributes returns privateRemarks load ( runtime , id , services , channelAttributes ) : Promise < IChannel > ; param runtime param id returns privateRemarks create ( runtime , id ) : IChannel ; }