builders icon indicating copy to clipboard operation
builders copied to clipboard

feat(MessageButton): builder and associated interfaces

Open monbrey opened this issue 4 years ago • 1 comments

The MessageButton builder, in TypeScript

  • Builder class for Message Buttons
  • Interfaces and types
  • Some Util functions as static methods that would probably belong better elsewhere
  • Added ow as a dependency to validate input
  • Tests

This is a draft for now for a few reasons:

  • Unsure if it needs to extend a base component class or not
  • It's the first time I've used jest for anything, so will need advise/reviews on the tests
  • I've re-written a lot of types that could just be imported from discord-api-types, but it would require bumping the dependency version to 0.19

Status and versioning classification: TBD

monbrey avatar Jul 04 '21 07:07 monbrey

Codecov Report

Merging #6 (2aea829) into main (97cf337) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main        #6   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         2    +1     
  Lines           12        61   +49     
  Branches         4        19   +15     
=========================================
+ Hits            12        61   +49     
Impacted Files Coverage Δ
src/components/MessageButton.ts 100.00% <100.00%> (ø)
src/messages/formatters.ts 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 97cf337...2aea829. Read the comment docs.

codecov-commenter avatar Jul 04 '21 07:07 codecov-commenter