import type { GraphClientConfig } from "../lib/graph-client.js"; import type { AttachmentListItem } from "../lib/attachment-list.js"; /** * Attachment retrieval for Outlook mailboxes. * * `runMailAttachmentList` enumerates a message's attachments (metadata only, no * bytes). It is not inbound-only: a draft is a message in the same collection, * so passing a draftId lists what that draft carries, and the id/name it returns * is the handle outlook-draft-edit's `removeAttachments` resolves against. * Downloading bytes is inbound in practice, since a draft's own attachments came * from the account directory to begin with. * * `runMailAttachmentDownload` fetches one file attachment's bytes and * writes them to the account's uploads directory so the agent can Read the * file, forward it, or attach it to a reply. * * Only `fileAttachment` carries downloadable bytes. `itemAttachment` (an * embedded message/event) and `referenceAttachment` (a cloud-drive link) are * listed with their kind but refused for download, so a caller never writes a * zero-byte or malformed file. */ export interface AttachmentListResult { items: AttachmentListItem[]; } /** * List a message's attachments by id. Metadata only — no file bytes are * downloaded. Get `messageId` from outlook-mail-list / outlook-mail-search * (both now report `hasAttachments`). * * The GET itself lives in lib/attachment-list.ts because outlook-draft-edit * resolves attachment removals against the same call. */ export declare function runMailAttachmentList(config: GraphClientConfig, args: { messageId: string; }): Promise; export interface AttachmentDownloadResult { /** Absolute path of the written file, under {accountDir}/uploads/outlook. */ path: string; name: string; contentType: string | null; bytes: number; } /** * Download one file attachment's bytes to the account's uploads directory and * return the saved path. Refuses non-file attachments (item/reference), an * empty payload, and anything over the 25 MB cap — in each case nothing is * written. The write is verified by re-stat before returning, so the reported * path always holds the reported byte count. */ export declare function runMailAttachmentDownload(config: GraphClientConfig, args: { messageId: string; attachmentId: string; }): Promise; //# sourceMappingURL=mail-attachment.d.ts.map