import type { Layer } from 'effect'; import type { TableDefinition } from '../std-table/definition/index.js'; import { contractLayer, type EncodedItem, type StdTableService, } from '../std-table/contract/index.js'; import { makeTableContract } from './table/index.js'; type TableSource = Pick< TableDefinition, 'logicalName' | 'localSecondaryIndexes' | 'globalSecondaryIndexes' >; export interface MemoryTable { readonly layer: Layer.Layer>; } const make = ( table: TableSource, ): MemoryTable => { const items = new Map(); return { layer: contractLayer(table.logicalName, makeTableContract(table, items)), }; }; export const Memory = { make } as const;