Skip to content

socket-mode: Type event payloads #1768

@slifty

Description

@slifty

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:typescriptissues that specifically impact using the package from typescript projectsauto-triage-skipenhancementM-T: A feature request for new functionalitypkg:socket-modeapplies to `@slack/socket-mode`semver:major

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions