René's URL Explorer Experiment


Title: Generating type definitions for mixin classes with protected members · Issue #17744 · microsoft/TypeScript · GitHub

Open Graph Title: Generating type definitions for mixin classes with protected members · Issue #17744 · microsoft/TypeScript

X Title: Generating type definitions for mixin classes with protected members · Issue #17744 · microsoft/TypeScript

Description: TypeScript Version: 2.4.2 Code: I'm using mixins as described by: #13743 export type Constructor = new(...args: any[]) => T; export function Unsubscriber>(Base: T) { class Unsubscriber extends Base implements...

Open Graph Description: TypeScript Version: 2.4.2 Code: I'm using mixins as described by: #13743 export type Constructor = new(...args: any[]) => T; export function Unsubscriber>(Base: T) { cl...

X Description: TypeScript Version: 2.4.2 Code: I'm using mixins as described by: #13743 export type Constructor<T> = new(...args: any[]) => T; export function Unsubscriber<T extends Constructor<...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generating type definitions for mixin classes with protected members","articleBody":"**TypeScript Version:**  2.4.2\r\n\r\n**Code:**\r\n\r\nI'm using mixins as described by: https://github.com/Microsoft/TypeScript/pull/13743\r\n\r\n```\r\nexport type Constructor\u003cT> = new(...args: any[]) => T;\r\nexport function Unsubscriber\u003cT extends Constructor\u003c{}>>(Base: T)  {\r\n  class Unsubscriber extends Base implements OnDestroy {\r\n    protected unsubscribe: Subject\u003cvoid> = new Subject();\r\n\r\n    ngOnDestroy() {\r\n      this.unsubscribe.next();\r\n      this.unsubscribe.complete();\r\n    }\r\n  }\r\n  return Unsubscriber;\r\n}\r\n```\r\n\r\nIf I compile this code with `\"declaration\": true` to get type definitions for my library, I get the following error:\r\n\r\n```\r\nERROR in (truncated)/mixins.ts (...): Return type of exported function has or is using private name 'Unsubscriber'.\r\n```\r\n\r\nOne solution is to add an interface...\r\n\r\n```\r\nexport interface IUnsubscriber extends OnDestroy {\r\n  unsubscribe: Subject\u003cvoid>;\r\n}\r\n```\r\n\r\n...and have my mixin `function` have a return type of `Constructor\u003cIUnsubscriber>`. This works, but it forces me to make the properties/methods exposed by my mixin be `public` even in cases where I want them to be `protected`.\r\n\r\nShort of adding `protected` members to interfaces (which I'm not sure is the right thing to do), this seems to be a limitation of the currently supported mixin strategy.\r\n\r\n","author":{"url":"https://github.com/fr0","@type":"Person","name":"fr0"},"datePublished":"2017-08-11T17:34:57Z","url":"https://github.com/microsoft/TypeScript/issues/17744"}

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:5b28a3df-f412-2fa3-4580-79fd156bbd44
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB980:2C69FC:6079C5:80AAD4:6B01A342
html-safe-nonced8d8d59b9754e80c09f1804af8c7e0768ac2964c29ec7ac0aec1ac5aa4a44bb6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTgwOjJDNjlGQzo2MDc5QzU6ODBBQUQ0OjZCMDFBMzQyIiwidmlzaXRvcl9pZCI6IjkwNDYyNTU1MDcyODI2OTkwNzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac18becd2bf0cdc66965fd56e798da0ace147e44d364df56e16049f8f774dd0491
hovercard-subject-tagissue:249700441
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/17744/issue_layout
twitter:imagehttps://opengraph.githubassets.com/892e4851431e55babd914368b8a1afdc12a4259d3bf3c0e5d0eac11fdfb1f207/microsoft/TypeScript/issues/17744
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/892e4851431e55babd914368b8a1afdc12a4259d3bf3c0e5d0eac11fdfb1f207/microsoft/TypeScript/issues/17744
og:image:altTypeScript Version: 2.4.2 Code: I'm using mixins as described by: #13743 export type Constructor = new(...args: any[]) => T; export function Unsubscriber>(Base: T) { cl...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamefr0
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/17744#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F17744
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%2F17744
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/17744
Reloadhttps://github.com/microsoft/TypeScript/issues/17744
Reloadhttps://github.com/microsoft/TypeScript/issues/17744
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/17744
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/17744
Generating type definitions for mixin classes with protected membershttps://github.com/microsoft/TypeScript/issues/17744#top
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Domain: Declaration EmitThe issue relates to the emission of d.ts fileshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20Declaration%20Emit%22
Backloghttps://github.com/microsoft/TypeScript/milestone/29
https://github.com/fr0
Chris Frolik (fr0)https://github.com/fr0
on Aug 11, 2017https://github.com/microsoft/TypeScript/issues/17744#issue-249700441
#13743https://github.com/microsoft/TypeScript/pull/13743
Nexthttps://github.com/microsoft/TypeScript/issues/17744?timeline_page=1
Chris Frolik (fr0)https://github.com/fr0
on Aug 11, 2017https://github.com/microsoft/TypeScript/issues/17744#event-1203009767
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Aug 25, 2017https://github.com/microsoft/TypeScript/issues/17744#event-1220749597
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
Wesley Wigham (weswigham)https://github.com/weswigham
on Aug 25, 2017https://github.com/microsoft/TypeScript/issues/17744#event-1220749644
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
Domain: Declaration EmitThe issue relates to the emission of d.ts fileshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20Declaration%20Emit%22
on Aug 25, 2017https://github.com/microsoft/TypeScript/issues/17744#event-1220749691
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 2.6https://github.com/microsoft/TypeScript/milestone/53
on Sep 1, 2017https://github.com/microsoft/TypeScript/issues/17744#event-1230565536
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 2.6https://github.com/microsoft/TypeScript/milestone/53
TypeScript 2.7https://github.com/microsoft/TypeScript/milestone/56
on Oct 9, 2017https://github.com/microsoft/TypeScript/issues/17744#event-1284779778
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 2.7https://github.com/microsoft/TypeScript/milestone/56
TypeScript 2.8https://github.com/microsoft/TypeScript/milestone/61
on Jan 9, 2018https://github.com/microsoft/TypeScript/issues/17744#event-1414988465
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 2.8https://github.com/microsoft/TypeScript/milestone/61
TypeScript 2.9https://github.com/microsoft/TypeScript/milestone/67
on Mar 9, 2018https://github.com/microsoft/TypeScript/issues/17744#event-1514266091
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 2.9https://github.com/microsoft/TypeScript/milestone/67
TypeScript 3.0https://github.com/microsoft/TypeScript/milestone/70
on May 10, 2018https://github.com/microsoft/TypeScript/issues/17744#event-1620234769
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 3.0https://github.com/microsoft/TypeScript/milestone/70
on Jul 2, 2018https://github.com/microsoft/TypeScript/issues/17744#event-1712720253
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 3.2https://github.com/microsoft/TypeScript/milestone/77
Futurehttps://github.com/microsoft/TypeScript/milestone/29
on Oct 10, 2018https://github.com/microsoft/TypeScript/issues/17744#event-1896474703
https://github.com/octogonz
Pete Gonzalez (octogonz)https://github.com/octogonz
on Oct 20, 2018https://github.com/microsoft/TypeScript/issues/17744#issuecomment-431534647
https://github.com/hueyhe
Huey (hueyhe)https://github.com/hueyhe
on Mar 1, 2019https://github.com/microsoft/TypeScript/issues/17744#issuecomment-468615059
https://github.com/octogonz
Pete Gonzalez (octogonz)https://github.com/octogonz
on Mar 1, 2019https://github.com/microsoft/TypeScript/issues/17744#issuecomment-468748859
this examplehttps://www.typescriptlang.org/play/#src=%2F%2F%20Helper%20that%20copies%20properties%20from%20base's%20prototype%0D%0A%2F%2F%20to%20child's%20prototype%0D%0Afunction%20extend(child%3A%20any%2C%20base%3A%20any)%3A%20void%20%7B%0D%0A%20%20for%20(var%20property%20in%20base)%20%7B%0D%0A%20%20%20%20var%20descriptor%20%3D%20Object.getOwnPropertyDescriptor(base%2C%20property)%20%7C%7C%20%7B%20value%3A%20base%5Bproperty%5D%20%7D%3B%0D%0A%20%20%20%20Object.defineProperty(child%2C%20property%2C%20descriptor)%3B%0D%0A%20%20%7D%0D%0A%7D%0D%0A%0D%0A%2F%2F%20The%20mixin%20base%20classes%0D%0Aclass%20Base1%20%7B%0D%0A%20%20%20%20constructor()%20%7B%0D%0A%20%20%20%20%20%20%20%20console.log('Base1.constructor()%20called')%0D%0A%20%20%20%20%7D%0D%0A%20%20%20%20public%20method1()%3A%20void%20%7B%0D%0A%20%20%20%20%20%20%20%20console.log('method1()%20called')%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%0D%0Aclass%20Base2%20%7B%0D%0A%20%20%20%20constructor()%20%7B%0D%0A%20%20%20%20%20%20%20%20console.log('Base2.constructor()%20called')%0D%0A%20%20%20%20%7D%0D%0A%20%20%20%20public%20method2()%3A%20void%20%7B%0D%0A%20%20%20%20%20%20%20%20console.log('method2()%20called')%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%0D%0Aclass%20Base3%20%7B%0D%0A%20%20%20%20constructor()%20%7B%0D%0A%20%20%20%20%20%20%20%20console.log('Base3.constructor()%20called')%0D%0A%20%20%20%20%7D%0D%0A%20%20%20%20private%20_prop3%20%3D%20123%3B%0D%0A%20%20%20%20public%20get%20prop3()%3A%20number%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20this._prop3%3B%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%0D%0A%2F%2F%20Collect%20the%20base%20classes%20into%20an%20intermediary%20%22Mixin%22%20class%0D%0Atype%20Mixin%20%3D%20Base1%20%26%20Base2%20%26%20Base3%3B%0D%0Aconst%20Mixin%3A%20%7B%20new()%3A%20Mixin%20%7D%20%3D%20class%20%7B%20%0D%0A%20%20%20%20constructor()%20%7B%0D%0A%20%20%20%20%20%20%20%20Base1.call(this)%3B%0D%0A%20%20%20%20%20%20%20%20Base2.call(this)%3B%0D%0A%20%20%20%20%20%20%20%20Base3.call(this)%3B%0D%0A%20%20%20%20%7D%0D%0A%7D%20as%20any%3B%0D%0Aextend(Mixin.prototype%2C%20Base1.prototype)%3B%0D%0Aextend(Mixin.prototype%2C%20Base2.prototype)%3B%0D%0Aextend(Mixin.prototype%2C%20Base3.prototype)%3B%0D%0A%0D%0A%2F%2F%20Extend%20from%20the%20%22Mixin%22%20class%0D%0Aclass%20Child%20extends%20Mixin%20%7B%0D%0A%20%20%20%20public%20method4()%3A%20void%20%7B%0D%0A%20%20%20%20%20%20%20%20console.log('method4()%20called')%0D%0A%20%20%20%20%7D%20%20%20%20%0D%0A%7D%0D%0A%0D%0Aconst%20child%20%3D%20new%20Child()%3B%0D%0A%0D%0Achild.method1()%3B%0D%0Achild.method2()%3B%0D%0Aconsole.log('prop3%20%3D%20'%20%2B%20child.prop3)%3B%0D%0Achild.method4()%3B
https://github.com/Elvynia
Elvynia (Elvynia)https://github.com/Elvynia
on Aug 30, 2019https://github.com/microsoft/TypeScript/issues/17744#issuecomment-526579648
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
https://github.com/web-padawan
Serhii Kulykov (web-padawan)https://github.com/web-padawan
on Nov 27, 2019https://github.com/microsoft/TypeScript/issues/17744#issuecomment-558990381
Elixhttps://component.kitchen/blog/posts/hiding-internal-framework-methods-and-properties-from-web-component-apis
Generating type definitions for mixin classes with protected members #17744 (comment)https://github.com/microsoft/TypeScript/issues/17744#issuecomment-431534647
[ts] 'private' modifier cannot appear on a type member. #25163 (comment)https://github.com/microsoft/TypeScript/issues/25163#issuecomment-507074489
Make members private again hypermedia-app/Alcaeus#33https://github.com/hypermedia-app/Alcaeus/issues/33
Wesley Wigham (@weswigham)https://github.com/weswigham
#17293 (comment)https://github.com/microsoft/TypeScript/issues/17293#issuecomment-522491710
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
on Nov 27, 2019https://github.com/microsoft/TypeScript/issues/17744#issuecomment-559205923
https://github.com/trusktr
Joe Pea (trusktr)https://github.com/trusktr
on May 12, 2020https://github.com/microsoft/TypeScript/issues/17744#issuecomment-627040567
Chris Frolik (@fr0)https://github.com/fr0
#35822https://github.com/microsoft/TypeScript/issues/35822
https://github.com/justinfagnani
Justin Fagnani (justinfagnani)https://github.com/justinfagnani
on Nov 17, 2020https://github.com/microsoft/TypeScript/issues/17744#issuecomment-729118262
Wesley Wigham (@weswigham)https://github.com/weswigham
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
on Nov 18, 2020https://github.com/microsoft/TypeScript/issues/17744#issuecomment-729326441
https://github.com/jogibear9988
Jochen Kühner (jogibear9988)https://github.com/jogibear9988
on Mar 19, 2021https://github.com/microsoft/TypeScript/issues/17744#issuecomment-803076436
Wesley Wigham (@weswigham)https://github.com/weswigham
#35822https://github.com/microsoft/TypeScript/issues/35822
https://github.com/hjkcai
Jingkun Hua (hjkcai)https://github.com/hjkcai
on Apr 1, 2021https://github.com/microsoft/TypeScript/issues/17744#issuecomment-812017884
Rafael (rafern)https://github.com/rafern
on Jul 9, 2021https://github.com/microsoft/TypeScript/issues/17744#event-5000099014
Enable declaration file emission. Fix issues that arrise from thishttps://github.com/rafern/canvas-ui/commit/d8561608564c410a0f403f469e8406d66cdd9605
d856160https://github.com/rafern/canvas-ui/commit/d8561608564c410a0f403f469e8406d66cdd9605
https://github.com/hampoelz
Rene Hampölz (hampoelz)https://github.com/hampoelz
on Sep 29, 2025https://github.com/microsoft/TypeScript/issues/17744#issuecomment-3348861934
Jingkun Hua (@hjkcai)https://github.com/hjkcai
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/17744
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/17744
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Domain: Declaration EmitThe issue relates to the emission of d.ts fileshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20Declaration%20Emit%22
BacklogNo due datehttps://github.com/microsoft/TypeScript/milestone/29
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.