import { Actor } from './Actor' ; const children = new Map < string , Actor > ( ) ; let sessionIdIndex = 0 ; export interface Registry { bookId ( ) : string ; register ( id , actor ) : string ; get ( id ) : Actor | undefined ; free ( id ) : void ; } export const registry = { bookId ( ) { return `x:${ sessionIdIndex ++ }` ; } , register ( id , actor ) { children . set ( id , actor ) ; return id ; } , get ( id ) { return children . get ( id ) ; } , free ( id ) { children . delete ( id ) ; } } ;