René's URL Explorer Experiment


Title: JavaScript modules in TypeScript · Issue #4791 · microsoft/TypeScript · GitHub

Open Graph Title: JavaScript modules in TypeScript · Issue #4791 · microsoft/TypeScript

X Title: JavaScript modules in TypeScript · Issue #4791 · microsoft/TypeScript

Description: JavaScript module systems in TypeScript This brief write up is an attempt to capture how RequireJS and CommonJS module loading in JavaScript files may be modeled when powered by the TypeScript language service. It will outline some commo...

Open Graph Description: JavaScript module systems in TypeScript This brief write up is an attempt to capture how RequireJS and CommonJS module loading in JavaScript files may be modeled when powered by the TypeScript lang...

X Description: JavaScript module systems in TypeScript This brief write up is an attempt to capture how RequireJS and CommonJS module loading in JavaScript files may be modeled when powered by the TypeScript lang...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/4791

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"JavaScript modules in TypeScript","articleBody":"# JavaScript module systems in TypeScript\n\nThis brief write up is an attempt to capture how RequireJS and CommonJS module loading in JavaScript files may be modeled when powered by the TypeScript language service.  It will outline some common usages as reference points, and then outline a high-level algorithm to provide typing in the examples given.  A description of how this algorithm may be implemented within the TypeScript parser then follows.\n\n(See parent issue #4789 for an overview)\n## Example RequireJS usage\n\nThe below examples outline common RequireJS usage patterns, and use inline comments for annotations explaining the resulting types.\n### Canonical RequireJS style with a dependency array\n\n``` javascript\ndefine(['./foo','bar'], \n  /**\n   * @param {module: ./foo} foo\n   * @param {module: bar} bar\n   * @return {Object}\n   */\n  function(foo, bar){\n    return { \n      // Shape of this object defines the module\n    };\n  }\n);\n```\n### Using the CommonJS style\n\n``` javascript\ndefine(\n  // Note: No dependency array provided\n\n  /**\n   * The order and name of the parameters is important\n   * @param {RequireJS.require} require\n   * @param {Object} [exports]\n   * @param {RequireJS.module} [module]\n   * @return {typeof exports}\n   */\n  function(require, exports, module){\n    // Note that inside this function, the code is the same as for the CommonJS module system\n\n    // fs is the imported module as per: import * as fs from 'fs'\n    var fs = require('fs');\n\n    // The \"exports\" object is the resulting module\n    exports.prop = \"test\";\n  }\n)\n```\n### Combined dependency array and CommonJS style usage\n\n``` javascript\ndefine(\n  // The CommonJS wrapper names may also be provided as dependencies\n  ['vs/editor', 'exports'],\n  /**\n   * @param {module: vs/editor} ed\n   * @param {Object} exports\n   * @return {typeof exports}\n   */\n  function(ed, exports){\n    // Shape of the resulting \"exports\" object is the shape of the module\n    exports.prop = \"test\";\n  }\n);\n```\n### RequireJS plugins\n\nRequireJS allows for plugins to be provided as modules.  These follow a syntax of having the plugin module name, followed by a bang, followed by a 'resource name', e.g.\n\n``` javascript\ndefine([\"i18n!my/nls/colors\"], \n  /**\n   * @param {module: i18n} colors\n   */\n  function(colors) {\n    return {\n        testMessage: \"The name for red in this locale is: \" + colors.red\n    }\n});\n```\n### Modules defined as simple object literals\n\nAt its simplest, a call to \"define\" can just contain an object literal for the resulting module.\n\n``` javascript\ndefine(\n  // If the final param to \"define\" is just an object rather than a function, that is the module\n  {\n    \"root\": {\n        \"red\": \"red\",\n        \"blue\": \"blue\",\n        \"green\": \"green\"\n    }\n  }\n);\n```\n## Type inference for AMD modules\n\nNote: The below is an abstract description of the algorithm. An implementation specific description, based on the current TypeScript codebase, follows.\n\nTo process AMD modules, the file must be a JavaScript file (i.e. have an extension of either 'js' or 'jsx') and the module type must be set to 'amd'.  If these conditions are met, 'define' calls are processed in the following manner:\n1. Let 'args' be the array of the arguments passed to the 'define' function, and 'M' represent the external module type to be constructed.\n2. If the 1st element of 'args' is a string, register the module 'M' with this name (as for a `declare module \"name\" {...}` TypeScript statement), else register the module 'M' based on the current file path (as for a TypeScript script with top level import/export statements).  Perform a 'shift' operation on 'args' (i.e. remove the 1st element, make the 2nd the 1st, etc..).\n3. If the 1st element of 'args' is an expression resulting in an object type (e.g. an object literal), then assign the type of the expression to the module 'M' and skip remaining steps.\n4. If the 1st element of 'args' is an array of strings, process as follows and then perform a 'shift' on 'args':\n   1. Place the string names in an ordered list of `{'name': string, 'type': any}` tuples.  Call this list 'imports'.\n   2. For each tuple in 'imports':\n      1. If 'name' is 'require', assign to 'type' the type 'RequireJS.require' (this \"known\" type will be used below).\n      2. If 'name' is 'exports', assign to 'type' the type 'RequireJS.exports' (this \"known\" type will be used below).\n      3. If 'name' is 'module', assign to 'type' the type 'RequireJS.module' (this \"known\" type will be used below).\n      4. For any other name, resolve the module as for a ES6 external module import (e.g. `import * as x from 'name';`), and assign to 'type' the resulting type of `x`.\n5. If the 1st element of 'args' is a function, process as follows:\n   1. If any of the parameters to the function have a JsDoc annotation which specified a type, then assign the parameter this type and exclude that parameter from the remaining steps.\n   2. If the 'imports' list is undefined, check the parameter list to see if it matches the list `['require', 'exports', 'module']` where the 2nd and 3rd are optional.  If so, assign to the 'imports' list the corresponding 3 types as per steps 4.ii.a to 4.ii.c.\n   3. Assign the function parameters the types from the 'imports' list in order.  Error if there are more parameters that entries in 'imports'. (To be error tolerant, just assign the 'any' type rather than error).\n   4. If the function body contains an expression of type 'RequireJS.require', which is called as a function with a string argument, then:\n      1. Let 'name' be the string value\n      2. Let 'module' be the value `x` as evaluated in the ES6 import: `import * as x from 'name'`\n      3. Assign the type of 'module' as the type of the function call expression (i.e. the \"required\" module type)\n   5. If the function body contains `return` statements that return a value, then the type of the module 'M' is the best common type of the return statements, and skip remaining steps.\n   6. If the function body contains an expression of type 'RequireJS.module', and the property `exports` is assigned to, then the type of the module 'M' is the best common type of any assignments to the `exports` property, and skip remaining steps.\n   7. If the function body contains expressions of type 'RequireJS.exports', then:\n      1. For each property assignment onto the type with either a constant string indexer (e.g. `exports[\"foo-bar\"] = 42;`) or a valid identifier (e.g. `exports.foo = new Date();`), then create a property on the module type 'M' of that name as would be done for an ES6 export (e.g. `export var foo = new Date();`).\n      2. For other assignments (e.g. computed expressions such as `exports[myVar] = true;`), ignore.\n      3. Skip remaining steps.\n6. If this step is reached, then error on the arguments provided to 'define'.\n## Type inference for CommonJS modules\n\nNote that this is a subset of the AMD scenarios, and behaves identically to code in an AMD `define` call when using the CommonJS pattern.\n### Other RequireJS API calls\n\nOther calls in RequireJS to be handled specially are when invoking the identifiers 'require' or 'requirejs' as a function.  Note that [these point to the same function](http://stackoverflow.com/questions/13605600/requirejs-difference-between-requirejs-and-require-functions), so treatment is identical.  Only 'require' will be discussed below for clarity.\n\nCalls to 'require' are typically used in the [data-main entry point](http://www.requirejs.org/docs/api.html#data-main) to load the first app module and run some code on load. Thus, the main difference between 'require' and 'define' is minimal, and indeed its usage pattern is very similar to the first 'canonical' example of RequireJS usage at the start of this Gist.  The processing of 'require' calls differs from the calls to 'define' only in that step #2 in the algorithm above is skipped. That is, you cannot provide a string as the first argument to define a module name, and no external module is registered.\n## Notes\n- If multiple calls to 'define' without a string as the first argument are present, the last call will define the module.  (Could error here, but designed to be tolerant).\n- The algorithm prioritizes return statement values, over 'module.exports' assignments, over settings properties on the 'exports' object, to determine the module type.  This may or may not be accurate depending on code flow, but is a simplification for the common case (where mixing of these methods in a module definition is unusual, and behavior in the presense of multiple methods is not documented by RequireJS).\n## Implementation in TypeScript\n\nScripts compiled with the module type 'amd' are handled differently than other types of module systems, in that they contain code in global scope, yet function expressions within a 'define' call declare an external module.\n\nThe process goes through the usual pipeline:\n1. Parsing\n2. Binding\n3. Type checking\n### Parsing\n\nIn the parsing phase, declarations are marked. For script compiled with module type 'amd', there is special handling whenever a call to `define` is encountered. If the call has a string as the first param, it is a declaration for the module named by the string.  If not, it is a declaration for a module of the name of the script being parsed (e.g. `./src/foo.js`). The function expression (or object literal) which is the last parameter to `define` is marked as the module declaration.\n### Binding\n\nIn the binding phase, identifiers are bound to their declarations. This is handled specially for function expressions within `require` or `define` calls.\n1. If the function parameters are named `require`, `exports`, `module`, in that order (with only the first required), and the prior argument to `define` or `require` was not an array, then the parameters are automatically bound to the `RequireJS.require`, `RequireJS.exports`, and `RequireJS.module` declarations.\n2. Otherwise if there are function parameters, then the prior argument must be a string array. Each parameter in the function expression is bound to the module name given by the corresponding element in the array (the module names `require`, `exports`, and `module` are already declared internally and map to types as outlined above).\n#### Handling calls to 'require'\n\nCalls to `require` are used commonly in two places: Inside module definitions using the CommonJS pattern, and outside module definitions to initiate module loading. These usages have unique signatures.\n\nIn order for type checking to handle the CommonJS usage pattern (where the `var x = require(\"modulename\")` expression is used), binding of this expression must be handled specially. Specifically, when an expression of type `RequireJS.require` is invoked as a function with a single string literal argument, then the call expression should be bound as for an imported module of that name (as per step #2 above). (OPEN: This might be better handled at the type checking phase when the type of `x` is pulled).\n\nIn order for type checking to handle the module loading usage pattern, the binding is as per the `define` binding when the first argument is either an array or a function expression. A major difference being that calls to `require` do not define a module. (Note also that calls to the `requirejs` function are equivalent to calls to `require`).\n\nTODO: Calls to require can contain a [`config` object as the first param](https://github.com/jrburke/requirejs/blob/master/require.js#L1730). Per implementation, valid signature usage appears to be:\n\n``` typescript\nrequire(moduleName: string); // CommonJS style\nrequire(deps: string[], callback?: Function, errback?: Function); // Loader call\n\n// Note: Usage of config object as first param seems like a deprecated pattern. May not be needed.\nrequire(config: Object, deps?: string[], callback?: Function, errback?: Function); // Config object\nrequire(config: Object, callback?: Function, errback?: Function); // Dependencies in config object\n```\n### Type checking\n\nWhen a module declaration is pulled for type checking, the following process occurs:\n1. If the declaration is an object literal, then the type of the module declaration is evaluated as for any other object literal expression. Else the declaration must be a function expression.\n2. If the function expression contains `return \u003cexpression>;` statements, then the type of the module is the best common type of the return expressions.\n3. Else if the function expression contains a parameter of type `RequireJS.module`, then the function body is searched for any assignments to the `export` property of the parameter. If there are 1 or more, then the type of the module is the best common type of the types of the expressions assigned to the `export` property.\n4. Else if the function expression contains a parameter of type `RequireJS.exports`, then the function body is searched for any assignments to properties on this parameter (where property names must be assigned with string constants or IdentifierName tokens). A type is constructed, starting with an empty object, by adding each proporty assigned to `exports` as a member (of the type of the expression assigned to the property).  The type of the module is the final type of the constructed object.\n5. Else the module type is `Object`.\n### OPEN\n- Currently TypeScript maps an external module implementation to a script file. This will need to be changed for one or more external modules to be declared within a script (which is treated as global outside the 'define' calls).\n- Check if the implementation as it stands allows for the parameters in the function expressions passed to `define` and `require` to be bound to the special 'RequireJS.*' declarations.\n## TODO\n- What to do about important settings for processing such as `baseUrl`? (Current thoughts, add a tsconfig.json setting for it, rather than try to infer from code, which is difficult as you may not come across the file setting the baseUrl until you have already processed some module files).\n- What to do about [other config settings](http://www.requirejs.org/docs/api.html#config), such as `shim`, `paths`, `map`, etc... (Current thoughts, nothing unless there is strong demand).\n","author":{"url":"https://github.com/billti","@type":"Person","name":"billti"},"datePublished":"2015-09-14T21:27:19Z","url":"https://github.com/microsoft/TypeScript/issues/4791"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f05bb627-0a80-a4ed-fbe1-bfca17cbf793
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE5EC:B1B84:13FE0C6:195557B:6B0163A3
html-safe-nonce2fdc2057f54938fad1d1cd86a0f61de8cc7fd7b9d27762a17d89e298c86be3f8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUVDOkIxQjg0OjEzRkUwQzY6MTk1NTU3Qjo2QjAxNjNBMyIsInZpc2l0b3JfaWQiOiI3ODM5OTcyMjg4NTg1NjU1MzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac91de2c55eeea11bd25dc30ac2dfca1097ad2239175636c936ee3de605ca5ac4f
hovercard-subject-tagissue:106431730
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/4791/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4a01327e2ad8f6bd6a8863e2eb06cf4e7cd985344a15c1f72d0d4dd0ddd8195c/microsoft/TypeScript/issues/4791
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4a01327e2ad8f6bd6a8863e2eb06cf4e7cd985344a15c1f72d0d4dd0ddd8195c/microsoft/TypeScript/issues/4791
og:image:altJavaScript module systems in TypeScript This brief write up is an attempt to capture how RequireJS and CommonJS module loading in JavaScript files may be modeled when powered by the TypeScript lang...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebillti
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/4791#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F4791
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F4791
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/4791
Reloadhttps://github.com/microsoft/TypeScript/issues/4791
Reloadhttps://github.com/microsoft/TypeScript/issues/4791
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests312 (312)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/4791
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/4791
JavaScript modules in TypeScripthttps://github.com/microsoft/TypeScript/issues/4791#top
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com/billti
Bill Ticehurst (billti)https://github.com/billti
on Sep 14, 2015https://github.com/microsoft/TypeScript/issues/4791#issue-106431730
#4789https://github.com/microsoft/TypeScript/issues/4789
these point to the same functionhttp://stackoverflow.com/questions/13605600/requirejs-difference-between-requirejs-and-require-functions
data-main entry pointhttp://www.requirejs.org/docs/api.html#data-main
#2https://github.com/microsoft/TypeScript/pull/2
#2https://github.com/microsoft/TypeScript/pull/2
config object as the first paramhttps://github.com/jrburke/requirejs/blob/master/require.js#L1730
other config settingshttp://www.requirejs.org/docs/api.html#config
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
on Sep 18, 2015https://github.com/microsoft/TypeScript/issues/4791#event-412736507
Zhengbo Li (zhengbli)https://github.com/zhengbli
Salsahttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Salsa%22
on Sep 21, 2015https://github.com/microsoft/TypeScript/issues/4791#event-415312428
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Nov 11, 2015https://github.com/microsoft/TypeScript/issues/4791#issuecomment-155896431
#5266https://github.com/microsoft/TypeScript/pull/5266
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 11, 2015https://github.com/microsoft/TypeScript/issues/4791#event-461707920
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
on Nov 11, 2015https://github.com/microsoft/TypeScript/issues/4791#event-461708072
https://github.com/ksjogo
Johannes Goslar (ksjogo)https://github.com/ksjogo
on Jun 3, 2017https://github.com/microsoft/TypeScript/issues/4791#issuecomment-306003957
microsofthttps://github.com/microsoft
on Jun 19, 2018https://github.com/microsoft/TypeScript/issues/4791#event-1689615420
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/4791
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/4791
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.