import { IChannelAttributes , IFluidDataStoreRuntime , IChannelServices , } from "@fluidframework/datastore-definitions" ; import { ConsensusQueue } from "./consensusQueue" ; import { IConsensusOrderedCollection , IConsensusOrderedCollectionFactory } from "./interfaces" ; import { pkgVersion } from "./packageVersion" ; /**
 * The factory that defines the consensus queue
 */ export class ConsensusQueueFactory implements IConsensusOrderedCollectionFactory { public static Type = "https://graph.microsoft.com/types/consensus-queue" ; public static readonly Attributes : IChannelAttributes = { type : ConsensusQueueFactory . Type , snapshotFormatVersion : "0.1" , packageVersion : pkgVersion } ; public get type ( ) { return ConsensusQueueFactory . Type ; } public get attributes ( ) { return ConsensusQueueFactory . Attributes ; } /**
     * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
     */ public async load ( runtime , id , services , attributes ) { const collection = new ConsensusQueue ( id , runtime , attributes ) ; await collection . load ( services ) ; return collection ; } public create ( document , id ) { const collection = new ConsensusQueue ( id , document , this . attributes ) ; collection . initializeLocal ( ) ; return collection ; } }