import * as functions from './functions';
const api = new Api(); // Define the Api object here
const withApi = Object.keys(functions).reduce((result, key) => {
result[key as keyof typeof functions] = functions[key as keyof typeof functions](api)
}, {} as /* What type should i put here??? */);
我能找到的最好的
/* What type should i put here??? */
是
{ [index:string]: Promise<any> }
,这一点都不令人满意。