deno-slack-api icon indicating copy to clipboard operation
deno-slack-api copied to clipboard

[FEATURE] Add proper types to clients

Open ChuckJonas opened this issue 1 year ago • 1 comments

Description of the problem being solved

Please add types to the client. Seems like all but a very few of the SlackAPIClient methods are untyped. This makes the DX very poor.

Alternative solutions

Generate your own types based on the docs, but this can be inaccurate

Requirements

Have accurate types for all endpoints of the APIClient

ChuckJonas avatar Apr 03 '24 16:04 ChuckJonas

This is a hard problem for Slack. While argument types are possible (though they take a lot of work to maintain; see e.g. the node PR that put them into place for the @slack/web-api package), response types are difficult due to the context of execution impacting responses. For example, certain APIs payload will differ depending on the Slack paid plan you are on. Other fields are also client-context-specific: some events will have different payload shapes depending on what object within Slack is being operated on.

Ideally, we would re-use the node @slack/web-api library instead of depending on this library, but last I tried to use the node-to-deno compatibility layer with the @slack/web-api npm library, support was not good.

filmaj avatar Apr 03 '24 17:04 filmaj