import { readFile, realpath, stat } from "node:fs/promises"; import type { SlackResult } from "./slack-api.js"; export interface SlackUploadParams { content?: string; path?: string; filename?: string; filetype?: string; title?: string; } export interface PreparedSlackUpload { bytes: Buffer; byteLength: number; filename: string; title: string; filetype?: string; snippetType?: string; source: "content" | "path"; resolvedPath?: string; } export interface SlackUploadDeps { slack: (method: string, token: string, body?: Record) => Promise; token: string; fetchImpl?: (url: string, init: RequestInit) => Promise>; } export interface PerformSlackUploadOptions extends SlackUploadDeps { upload: PreparedSlackUpload; channelId: string; threadTs?: string; initialComment?: string; } export interface PerformSlackUploadsOptions extends SlackUploadDeps { uploads: readonly PreparedSlackUpload[]; channelId: string; threadTs?: string; initialComment?: string; } export interface CompletedSlackUpload { fileId: string; response: SlackResult; } export interface CompletedSlackUploads { fileIds: string[]; response: SlackResult; } interface PrepareSlackUploadFs { readFileImpl?: typeof readFile; realpathImpl?: typeof realpath; statImpl?: typeof stat; } export declare function inferSlackUploadFiletype(filename: string | undefined, explicitFiletype?: string): string | undefined; export declare function chooseSlackSnippetType(upload: { source: "content" | "path"; byteLength: number; filename: string; filetype?: string; }): string | undefined; export declare function resolveSlackUploadPath(inputPath: string, cwd: string, tmpdir: string, fsDeps?: PrepareSlackUploadFs): Promise; export declare function prepareSlackUpload(params: SlackUploadParams, cwd: string, tmpdir: string, fsDeps?: PrepareSlackUploadFs): Promise; export declare function performSlackUploads({ uploads, channelId, threadTs, initialComment, slack, token, fetchImpl, }: PerformSlackUploadsOptions): Promise; export declare function performSlackUpload({ upload, channelId, threadTs, initialComment, slack, token, fetchImpl, }: PerformSlackUploadOptions): Promise; export {};