Description
When using the options example here, TypeScript gives the following error when using ack:
TS2345: Argument of type '{ options: Option[]; }' is not assignable to parameter of type '(Without<MessageOptions, OptionGroups<MessageOptions>> & OptionGroups<MessageOptions> & Without<...> & OptionGroups<...> & Without<...> & OptionGroups<...>) | (Without<...> & ... 4 more ... & BlockOptions) | undefined'.
Types of property 'options' are incompatible.
Type 'Option[]' is not assignable to type '{ text: string; value: string; }[] & { label: string; value: string; }[] & Option[]'.
Type 'Option[]' is not assignable to type '{ text: string; value: string; }[]'.
Type 'Option' is not assignable to type '{ text: string; value: string; }'.
Types of property 'text' are incompatible.
Type 'PlainTextElement | MrkdwnElement' is not assignable to type 'string'.
Type 'PlainTextElement' is not assignable to type 'string'.
This is fixed by the following cast, which shouldn't be necessary, but is:
ack as AckFn<{ options: Option[] }>
I believe this has to do with the XOR in AckFn<XOR<BlockOptions, OptionGroups<BlockOptions>>>
What type of issue is this? (place an x in one of the [ ])
Requirements (place an x in each of the [ ])
Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version: 3.3.0
node version: N/A
OS version(s): N/A
Steps to reproduce:
- Implement the given Bolt example for Options, in TypeScript
- Receive a TS error
Expected result:
What you expected to happen
Actual result:
What actually happened
Attachments:
Logs, screenshots, screencast, sample project, funny gif, etc.
Description
When using the options example here, TypeScript gives the following error when using
ack:This is fixed by the following cast, which shouldn't be necessary, but is:
I believe this has to do with the
XORinAckFn<XOR<BlockOptions, OptionGroups<BlockOptions>>>What type of issue is this? (place an
xin one of the[ ])Requirements (place an
xin each of the[ ])Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version:
3.3.0node version: N/A
OS version(s): N/A
Steps to reproduce:
Expected result:
What you expected to happen
Actual result:
What actually happened
Attachments:
Logs, screenshots, screencast, sample project, funny gif, etc.