import { StorageBoxInterface , StorageBoxDriveInterface , StorageBoxDriveRegister , } from "./interfaces" ; class implements StorageDriveInterface export class MemoryDrive implements StorageBoxDriveInterface { readonly data : Record < string , any > = { } ; param { StorageBoxInterface } box constructor ( protected readonly box ) { } param { string } key returns { string } #generateKey ( key ) { return `${ this . box . name }:${ key }` ; } param { string } key returns { T } async get < T > ( key ) { return this . data [ this . #generateKey ( key ) ] ; } param { string } key param { T } value returns { Promise < void > } async set < T > ( key , value ) { this . data [ this . #generateKey ( key ) ] = value ; } param { string } key returns { Promise < void > } async remove ( key ) { delete this . data [ this . #generateKey ( key ) ] ; } } export const memoryDriveReguster = ( box ) => new MemoryDrive ( box ) ;