René's URL Explorer Experiment


Title: Extending string-based enums · Issue #17592 · microsoft/TypeScript · GitHub

Open Graph Title: Extending string-based enums · Issue #17592 · microsoft/TypeScript

X Title: Extending string-based enums · Issue #17592 · microsoft/TypeScript

Description: Before string based enums, many would fall back to objects. Using objects also allows extending of types. For example: const BasicEvents = { Start: "Start", Finish: "Finish" }; const AdvEvents = { ...BasicEvents, Pause: "Pause", Resume: ...

Open Graph Description: Before string based enums, many would fall back to objects. Using objects also allows extending of types. For example: const BasicEvents = { Start: "Start", Finish: "Finish" }; const AdvEvents = { ...

X Description: Before string based enums, many would fall back to objects. Using objects also allows extending of types. For example: const BasicEvents = { Start: "Start", Finish: "Finish" }; ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Extending string-based enums","articleBody":"Before string based enums, many would fall back to objects. Using objects also allows extending of types. For example:\r\n```ts\r\nconst BasicEvents = {\r\n    Start: \"Start\",\r\n    Finish: \"Finish\"\r\n};\r\n\r\nconst AdvEvents = {\r\n    ...BasicEvents,\r\n    Pause: \"Pause\",\r\n    Resume: \"Resume\"\r\n};\r\n```\r\n\r\nWhen switching over to string enums, it\"s impossible to achieve this without re-defining the enum.\r\n\r\nI would be very useful to be able to do something like this:\r\n\r\n```ts\r\nenum BasicEvents {\r\n    Start = \"Start\",\r\n    Finish = \"Finish\"\r\n};\r\n\r\n// extend enum using \"extends\" keyword\r\nenum AdvEvents extends BasicEvents {\r\n    Pause = \"Pause\",\r\n    Resume = \"Resume\"\r\n};\r\n```\r\n\r\nConsidering that the produced enums are objects, this won\"t be too horrible either:\r\n```ts\r\n// extend enum using spread\r\nenum AdvEvents {\r\n    ...BasicEvents,\r\n    Pause = \"Pause\",\r\n    Resume = \"Resume\"\r\n};\r\n```\r\n","author":{"url":"https://github.com/nomaed","@type":"Person","name":"nomaed"},"datePublished":"2017-08-03T16:51:38Z","url":"https://github.com/microsoft/TypeScript/issues/17592"}

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:c8b17904-eaaf-1857-cb46-96ee7ba8f4d6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBB10:102D75:3D39D:4DF88:6B00F19B
html-safe-noncea8b1b4f397b4a67765cf50ec08c4087c19b8dd626a9aef57469b5005360b6dd2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjEwOjEwMkQ3NTozRDM5RDo0REY4ODo2QjAwRjE5QiIsInZpc2l0b3JfaWQiOiIxMzgwMzA2NzU1OTA4NTk2MTIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac6b56b6a42d18a9176beb22f29ef1b974184c802e4c854a086a52027b16f232e7
hovercard-subject-tagissue:247770146
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/17592/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c32aae99dfb8070bc2458c16158b2539f482d268afae6568f5c35659bce10e7d/microsoft/TypeScript/issues/17592
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c32aae99dfb8070bc2458c16158b2539f482d268afae6568f5c35659bce10e7d/microsoft/TypeScript/issues/17592
og:image:altBefore string based enums, many would fall back to objects. Using objects also allows extending of types. For example: const BasicEvents = { Start: "Start", Finish: "Finish" }; const AdvEvents = { ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamenomaed
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/17592#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F17592
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%2F17592
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/17592
Reloadhttps://github.com/microsoft/TypeScript/issues/17592
Reloadhttps://github.com/microsoft/TypeScript/issues/17592
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/17592
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/17592
Extending string-based enumshttps://github.com/microsoft/TypeScript/issues/17592#top
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
Waiting for TC39Unactionable until TC39 reaches some conclusionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%20TC39%22
https://github.com/nomaed
Boris Aranovič (nomaed)https://github.com/nomaed
on Aug 3, 2017https://github.com/microsoft/TypeScript/issues/17592#issue-247770146
Nexthttps://github.com/microsoft/TypeScript/issues/17592?timeline_page=1
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 3, 2017https://github.com/microsoft/TypeScript/issues/17592#event-1191779729
https://github.com/nomaed
Boris Aranovič (nomaed)https://github.com/nomaed
on Aug 3, 2017https://github.com/microsoft/TypeScript/issues/17592#issuecomment-320028196
https://github.com/aluanhaddad
Aluan Haddad (aluanhaddad)https://github.com/aluanhaddad
on Aug 7, 2017https://github.com/microsoft/TypeScript/issues/17592#issuecomment-320805415
https://github.com/aj-r
AJ Richardson (aj-r)https://github.com/aj-r
on Sep 22, 2017https://github.com/microsoft/TypeScript/issues/17592#issuecomment-331491147
https://github.com/serhiipalash
Serhii Palash (serhiipalash)https://github.com/serhiipalash
on Mar 25, 2018https://github.com/microsoft/TypeScript/issues/17592#issuecomment-375968110
https://github.com/aj-r
AJ Richardson (aj-r)https://github.com/aj-r
on Mar 25, 2018https://github.com/microsoft/TypeScript/issues/17592#issuecomment-375968511
https://github.com/Xenya0815
Xenya0815https://github.com/Xenya0815
on May 8, 2018https://github.com/microsoft/TypeScript/issues/17592#issuecomment-387389023
https://github.com/nOstap
nOstaphttps://github.com/nOstap
on Sep 4, 2018https://github.com/microsoft/TypeScript/issues/17592#issuecomment-418336376
https://github.com/guptaamol
guptaamolhttps://github.com/guptaamol
on Oct 19, 2018https://github.com/microsoft/TypeScript/issues/17592#issuecomment-431257230
https://github.com/cshaa
csha (cshaa)https://github.com/cshaa
on Nov 29, 2018https://github.com/microsoft/TypeScript/issues/17592#issuecomment-442751935
https://user-images.githubusercontent.com/1671665/49209969-30a01980-f3bc-11e8-9dd2-9b9394d70c57.png
https://github.com/LukePetruzzi
Luciano Giovanni (LukePetruzzi)https://github.com/LukePetruzzi
on Dec 18, 2018https://github.com/microsoft/TypeScript/issues/17592#issuecomment-448391522
https://github.com/masak
Carl Mäsak (masak)https://github.com/masak
on Dec 21, 2018https://github.com/microsoft/TypeScript/issues/17592#issuecomment-449412521
https://github.com/alangpierce
Alan Pierce (alangpierce)https://github.com/alangpierce
on Dec 21, 2018https://github.com/microsoft/TypeScript/issues/17592#issuecomment-449417534
Carl Mäsak (@masak)https://github.com/masak
https://github.com/masak
Carl Mäsak (masak)https://github.com/masak
on Dec 21, 2018https://github.com/microsoft/TypeScript/issues/17592#issuecomment-449418683
https://github.com/freakzlike
freakzlikehttps://github.com/freakzlike
on Feb 17, 2022https://github.com/microsoft/TypeScript/issues/17592#issuecomment-1042626684
Nazario A. Ayala (@nazarioa)https://github.com/nazarioa
https://github.com/whut
Rafal Klys (whut)https://github.com/whut
on Feb 22, 2022https://github.com/microsoft/TypeScript/issues/17592#issuecomment-1048313321
Daniel Rosenwasser (@DanielRosenwasser)https://github.com/DanielRosenwasser
https://github.com/Jack-Works/proposal-enumhttps://github.com/Jack-Works/proposal-enum
https://github.com/patriciaverso
Patrícia Villela (patriciaverso)https://github.com/patriciaverso
on Apr 11, 2022https://github.com/microsoft/TypeScript/issues/17592#issuecomment-1095476510
Nazario A. Ayala (@nazarioa)https://github.com/nazarioa
freakzlikehttps://github.com/freakzlike
https://github.com/masak
Carl Mäsak (masak)https://github.com/masak
on Apr 12, 2022https://github.com/microsoft/TypeScript/issues/17592#issuecomment-1095871718
Patrícia Villela (@patriciavillela)https://github.com/patriciavillela
Patrícia Villela (@patriciavillela)https://github.com/patriciavillela
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
Thishttps://github.com/Jack-Works/proposal-enum/discussions/5
https://github.com/nazarioa
Nazario A. Ayala (nazarioa)https://github.com/nazarioa
on Apr 21, 2022https://github.com/microsoft/TypeScript/issues/17592#issuecomment-1105415235
Patrícia Villela (@patriciavillela)https://github.com/patriciavillela
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Waiting for TC39Unactionable until TC39 reaches some conclusionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%20TC39%22
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featurehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Awaiting%20More%20Feedback%22
on Oct 27, 2022https://github.com/microsoft/TypeScript/issues/17592#event-7685937857
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Oct 27, 2022https://github.com/microsoft/TypeScript/issues/17592#issuecomment-1294079155
#51310https://github.com/microsoft/TypeScript/issues/51310
a proposal that's actively being developedhttps://github.com/Jack-Works/proposal-enum
https://github.com/whatwhywhenandwho
Alex (whatwhywhenandwho)https://github.com/whatwhywhenandwho
on Dec 16, 2022https://github.com/microsoft/TypeScript/issues/17592#issuecomment-1354594355
https://github.com/masak
Carl Mäsak (masak)https://github.com/masak
on Dec 19, 2022https://github.com/microsoft/TypeScript/issues/17592#issuecomment-1357009982
Alex (@whatwhywhenandwho)https://github.com/whatwhywhenandwho
https://github.com/alita-moore
Alita Moore (alita-moore)https://github.com/alita-moore
on Jun 24, 2023https://github.com/microsoft/TypeScript/issues/17592#issuecomment-1605675427
https://github.com/masak
Carl Mäsak (masak)https://github.com/masak
on Jun 25, 2023https://github.com/microsoft/TypeScript/issues/17592#issuecomment-1605947288
Sophia Mersmann (sophiamersmann)https://github.com/sophiamersmann
on Nov 26, 2024https://github.com/microsoft/TypeScript/issues/17592#event-15433403579
🔨 (grapher) replace some enum types / TAS-709 (#4170)https://github.com/owid/owid-grapher/commit/c77e1cfab2cb5209c413307c40054ad8afd36b41
#4170https://github.com/owid/owid-grapher/pull/4170
c77e1cfhttps://github.com/owid/owid-grapher/commit/c77e1cfab2cb5209c413307c40054ad8afd36b41
https://github.com/XIshArkIX
shArky (XIshArkIX)https://github.com/XIshArkIX
on May 25, 2026https://github.com/microsoft/TypeScript/issues/17592#issuecomment-4531208759
https://github.com/masak
Carl Mäsak (masak)https://github.com/masak
on May 25, 2026https://github.com/microsoft/TypeScript/issues/17592#issuecomment-4532120182
shArky (@XIshArkIX)https://github.com/XIshArkIX
Ryan Cavanaugh's responsehttps://github.com/microsoft/TypeScript/issues/17592#issuecomment-1294079155
there's now a tc39 proposalhttps://github.com/tc39/proposal-enum
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/17592
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/17592
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
Waiting for TC39Unactionable until TC39 reaches some conclusionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%20TC39%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.