Title: Design Meeting Notes for 1/22/2016 · Issue #6614 · microsoft/TypeScript · GitHub
Open Graph Title: Design Meeting Notes for 1/22/2016 · Issue #6614 · microsoft/TypeScript
X Title: Design Meeting Notes for 1/22/2016 · Issue #6614 · microsoft/TypeScript
Description: Declaring ambient external modules Related issues: #247 (comment) #5787 #2709 #6371 (comment) Problems: Can not easily specify a loader extension for json or css (e.g. `json!a.json); currnetlly every reousere needs to have its own declar...
Open Graph Description: Declaring ambient external modules Related issues: #247 (comment) #5787 #2709 #6371 (comment) Problems: Can not easily specify a loader extension for json or css (e.g. `json!a.json); currnetlly eve...
X Description: Declaring ambient external modules Related issues: #247 (comment) #5787 #2709 #6371 (comment) Problems: Can not easily specify a loader extension for json or css (e.g. `json!a.json); currnetlly eve...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/6614
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes for 1/22/2016","articleBody":"# Declaring ambient external modules\n### Related issues:\n- https://github.com/Microsoft/TypeScript/issues/247#issuecomment-173649104\n- https://github.com/Microsoft/TypeScript/issues/5787\n- https://github.com/Microsoft/TypeScript/issues/2709\n- https://github.com/Microsoft/TypeScript/issues/6371#issuecomment-169597919\n### Problems:\n- Can not easily specify a loader extension for json or css (e.g. `json!a.json); currnetlly every reousere needs to have its own declaration\n- Problem with migrating to .ts, with modules that do not have typings, and users just want to get by\n### Proposal:\n- Allow for short hand module declarations:\n \n ``` ts\n declare module \"foo\";\n ```\n \n to be equivalent to:\n \n ``` ts\n declare module \"foo\" {\n var _temp: any;\n export = _temp;\n }\n ```\n- Allow module names to have a wildcard character and match that in lookup\n \n ``` ts\n declare module \"json!*\" {\n let json: any;\n export default json;\n }\n \n import d from \"json!a/b/bar.json\";\n // lookup:\n // json!a/b/bar.json\n // json!*\n ```\n- Additional the module \"*\" would allow for matching all unknown modules in the system, which can be used as a way to suppress all missing module errors\n \n ``` ts\n \n declare module \"*\";\n \n import d from \"some\\unknown\\module\"; // no error, d is any\n ```\n- Report no-implicit-any errors for modules declared using the shorthand notaion\n Open issue: is this reported on declaration or use sites\n# Readonly properties\n### Suggestion\n- https://github.com/Microsoft/TypeScript/issues/12\n### PR\n- https://github.com/Microsoft/TypeScript/pull/6532\n### Design\n\nA property is allowed to have one of three states:\n- readonly\n- unknown\n- mutable\n\nreadonly properties are declared using `readonly` modifier, or as getters with no setters.\nmutable properties are\nreadonly properties can not be assigned to if accessed directly. readonly properties are assignable to properties deemed \"unknown\", but not to mutable properties.\n\nThe rational here is ppl today do not have a way of expressing readonly, so existing typings do not really mean \"mutable\" by default. enforcing a default of mutability on these definitions will make using them with exiting typings much harder. \nwe still want to catch the most blatant violations of readonly, i.e. writing to a readonly property.\n\nSo: \n\n``` ts\ninterface I {\n x: number; \n}\n\nclass C {\n get x() { return 1; }\n}\n\nvar c = new C();\nvar i: I;\n\nc.x = 1; // error, assigning to a readonly property\n\ni = c; // No error, c is assignable to i\n```\n### Next steps\n- Merge https://github.com/Microsoft/TypeScript/pull/6532\n- Add the mutable modifier\n- Look into a `readonly` type operator to generate a readonly version of a type e.g. \n \n ``` ts\n var x: readonly { a: string[] }\n x.a = []; // error;\n x.a.push(..); // error\n x[\"b\"] = 0; // error\n ```\n","author":{"url":"https://github.com/mhegazy","@type":"Person","name":"mhegazy"},"datePublished":"2016-01-25T20:11:29Z","url":"https://github.com/microsoft/TypeScript/issues/6614"}
| 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:b98c26bd-f78d-b1ca-3802-ea3822973987 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CFDA:14FED7:2AFCCC:395C3B:6AFBB83F |
| html-safe-nonce | dd570d508ae5a03388ef11530cf7fc077cce308cbb1930b7e67817505abee1d8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRkRBOjE0RkVENzoyQUZDQ0M6Mzk1QzNCOjZBRkJCODNGIiwidmlzaXRvcl9pZCI6IjYyNTQxOTE0ODY4NTAyODM1ODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fb365da0c1aa9548cac6e2c762d0b0578ef2f6cbc5e554f2051e20c957c49f5d |
| hovercard-subject-tag | issue:128626653 |
| 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/6614/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2ceca45154a1805ee9a22d3dfc8a706e0285c58132252eeff3317be5a026a0e3/microsoft/TypeScript/issues/6614 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2ceca45154a1805ee9a22d3dfc8a706e0285c58132252eeff3317be5a026a0e3/microsoft/TypeScript/issues/6614 |
| og:image:alt | Declaring ambient external modules Related issues: #247 (comment) #5787 #2709 #6371 (comment) Problems: Can not easily specify a loader extension for json or css (e.g. `json!a.json); currnetlly eve... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mhegazy |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c |
| 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 | e4cce0e99cf61481a318ff12c2e8580153a6c7c6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width