tests/cases/conformance/jsdoc/declarations/file2.js(1,9): error TS18042: 'myTypes' is a type and cannot be imported in JavaScript files. Use 'import("./file.js").myTypes' in a JSDoc type annotation.


==== tests/cases/conformance/jsdoc/declarations/file.js (0 errors) ====
    /**
     * @namespace myTypes
     * @global
     * @type {Object<string,*>}
     */
    const myTypes = {
        // SOME PROPS HERE
    };
    
    /** @typedef {string|RegExp|Array<string|RegExp>} myTypes.typeA */
    
    /**
     * @typedef myTypes.typeB
     * @property {myTypes.typeA}    prop1 - Prop 1.
     * @property {string}           prop2 - Prop 2.
     */
    
    /** @typedef {myTypes.typeB|Function} myTypes.typeC */
    
    export {myTypes};
==== tests/cases/conformance/jsdoc/declarations/file2.js (1 errors) ====
    import {myTypes} from './file.js';
            ~~~~~~~
!!! error TS18042: 'myTypes' is a type and cannot be imported in JavaScript files. Use 'import("./file.js").myTypes' in a JSDoc type annotation.
    
    /**
     * @namespace testFnTypes
     * @global
     * @type {Object<string,*>}
     */
    const testFnTypes = {
        // SOME PROPS HERE
    };
    
    /** @typedef {boolean|myTypes.typeC} testFnTypes.input */
    
    /**
     * @function testFn
     * @description A test function.
     * @param {testFnTypes.input} input - Input.
     * @returns {number|null} Result.
     */
    function testFn(input) {
        if (typeof input === 'number') {
            return 2 * input;
        } else {
            return null;
        }
    }
    
    export {testFn, testFnTypes};