Title: immutable types · Issue #11535 · microsoft/TypeScript · GitHub
Open Graph Title: immutable types · Issue #11535 · microsoft/TypeScript
X Title: immutable types · Issue #11535 · microsoft/TypeScript
Description: situation: i need an interface 100% similar to a given one but with all properties readonly: interface MyConfig { name: string; settings: MySettings } interface MySettins { values: string[]; } problem: in order to get MyConfig immutable ...
Open Graph Description: situation: i need an interface 100% similar to a given one but with all properties readonly: interface MyConfig { name: string; settings: MySettings } interface MySettins { values: string[]; } prob...
X Description: situation: i need an interface 100% similar to a given one but with all properties readonly: interface MyConfig { name: string; settings: MySettings } interface MySettins { values: string[]; } prob...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/11535
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"immutable types","articleBody":"situation:\n- i need an interface 100% similar to a given one but with all properties readonly: \n \n ``` typescript\n interface MyConfig {\n name: string;\n settings: MySettings\n }\n interface MySettins {\n values: string[];\n }\n ```\n\nproblem: \n- in order to get `MyConfig` immutable i have to effectively re-declare it with all properties which is a lot of work and maintenance:\n \n ``` typescript\n interface MyConfigReadOnly {\n readonly name: string;\n readonly settings: MySettingsReadOnly;\n }\n interface MySettingsReadOnly {\n readonly values: ReadOnlyArray\u003cstring>;\n }\n ```\n\nsolution:\n- allow special declaration that produces a readonly version of an interface based on the original one :\n \n ``` typescript\n \n interface MyConfigReadOnly readonly MyConfig {\n // \u003c-- notice here how we saved some work redeclaring the name property!\n settings: MySettingsReadOnly;\n }\n interface MySettingsReadOnly readonly MySettings {\n values: ReadOnlyArray\u003cstring>;\n }\n ```\n","author":{"url":"https://github.com/zpdDG4gta8XKpMCd","@type":"Person","name":"zpdDG4gta8XKpMCd"},"datePublished":"2016-10-11T15:52:51Z","url":"https://github.com/microsoft/TypeScript/issues/11535"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ca2e47a7-613d-7e77-b7bd-ea350c2ff18f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ABAC:20CEDF:7BC239:A441BD:6AFBCFCB |
| html-safe-nonce | a8058a00ab9c3622116d912ee3cc3fe78df6c2dd74977f0ad26a1b8cd6adaf3b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkFDOjIwQ0VERjo3QkMyMzk6QTQ0MUJEOjZBRkJDRkNCIiwidmlzaXRvcl9pZCI6IjU3NzQ3ODI0Nzg0NDcwMDU2NDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | febd7fadd8a807227a71c34baa936a97840a4675211f9691682c870aaff35937 |
| hovercard-subject-tag | issue:182302881 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/11535/issue_layout |
| twitter:image | https://opengraph.githubassets.com/01c2818742eaac9c45f5c4fcb23ce5ff298137380d149f421e1a8bc474babac5/microsoft/TypeScript/issues/11535 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/01c2818742eaac9c45f5c4fcb23ce5ff298137380d149f421e1a8bc474babac5/microsoft/TypeScript/issues/11535 |
| og:image:alt | situation: i need an interface 100% similar to a given one but with all properties readonly: interface MyConfig { name: string; settings: MySettings } interface MySettins { values: string[]; } prob... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zpdDG4gta8XKpMCd |
| hostname | github.com |
| expected-hostname | github.com |
| None | 18742cb872ec73544356e60359266b67aafece70c4ce008042e06227924cdd07 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 820be804f18e1ef3940bd74a00d41d73d02e2b91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width