-
Notifications
You must be signed in to change notification settings - Fork 132
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
Method.ts addContextListener signature was not updated for 1.2 and it overrides types for Desktop Agent #435
Comments
@mattjamieson Any chance you could take a look at/have a think about this one? |
Fix should be backported into NPM module for 1.2 |
@mattjamieson @rikoe Lines 24 to 28 in 4cef6a7
It may not matter all that much when all the function signatures are in sync and a container provides the API at The solution may be to move the export of Methods.ts under a namespace, e.g.
|
Hey @kriswest, yes I've been playing with a couple of options. Should get the PR updated tomorrow. |
Minor Issue
We noticed that Methods.ts hasn't been updated for the revised signature for
addContextListener
. The Methods.ts exports also override the DesktopAgent exports.Desktop agent:
FDC3/src/api/DesktopAgent.ts
Line 151 in 4cef6a7
FDC3/src/api/DesktopAgent.ts
Line 151 in 0f240e8
Methods.ts:
FDC3/src/api/Methods.ts
Lines 70 to 78 in 4cef6a7
FDC3/src/api/Methods.ts
Lines 70 to 78 in 0f240e8
Further, we're finding that if you import FDC3 from the NPM module like so:
import * as fdc3 from "@finos/fdc3";
Then the Methods.ts exports take precedence and if you try and use
fdc3.addContextListener(null, listener)
you'll get a typescript error (howeverwindow.fdc3.addContextListener(null, listener)
does pick up the right type.We may need to reconsider how (or even if) these are exported in the index.ts file. I believe they take precedence as they are exported later than the DesktopAgent with the same function names. Some sort of namespacing maybe needed...
Area of Issue
[ ] App Directory
[x] API
[ ] Context Data
[ ] Intents
[ ] Use Cases
[ ] Other
The text was updated successfully, but these errors were encountered: