import { EventEmitter } from "events" ; import { ICollection , IDb } from "@fluidframework/server-services-core" ; import { Collection } from "./inMemorycollection" ; export class InMemoryDb extends EventEmitter implements IDb { private readonly collections = new Map < string , Collection < any > > ( ) ; public async close ( ) { return ; } public collection < T > ( name ) { if ( ! this . collections . has ( name ) ) { const collection = new Collection ( ) ; this . collections . set ( name , collection ) ; } return this . collections . get ( name ) ; } }