/* IMPORT */ import type {TestAPI} from './types'; /* HELPERS */ const tapi = { current: > {} }; /* MAIN */ //TODO: Publish a polished version of this as a standalone module, "proxy-of" maybe const t = new Proxy ( {} as TestAPI, { //TSC get ( target: {}, key: K ): TestAPI[K] | undefined { return tapi.current[key]; }, set ( target: {}, key: K, value: TestAPI[K] ): boolean { tapi.current[key] = value; return true; }, has ( target: {}, key: K ): boolean { return ( key in tapi.current ); } }); /* EXPORT */ export default t; export {tapi};