/**
 * Slack Node - Version 2
 * Discriminator: resource=message, operation=update
 */


interface Credentials {
  slackApi: CredentialReference;
  slackOAuth2Api: CredentialReference;
}

export type SlackV2MessageUpdateParams = {
  resource: 'message';
  operation: 'update';
  authentication?: 'accessToken' | 'oAuth2' | Expression<string>;
/**
 * The Slack channel to update the message from
 * @default {"mode":"list","value":""}
 */
    channelId?: { __rl: true; mode: 'list' | 'id' | 'url'; value: string; cachedResultName?: string };
/**
 * Timestamp of the message to update
 */
    ts: number | Expression<number>;
/**
 * Whether to send a simple text message, or use Slack’s Blocks UI builder for more sophisticated messages that include form fields, sections and more
 * @default text
 */
    messageType?: 'text' | 'block' | 'attachment' | Expression<string>;
/**
 * Enter the JSON output from Slack's visual Block Kit Builder here. You can then use expressions to add variable content to your blocks. To create blocks, use &lt;a target='_blank' href='https://app.slack.com/block-kit-builder'&gt;Slack's Block Kit Builder&lt;/a&gt;
 * @hint To create blocks, use &lt;a target='_blank' href='https://app.slack.com/block-kit-builder'&gt;Slack's Block Kit Builder&lt;/a&gt;
 * @displayOptions.show { messageType: ["block"] }
 */
    blocksUi?: string | Expression<string> | PlaceholderValue;
/**
 * Fallback text to display in slack notifications. Supports &lt;a href="https://api.slack.com/reference/surfaces/formatting"&gt;markdown&lt;/a&gt; by default - this can be disabled in "Options".
 * @displayOptions.show { messageType: ["block"] }
 */
    text?: string | Expression<string> | PlaceholderValue;
/**
 * Update Fields
 * @default {}
 */
    updateFields?: {
    /** Whether to find and link channel names and usernames
     * @default false
     */
    link_names?: boolean | Expression<boolean>;
    /** Change how messages are treated
     * @default client
     */
    parse?: 'client' | 'full' | 'none' | Expression<string>;
  };
/**
 * Other options to set
 * @default {}
 */
    otherOptions?: {
    /** Whether to append a link to this workflow at the end of the message. This is helpful if you have many workflows sending Slack messages.
     * @default true
     */
    includeLinkToWorkflow?: boolean | Expression<boolean>;
  };
};

export type SlackV2MessageUpdateOutput = {
  channel?: string;
  message?: {
    app_id?: string;
    blocks?: Array<{
      block_id?: string;
      elements?: Array<{
        elements?: Array<{
          style?: {
            bold?: boolean;
            italic?: boolean;
          };
          text?: string;
          type?: string;
          url?: string;
        }>;
        type?: string;
      }>;
      text?: {
        text?: string;
        type?: string;
        verbatim?: boolean;
      };
      type?: string;
    }>;
    bot_id?: string;
    bot_profile?: {
      app_id?: string;
      deleted?: boolean;
      icons?: {
        image_36?: string;
        image_48?: string;
        image_72?: string;
      };
      id?: string;
      name?: string;
      team_id?: string;
      updated?: number;
    };
    edited?: {
      ts?: string;
      user?: string;
    };
    team?: string;
    text?: string;
    type?: string;
    user?: string;
  };
  message_timestamp?: string;
  ok?: boolean;
  text?: string;
};

export type SlackV2MessageUpdateNode = {
  type: 'n8n-nodes-base.slack';
  version: 2;
  credentials?: Credentials;
  config: NodeConfig<SlackV2MessageUpdateParams>;
  output?: Items<SlackV2MessageUpdateOutput>;
};