import { IChannelAttributes , IFluidDataStoreRuntime , IChannelServices , IChannelFactory , } from '@fluidframework/datastore-definitions' ; import { ISharedObject } from '@fluidframework/shared-object-base' ; import { SharedTree } from './SharedTree' ; public export class SharedTreeFactory implements IChannelFactory { /**
     * {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory."type"}
     */ public static Type = 'SharedTree' ; /**
     * {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory.attributes}
     */ public static Attributes : IChannelAttributes = { type : SharedTreeFactory . Type , snapshotFormatVersion : '0.1' , packageVersion : '0.1' } ; /**
     * {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory."type"}
     */ public get type ( ) : string { return SharedTreeFactory . Type ; } /**
     * {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory.attributes}
     */ public get attributes ( ) : IChannelAttributes { return SharedTreeFactory . Attributes ; } /**
     * {@inheritDoc @fluidframework/shared-object-base#ISharedObjectFactory.load}
     */ public async load ( runtime , id , services , _channelAttributes ) { const sharedTree = new SharedTree ( runtime , id ) ; await sharedTree . load ( services ) ; return sharedTree ; } param runtime param id public create ( runtime , id , expensiveValidation ? ) { const sharedTree = new SharedTree ( runtime , id , expensiveValidation , this . includeHistoryInSummary ( ) ) ; sharedTree . initializeLocal ( ) ; return sharedTree ; } /**
     * Determines how the SharedTree will summarize the history.
     * This is a workaround for lacking the ability to construct DDSs with custom parameters.
     */ protected includeHistoryInSummary ( ) { return true ; } } public export class SharedTreeFactoryNoHistory extends SharedTreeFactory { protected includeHistoryInSummary ( ) { return false ; } }