UNPKG

@onereach/channel-transformer

Version:

Convert data model between different channels (Slack, Microsoft Teams, Generic...)

1,242 lines 128 kB
declare module "channels/generic/types/text" { type TextType = 'markdown' | 'plain' | 'html'; interface IGenericText { type: 'text'; props: { value: string; type?: TextType; slack?: { type: 'plain_text' | 'mrkdwn'; emoji?: boolean; verbatim?: boolean; }; web?: { isTag?: 'p' | 'h1' | 'h2' | 'h3'; }; }; } export { IGenericText, TextType }; } declare module "channels/generic/types/wrapper" { import { IGenericText } from "channels/generic/types/text"; interface IGenericWrapper { readonly type: string; children: Array<any>; props?: { slack?: { type: string; title?: IGenericText; submit?: IGenericText; close?: IGenericText; }; rwc?: { mergeTextSections?: boolean; }; }; } export { IGenericWrapper }; } declare module "channels/slack/types/composition-objects" { interface ISlackTextObject { readonly type: 'plain_text' | 'mrkdwn'; text: string; emoji?: boolean; verbatim?: boolean; } interface ISlackConfirm { title: ISlackTextObject; text: ISlackTextObject; confirm: ISlackTextObject; deny: ISlackTextObject; style?: string; } interface ISlackFilterObject { include?: string; exclude_external_shared_channels?: boolean; exclude_bot_users?: boolean; } interface ISlackOptionObject { text: ISlackTextObject; value: string; description?: ISlackTextObject; url?: string; } interface ISlackOptionGroupObject { label: ISlackTextObject; options: Array<ISlackOptionObject>; } export { ISlackTextObject, ISlackConfirm, ISlackFilterObject, ISlackOptionObject, ISlackOptionGroupObject }; } declare module "channels/slack/types/blocks" { import { ISlackTextObject } from "channels/slack/types/composition-objects"; interface ISlackActions { readonly type: 'actions'; elements: Array<any>; block_id?: string; } interface ISlackSection { readonly type: 'section'; text?: ISlackTextObject; block_id?: string; fields?: Array<ISlackTextObject>; accessory?: { readonly type: string; }; } interface ISlackContext { readonly type: 'context'; elements: Array<any>; block_id?: string; } interface ISlackHeader { readonly type: 'header'; text: ISlackTextObject; block_id?: string; } interface ISlackDivider { readonly type: 'divider'; } interface ISlackFile { readonly type: 'file'; external_id: string; source: string; block_id?: string; } interface ISlackImage { readonly type: 'image'; image_url: string; alt_text: string; title?: ISlackTextObject; block_id?: string; } interface ISlackInput { readonly type: 'input'; element: any; label?: ISlackTextObject; dispatch_action?: boolean; block_id?: string; hint?: ISlackTextObject; optional?: boolean; } export { ISlackActions, ISlackSection, ISlackContext, ISlackHeader, ISlackDivider, ISlackFile, ISlackImage, ISlackInput }; } declare module "channels/slack/types/selects" { import { ISlackTextObject, ISlackConfirm, ISlackFilterObject, ISlackOptionObject, ISlackOptionGroupObject } from "channels/slack/types/composition-objects"; interface ISlackChannelsSelect { readonly type: 'channels_select'; placeholder: ISlackTextObject; action_id: string; initial_channel?: string; response_url_enabled?: boolean; confirm?: ISlackConfirm; } interface ISlackSelectConversations { readonly type: 'conversations_select'; placeholder: ISlackTextObject; action_id: string; initial_conversation?: string; default_to_current_conversation?: boolean; confirm?: ISlackConfirm; response_url_enabled?: boolean; filter?: ISlackFilterObject; } interface ISlackMultiConversationSelect { type: 'multi_conversations_select'; placeholder: ISlackTextObject; action_id: string; initial_conversation?: string; default_to_current_conversation?: boolean; confirm?: ISlackConfirm; max_selected_items?: number; filter?: ISlackFilterObject; } interface ISlackMultiUsersSelect { readonly type: 'multi_users_select'; placeholder: ISlackTextObject; action_id: string; initial_users?: string; confirm?: ISlackConfirm; max_selected_items?: number; } interface ISlackOverflow { readonly type: 'overflow'; action_id: string; options: Array<ISlackOptionObject>; confirm?: ISlackConfirm; } interface ISlackSelectStatic { readonly type: 'static_select'; placeholder: ISlackTextObject; action_id: string; options?: Array<ISlackOptionObject>; option_groups?: Array<ISlackOptionGroupObject>; initial_option?: ISlackOptionObject | ISlackOptionGroupObject; confirm?: ISlackConfirm; } interface ISlackMultiStaticSelect { readonly type: 'multi_static_select'; placeholder: ISlackTextObject; action_id: string; options?: Array<ISlackOptionObject>; option_groups?: Array<ISlackOptionGroupObject>; initial_options?: ISlackOptionObject | ISlackOptionGroupObject; confirm?: ISlackConfirm; max_selected_items?: number; } interface ISlackSelectUsers { readonly type: 'users_select'; placeholder: ISlackTextObject; action_id: string; initial_user?: string; confirm?: ISlackConfirm; } interface ISlackSelectExternal { readonly type: 'external_select'; placeholder: ISlackTextObject; action_id: string; initial_option?: ISlackOptionObject | ISlackOptionGroupObject; min_query_length?: number; confirm?: ISlackConfirm; } export { ISlackSelectStatic, ISlackSelectUsers, ISlackChannelsSelect, ISlackSelectConversations, ISlackMultiUsersSelect, ISlackMultiConversationSelect, ISlackOverflow, ISlackSelectExternal, ISlackMultiStaticSelect }; } declare module "channels/slack/types/block-elements" { import { ISlackTextObject, ISlackConfirm, ISlackOptionObject } from "channels/slack/types/composition-objects"; interface ISlackButton { readonly type: 'button'; text: ISlackTextObject; action_id: string; url?: string; value?: string; style?: 'default' | 'primary' | 'danger'; confirm?: ISlackConfirm; } interface ISlackCheckboxes { readonly type: 'checkboxes'; action_id: string; options: Array<ISlackOptionObject>; initial_options?: Array<ISlackOptionObject>; confirm?: ISlackConfirm; } interface ISlackRadioButton { readonly type: 'radio_buttons'; action_id: string; options: Array<ISlackOptionObject>; initial_option?: ISlackOptionObject; confirm?: ISlackConfirm; } interface ISlackDatePicker { readonly type: 'datepicker'; action_id: string; placeholder?: ISlackTextObject; initial_date?: string; confirm?: ISlackConfirm; } interface ISlackTimePicker { readonly type: 'timepicker'; action_id: string; placeholder?: ISlackTextObject; initial_time?: string; confirm?: ISlackConfirm; } interface ISlackInputText { readonly type: 'plain_text_input'; action_id: string; placeholder?: ISlackTextObject; initial_value?: string; multiline?: boolean; min_length?: number; max_length?: number; dispatch_action_config?: any; } export { ISlackButton, ISlackCheckboxes, ISlackDatePicker, ISlackInputText, ISlackRadioButton, ISlackTimePicker }; } declare module "channels/slack/types/index" { import { ISlackActions, ISlackSection, ISlackContext, ISlackHeader, ISlackDivider, ISlackFile, ISlackImage, ISlackInput } from "channels/slack/types/blocks"; import { ISlackTextObject, ISlackConfirm, ISlackFilterObject, ISlackOptionObject, ISlackOptionGroupObject } from "channels/slack/types/composition-objects"; import { ISlackSelectStatic, ISlackSelectUsers, ISlackChannelsSelect, ISlackSelectConversations, ISlackMultiUsersSelect, ISlackMultiConversationSelect, ISlackOverflow, ISlackSelectExternal, ISlackMultiStaticSelect } from "channels/slack/types/selects"; import { ISlackButton, ISlackCheckboxes, ISlackRadioButton, ISlackDatePicker, ISlackInputText, ISlackTimePicker } from "channels/slack/types/block-elements"; interface ISlackBlockElement { blocks?: Array<any>; } interface ISlackBlockKitData extends ISlackBlockElement { readonly type?: string; attachments?: Array<ISlackBlockElement>; title?: ISlackTextObject; submit?: ISlackTextObject; close?: ISlackTextObject; } export { ISlackBlockKitData, ISlackActions, ISlackSection, ISlackContext, ISlackHeader, ISlackFile, ISlackDivider, ISlackImage, ISlackInput, ISlackTextObject, ISlackFilterObject, ISlackConfirm, ISlackOptionObject, ISlackOptionGroupObject, ISlackButton, ISlackCheckboxes, ISlackRadioButton, ISlackDatePicker, ISlackInputText, ISlackTimePicker, ISlackSelectStatic, ISlackSelectUsers, ISlackChannelsSelect, ISlackSelectConversations, ISlackMultiUsersSelect, ISlackMultiConversationSelect, ISlackOverflow, ISlackSelectExternal, ISlackMultiStaticSelect }; } declare module "channels/generic/types/unic/confirm" { import { IGenericText } from "channels/generic/types/text"; export interface IGenericUnicConfirm { readonly type: 'unic_confirm'; props: { title: IGenericText; text: IGenericText; confirm: IGenericText; deny: IGenericText; style?: string; }; } } declare module "channels/generic/types/utils/element" { interface IGenericElement { type: string; props?: any; children?: Array<IGenericElement>; id?: string; } export { IGenericElement }; } declare module "channels/generic/types/button" { import { IGenericUnicConfirm } from "channels/generic/types/unic/confirm"; import { IGenericElement } from "channels/generic/types/utils/element"; interface IGenericButton extends IGenericElement { type: 'button'; props: { label: string; value?: string; color?: string; variableName?: string; web?: { variableName?: string; buttonType?: 'go back' | 'cancel' | 'submit' | 'interactive'; type?: 'primary' | 'secondary'; size?: 'large' | 'normal' | 'small'; icon?: string; iconPosition?: 'left' | 'right'; }; slack?: { action_id?: string; value?: string; confirm?: IGenericUnicConfirm; url?: string; label_type?: 'plain_text' | 'mrkdwn'; label_emoji?: boolean; label_verbatim?: boolean; }; rwc?: { buttonStyle?: "default" | "filled" | "outlined" | "custom"; }; }; } export { IGenericButton }; } declare module "channels/generic/types/text-object" { export interface IGenericTextObject { value: string; type?: 'markdown' | 'plain' | 'html'; slack?: { type: 'plain_text' | 'mrkdwn'; emoji?: boolean; verbatim?: boolean; }; } } declare module "channels/generic/types/utils/options" { import { IGenericTextObject } from "channels/generic/types/text-object"; interface IGenericOptions { name?: string; value?: string; key?: string; label?: string; slack?: { description?: IGenericTextObject; url?: string; type: 'plain_text' | 'mrkdwn'; emoji?: boolean; verbatim?: boolean; }; } interface IGenericGroupOptions { label: IGenericTextObject; options: Array<IGenericOptions>; } export { IGenericOptions, IGenericGroupOptions }; } declare module "channels/generic/types/checkbox" { import { IGenericOptions } from "channels/generic/types/utils/options"; import { IGenericUnicConfirm } from "channels/generic/types/unic/confirm"; interface IGenericCheckboxValue { [key: string]: boolean; } interface IGenericCheckbox { type: 'checkbox'; props: { value?: Array<IGenericOptions> | IGenericCheckboxValue; multiple: boolean; options?: Array<IGenericOptions>; label?: string; variableName?: string; slack?: { action_id?: string; confirm?: IGenericUnicConfirm; }; web?: { variableName?: string; required?: boolean; interactive?: boolean; hint?: string; vertical?: boolean; }; rwc?: any; }; } export { IGenericCheckbox, IGenericCheckboxValue }; } declare module "channels/generic/types/date-picker" { import { IGenericUnicConfirm } from "channels/generic/types/unic/confirm"; interface IGenericDatePicker { type: 'datePicker'; props: { value?: string; label?: string; placeholder?: string; variableName?: string; slack?: { action_id?: string; confirm?: IGenericUnicConfirm; placeholder_type?: 'plain_text' | 'mrkdwn'; placeholder_emoji?: boolean; placeholder_verbatim?: boolean; }; web?: { variableName?: string; dateFormat?: string; hint?: string; required?: boolean; interactive?: boolean; value?: Date; weekStartFrom?: string; }; rwc?: { startDate?: string; outFormat?: string; pickerFormat?: string; }; }; } export { IGenericDatePicker }; } declare module "channels/generic/types/divider" { export interface IGenericDivider { type: 'divider'; } } declare module "channels/generic/types/image" { interface IGenericImage { type: 'image'; props: { url: string; alt?: string; title?: string; slack?: { block_id?: string; title_type?: 'plain_text' | 'mrkdwn'; title_emoji?: boolean; title_verbatim?: boolean; }; web?: { width?: number; }; rwc?: any; }; } export { IGenericImage }; } declare module "channels/generic/types/input" { interface IGenericInput { type: 'input'; props: { value?: string; label?: string; minLength?: number; maxLength?: number; multiline?: boolean; placeholder?: string; variableName?: string; slack?: { type: string; action_id?: string; multiline?: boolean; dispatch_action_config?: any; placeholder_type?: 'plain_text' | 'mrkdwn'; placeholder_emoji?: boolean; placeholder_verbatim?: boolean; }; web?: { variableName?: string; interactive?: boolean; regularExpression?: string; required?: string; hint?: string; min?: number; max?: number; inputType: string; }; rwc?: any; }; } export { IGenericInput }; } declare module "channels/generic/types/radio" { import { IGenericOptions } from "channels/generic/types/utils/options"; import { IGenericUnicConfirm } from "channels/generic/types/unic/confirm"; interface IGenericRadioValue { [key: string]: boolean; } interface IGenericRadio { type: 'radio'; props: { value?: Array<IGenericOptions> | IGenericRadioValue; label?: string; options?: Array<IGenericOptions>; variableName?: string; slack?: { action_id?: string; confirm?: IGenericUnicConfirm; }; web?: { variableName?: string; required?: boolean; interactive?: boolean; label?: string; hint?: string; vertical?: boolean; }; rwc?: any; }; } export { IGenericRadio, IGenericRadioValue }; } declare module "channels/generic/types/section" { interface IGenericSection { type: 'section'; props?: { slack?: any; salesforce?: { type?: string; }; servicenow?: { type?: string; }; rwc?: { id?: string; type?: string; time?: number; }; msteams?: { type: string; }; }; children?: Array<any>; } export { IGenericSection }; } declare module "channels/generic/types/select" { import { IGenericOptions, IGenericGroupOptions } from "channels/generic/types/utils/options"; import { IGenericUnicConfirm } from "channels/generic/types/unic/confirm"; import { IGenericElement } from "channels/generic/types/utils/element"; interface IGenericSelect extends IGenericElement { type: 'select'; props?: { value?: any; label?: string; placeholder?: string; options?: Array<IGenericOptions>; multiple?: Boolean; variableName?: string; slack?: { type?: string; action_id?: string; initial_user?: string; initial_option?: IGenericOptions | IGenericGroupOptions; initial_options?: IGenericOptions | IGenericGroupOptions; confirm?: IGenericUnicConfirm; initial_conversation?: string; default_to_current_conversation?: boolean; max_selected_items?: number; filter?: object; response_url_enabled?: boolean; initial_channel?: string; initial_users?: string; min_query_length?: number; option_groups?: Array<IGenericGroupOptions>; placeholder_type?: 'plain_text' | 'mrkdwn'; placeholder_emoji?: boolean; placeholder_verbatim?: boolean; }; web?: { variableName?: string; required?: boolean; interactive?: boolean; hint?: string; vertical?: boolean; }; rwc?: { type?: string; button?: string; }; }; } export { IGenericSelect }; } declare module "channels/generic/types/switch" { interface IGenericSwitch { type: 'switch'; props: { value?: string; label?: string; web: { variableName: string; required?: string; switchPosition?: 'left' | 'right' | 'top' | 'bottom'; }; }; } export { IGenericSwitch }; } declare module "channels/generic/types/unic/input-wrapper" { export interface IGenericUnicInputWrapper { readonly type: string; children?: Array<any>; props: { label?: string; variableName?: string; slack?: { dispatch_action?: boolean; type?: string; action_id?: string; label_type?: "plain_text" | "mrkdwn"; label_emoji?: boolean; label_verbatim?: boolean; }; web?: { variableName?: string; }; }; } } declare module "channels/generic/types/time-picker" { import { IGenericUnicConfirm } from "channels/generic/types/unic/confirm"; interface IGenericTimePicker { type: 'timePicker'; props: { value?: string; timeformat?: string | number; label?: string; placeholder?: string; variableName?: string; slack?: { action_id?: string; confirm?: IGenericUnicConfirm; placeholder_type?: 'plain_text' | 'mrkdwn'; placeholder_emoji?: boolean; placeholder_verbatim?: boolean; }; web?: { variableName?: string; timeformat?: string; hint?: string; required?: boolean; interactive?: boolean; value?: string; }; rwc?: { timeFormat: string; }; }; } export { IGenericTimePicker }; } declare module "channels/generic/types/file" { interface IGenericFile { type: 'file'; props?: { allowedTypes?: Array<any>; multiple?: boolean; web?: { "variableName": string; "multiple": boolean; "maxSize": string; "folder": string; "required": boolean; "allowedTypes": Array<any>; "customCssClass": string; }; salesforce?: any; servicenow?: any; rwc?: { filesValidation?: boolean; isPrivate?: boolean; maxSize?: string; maxSizeOption?: "file" | "total"; }; }; } export { IGenericFile }; } declare module "channels/generic/types/link" { interface IGenericLink { type: 'link'; props: { url: string; label?: string; title?: string; }; children?: Array<any>; } export { IGenericLink }; } declare module "channels/generic/types/location" { interface IGenericLocation { type: 'location'; props: { label?: string; value?: Array<string | number>; web?: { variableName?: string; customCssClass: string; }; rwc?: { useDefault?: boolean; }; }; } export { IGenericLocation }; } declare module "channels/generic/types/range" { interface IGenericRange { type: 'range'; props: { label?: string; value: [string | number, string | number]; min: string | number; max: string | number; step?: string | number; unit?: string; unitPosition?: string; rwc?: { mode?: "single" | "range"; useCustomLabels?: boolean; labelFunction?: Function; options?: Array<any>; defaultValue?: string; defaultValueStart?: string; defaultValueEnd?: string; }; }; } export { IGenericRange }; } declare module "channels/generic/types/card" { interface IGenericCard { type: 'card'; props?: { rwc?: any; }; children: Array<any>; } export { IGenericCard }; } declare module "channels/generic/types/header" { type HeaderLevel = 1 | 2 | 3 | 4 | 5 | 6; interface IGenericHeader { type: 'header'; props?: { level?: HeaderLevel; slack?: any; }; children?: Array<any>; } export { IGenericHeader }; } declare module "channels/generic/types/fields" { interface IGenericFields { type: 'fields'; props: { column?: number; }; children?: Array<any>; } export { IGenericFields }; } declare module "channels/generic/types/context" { interface IGenericContext { type: 'context'; props?: { slack?: any; servicenow?: any; }; children?: Array<any>; } export { IGenericContext }; } declare module "channels/generic/types/attachments" { interface IGenericAttachments { type: 'attachments'; props: { value: { filesValue?: Array<any>; staticValue?: Array<any>; }; web?: any; rwc?: any; }; } export { IGenericAttachments }; } declare module "channels/generic/types/carousel" { import { IGenericCard } from "channels/generic/types/card"; interface IGenericCarousel { type: string; props: { rwc?: any; }; children?: Array<IGenericCard>; } export { IGenericCarousel }; } declare module "channels/generic/types/rate" { interface IGenericRate { type: 'rate'; props: { placeholder?: string; rwc?: { showInput?: boolean; ratingSubmitLabel?: string; ratingDiscardLabel?: string; }; }; } export { IGenericRate }; } declare module "channels/generic/types/multimedia" { type MediaTypes = 'audio' | 'video' | 'screen' | 'file'; interface IGenericMultimedia { type: 'record'; props: { rwc?: { allowedMediaTypes?: Array<MediaTypes>; allowUploadAllMediaTypes?: boolean; }; }; } export { IGenericMultimedia }; } declare module "channels/generic/types/media-playback" { interface IGenericMediaPlayback { type: 'mediaPlayback'; props: { value?: string | number; label?: string; rwc?: { name?: string; autoplay?: boolean; button?: string; chapters?: Array<any>; }; }; children?: Array<any>; } export { IGenericMediaPlayback }; } declare module "channels/generic/types/signature" { interface IGenericSignature { type: 'signature'; props?: { rwc?: any; }; } export { IGenericSignature }; } declare module "channels/generic/types/credit-card" { interface IGenericCreditCard { type: 'creditCard'; props: { rwc?: { buttonLabel?: string; cancelButtonLabel?: string; termsCheckboxLabel?: string; }; }; children: Array<any>; } export { IGenericCreditCard }; } declare module "channels/generic/types/list" { import { IGenericOptions } from "channels/generic/types/utils/options"; interface IGenericList { type: 'list'; props: { options?: Array<IGenericOptions>; rwc?: { listTitle?: string; }; }; } export { IGenericList }; } declare module "channels/generic/types/scheduler" { import { IGenericOptions } from "channels/generic/types/utils/options"; interface IGenericScheduler { type: 'scheduler'; props?: { value?: any; options?: Array<IGenericOptions>; multiple?: boolean; rwc?: { disableByManually?: boolean; disableByMf?: boolean; disableByByFunction?: boolean; disableManual?: Array<any>; disableFunction?: string; multiselectQuantity?: string; }; }; } export { IGenericScheduler }; } declare module "channels/generic/types/index" { import { IGenericButton } from "channels/generic/types/button"; import { IGenericText, TextType } from "channels/generic/types/text"; import { IGenericCheckbox, IGenericCheckboxValue } from "channels/generic/types/checkbox"; import { IGenericDatePicker } from "channels/generic/types/date-picker"; import { IGenericDivider } from "channels/generic/types/divider"; import { IGenericImage } from "channels/generic/types/image"; import { IGenericInput } from "channels/generic/types/input"; import { IGenericRadio, IGenericRadioValue } from "channels/generic/types/radio"; import { IGenericSection } from "channels/generic/types/section"; import { IGenericSelect } from "channels/generic/types/select"; import { IGenericSwitch } from "channels/generic/types/switch"; import { IGenericWrapper } from "channels/generic/types/wrapper"; import { IGenericUnicConfirm } from "channels/generic/types/unic/confirm"; import { IGenericUnicInputWrapper } from "channels/generic/types/unic/input-wrapper"; import { IGenericOptions } from "channels/generic/types/utils/options"; import { IGenericTimePicker } from "channels/generic/types/time-picker"; import { IGenericTextObject } from "channels/generic/types/text-object"; import { IGenericFile } from "channels/generic/types/file"; import { IGenericLink } from "channels/generic/types/link"; import { IGenericLocation } from "channels/generic/types/location"; import { IGenericRange } from "channels/generic/types/range"; import { IGenericCard } from "channels/generic/types/card"; import { IGenericHeader } from "channels/generic/types/header"; import { IGenericFields } from "channels/generic/types/fields"; import { IGenericContext } from "channels/generic/types/context"; import { IGenericAttachments } from "channels/generic/types/attachments"; import { IGenericCarousel } from "channels/generic/types/carousel"; import { IGenericRate } from "channels/generic/types/rate"; import { IGenericMultimedia } from "channels/generic/types/multimedia"; import { IGenericMediaPlayback } from "channels/generic/types/media-playback"; import { IGenericSignature } from "channels/generic/types/signature"; import { IGenericCreditCard } from "channels/generic/types/credit-card"; import { IGenericList } from "channels/generic/types/list"; import { IGenericScheduler } from "channels/generic/types/scheduler"; export { TextType, IGenericWrapper, IGenericButton, IGenericText, IGenericCheckbox, IGenericCheckboxValue, IGenericDatePicker, IGenericDivider, IGenericImage, IGenericInput, IGenericRadio, IGenericRadioValue, IGenericSection, IGenericSelect, IGenericUnicConfirm, IGenericUnicInputWrapper, IGenericOptions, IGenericSwitch, IGenericTimePicker, IGenericTextObject, IGenericFile, IGenericLink, IGenericLocation, IGenericRange, IGenericCard, IGenericHeader, IGenericFields, IGenericContext, IGenericAttachments, IGenericCarousel, IGenericRate, IGenericMediaPlayback, IGenericMultimedia, IGenericSignature, IGenericCreditCard, IGenericList, IGenericScheduler }; } declare module "channels/slack/parsers/parse-slack-mrkdwn-to-markdown" { /** * Parser from Mrkdwn -> Markdown * @param {String} str */ export function parseSlackMrkdwnToMarkdown(str: any): any; } declare module "channels/slack/toGeneric/items/text-object" { import { IGenericText } from "channels/generic/types/index"; import { ISlackTextObject } from "channels/slack/types/index"; export const transformText: ({ type, text, emoji, verbatim }: ISlackTextObject) => IGenericText; } declare module "helpers/get-key-value" { export const getKeyValue: <T extends object, U extends keyof T>(obj: T) => (key: U) => T[U]; } declare module "helpers/get-error-object" { interface IErrorObject { readonly type: 'error'; props: { message: string; }; } interface IInputErrorData { type: string; message: string; } export const getErrorObject: ({ type, message }: IInputErrorData) => () => { type: string; props: { message: string; }; }; export { IErrorObject }; } declare module "channels/slack/toGeneric/items/section" { import { IGenericSection } from "channels/generic/types/index"; import { ISlackSection } from "channels/slack/types/index"; export const transformSection: ({ text, block_id, fields, accessory }: ISlackSection) => IGenericSection; } declare module "channels/slack/toGeneric/items/actions" { import { IGenericSection } from "channels/generic/types/index"; import { ISlackActions } from "channels/slack/types/index"; export const transformActions: ({ elements, block_id }: ISlackActions) => IGenericSection; } declare module "channels/slack/toGeneric/items/context" { import { IGenericContext, IGenericSection } from "channels/generic/types/index"; import { ISlackContext } from "channels/slack/types/index"; export const transformContext: ({ elements, block_id }: ISlackContext) => IGenericContext | IGenericSection; } declare module "channels/slack/toGeneric/items/header" { import { IGenericHeader, IGenericSection } from "channels/generic/types/index"; import { ISlackHeader } from "channels/slack/types/index"; export const transformHeader: ({ text, block_id }: ISlackHeader) => IGenericHeader | IGenericSection; } declare module "channels/slack/toGeneric/items/helpers/transform-text-object" { import { IGenericTextObject } from "channels/generic/types/index"; import { ISlackTextObject } from "channels/slack/types/index"; export const transformTextObject: ({ type, text, emoji, verbatim }: ISlackTextObject) => IGenericTextObject; } declare module "channels/slack/toGeneric/items/input" { import { IGenericUnicInputWrapper, IGenericSection } from "channels/generic/types/index"; import { ISlackInput } from "channels/slack/types/index"; export const transformInput: ({ element, label, dispatch_action, block_id }: ISlackInput) => IGenericUnicInputWrapper | IGenericSection; } declare module "channels/slack/toGeneric/items/confirm" { import { IGenericUnicConfirm } from "channels/generic/types/index"; import { ISlackConfirm } from "channels/slack/types/index"; export const transformConfirm: ({ title, text, confirm, deny, style }: ISlackConfirm) => IGenericUnicConfirm; } declare module "channels/slack/toGeneric/items/button" { import { IGenericButton } from "channels/generic/types/index"; import { ISlackButton } from "channels/slack/types/index"; export const transformButton: ({ text, action_id, url, value, style, confirm }: ISlackButton) => IGenericButton; } declare module "channels/slack/toGeneric/items/image" { /** * Slack API Docs: https://api.slack.com/reference/block-kit/blocks#image */ import { IGenericImage } from "channels/generic/types/index"; import { ISlackImage } from "channels/slack/types/index"; export const transformImage: ({ image_url, alt_text, title, block_id }: ISlackImage) => IGenericImage; } declare module "channels/slack/toGeneric/items/date-picker" { import { IGenericDatePicker } from "channels/generic/types/index"; import { ISlackDatePicker } from "channels/slack/types/index"; export const transformDatePicker: ({ action_id, placeholder, initial_date, confirm }: ISlackDatePicker) => IGenericDatePicker; } declare module "channels/slack/toGeneric/items/divider" { import { IGenericDivider } from "channels/generic/types/index"; import { ISlackDivider } from "channels/slack/types/index"; export const transformDivider: (data: ISlackDivider) => IGenericDivider; } declare module "channels/slack/toGeneric/items/helpers/convert-options" { import { IGenericOptions, IGenericGroupOptions } from "channels/generic/types/utils/options"; import { ISlackOptionObject, ISlackOptionGroupObject } from "channels/slack/types/index"; function convertSingleOption(item: any): IGenericOptions; function convertOptions(arr: Array<ISlackOptionObject>): Array<IGenericOptions>; function convertGroupOption(item: any): { label: import("channels/generic/types").IGenericTextObject; options: any; }; function convertGroupOptions(arr: Array<ISlackOptionGroupObject>): Array<IGenericGroupOptions>; export { convertOptions, convertSingleOption, convertGroupOption, convertGroupOptions }; } declare module "channels/slack/toGeneric/items/checkboxes" { import { IGenericCheckbox } from "channels/generic/types/index"; import { ISlackCheckboxes } from "channels/slack/types/index"; export const transformCheckboxes: ({ action_id, options, initial_options, confirm }: ISlackCheckboxes) => IGenericCheckbox; } declare module "channels/slack/toGeneric/items/radio-buttons" { import { IGenericRadio } from "channels/generic/types/index"; import { ISlackRadioButton } from "channels/slack/types/index"; export const transformRadioButtons: ({ action_id, options, initial_option, confirm }: ISlackRadioButton) => IGenericRadio; } declare module "channels/slack/toGeneric/items/plain-text-input" { import { IGenericInput } from "channels/generic/types/index"; import { ISlackInputText } from "channels/slack/types/index"; export const transformPlainTextInput: ({ type, action_id, placeholder, initial_value, multiline, min_length, max_length, dispatch_action_config }: ISlackInputText) => IGenericInput; } declare module "channels/slack/toGeneric/items/time-picker" { import { IGenericTimePicker } from "channels/generic/types/index"; import { ISlackTimePicker } from "channels/slack/types/index"; export const transformTimePicker: ({ action_id, placeholder, initial_time, confirm }: ISlackTimePicker) => IGenericTimePicker; } declare module "channels/slack/toGeneric/items/select/channels-select" { import { IGenericSelect } from "channels/generic/types/select"; import { ISlackChannelsSelect } from "channels/slack/types/index"; export const transformChannelsSelect: ({ type, placeholder, action_id, response_url_enabled, initial_channel, confirm }: ISlackChannelsSelect) => IGenericSelect; } declare module "channels/slack/toGeneric/items/select/overflow" { import { IGenericSelect } from "channels/generic/types/select"; import { ISlackOverflow } from "channels/slack/types/index"; export const transformOverflow: ({ type, action_id, options, confirm }: ISlackOverflow) => IGenericSelect; } declare module "channels/slack/toGeneric/items/select/conversations-select" { import { IGenericSelect } from "channels/generic/types/select"; import { ISlackSelectConversations } from "channels/slack/types/index"; export const transformConversationsSelect: ({ type, placeholder, action_id, initial_conversation, default_to_current_conversation, confirm, response_url_enabled, filter }: ISlackSelectConversations) => IGenericSelect; } declare module "channels/slack/toGeneric/items/select/multi-conversations-select" { import { IGenericSelect } from "channels/generic/types/select"; import { ISlackMultiConversationSelect } from "channels/slack/types/index"; export const transformMultiConversationsSelect: ({ type, placeholder, action_id, initial_conversation, default_to_current_conversation, confirm, max_selected_items, filter }: ISlackMultiConversationSelect) => IGenericSelect; } declare module "channels/slack/toGeneric/items/select/users-select" { import { IGenericSelect } from "channels/generic/types/select"; import { ISlackSelectUsers } from "channels/slack/types/index"; export const transformUsersSelect: ({ type, placeholder, action_id, initial_user, confirm }: ISlackSelectUsers) => IGenericSelect; } declare module "channels/slack/toGeneric/items/select/select" { import { IGenericSelect } from "channels/generic/types/select"; import { ISlackSelectStatic } from "channels/slack/types/index"; export const transformSelect: ({ type, placeholder, action_id, options, option_groups, initial_option, confirm }: ISlackSelectStatic) => IGenericSelect; } declare module "channels/slack/toGeneric/items/select/multi-users-select" { import { IGenericSelect } from "channels/generic/types/select"; import { ISlackMultiUsersSelect } from "channels/slack/types/index"; export const transformMultiUsersSelect: ({ type, placeholder, action_id, initial_users, confirm, max_selected_items }: ISlackMultiUsersSelect) => IGenericSelect; } declare module "channels/slack/toGeneric/items/select/multi-static-select" { import { IGenericSelect } from "channels/generic/types/select"; import { ISlackMultiStaticSelect } from "channels/slack/types/index"; export const transformMultiStaticSelect: ({ type, placeholder, action_id, options, option_groups, initial_options, confirm, max_selected_items }: ISlackMultiStaticSelect) => IGenericSelect; } declare module "channels/slack/toGeneric/methods" { const methods: { [key: string]: Function; }; export const getMethods: (type: string) => Function; export { methods }; export const methodsSlackToGenrric: { [key: string]: Function; }; } declare module "channels/slack/toGeneric/index" { import { IGenericWrapper } from "channels/generic/types/wrapper"; import { ISlackBlockKitData } from "channels/slack/types/index"; export function transformSlackToGeneric({ blocks, attachments, type, title, submit, close }: ISlackBlockKitData): IGenericWrapper; } declare module "channels/slack/parsers/parse-markdown-to-slack-mrkdwn" { /** * Parser from Markdown -> Mrkdwn */ export function parseMarkdownToSlackMrkdwn(str: string): string; } declare module "channels/slack/fromGeneric/items/text" { import { IGenericText } from "channels/generic/types/text"; import { ISlackTextObject } from "channels/slack/types/index"; interface IGenericTextObject { value: string; type?: 'markdown' | 'plain' | 'html'; slack?: { type: 'plain_text' | 'mrkdwn'; emoji?: boolean; verbatim?: boolean; }; } const transformTextObject: ({ value, type, slack }: IGenericTextObject) => ISlackTextObject; const transformText: ({ props }: IGenericText) => ISlackTextObject; export { transformTextObject, transformText }; } declare module "channels/slack/fromGeneric/items/section" { import { IGenericSection } from "channels/generic/types/index"; import { ISlackSection, ISlackActions } from "channels/slack/types/index"; function transformSection({ props, children }: IGenericSection): ISlackActions; function transformSection({ props, children }: IGenericSection): Array<ISlackSection | ISlackActions>; export { transformSection }; } declare module "channels/slack/fromGeneric/items/confirm" { import { IGenericUnicConfirm } from "channels/generic/types/index"; import { ISlackConfirm } from "channels/slack/types/index"; export const transformConfirm: ({ props }: IGenericUnicConfirm) => ISlackConfirm; } declare module "channels/slack/fromGeneric/items/button" { import { IGenericButton } from "channels/generic/types/index"; import { ISlackButton } from "channels/slack/types/index"; export const transformButton: ({ props }: IGenericButton) => ISlackButton; } declare module "channels/slack/fromGeneric/helpers/convert-options" { import { ISlackOptionObject, ISlackOptionGroupObject } from "channels/slack/types/index"; import { IGenericOptions, IGenericGroupOptions } from "channels/generic/types/utils/options"; function convertGenericSingleOption(item: any): ISlackOptionObject; function convertGenericOptions(arr: Array<IGenericOptions>): Array<ISlackOptionObject>; function convertGenericSingleOptionGroup(item: any): { label: import("channels/slack/types/composition-objects").ISlackTextObject; options: any; }; function convertGenericOptionsGroup(arr: Array<IGenericGroupOptions>): Array<ISlackOptionGroupObject>; export { convertGenericOptions, convertGenericOptionsGroup, convertGenericSingleOption, convertGenericSingleOptionGroup }; } declare module "channels/slack/fromGeneric/helpers/section-wrapper" { import { ISlackTextObject, ISlackInput } from "channels/slack/types/index"; function getElementWithSectionWrapper(element: any, label: ISlackTextObject, interactive?: boolean): ISlackInput; export { getElementWithSectionWrapper }; } declare module "channels/slack/fromGeneric/items/select" { import { IGenericSelect } from "channels/generic/types/index"; import { ISlackSelectStatic, ISlackSelectUsers, ISlackChannelsSelect, ISlackSelectConversations, ISlackMultiUsersSelect, ISlackMultiConversationSelect, ISlackOverflow, ISlackMultiStaticSelect, ISlackInput } from "channels/slack/types/index"; function transformSelect({ props }: IGenericSelect, type: String): ISlackSelectStatic; function transformSelect({ props }: IGenericSelect, type: String): ISlackSelectUsers; function transformSelect({ props }: IGenericSelect, type: String): ISlackMultiConversationSelect; function transformSelect({ props }: IGenericSelect, type: String): ISlackOverflow; function transformSelect({ props }: IGenericSelect, type: String): ISlackChannelsSelect; function transformSelect({ props }: IGenericSelect, type: String): ISlackSelectConversations; function transformSelect({ props }: IGenericSelect, type: String): ISlackMultiUsersSelect; function transformSelect({ props }: IGenericSelect, type: String): ISlackMultiStaticSelect; function transformSelect({ props }: IGenericSelect, type: String): ISlackInput; export { transformSelect }; } declare module "channels/slack/fromGeneric/items/image" { import { IGenericImage } from "channels/generic/types/index"; import { ISlackImage } from "channels/slack/types/index"; export const transformImage: ({ props }: IGenericImage) => ISlackImage; } declare module "channels/slack/fromGeneric/items/date-picker" { import { IGenericDatePicker } from "channels/generic/types/index"; import { ISlackDatePicker, ISlackInput } from "channels/slack/types/index"; export const transformDatePicker: ({ props }: IGenericDatePicker) => ISlackDatePicker | ISlackInput; } declare module "channels/slack/fromGeneric/items/divider" { import { IGenericDivider } from "channels/generic/types/index"; import { ISlackDivider } from "channels/slack/types/index"; export const transformDivider: (data: IGenericDivider) => ISlackDivider; } declare module "channels/slack/fromGeneric/items/input" { import { ISlackInput } from "channels/slack/types/index"; import { IGenericSection, IGenericUnicInputWrapper } from "channels/generic/types/index"; export const transformInput: ({ props, children }: IGenericUnicInputWrapper | IGenericSection) => ISlackInput; } declare module "channels/slack/fromGeneric/items/plain-text-input" { import { IGenericInput } from "channels/generic/types/index"; import { ISlackInput } from "channels/slack/types/index"; export const transformPlainTextInput: ({ props }: IGenericInput) => ISlackInput; } declare module "channels/slack/fromGeneric/items/checkbox" { import { IGenericCheckbox } from "channels/generic/types/index"; import { ISlackCheckboxes, ISlackInput } from "channels/slack/types/index"; export const transformCheckbox: ({ props }: IGenericCheckbox) => ISlackCheckboxes | ISlackInput; } declare module "channels/slack/fromGeneric/items/radio" { import { IGenericRadio } from "channels/generic/types/index"; import { ISlackInput, ISlackRadioButton } from "channels/slack/types/index"; export const transformRadioButtons: ({ props }: IGenericRadio) => ISlackRadioButton | ISlackInput; } declare module "channels/slack/fromGeneric/items/time-picker" { import { IGenericTimePicker } from "channels/generic/types/index"; import { ISlackInput, ISlackTimePicker } from "channels/slack/types/index"; export const transformTimePicker: ({ props }: IGenericTimePicker) => ISlackTimePicker | ISlackInput; } declare module "channels/slack/fromGeneric/items/context" { import { IGenericContext } from "channels/generic/types/index"; import { ISlackContext } from "channels/slack/types/index"; function transformContext({ props, children }: IGenericContext): ISlackContext; export { transformContext }; } declare module "channels/slack/fromGeneric/items/header" { import { IGenericHeader } from "channels/generic/types/index"; import { ISlackHeader, ISlackSection } from "channels/slack/types/index"; function transformHeader({ props, children }: IGenericHeader): ISlackHeader | ISlackSection; export { transformHeader }; } declare module "channels/slack/fromGeneric/items/fields" { import { IGenericFields } from "channels/generic/types/index"; import { ISlackSection, ISlackTextO