import type { OAuth2Client } from 'googleapis-common'; import { type AttachmentMeta, type Capabilities, type DraftInput, type EmailProvider, type EmailQuery, type Folder, type GetAttachmentOpts, type GetMessageOpts, type Label, type Message, type ModifyAction, type MessageSearchPage, type PageOpts, type SendResult, type SendAsIdentity, type Thread } from '@fluxmail/core'; export interface GmailProviderOptions { accountId: string; email: string; /** Stored sender name used when Gmail settings and the current Google profile have no name. */ displayName?: string; auth: OAuth2Client; } export declare const GMAIL_CAPABILITIES: Capabilities; export declare class GmailProvider implements EmailProvider { readonly capabilities: Capabilities; private readonly gmail; private readonly accountId; private readonly email; private readonly displayName; private readonly auth; private labelCache; private sendAsCache; /** undefined = not resolved yet; null = no name available. */ private senderName; constructor(opts: GmailProviderOptions); /** * Sender name for the From header, matching what the Gmail UI would use: * the primary send-as displayName when set, else the current Google profile * name, with the stored account name as an offline fallback. */ private resolveSenderName; testConnection(): Promise; listSendAs(): Promise; private labels; private labelNameMap; /** Gmail messages carry the DRAFT label, but only Draft resources expose the draft id. */ private attachDraftIds; private resolveLabelId; listMessages(input: EmailQuery, page?: PageOpts): Promise; private attachSearchContext; private searchContext; getMessage(id: string, opts?: GetMessageOpts): Promise; getThread(threadId: string): Promise; private parseFullMessage; listFolders(): Promise; listLabels(): Promise; /** Resolve reply threading (headers + Gmail thread id) from the message being replied to. */ private resolveReply; /** Threading already present on an existing draft, so content updates keep a reply on its thread. */ private resolveExistingDraftThreading; private composeRaw; private draftToMessage; createDraft(d: DraftInput): Promise; getDraft(draftId: string): Promise; updateDraft(draftId: string, d: DraftInput): Promise; deleteDraft(draftId: string): Promise; send(input: DraftInput | { draftId: string; }): Promise; modify(ids: string[], action: ModifyAction): Promise; getAttachment(messageId: string, attachmentId: string, opts?: GetAttachmentOpts): Promise<{ meta: AttachmentMeta; content: Buffer; }>; } //# sourceMappingURL=gmailProvider.d.ts.map