Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore (types): small refactorings and two new helper types #1823

Merged
merged 3 commits into from
Jun 18, 2024

Conversation

filmaj
Copy link
Contributor

@filmaj filmaj commented Jun 17, 2024

  • adding and removing some TODOs
  • factored out some helper types and exported them: ColorScheme, MaxItemsSelectable, RichTextBorderable, URLRespondable, and Conversation
  • inching towards tackling breaking changes / prep for major release of types

…ching towards tackling breaking changes / prep for major release of types.
@filmaj filmaj added semver:minor area:typescript issues that specifically impact using the package from typescript projects pkg:types applies to `@slack/types` labels Jun 17, 2024
@filmaj filmaj added this to the types@2.13.0 milestone Jun 17, 2024
@filmaj filmaj self-assigned this Jun 17, 2024
@filmaj filmaj requested a review from a team June 17, 2024 21:02
Copy link

codecov bot commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.76%. Comparing base (91523a1) to head (80e27b0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1823   +/-   ##
=======================================
  Coverage   81.76%   81.76%           
=======================================
  Files          35       35           
  Lines        7745     7745           
  Branches      317      317           
=======================================
  Hits         6333     6333           
  Misses       1400     1400           
  Partials       12       12           
Flag Coverage Δ
cli-hooks 95.07% <ø> (ø)
cli-test 53.89% <ø> (ø)
oauth 76.51% <ø> (ø)
socket-mode 59.41% <ø> (ø)
web-api 96.53% <ø> (ø)
webhook 95.20% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All great changes and great improvements 🪄 The docs are solid too - LGTM! 🚀

@@ -50,6 +50,7 @@ export interface Block {
*/
export type KnownBlock = ImageBlock | ContextBlock | ActionsBlock | DividerBlock |
SectionBlock | InputBlock | FileBlock | HeaderBlock | VideoBlock | RichTextBlock;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌 🙌

Comment on lines 3 to 11
/**
* Re-usable labels for common color schemes present in Slack. `danger` displays with a red background (red text on
* mobile), while `primary` displays with a green background (green text on mobile).
*/
export type ColorScheme = 'primary' | 'danger';

/** The conversation type as available within the Slack UI. */
export type Conversation = 'im' | 'mpim' | 'private' | 'public';

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicee 👏

interface BaseConversationFilter {
/**
* @description Indicates which type of conversations should be included in the list. When this field is provided, any
* conversations that do not match will be excluded. You should provide an array of strings from the following options:
* `im`, `mpim`, `private`, and `public`. The array cannot be empty.
*/
include?: [Conversation, ...Conversation[]]; // TS gymnastics for "at least one item"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL! This is interesting 😳

@@ -182,6 +180,7 @@ export interface Confirmation {
title?: string;
}

// Used in web-api chat.* API method request parameters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@filmaj filmaj merged commit 042fec0 into main Jun 18, 2024
21 checks passed
@filmaj filmaj deleted the types-small-refactor branch June 18, 2024 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:typescript issues that specifically impact using the package from typescript projects pkg:types applies to `@slack/types` semver:minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants