Skip to content

Commit

Permalink
biomelint types
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip Maj committed Sep 4, 2024
1 parent 9c00ddc commit 74990e8
Show file tree
Hide file tree
Showing 26 changed files with 204 additions and 295 deletions.
1 change: 0 additions & 1 deletion packages/types/.eslintignore

This file was deleted.

1 change: 0 additions & 1 deletion packages/types/.eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/types/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"typescript.tsdk": "./node_modules/typescript/lib"
"typescript.tsdk": "./node_modules/typescript/lib"
}
34 changes: 0 additions & 34 deletions packages/types/api-extractor.json

This file was deleted.

4 changes: 4 additions & 0 deletions packages/types/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"extends": ["../../biome.json"]
}
27 changes: 5 additions & 22 deletions packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,10 @@
"description": "Shared type definitions for the Node Slack SDK",
"author": "Slack Technologies, LLC",
"license": "MIT",
"keywords": [
"slack",
"typescript",
"types",
"api"
],
"keywords": ["slack", "typescript", "types", "api"],
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/**/*"
],
"files": ["dist/**/*"],
"engines": {
"node": ">= 12.13.0",
"npm": ">= 6.12.0"
Expand All @@ -31,22 +24,12 @@
"prepare": "npm run build",
"build": "npm run build:clean && tsc",
"build:clean": "shx rm -rf ./dist",
"lint": "eslint --fix --ext .ts src",
"lint": "npx @biomejs/biome check --write .",
"test": "npm run lint && npm run build && npm run test:types",
"test:types": "tsd",
"ref-docs:model": "api-extractor run"
"test:types": "tsd"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.38.0",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.0",
"eslint": "^8.47.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-import-newlines": "^1.3.4",
"eslint-plugin-jsdoc": "^46.5.0",
"eslint-plugin-node": "^11.1.0",
"@biomejs/biome": "^1.8.3",
"shx": "^0.3.2",
"tsd": "^0.31.0",
"typescript": "^5.5.4"
Expand Down
123 changes: 24 additions & 99 deletions packages/types/src/block-kit/block-elements.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// This file contains objects documented here: https://api.slack.com/reference/block-kit/block-elements

import { RichTextBlock } from './blocks';
import {
import type { RichTextBlock } from './blocks';
import type {
ColorScheme,
Option,
PlainTextElement,
PlainTextOption,
SlackFileImageObject,
UrlImageObject,
} from './composition-objects';
import {
import type {
Actionable,
Confirmable,
Dispatchable,
Expand Down Expand Up @@ -89,11 +89,7 @@ export interface Checkboxes extends Actionable, Confirmable, Focusable {
* @see {@link https://api.slack.com/reference/block-kit/block-elements#datepicker Date picker element reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export interface Datepicker
extends Actionable,
Confirmable,
Focusable,
Placeholdable {
export interface Datepicker extends Actionable, Confirmable, Focusable, Placeholdable {
/**
* @description The type of element. In this case `type` is always `datepicker`.
*/
Expand Down Expand Up @@ -131,11 +127,7 @@ export interface DateTimepicker extends Actionable, Confirmable, Focusable {
* @see {@link https://api.slack.com/reference/block-kit/block-elements#email Email input element reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export interface EmailInput
extends Actionable,
Dispatchable,
Focusable,
Placeholdable {
export interface EmailInput extends Actionable, Dispatchable, Focusable, Placeholdable {
/**
* @description The type of element. In this case `type` is always `email_text_input`.
*/
Expand Down Expand Up @@ -199,12 +191,7 @@ export type ImageElement = {
* @see {@link https://api.slack.com/reference/block-kit/block-elements#select Select menu element reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export type Select =
| UsersSelect
| StaticSelect
| ConversationsSelect
| ChannelsSelect
| ExternalSelect;
export type Select = UsersSelect | StaticSelect | ConversationsSelect | ChannelsSelect | ExternalSelect;

/**
* @description Allows users to select multiple items from a list of options.
Expand All @@ -229,11 +216,7 @@ export type MultiSelect =
* @see {@link https://api.slack.com/reference/block-kit/block-elements#users_select Select menu of users reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export interface UsersSelect
extends Actionable,
Confirmable,
Focusable,
Placeholdable {
export interface UsersSelect extends Actionable, Confirmable, Focusable, Placeholdable {
/**
* @description The type of element. In this case `type` is always `users_select`.
*/
Expand All @@ -250,12 +233,7 @@ export interface UsersSelect
* @see {@link https://api.slack.com/reference/block-kit/block-elements#users_multi_select Multi-select menu of users reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export interface MultiUsersSelect
extends Actionable,
Confirmable,
Focusable,
MaxItemsSelectable,
Placeholdable {
export interface MultiUsersSelect extends Actionable, Confirmable, Focusable, MaxItemsSelectable, Placeholdable {
/**
* @description The type of element. In this case `type` is always `multi_users_select`.
*/
Expand All @@ -272,11 +250,7 @@ export interface MultiUsersSelect
* @see {@link https://api.slack.com/reference/block-kit/block-elements#static_select Select menu of static options reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export interface StaticSelect
extends Actionable,
Confirmable,
Focusable,
Placeholdable {
export interface StaticSelect extends Actionable, Confirmable, Focusable, Placeholdable {
/**
* @description The type of element. In this case `type` is always `static_select`.
*/
Expand Down Expand Up @@ -313,12 +287,7 @@ export interface StaticSelect
* @see {@link https://api.slack.com/reference/block-kit/block-elements#static_multi_select Multi-select menu of static options reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export interface MultiStaticSelect
extends Actionable,
Confirmable,
Focusable,
MaxItemsSelectable,
Placeholdable {
export interface MultiStaticSelect extends Actionable, Confirmable, Focusable, MaxItemsSelectable, Placeholdable {
/**
* @description The type of element. In this case `type` is always `multi_static_select`.
*/
Expand Down Expand Up @@ -355,12 +324,7 @@ export interface MultiStaticSelect
* @see {@link https://api.slack.com/reference/block-kit/block-elements#conversations_select Select menu of conversations reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export interface ConversationsSelect
extends Actionable,
Confirmable,
Focusable,
Placeholdable,
URLRespondable {
export interface ConversationsSelect extends Actionable, Confirmable, Focusable, Placeholdable, URLRespondable {
/**
* @description The type of element. In this case `type` is always `conversations_select`.
*/
Expand Down Expand Up @@ -396,10 +360,10 @@ export interface ConversationsSelect
*/
export interface MultiConversationsSelect
extends Actionable,
Confirmable,
Focusable,
MaxItemsSelectable,
Placeholdable {
Confirmable,
Focusable,
MaxItemsSelectable,
Placeholdable {
/**
* @description The type of element. In this case `type` is always `conversations_select`.
*/
Expand Down Expand Up @@ -432,12 +396,7 @@ export interface MultiConversationsSelect
* @see {@link https://api.slack.com/reference/block-kit/block-elements#channels_select Select menu of public channels reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export interface ChannelsSelect
extends Actionable,
Confirmable,
Focusable,
Placeholdable,
URLRespondable {
export interface ChannelsSelect extends Actionable, Confirmable, Focusable, Placeholdable, URLRespondable {
/**
* @description The type of element. In this case `type` is always `channels_select`.
*/
Expand All @@ -454,12 +413,7 @@ export interface ChannelsSelect
* @see {@link https://api.slack.com/reference/block-kit/block-elements#channel_multi_select Multi-select menu of public channels reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export interface MultiChannelsSelect
extends Actionable,
Confirmable,
Focusable,
MaxItemsSelectable,
Placeholdable {
export interface MultiChannelsSelect extends Actionable, Confirmable, Focusable, MaxItemsSelectable, Placeholdable {
/**
* @description The type of element. In this case `type` is always `multi_channels_select`.
*/
Expand All @@ -477,11 +431,7 @@ export interface MultiChannelsSelect
* @see {@link https://api.slack.com/reference/block-kit/block-elements#external_select Select menu of external data source reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export interface ExternalSelect
extends Actionable,
Confirmable,
Focusable,
Placeholdable {
export interface ExternalSelect extends Actionable, Confirmable, Focusable, Placeholdable {
/**
* @description The type of element. In this case `type` is always `external_select`.
*/
Expand All @@ -504,12 +454,7 @@ export interface ExternalSelect
* @see {@link https://api.slack.com/reference/block-kit/block-elements#external_multi_select Multi-select menu of external data source reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export interface MultiExternalSelect
extends Actionable,
Confirmable,
Focusable,
MaxItemsSelectable,
Placeholdable {
export interface MultiExternalSelect extends Actionable, Confirmable, Focusable, MaxItemsSelectable, Placeholdable {
/**
* @description The type of element. In this case `type` is always `multi_external_select`.
*/
Expand Down Expand Up @@ -538,11 +483,7 @@ export interface MultiExternalSelect
* @see {@link https://api.slack.com/reference/block-kit/block-elements#number Number input element reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export interface NumberInput
extends Actionable,
Dispatchable,
Focusable,
Placeholdable {
export interface NumberInput extends Actionable, Dispatchable, Focusable, Placeholdable {
/**
* @description The type of element. In this case `type` is always `number_input`.
*/
Expand Down Expand Up @@ -591,11 +532,7 @@ export interface Overflow extends Actionable, Confirmable {
* @see {@link https://api.slack.com/reference/block-kit/block-elements#input Plain-text input element reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export interface PlainTextInput
extends Actionable,
Dispatchable,
Focusable,
Placeholdable {
export interface PlainTextInput extends Actionable, Dispatchable, Focusable, Placeholdable {
/**
* @description The type of element. In this case `type` is always `plain_text_input`.
*/
Expand Down Expand Up @@ -649,11 +586,7 @@ export interface RadioButtons extends Actionable, Confirmable, Focusable {
* @see {@link https://api.slack.com/reference/block-kit/block-elements#timepicker Time picker element reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export interface Timepicker
extends Actionable,
Confirmable,
Focusable,
Placeholdable {
export interface Timepicker extends Actionable, Confirmable, Focusable, Placeholdable {
/**
* @description The type of element. In this case `type` is always `timepicker`.
*/
Expand All @@ -676,11 +609,7 @@ export interface Timepicker
* @see {@link https://api.slack.com/reference/block-kit/block-elements#url URL input element reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export interface URLInput
extends Actionable,
Dispatchable,
Focusable,
Placeholdable {
export interface URLInput extends Actionable, Dispatchable, Focusable, Placeholdable {
/**
* @description The type of element. In this case `type` is always `url_text_input`.
*/
Expand Down Expand Up @@ -1024,11 +953,7 @@ export interface RichTextPreformatted extends RichTextBorderable {
* @see {@link https://api.slack.com/reference/block-kit/block-elements#rich_text_input Rich-text input element reference}.
* @see {@link https://api.slack.com/interactivity/handling This is an interactive component - see our guide to enabling interactivity}.
*/
export interface RichTextInput
extends Actionable,
Dispatchable,
Focusable,
Placeholdable {
export interface RichTextInput extends Actionable, Dispatchable, Focusable, Placeholdable {
/**
* @description The type of element. In this case `type` is always `rich_text_input`.
*/
Expand Down
Loading

0 comments on commit 74990e8

Please sign in to comment.