a.js(5,1): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig.
b.js(2,14): error TS2339: Property 'a' does not exist on type 'typeof import("a")'.
b.js(3,14): error TS2339: Property 'b' does not exist on type 'typeof import("a")'.


==== b.js (2 errors) ====
    const a = require("./a");
    const c1 = a.a;
                 ~
!!! error TS2339: Property 'a' does not exist on type 'typeof import("a")'.
    const c2 = a.b;
                 ~
!!! error TS2339: Property 'b' does not exist on type 'typeof import("a")'.
    /** @type {a.Foo} */
    let v1 = { x: "test" };
    
==== a.js (1 errors) ====
    /**
     * @typedef {{x: string}} Foo
     */
    export const x = 1; // Causes error
    module.exports = { a: 1, b: "hello" };
    ~~~~~~
!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig.