En mi proyecto nextjs tengo este código:
const go = new global.Go() global.Go se define mediante wasm .
Cuando ejecuto el comando tsc me sale el siguiente error:
error TS7017: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature. Así que creé los types/global.d.ts y agregué estas líneas:
export declare global { function Go(): unknown }pero ahora me sale este error:
error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.¿Cómo puedo solucionar este problema?
Como dice el mensaje de error; darle una firma de construcción
export declare global { const Go: new () => Go }