Title: Augmentet methods not available in Visual Studio intellisense unless something is exported from the augmentation module · Issue #7415 · microsoft/TypeScript · GitHub
Open Graph Title: Augmentet methods not available in Visual Studio intellisense unless something is exported from the augmentation module · Issue #7415 · microsoft/TypeScript
X Title: Augmentet methods not available in Visual Studio intellisense unless something is exported from the augmentation module · Issue #7415 · microsoft/TypeScript
Description: I have a class called Webpack, which I augment to add a new method addLess like so: // addLess.ts import { Webpack } from '../webpack'; declare module '../webpack' { interface Webpack { addLess(): Webpack; } } const lessConfiguration = {...
Open Graph Description: I have a class called Webpack, which I augment to add a new method addLess like so: // addLess.ts import { Webpack } from '../webpack'; declare module '../webpack' { interface Webpack { addLess(): ...
X Description: I have a class called Webpack, which I augment to add a new method addLess like so: // addLess.ts import { Webpack } from '../webpack'; declare module '../webpack' { interface Webpa...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/7415
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Augmentet methods not available in Visual Studio intellisense unless something is exported from the augmentation module","articleBody":"I have a class called Webpack, which I augment to add a new method `addLess` like so:\n\n``` typescript\n// addLess.ts\nimport { Webpack } from '../webpack';\n\ndeclare module '../webpack' {\n interface Webpack {\n addLess(): Webpack;\n }\n}\n\nconst lessConfiguration = {\n module: {\n loaders: [\n { test: /\\.less$/, loader: \"style!css!less\" }\n ]\n }\n};\n\nclass Implementation extends Webpack {\n addLess(): Webpack {\n return this.mergeModule('less', lessConfiguration);\n }\n}\n\nWebpack.prototype.addLess = Implementation.prototype.addLess;\n```\n\nThis works great in the current typescript project, but if I compile (with declarations), and try to use the compiled project in another project, the new method is not shown in intellisense in Visual Studio, and it is shown as an error if I try to use it anyway.\nHowever, if I make sure something is exported from the module above it works as expected. For example, I can work around the issue by exporting the class `Implementation` like so:\n\n``` typescript\n// addLess.ts\nimport { Webpack } from '../webpack';\n\ndeclare module '../webpack' {\n interface Webpack {\n addLess(): Webpack;\n }\n}\n\nconst lessConfiguration = {\n module: {\n loaders: [\n { test: /\\.less$/, loader: \"style!css!less\" }\n ]\n }\n};\n\nexport class Implementation extends Webpack {\n addLess(): Webpack {\n return this.mergeModule('less', lessConfiguration);\n }\n}\n\nWebpack.prototype.addLess = Implementation.prototype.addLess;\n```\n\nHowever, this means that I am exporting something, that should be private to the module.\n\nThis issue is only in Visual Studio. When compiling with `gulp-typescript` using typescript 1.8.2, 1.8.5, 1.8.6 or 1.8.7 I get no errors - with or without the extra export.\n\nI am using Visual Studio 2015 update 1 with the extension for Typescript 1.8.4.\n","author":{"url":"https://github.com/MortenHoustonLudvigsen","@type":"Person","name":"MortenHoustonLudvigsen"},"datePublished":"2016-03-07T13:20:21Z","url":"https://github.com/microsoft/TypeScript/issues/7415"}
| 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:b5b0c217-b0a7-1506-8537-b9dc433cd67c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AB82:1F2F:5E0610:7D4B8D:6B018774 |
| html-safe-nonce | c8592cd76c500dc211aeb02702c5f844081c37378e364963495a6c2575b9b73a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjgyOjFGMkY6NUUwNjEwOjdENEI4RDo2QjAxODc3NCIsInZpc2l0b3JfaWQiOiI4NTIzMTM5NzQ3NzM5MTc0NzcyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 53481dd874ac6630d8a8d3fe7ff24ef969330aaf53833387572366a4ba87761f |
| hovercard-subject-tag | issue:138976828 |
| 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/7415/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ee778465d7b3dd6a2cb01bbe7f0d7dede178db6f668a6bb54526143a077ce679/microsoft/TypeScript/issues/7415 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ee778465d7b3dd6a2cb01bbe7f0d7dede178db6f668a6bb54526143a077ce679/microsoft/TypeScript/issues/7415 |
| og:image:alt | I have a class called Webpack, which I augment to add a new method addLess like so: // addLess.ts import { Webpack } from '../webpack'; declare module '../webpack' { interface Webpack { addLess(): ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MortenHoustonLudvigsen |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width