slackapi / slackapi/node-slack-sdk
socket-mode: Type event payloads
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.4k
- Forks
- 688
- Avg merge
- 15h 31m
- Merged PRs (30d)
- 27
Description
I'm using @slack/socket-mode in a TypeScript project and would love to be able to benefit from type definitions when defining event handlers -- e.g. when I invoke something along the lines of
socketModeClient.on(
'reaction_added',
async (event) => {
...
}
);
I'd like event to not be of the any type but instead to reflect the expected type for the event in question.
It looks like there are libraries that might support this, for your consideration.
Packages:
Select all that apply:
-
@slack/web-api -
@slack/rtm-api -
@slack/webhooks -
@slack/oauth -
@slack/socket-mode -
@slack/types - I don't know
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the @slack/socket-mode event-handler API and inspect how TypeScript declarations currently type callbacks. Consider the linked typed-emitter library, then verify that a reaction_added handler receives its expected event payload rather than any.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100