import type { ConversationsInfoResponse, UsersInfoResponse } from '@slack/web-api'; import type { InboxFileMeta } from '../../shared/inbox.js'; export type SlackConversationInfo = NonNullable; export type SlackUserInfo = NonNullable; interface SlackHandleCandidateUser { displayName?: string; name?: string; profile?: { display_name?: string; real_name?: string; }; realName?: string; real_name?: string; } interface SlackNamedConversation { name?: string; name_normalized?: string; } export interface SlackRawFile { id?: string; name?: string; title?: string; mimetype?: string; filetype?: string; size?: number; permalink?: string; url_private?: string; url_private_download?: string; } export type DownloadableSlackFile = InboxFileMeta & { urlPrivate?: string; }; /** * The house definition of "not a human", over any Slack user shape that carries * the two flags. * * Slack marks classic bot users with `is_bot` and Slack-app users with * `is_app_user`, and an app can present as either depending on how it was * installed. Both mean the same thing to us - there is no person behind the * account - so no caller should test only one. Structural parameter type: the * three call sites hold three different user shapes (`SlackUserInfo`, * `SlackDirectoryUser`, and the raw ask target) that agree on these fields. */ export declare function isBotSlackUser(user: { isAppUser?: boolean; isBot?: boolean; }): boolean; export declare function extractSlackUserMentionIds(text: string): string[]; export declare function replaceSlackUserMentions(text: string, labels: Map): string; export declare function extractSlackChannelMentionIds(text: string): string[]; export declare function replaceSlackChannelMentions(text: string, labels: Map): string; export declare function extractReadableSlackUserMentions(text: string): string[]; export declare function extractReadableSlackUserIdMentions(text: string): string[]; export declare function replaceReadableSlackUserMentions(text: string, userIds: Map): string; export declare function replaceReadableSlackUserIdMentions(text: string): string; export declare function extractReadableSlackChannelMentions(text: string): string[]; export declare function replaceReadableSlackChannelMentions(text: string, channelIds: Map): string; export declare function atLabel(value: string): string; export declare function channelLabel(value: string): string; export interface SlackActorNameParts { displayName?: string; handle?: string; userId?: string; } export declare function slackDisplayLabel(parts: SlackActorNameParts): string; export declare function slackMentionLabel(parts: SlackActorNameParts): string; export declare function slackTsToIso(ts: string): string | undefined; export declare function findSlackConversationByName(channels: T[], name: string): T | undefined; export declare function getUniqueSlackUserByHandle(users: SlackUserInfo[], handle: string): SlackUserInfo; export declare function isFreshSlackCacheEntry(iso: string | undefined, ttlMs: number): boolean; export declare function normalizeSlackConversationName(value: string): string; export declare function normalizeSlackEventFiles(rawFiles: SlackRawFile[] | undefined): InboxFileMeta[] | undefined; export declare function normalizeSlackHandle(value: string): string; export declare function slackFileFromRaw(raw: SlackRawFile): DownloadableSlackFile | undefined; export declare function slackUserHandleCandidates(user: SlackHandleCandidateUser): string[]; export declare function upsertSlackConversation(cache: T, channel: SlackConversationInfo): T; export declare function upsertSlackUser(cache: T, user: SlackUserInfo): T; export {}; //# sourceMappingURL=slack.helper.d.ts.map