-
-
Notifications
You must be signed in to change notification settings - Fork 623
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
Allow better typing for module configuration #940
Comments
I don't think that we'l be able to address this in the current version of Aurelia. However, we've gathered a ton of feedback over the years on our plugin system in general and have made a bunch of improvements for our vNext. I'm going to close this out since we've already addressed this particular concern there. |
Actually, if all it really takes is the above modification of the types, I think we could do that in vCurrent possibly. I'm a bit nervous that this could break some people. We don't want to do that. If you want to submit a PR for this, we could discuss the implications further there. |
Yes, its doable, and a quality of life improvement that can help many typescript users. Can we reopen this? |
Re-opened 😄 |
I'm submitting a feature request
1.3.1
Please tell us about your environment:
Operating System:
Windows 10
Node Version:
12.8.0
NPM Version:
6.11.3
Aurelia CLI OR JSPM OR Webpack AND Version
none
Browser:
all
Language:
TypeScript
Current behavior:
During intial configuration when modules are included, the module configuration argument is of type any:
It is currently not possible for module authors to improve typings for their module, as
aurelia.use
is of typeFrameworkConfiguration
, and it is not possible to extend classes with typings in typescript.Expected/desired behavior:
It would be really neat if the
FramworkConfiguration
implemented an interface, sayIFramworkConfiguration
for the builder api instead of theFrameworkConfiguration
itself.The interface should of cause contain all all the properties/methods of
FramworkConfiguration
, and the return type for the methods should be changed toIFrameworkConfiguration
.This change would enable module authors to include typing aided configuration. Say for example:
To make this work with
PLATFORM.moduleName()
in webpack environments, its typing definitation should be changed from:to:
to specifically tell typescript that the same module name is returned.
To make for a more robust plugin experience where configuration is typed.
The text was updated successfully, but these errors were encountered: