Fix Incorrect Typing for Certain Methods

This issue has been created since 2021-04-04.

Currently, when using TypeScript, since it depends on object structure of a class as opposed to whether or not an object is an instance of that class, some of the methods can accept incorrect params.

For example:

Interface for the base class Element object:

interface Element {
  end(): this;
}

Interface for the base class for a Block object:

interface Block {
  blockId(blockId: string): this;
  end(): this;
}

Definition for elements() method:

interface Actions extends Block {
 elements(...elements: Array<Element.Element | Element.Element[]>): 
}

As such, when the elements() method is called and a Block object is passed in, TypeScript does not display an error, since the Block object does conform to the Element interface:

Message()
  .blocks(
    Blocks.Section({ text: 'This should all  be invalid'}),
    Blocks.Actions()
      .elements(Blocks.Section({ text: 'But it is not!'})))
  .buildToJSON();
raycharius wrote this answer on 2021-04-04

Version 2.0.0 is being written in TypeScript, and this issue should be closed with that release.

More Details About Repo
Owner Name raycharius
Repo Name slack-block-builder
Full Name raycharius/slack-block-builder
Language TypeScript
Created Date 2020-06-09
Updated Date 2022-05-17
Star Count 290
Watcher Count 4
Fork Count 21
Issue Count 8

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Provide a way to get method parameter modifiers 5 2021-12-06 2022-08-18
"reprounzip docker upload" not working 5 2021-03-24 2022-08-16
[BUG] Docker image tag not semver compliant 8 2022-04-28 2022-08-03
ldap_start_tls failed ,who can help me 4 2021-06-25 2022-09-19
Add an option for pet rat 0 2021-03-19 2022-09-04
Replace io.ReadAll usage with pre-allocated buffers of appropriate size 3 2022-01-02 2022-09-19
优质网站同好者周刊(第 3 期)- 倾城之链 | 晚晴幽草轩 0 2021-03-04 2022-07-21
Comparison with other Neural Networks 3 2020-12-04 2022-09-13
SAB3 from PPA on Ubuntu 18.04 on ARM: "Missing module: jaraco.collections" ... due to pip's version of cherrypy 1 2020-06-30 2022-08-26
Primary name cannot be set through ens-app for a sub-domain with custom resolver 6 2022-06-15 2022-09-10
Authenticate to artifact registry fails 2 2022-07-21 2022-08-19
机器人调用登录接口的时候报 PuppetHostie startGrpcStream() connection failed and max retries has been reached. 1 2021-04-26 2022-08-28
Set consult-line-point-placement to 'match-beginning not working sometime 4 2022-05-11 2022-09-16
All new headers should be RFC8941 Structured Field Values 2 2021-04-16 2022-08-31
Horizontal and Wide Reviews for Technical Reports 0 2021-04-20 2022-08-30
Should the compiler always generate hash functions for records? 20 2021-10-13 2022-09-16
Use log-linear algorithm to get pareto front trials. 0 2021-03-25 2022-09-19
install() got an unexpected keyword argument 'root_prefix' 4 2022-01-06 2022-09-18
can not work, commBind: Cannot bind socket FD 13 to [::1]: (99) Cannot assign requested address 0 2021-10-13 2022-09-13
Listen socket keeps opened indefinitely when stopped via StopChan 1 2021-12-15 2022-09-18
InputStream question 2 2021-10-21 2022-09-10
User invite call cannot handle a relational filter 2 2022-04-20 2022-09-19
invalidate_pending_binding_requests occurs panic sometimes 3 2021-10-31 2022-09-14
regex filtering still not working in graph management 11 2022-06-10 2022-08-23
V5 create high availability cluster from examples repo failed with Bus error 7 2022-02-02 2022-09-20
"Cannot generate preview" 3 2022-01-03 2022-09-25
Pod with instio-cni cannot start 0 2021-10-13 2022-09-20
Add a real 404 page 1 2021-09-03 2022-01-21
DID recovery_spend: list index out of range [Bug] 4 2022-06-22 2022-09-19
[Bug] full_node asyncio : ERROR Task exception was never retrieved 3 2022-06-22 2022-09-23
ssh-askpass missing with PKCS11 use 2 2022-03-24 2022-09-25
HTTPs with self signed certificate through ERR_CERT_AUTHORITY_INVALID 8 2022-03-10 2022-07-05
Support Shipping API v2 model 0 2022-09-14 2022-09-07
Incomplete enum list for FulfillmentInbound ShipmentStatus in fulfillmentInboundV0.json 0 2022-08-24 2022-09-19
Refactor the main README 4 2021-05-27 2022-08-12
Update Cake.ExtendedNuGet README: Add link to GitHub Discussions 3 2021-05-18 2022-01-02
Missing datasource State metric 4 2022-07-25 2022-08-30
No file syncing for Oracle Database VM 5 2020-09-07 2022-09-28
Feature Request: add the possibility to configure resources for a sidecar container 1 2022-08-04 2022-09-21
ob run fails to find GHC 3 2022-04-03 2022-09-18
Cannot Connect to R in a Windows 10 Multi Host machine 3 2021-09-14 2022-08-14
Make a super-cool password reading library 1 2021-07-25 2022-09-03
Translate 'library/collections.abc.po' 2 2021-10-18 2022-09-04
Core dump at ClientConfiguration::ClientConfiguration() 13 2021-06-24 2022-08-21
Custom objective does not have the same loss curves. 4 2022-07-04 2022-09-08
local build fails 10 2020-05-03 2021-12-27
After update to 4.0.0 can't start BigBlueButton conference 3 2021-10-05 2022-09-29
Update to 4.0.0 broke GitHub webhook integration 3 2021-10-05 2022-09-01
v8: component setup function is not called 1 2020-12-03 2022-09-23
Remove UserSettings From Engine 7 2021-01-20 2022-09-24