@slack/types
Advanced tools
Comparing version 2.11.0 to 2.12.0
import { Actionable, Confirmable, Dispatchable, Focusable, Placeholdable, RichTextStyleable } from './extensions'; | ||
import { Option, PlainTextElement, PlainTextOption } from './composition-objects'; | ||
import { Option, PlainTextElement, PlainTextOption, UrlImageObject, SlackFileImageObject } from './composition-objects'; | ||
import { RichTextBlock } from './blocks'; | ||
@@ -143,3 +143,3 @@ /** | ||
*/ | ||
export interface ImageElement { | ||
export type ImageElement = { | ||
/** | ||
@@ -150,10 +150,6 @@ * @description The type of element. In this case `type` is always `image`. | ||
/** | ||
* @description The URL of the image to be displayed. | ||
*/ | ||
image_url: string; | ||
/** | ||
* @description A plain-text summary of the image. This should not contain any markup. | ||
*/ | ||
alt_text: string; | ||
} | ||
} & (UrlImageObject | SlackFileImageObject); | ||
/** | ||
@@ -472,3 +468,3 @@ * @description Allows users to choose an option from a drop down menu. | ||
* @description Allows users to press a button to view a list of options. | ||
* Unlike the select menu, there is no typeahead field, and the button always appears with an ellipsis ("…") rather | ||
* Unlike the select menu, there is no typeahead field, and the button always appears with an ellipsis ('…') rather | ||
* than customizable text. As such, it is usually used if you want a more compact layout than a select menu, or to | ||
@@ -559,3 +555,3 @@ * supply a list of less visually important actions after a row of buttons. You can also specify simple URL links as | ||
/** | ||
* @description A string in the IANA format, e.g. "America/Chicago". The timezone is displayed to end users as hint | ||
* @description A string in the IANA format, e.g. 'America/Chicago'. The timezone is displayed to end users as hint | ||
* text underneath the time picker. It is also passed to the app upon certain interactions, such as view_submission. | ||
@@ -872,2 +868,7 @@ */ | ||
elements: RichTextElement[]; | ||
/** | ||
* @description Whether to render a quote-block-like border on the inline side of the text quote. | ||
* `0` renders no border, while `1` renders a border. Defaults to `0`. | ||
*/ | ||
border?: 0 | 1; | ||
} | ||
@@ -874,0 +875,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { PlainTextElement, MrkdwnElement } from './composition-objects'; | ||
import { PlainTextElement, MrkdwnElement, UrlImageObject, SlackFileImageObject } from './composition-objects'; | ||
import { Actionable } from './extensions'; | ||
@@ -98,3 +98,3 @@ import { Button, Checkboxes, Datepicker, DateTimepicker, EmailInput, FileInput, ImageElement, MultiSelect, NumberInput, Overflow, PlainTextInput, RadioButtons, Select, Timepicker, URLInput, WorkflowButton, RichTextSection, RichTextList, RichTextQuote, RichTextPreformatted, RichTextInput } from './block-elements'; | ||
*/ | ||
export interface ImageBlock extends Block { | ||
export type ImageBlock = { | ||
/** | ||
@@ -105,6 +105,2 @@ * @description The type of block. For an image block, `type` is always `image`. | ||
/** | ||
* @description The URL of the image to be displayed. Maximum length for this field is 3000 characters. | ||
*/ | ||
image_url: string; | ||
/** | ||
* @description A plain-text summary of the image. This should not contain any markup. | ||
@@ -119,3 +115,3 @@ * Maximum length for this field is 2000 characters. | ||
title?: PlainTextElement; | ||
} | ||
} & Block & (UrlImageObject | SlackFileImageObject); | ||
/** | ||
@@ -122,0 +118,0 @@ * @description Collects information from users via block elements. |
@@ -172,3 +172,41 @@ /** | ||
export type ConversationFilter = (BaseConversationFilter & Required<Pick<BaseConversationFilter, 'include'>>) | (BaseConversationFilter & Required<Pick<BaseConversationFilter, 'exclude_bot_users'>>) | (BaseConversationFilter & Required<Pick<BaseConversationFilter, 'exclude_external_shared_channels'>>); | ||
/** | ||
* @description Object for image which contains a image_url. | ||
*/ | ||
export interface UrlImageObject { | ||
/** | ||
* @description The URL of the image to be displayed. | ||
*/ | ||
image_url: string; | ||
} | ||
/** | ||
* @description Object for image which contains a slack_file. | ||
*/ | ||
export interface SlackFileImageObject { | ||
/** | ||
* @description The slack file of the image to be displayed. | ||
*/ | ||
slack_file: SlackFile; | ||
} | ||
interface SlackFileViaUrl { | ||
/** | ||
* @description This URL can be the `url_private` or the `permalink` of the {@link Slack file https://api.slack.com/types/file}. | ||
*/ | ||
url: string; | ||
} | ||
interface SlackFileViaId { | ||
/** | ||
* @description `id` of the {@link Slack file https://api.slack.com/types/file}. | ||
*/ | ||
id: string; | ||
} | ||
/** | ||
* @description Defines an object containing Slack file information to be used in an image block or image element. | ||
* This {@link file https://api.slack.com/types/file} must be an image and you must provide either the URL or ID. In addition, | ||
* the user posting these blocks must have access to this file. If both are provided then the payload will be rejected. | ||
* Currently only `png`, `jpg`, `jpeg`, and `gif` Slack image files are supported. | ||
* @see {@link https://api.slack.com/reference/block-kit/composition-objects#slack_file Slack File object reference}. | ||
*/ | ||
export type SlackFile = SlackFileViaUrl | SlackFileViaId; | ||
export {}; | ||
//# sourceMappingURL=composition-objects.d.ts.map |
{ | ||
"name": "@slack/types", | ||
"version": "2.11.0", | ||
"version": "2.12.0", | ||
"description": "Shared type definitions for the Node Slack SDK", | ||
@@ -39,10 +39,11 @@ "author": "Slack Technologies, LLC", | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.3.4", | ||
"@typescript-eslint/eslint-plugin": "^4.4.1", | ||
"@typescript-eslint/parser": "^4.4.0", | ||
"eslint": "^7.32.0", | ||
"eslint-config-airbnb-base": "^14.2.1", | ||
"eslint-config-airbnb-typescript": "^12.3.1", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jsdoc": "^30.6.1", | ||
"@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", | ||
@@ -49,0 +50,0 @@ "shx": "^0.3.2", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106827
43
1757
12