René's URL Explorer Experiment


Title: Star-imported module should conform to the type of a string-indexed object · Issue #17622 · microsoft/TypeScript · GitHub

Open Graph Title: Star-imported module should conform to the type of a string-indexed object · Issue #17622 · microsoft/TypeScript

X Title: Star-imported module should conform to the type of a string-indexed object · Issue #17622 · microsoft/TypeScript

Description: TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx) Suppose I have this module: // foo.ts export const x = 3 export const y = 5 Conceptually this module represents a map of strings to numbers, { [k: string]: number }, however if I t...

Open Graph Description: TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx) Suppose I have this module: // foo.ts export const x = 3 export const y = 5 Conceptually this module represents a map of strings to numbers,...

X Description: TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx) Suppose I have this module: // foo.ts export const x = 3 export const y = 5 Conceptually this module represents a map of strings to numbers,...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Star-imported module should conform to the type of a string-indexed object","articleBody":"**TypeScript Version:**  2.4.0 / nightly (2.5.0-dev.201xxxxx)\r\n\r\nSuppose I have this module:\r\n\r\n```ts\r\n// foo.ts\r\n\r\nexport const x = 3\r\nexport const y = 5\r\n```\r\n\r\nConceptually this module represents a map of strings to numbers, `{ [k: string]: number }`, however if I try to use it directly as such I get a type error:\r\n\r\n```ts\r\n// bar.ts\r\n\r\nimport * as foo from './foo'\r\n\r\nfunction f(map: { [k: string]: number }) {\r\n  // ...\r\n}\r\n\r\nf(foo)\r\n//^^^ Argument of type 'typeof \"/Users/tom/code/example/src/foo\"' is not assignable to parameter of type '{ [k: string]: number; }'.\r\n//      Index signature is missing in type 'typeof \"/Users/tom/code/example/src/foo\"'.\r\n```\r\n\r\nFortunately there is a workaround: I can simply spread and recompose the module to make it conform to the expected type:\r\n\r\n```ts\r\nf({ ...foo }) // this type checks!\r\n```\r\n\r\nHowever it'd be nice if the more straightforward approach just worked!","author":{"url":"https://github.com/pelotom","@type":"Person","name":"pelotom"},"datePublished":"2017-08-04T20:59:14Z","url":"https://github.com/microsoft/TypeScript/issues/17622"}

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:f2c357ea-d1ab-5b12-d04d-8965773c86cd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC35E:DB09F:A35223:D1B8EA:6B00F546
html-safe-nonce130e6e35c74d0ff9e1538b45f1e7f858c7fc8d3dd44df56f5a9e1dd5366e299a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzVFOkRCMDlGOkEzNTIyMzpEMUI4RUE6NkIwMEY1NDYiLCJ2aXNpdG9yX2lkIjoiNTQ3NzU3MTc4MDk0NjIyODU1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc27b2b98766c0f238256846c0177d07abd6cfd878ed74b918cbfa4bef9003315
hovercard-subject-tagissue:248115930
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/17622/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ca1e74b4204802790d8aee1d3913f66d14bd2f6249fc998196eabd6103e5234a/microsoft/TypeScript/issues/17622
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ca1e74b4204802790d8aee1d3913f66d14bd2f6249fc998196eabd6103e5234a/microsoft/TypeScript/issues/17622
og:image:altTypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx) Suppose I have this module: // foo.ts export const x = 3 export const y = 5 Conceptually this module represents a map of strings to numbers,...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepelotom
hostnamegithub.com
expected-hostnamegithub.com
None4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc
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
release9983dd5da06943f833c971dd5b6bc988e2858be5
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/17622#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F17622
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%2F17622
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/17622
Reloadhttps://github.com/microsoft/TypeScript/issues/17622
Reloadhttps://github.com/microsoft/TypeScript/issues/17622
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests308 (308)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/17622
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/17622
Star-imported module should conform to the type of a string-indexed objecthttps://github.com/microsoft/TypeScript/issues/17622#top
https://github.com/weswigham
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
TypeScript 2.6.1https://github.com/microsoft/TypeScript/milestone/57
https://github.com/pelotom
Tom Crockett (pelotom)https://github.com/pelotom
on Aug 4, 2017https://github.com/microsoft/TypeScript/issues/17622#issue-248115930
https://github.com/pelotom
Tom Crockett (pelotom)https://github.com/pelotom
on Aug 4, 2017https://github.com/microsoft/TypeScript/issues/17622#issuecomment-320353680
https://github.com/aluanhaddad
Aluan Haddad (aluanhaddad)https://github.com/aluanhaddad
on Aug 6, 2017https://github.com/microsoft/TypeScript/issues/17622#issuecomment-320481683
https://github.com/pelotom
Tom Crockett (pelotom)https://github.com/pelotom
on Aug 6, 2017https://github.com/microsoft/TypeScript/issues/17622#issuecomment-320487172
https://github.com/pelotom
Tom Crockett (pelotom)https://github.com/pelotom
on Aug 6, 2017https://github.com/microsoft/TypeScript/issues/17622#issuecomment-320487270
https://github.com/aluanhaddad
Aluan Haddad (aluanhaddad)https://github.com/aluanhaddad
on Aug 6, 2017https://github.com/microsoft/TypeScript/issues/17622#issuecomment-320489064
https://github.com/kitsonk
Kitson Kelly (kitsonk)https://github.com/kitsonk
on Aug 6, 2017https://github.com/microsoft/TypeScript/issues/17622#issuecomment-320511988
#16248https://github.com/microsoft/TypeScript/issues/16248
#10998https://github.com/microsoft/TypeScript/issues/10998
https://github.com/thw0rted
James Bromwell (thw0rted)https://github.com/thw0rted
on Aug 17, 2017https://github.com/microsoft/TypeScript/issues/17622#issuecomment-323009210
https://github.com/aluanhaddad
Aluan Haddad (aluanhaddad)https://github.com/aluanhaddad
on Aug 17, 2017https://github.com/microsoft/TypeScript/issues/17622#issuecomment-323058953
James Bromwell (@thw0rted)https://github.com/thw0rted
https://github.com/thw0rted
James Bromwell (thw0rted)https://github.com/thw0rted
on Aug 17, 2017https://github.com/microsoft/TypeScript/issues/17622#issuecomment-323065128
https://github.com/aluanhaddad
Aluan Haddad (aluanhaddad)https://github.com/aluanhaddad
on Aug 17, 2017https://github.com/microsoft/TypeScript/issues/17622#issuecomment-323075101
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
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on Aug 17, 2017https://github.com/microsoft/TypeScript/issues/17622#event-1211029381
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Aug 17, 2017https://github.com/microsoft/TypeScript/issues/17622#issuecomment-323214830
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
Wesley Wigham (weswigham)https://github.com/weswigham
on Sep 19, 2017https://github.com/microsoft/TypeScript/issues/17622#event-1255933971
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on Sep 19, 2017https://github.com/microsoft/TypeScript/issues/17622#event-1255934071
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 2.6https://github.com/microsoft/TypeScript/milestone/53
on Sep 19, 2017https://github.com/microsoft/TypeScript/issues/17622#event-1255934133
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 2.6https://github.com/microsoft/TypeScript/milestone/53
TypeScript 2.6.1https://github.com/microsoft/TypeScript/milestone/57
on Oct 9, 2017https://github.com/microsoft/TypeScript/issues/17622#event-1284827521
Wesley Wigham (weswigham)https://github.com/weswigham
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#19090https://github.com/microsoft/TypeScript/pull/19090
on Oct 11, 2017https://github.com/microsoft/TypeScript/issues/17622#event-1289170762
Wesley Wigham (weswigham)https://github.com/weswigham
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
on Oct 11, 2017https://github.com/microsoft/TypeScript/issues/17622#event-1289171040
microsofthttps://github.com/microsoft
on Jun 14, 2018https://github.com/microsoft/TypeScript/issues/17622#event-1682136475
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/17622
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/17622
Wesley Wigham (weswigham)https://github.com/weswigham
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
TypeScript 2.6.1https://github.com/microsoft/TypeScript/milestone/57
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.