Title: Add Support for design-time decorators · Issue #2900 · microsoft/TypeScript · GitHub
Open Graph Title: Add Support for design-time decorators · Issue #2900 · microsoft/TypeScript
X Title: Add Support for design-time decorators · Issue #2900 · microsoft/TypeScript
Description: Now that decorators are supported in TypeScript (#2249), consider adding support for ambient/design-time-only decorators: Ambient decorators can be an extensible way to declare properties on or associate special behavior to declarations;...
Open Graph Description: Now that decorators are supported in TypeScript (#2249), consider adding support for ambient/design-time-only decorators: Ambient decorators can be an extensible way to declare properties on or ass...
X Description: Now that decorators are supported in TypeScript (#2249), consider adding support for ambient/design-time-only decorators: Ambient decorators can be an extensible way to declare properties on or ass...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/2900
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add Support for design-time decorators","articleBody":"Now that decorators are supported in TypeScript (#2249), consider adding support for ambient/design-time-only decorators:\n\nAmbient decorators can be an extensible way to declare properties on or associate special behavior to declarations; design time tools can leverage these associations to produce errors or produce documentation. For example:\n#### Use cases:\n- Deprecated/Obsolete, to support warning on use of specific API’s:\n\n``` ts\ninterface JQuery { \n /** \n * A selector representing selector passed to jQuery(), if any, when creating the original set. \n * version deprecated: 1.7, removed: 1.9 \n */ \n @@deprecated(\"Property is only maintained to the extent needed for supporting .live() in the jQuery Migrate plugin. It may be removed without notice in a future version.\", false) \n selector: string; \n}\n```\n- Suppress linter warning:\n\n``` ts\n@@suppressWarning(\"disallow-leading-underscore\") \nfunction __init() { \n}\n```\n#### Proposal\n\nDesign-time (Ambient) decorators are:\n- ambient functions\n- have a special name starting with \"@\"\n- are not emitted in output JS code, but persisted in .d.ts outputs.\n\nApplication\n- Applying a design-time can only accept constant values. Variables would not be observable by the compiler at compile time. Here is the set of possible values:\n - string literal,\n - number literal,\n - regexp literal,\n - true keyword,\n - false keyword,\n - null keyword,\n - undefined symbol,\n - const enum members,\n - array literals of one of the previous kinds,\n - object literal with only properties with values of one of the previous kinds\n","author":{"url":"https://github.com/mhegazy","@type":"Person","name":"mhegazy"},"datePublished":"2015-04-24T01:51:01Z","url":"https://github.com/microsoft/TypeScript/issues/2900"}
| 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:5083ad31-5310-5946-3a21-1ea4b43e2845 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B7FA:BBAAA:72419C:98F200:6B00D762 |
| html-safe-nonce | d386e0a13f6148bb1fc8f5dc6a0ff6ca5739fb4c6bd3398d70876c42a5790708 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCN0ZBOkJCQUFBOjcyNDE5Qzo5OEYyMDA6NkIwMEQ3NjIiLCJ2aXNpdG9yX2lkIjoiNTE1NTk2MjA1NjExMzQxNjY2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fdc540bd981761169f853db6a715a6d7d240706fefc7e5386abba46d5b62878c |
| hovercard-subject-tag | issue:70560585 |
| 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/2900/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ac5e88ba4cc4d5681e8d12759e68de69487b3c616e02245e58ff5203dac5bdc3/microsoft/TypeScript/issues/2900 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ac5e88ba4cc4d5681e8d12759e68de69487b3c616e02245e58ff5203dac5bdc3/microsoft/TypeScript/issues/2900 |
| og:image:alt | Now that decorators are supported in TypeScript (#2249), consider adding support for ambient/design-time-only decorators: Ambient decorators can be an extensible way to declare properties on or ass... |
| 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 | a481f62a1e04c9b9bdcb5628230682c66d59006f5b13b080f79cba84a176905b |
| 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 | 84c8c5cc25e2fb7f2308428458538436baecc6d2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width