import type * as Webhooks from '../Webhooks.js'; import * as WebhookDestination from '../WebhookDestination.js'; /** * Builds a `slack` destination. Its `deliver` formats the envelope into a * per-event Block Kit message ({@link formatBlocks}) and POSTs it to the Slack * incoming-webhook URL unsigned (the URL is the shared secret; host-locked to * `hooks.slack.com`). Deliver with `.deliver({ envelope })`. */ export declare function slack(url: string): WebhookDestination.Instance; /** A Slack `section.fields` / `context.elements` entry. */ type Field = { text: string; type: 'mrkdwn'; }; /** A Slack Block Kit block (loosely typed; only the shapes we emit). */ type Block = { elements: Field[]; type: 'context'; } | { fields: Field[]; type: 'section'; } | { text: { emoji: true; text: string; type: 'plain_text'; }; type: 'header'; } | { text: Field; type: 'section'; }; /** * Formats an envelope into a Slack Block Kit message (`{ blocks, text }`) using a * per-event layout. Every message shares the cross-cutting rules: a header (the * subscription's `context.title` when set, else the event's friendly name), an * optional description section, an event-specific lead + fields grid, and a * trailing context line that always preserves the raw event type/id/chain/time. * Pure and synchronous — all inputs come from the envelope or static chain data. */ export declare function formatBlocks(envelope: Webhooks.Envelope): { blocks: Block[]; text: string; }; /** * Validates a `slack` destination's incoming-webhook URL: must be `https` and * hosted at {@link slackWebhookHost}. The host lock keeps `slack` destinations * from becoming a generic "POST an unsigned message anywhere" primitive — a * `slack` delivery carries no signature, so it must only ever reach Slack. */ export declare function assertSlackUrl(input: string): URL; /** * Masks the secret path of a Slack incoming-webhook URL for logging, keeping the * host so the destination is still recognizable: `https://hooks.slack.com/…`. * Falls back to the bare origin if the URL can't be parsed. */ export declare function redactSlackUrl(url: string): string; export {}; //# sourceMappingURL=slack.d.ts.map