-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unable to use any plugins with Typescript #231
Comments
@peterhalicky - the Alternately, I tried this and it seems to work:, and it might have less impact to existing users import * as jsep from 'jsep';
import { IPlugin } from 'jsep';
// ...plugin
declare const _export: IPlugin;
export default _export; Any thoughts on something like this? |
I'm no expert on TS, but if I understand this correctly, you redeclare the type of the export to be |
🎉 This issue has been resolved in version 1.3.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [@jsep-plugin/arrow-v1.0.5](https://github.com/EricSmekens/jsep/compare/@jsep-plugin/arrow-v1.0.4...@jsep-plugin/arrow-v1.0.5) (2022-09-18) ### Bug Fixes * export default IPlugin from all plugins ([cd38da5](cd38da5)), closes [#231](#231)
🎉 This issue has been resolved in version @jsep-plugin/arrow-v1.0.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [@jsep-plugin/assignment-v1.2.1](https://github.com/EricSmekens/jsep/compare/@jsep-plugin/assignment-v1.2.0...@jsep-plugin/assignment-v1.2.1) (2022-09-18) ### Bug Fixes * export default IPlugin from all plugins ([cd38da5](cd38da5)), closes [#231](#231)
🎉 This issue has been resolved in version @jsep-plugin/assignment-v1.2.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [@jsep-plugin/async-await-v1.0.2](https://github.com/EricSmekens/jsep/compare/@jsep-plugin/async-await-v1.0.1...@jsep-plugin/async-await-v1.0.2) (2022-09-18) ### Bug Fixes * export default IPlugin from all plugins ([cd38da5](cd38da5)), closes [#231](#231)
🎉 This issue has been resolved in version @jsep-plugin/async-await-v1.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [@jsep-plugin/comment-v1.0.3](https://github.com/EricSmekens/jsep/compare/@jsep-plugin/comment-v1.0.2...@jsep-plugin/comment-v1.0.3) (2022-09-18) ### Bug Fixes * export default IPlugin from all plugins ([cd38da5](cd38da5)), closes [#231](#231)
🎉 This issue has been resolved in version @jsep-plugin/comment-v1.0.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [@jsep-plugin/new-v1.0.2](https://github.com/EricSmekens/jsep/compare/@jsep-plugin/new-v1.0.1...@jsep-plugin/new-v1.0.2) (2022-09-18) ### Bug Fixes * export default IPlugin from all plugins ([cd38da5](cd38da5)), closes [#231](#231)
🎉 This issue has been resolved in version @jsep-plugin/new-v1.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [@jsep-plugin/numbers-v1.0.1](https://github.com/EricSmekens/jsep/compare/@jsep-plugin/numbers-v1.0.0...@jsep-plugin/numbers-v1.0.1) (2022-09-18) ### Bug Fixes * export default IPlugin from all plugins ([cd38da5](cd38da5)), closes [#231](#231)
🎉 This issue has been resolved in version @jsep-plugin/numbers-v1.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [@jsep-plugin/object-v1.2.1](https://github.com/EricSmekens/jsep/compare/@jsep-plugin/object-v1.2.0...@jsep-plugin/object-v1.2.1) (2022-09-18) ### Bug Fixes * export default IPlugin from all plugins ([cd38da5](cd38da5)), closes [#231](#231)
🎉 This issue has been resolved in version @jsep-plugin/object-v1.2.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [@jsep-plugin/regex-v1.0.3](https://github.com/EricSmekens/jsep/compare/@jsep-plugin/regex-v1.0.2...@jsep-plugin/regex-v1.0.3) (2022-09-18) ### Bug Fixes * export default IPlugin from all plugins ([cd38da5](cd38da5)), closes [#231](#231)
🎉 This issue has been resolved in version @jsep-plugin/regex-v1.0.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [@jsep-plugin/spread-v1.0.2](https://github.com/EricSmekens/jsep/compare/@jsep-plugin/spread-v1.0.1...@jsep-plugin/spread-v1.0.2) (2022-09-18) ### Bug Fixes * export default IPlugin from all plugins ([cd38da5](cd38da5)), closes [#231](#231)
🎉 This issue has been resolved in version @jsep-plugin/spread-v1.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [@jsep-plugin/template-v1.0.2](https://github.com/EricSmekens/jsep/compare/@jsep-plugin/template-v1.0.1...@jsep-plugin/template-v1.0.2) (2022-09-18) ### Bug Fixes * export default IPlugin from all plugins ([cd38da5](cd38da5)), closes [#231](#231)
🎉 This issue has been resolved in version @jsep-plugin/template-v1.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [@jsep-plugin/ternary-v1.1.3](https://github.com/EricSmekens/jsep/compare/@jsep-plugin/ternary-v1.1.2...@jsep-plugin/ternary-v1.1.3) (2022-09-18) ### Bug Fixes * export default IPlugin from all plugins ([cd38da5](cd38da5)), closes [#231](#231)
🎉 This issue has been resolved in version @jsep-plugin/ternary-v1.1.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
It is not possible to use any of the provided plugins with Typescript (well - I've tried two). The following code:
Produces errors by tsc:
The only way I found to work around this is to use
jsep.plugins.register(comment as unknown as IPlugin)
, although that seems to be a bit ugly.When I modified the plugin's tsd.d.ts and changed the first line
import * as jsep from 'jsep';
toimport jsep from 'jsep';
then the compiler error disappeared. This is probably the way to fix the issue, although I will leave it to the authors to decide if that is the right solution.Code/project to reproduce the problem can be found here: https://github.com/peterhalicky/jsep-plugin-issue
The text was updated successfully, but these errors were encountered: