René's URL Explorer Experiment


Title: Global type references · Issue #983 · microsoft/TypeScript · GitHub

Open Graph Title: Global type references · Issue #983 · microsoft/TypeScript

X Title: Global type references · Issue #983 · microsoft/TypeScript

Description: When a type declaration in an inner module has the same name as a type declaration in an outer module, the outer declaration becomes inaccessible. Programmers can typically work around this, for example by deriving a type with an alterna...

Open Graph Description: When a type declaration in an inner module has the same name as a type declaration in an outer module, the outer declaration becomes inaccessible. Programmers can typically work around this, for ex...

X Description: When a type declaration in an inner module has the same name as a type declaration in an outer module, the outer declaration becomes inaccessible. Programmers can typically work around this, for ex...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Global type references","articleBody":"When a type declaration in an inner module has the same name as a type declaration in an outer module, the outer declaration becomes inaccessible. Programmers can typically work around this, for example by deriving a type with an alternate name in the outer module or, with our latest changes, by declaring a type alias. However, such manual work-arounds are not a good option for code generation tools such as the .d.ts generation facility provided by the compiler. We really need a fool proof way to ensure a lookup starts at the global scope. Consider:\n\n``` typescript\nfunction makeError(): Error {\n    return new Error(\"We've got a problem\");\n}\n\nmodule M {\n    export class Error {\n    }\n    export var x = makeError();  // No way to name global Error type here\n}\n```\n\nIt is currently impossible to create a .d.ts file for the code above because there is no way to emit a type annotation for `x` that references the global interface `Error`.\n\nNode.js uses the name `global` for the global scope. We could consider supporting something similar in type names. Specifically, if a qualified type name starts with the identifier `global` and if a lookup of `global` as a module name doesn't bind to anything (meaning the user didn't define a `global` module), then we consider it a globally qualified name. For the example above we could then generate the following .d.ts file:\n\n``` typescript\ndeclare module M {\n    class Error {\n    }\n    var x: global.Error;\n}\n```\n\nIf course, if the user defines their own `global` module we now have a problem again--but I think it is fine to just say you shouldn't do that. We could even consider making it an error, or allowing it only under a compiler switch.\n","author":{"url":"https://github.com/ahejlsberg","@type":"Person","name":"ahejlsberg"},"datePublished":"2014-10-28T23:29:55Z","url":"https://github.com/microsoft/TypeScript/issues/983"}

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:d8225af9-88e2-1581-f531-b474074c6535
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id97FA:2BE220:D066DB:1175EC5:6B00FFC6
html-safe-nonce4d32f898f46780d0f3f5d5493402aa10178d54241e9643e871898d083519a83f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5N0ZBOjJCRTIyMDpEMDY2REI6MTE3NUVDNTo2QjAwRkZDNiIsInZpc2l0b3JfaWQiOiI4OTMxMjk2NTU4NjY2ODA5Mjg2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac7dbb133dda3beb5fbc54ec7df3b6cf6059c54f8e4d5d5e0eeeda65fe5350df76
hovercard-subject-tagissue:47094780
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/983/issue_layout
twitter:imagehttps://opengraph.githubassets.com/662ad28d992f4937fb2438bb6e103fe1883865b5e9b7503a55e75934d3086d5d/microsoft/TypeScript/issues/983
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/662ad28d992f4937fb2438bb6e103fe1883865b5e9b7503a55e75934d3086d5d/microsoft/TypeScript/issues/983
og:image:altWhen a type declaration in an inner module has the same name as a type declaration in an outer module, the outer declaration becomes inaccessible. Programmers can typically work around this, for ex...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameahejlsberg
hostnamegithub.com
expected-hostnamegithub.com
Nonecb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124
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
release2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/983#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F983
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%2F983
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/983
Reloadhttps://github.com/microsoft/TypeScript/issues/983
Reloadhttps://github.com/microsoft/TypeScript/issues/983
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests309 (309)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/983
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/983
Woodpile37/TypeScript#10https://github.com/Woodpile37/TypeScript/pull/10
Global type referenceshttps://github.com/microsoft/TypeScript/issues/983#top
Woodpile37/TypeScript#10https://github.com/Woodpile37/TypeScript/pull/10
DeclinedThe issue was declined as something which matches the TypeScript visionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Declined%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Oct 28, 2014https://github.com/microsoft/TypeScript/issues/983#issue-47094780
Nexthttps://github.com/microsoft/TypeScript/issues/983?timeline_page=1
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on Oct 28, 2014https://github.com/microsoft/TypeScript/issues/983#event-185033199
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Oct 28, 2014https://github.com/microsoft/TypeScript/issues/983#event-185033200
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Oct 31, 2014https://github.com/microsoft/TypeScript/issues/983#issuecomment-61294568
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Nov 1, 2014https://github.com/microsoft/TypeScript/issues/983#issuecomment-61347959
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Nov 3, 2014https://github.com/microsoft/TypeScript/issues/983#issuecomment-61526412
https://github.com/sccolbert
S. Chris Colbert (sccolbert)https://github.com/sccolbert
on Nov 20, 2014https://github.com/microsoft/TypeScript/issues/983#issuecomment-63896721
https://github.com/basarat
Basarat Ali Syed (basarat)https://github.com/basarat
on Dec 11, 2014https://github.com/microsoft/TypeScript/issues/983#issuecomment-66704566
http://stackoverflow.com/a/27433864/390330http://stackoverflow.com/a/27433864/390330
https://github.com/basarat
Basarat Ali Syed (basarat)https://github.com/basarat
on Jan 13, 2015https://github.com/microsoft/TypeScript/issues/983#issuecomment-69681054
http://nodejs.org/api/globals.html#globals_globalhttp://nodejs.org/api/globals.html#globals_global
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
on Jan 13, 2015https://github.com/microsoft/TypeScript/issues/983#event-218282477
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Jan 14, 2015https://github.com/microsoft/TypeScript/issues/983#issuecomment-69871582
https://github.com/cseufert
Chris Seufert (cseufert)https://github.com/cseufert
on Feb 16, 2015https://github.com/microsoft/TypeScript/issues/983#issuecomment-74445590
https://github.com/basarat
Basarat Ali Syed (basarat)https://github.com/basarat
on Feb 16, 2015https://github.com/microsoft/TypeScript/issues/983#issuecomment-74445806
https://github.com/cseufert
Chris Seufert (cseufert)https://github.com/cseufert
on Feb 16, 2015https://github.com/microsoft/TypeScript/issues/983#issuecomment-74445995
https://github.com/basarat
Basarat Ali Syed (basarat)https://github.com/basarat
on Feb 16, 2015https://github.com/microsoft/TypeScript/issues/983#issuecomment-74446650
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Mar 1, 2016https://github.com/microsoft/TypeScript/issues/983#issuecomment-190849561
https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#exporting-non-local-names-from-a-modulehttps://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#exporting-non-local-names-from-a-module
https://github.com/bartzy
Bar Ziony (bartzy)https://github.com/bartzy
on Mar 2, 2016https://github.com/microsoft/TypeScript/issues/983#issuecomment-191127983
Mohamed Hegazy (@mhegazy)https://github.com/mhegazy
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Mar 2, 2016https://github.com/microsoft/TypeScript/issues/983#issuecomment-191346273
Bar Ziony (@bartzy)https://github.com/bartzy
https://github.com/bartzy
Bar Ziony (bartzy)https://github.com/bartzy
on Mar 2, 2016https://github.com/microsoft/TypeScript/issues/983#issuecomment-191351607
Mohamed Hegazy (@mhegazy)https://github.com/mhegazy
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Mar 2, 2016https://github.com/microsoft/TypeScript/issues/983#issuecomment-191353634
https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Declaration%20Merging.md#basic-conceptshttps://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Declaration%20Merging.md#basic-concepts
#1166https://github.com/microsoft/TypeScript/issues/1166
https://github.com/bartzy
Bar Ziony (bartzy)https://github.com/bartzy
on Mar 2, 2016https://github.com/microsoft/TypeScript/issues/983#issuecomment-191397867
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Mar 2, 2016https://github.com/microsoft/TypeScript/issues/983#issuecomment-191433139
https://github.com/rjamesnw
James (rjamesnw)https://github.com/rjamesnw
on Apr 5, 2017https://github.com/microsoft/TypeScript/issues/983#issuecomment-291943562
https://github.com/mnpenner
Mark Penner (mnpenner)https://github.com/mnpenner
on Aug 3, 2017https://github.com/microsoft/TypeScript/issues/983#issuecomment-319835974
https://github.com/fly-studio
TikTok (fly-studio)https://github.com/fly-studio
on Dec 6, 2017https://github.com/microsoft/TypeScript/issues/983#issuecomment-349584268
Al Marks (aomarks)https://github.com/aomarks
on Feb 1, 2018https://github.com/microsoft/TypeScript/issues/983#event-1453779611
Fix type declarations inadvertedtly referencing Polymer.Element.https://github.com/Polymer/polymer/commit/1eb9af807263e069c1fab2903e81c355e37ee363
1eb9af8https://github.com/Polymer/polymer/commit/1eb9af807263e069c1fab2903e81c355e37ee363
Fix type declarations inadvertedtly referencing Polymer.Element.https://github.com/Polymer/polymer/commit/f2aa6b9a8090e6738c8f331b9afa2656910c5c63
f2aa6b9https://github.com/Polymer/polymer/commit/f2aa6b9a8090e6738c8f331b9afa2656910c5c63
Fix type declarations inadvertedtly referencing Polymer.Element. (#5084)https://github.com/Polymer/polymer/commit/82cd3dad8d888fc375b433954c288fecfcaba0e9
#5084https://github.com/Polymer/polymer/pull/5084
82cd3dahttps://github.com/Polymer/polymer/commit/82cd3dad8d888fc375b433954c288fecfcaba0e9
https://github.com/inad9300
Daniel M. (inad9300)https://github.com/inad9300
on May 12, 2018https://github.com/microsoft/TypeScript/issues/983#issuecomment-388569577
microsofthttps://github.com/microsoft
on Jul 31, 2018https://github.com/microsoft/TypeScript/issues/983#event-1763298250
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/983
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/983
DeclinedThe issue was declined as something which matches the TypeScript visionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Declined%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.