Skip to content

Object mapping string to boolean or Object gets typed instead to any with new JS->declaration support #34914

@DavidAnson

Description

@DavidAnson
C:\T\tsrc>npm ls
C:\T\tsrc
`-- [email protected]


C:\T\tsrc>type example2.js
"use strict";

/**
 * Map of string to boolean or Object.
 *
 * @typedef {Object.<string, boolean | Object>} MyMap
 */

C:\T\tsrc>node_modules\.bin\tsc --allowjs --declaration --outdir out example2.js

C:\T\tsrc>type out\example2.d.ts
/**
 * Map of string to boolean or Object.
 */
type MyMap = {
    [x: string]: any;
};

C:\T\tsrc>

Metadata

Metadata

Assignees

Labels

Experimentation NeededSomeone needs to try this out to see what happensSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions