Skip to content
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

index.d.ts: missing connect.core.getEventBus() declaration #934

Open
mfulton26 opened this issue Oct 17, 2024 · 3 comments
Open

index.d.ts: missing connect.core.getEventBus() declaration #934

mfulton26 opened this issue Oct 17, 2024 · 3 comments

Comments

@mfulton26
Copy link

Documentation.md mentions a getEventBus() method on connect.core but index.d.ts does not declare one. May one be added please so that consumers using TypeScript don't need to cast connect.core in order to access the method?

My current workaround (although I'm not confident I've structured the types completely or not):

import "amazon-connect-streams";

interface EventBus {
    subscribe: (eventType: connect.EventType, callback: connect.Callback) => connect.Subscription;
}

const core = connect.core as typeof connect.core & { getEventBus: () => EventBus };
const eventBus = core.getEventBus();
@intptr-t
Copy link

I created a Pull request(Issue) in the past, but it was not reviewed.
It is likely that it will not be officially implemented for a while, so the only way to work around it is to use a Type Assertion like the one you wrote.

Copy link

This issue is stale because it has been open for 90 days with no activity. Remove stale label or comment to keep this active.

@mfulton26
Copy link
Author

This is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants