-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
CommittedThe team has roadmapped this issueThe team has roadmapped this issueDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolFixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
TypeScript Version: 2.9.0-dev.201xxxxx
Search Terms: Refactor, extract type, typedef
In a TypeScript file Extract to type alias
:
var x: { a: number, b: string } = { .. };
would generate:
type newType = { a: number, b: string }
var x: newType = { .. };
In a JavaScript file Extract to typedef
:
/** @type {import("./c2").mytype} */
var x;
would generate:
/** @typedef {import("./c2").mytype} newType */
/**@type {myType} */
var x;
gif courtesy of @DanielRosenwasser
DanielRosenwasser, Hotell, OliverJAsh, styfle, dderevjanik and 20 moreOctoD, karol-majewski, Glavin001 and NiroSugir
Metadata
Metadata
Assignees
Labels
CommittedThe team has roadmapped this issueThe team has roadmapped this issueDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolFixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScript