export declare const DEFAULT_NYLAS_API_URI = "https://api.us.nylas.com"; /** The SkyKoi Live OAuth app id — same Nylas app, so grants/scopes match. */ export declare const DEFAULT_NYLAS_CLIENT_ID = "da8f846e-9511-4957-91bc-2ed2a76eb0a2"; export type NylasConfig = { apiKey: string; clientId: string; apiUri: string; redirectUri?: string; }; /** Resolve Nylas config, or null when the master key is not configured yet. */ export declare function resolveNylasConfig(): NylasConfig | null; export declare function nylasConfigured(): boolean; export type NylasGrant = { grantId: string; email?: string; provider?: string; ts: number; }; export declare function readNylasGrant(): NylasGrant | null; export declare function writeNylasGrant(grant: Omit & { ts?: number; }): void; export declare function clearNylasGrant(): void; export declare function nylasLinked(): boolean; export declare class NylasError extends Error { readonly status?: number | undefined; constructor(message: string, status?: number | undefined); } export type EmailAddress = { email: string; name?: string; }; export type NylasAttachment = { id?: string; filename?: string; content_type?: string; size?: number; }; export type NylasMessage = { id?: string; thread_id?: string; subject?: string; snippet?: string; body?: string; from?: EmailAddress[]; to?: EmailAddress[]; cc?: EmailAddress[]; date?: number; unread?: boolean; folders?: string[]; attachments?: NylasAttachment[]; }; export declare function readMessages(opts: { limit?: number; query?: string; }): Promise; export declare function getThreadMessages(threadId: string): Promise; export declare function sendMessage(opts: { to: EmailAddress[]; subject: string; body: string; cc?: EmailAddress[]; bcc?: EmailAddress[]; replyToMessageId?: string; }): Promise<{ id?: string; }>; export declare function createDraft(opts: { to: EmailAddress[]; subject: string; body: string; }): Promise<{ id?: string; }>; /** * Download one attachment's bytes. Returns the raw bytes plus its content type, * so callers can extract text (text/* , csv, json), hand images to vision, or * note binary files — giving the koi the full contents of what's in an email. */ export declare function downloadAttachment(messageId: string, attachmentId: string): Promise<{ contentType: string; bytes: Buffer; }>; export type NylasEvent = { id?: string; title?: string; description?: string | null; location?: string; participants?: EmailAddress[]; when?: { start_time?: number; end_time?: number; start_date?: string; end_date?: string; }; calendar_id?: string; }; export declare function readEvents(opts: { start: number; end: number; calendarId?: string; limit?: number; title?: string; }): Promise; export declare function createEvent(opts: { title: string; start: number; end: number; calendarId?: string; description?: string; location?: string; participants?: EmailAddress[]; /** Auto-create a video conference on the event (default provider "Google Meet"). */ conferencing?: { provider?: string; }; }): Promise; /** The video link on an event Nylas just created with conferencing. */ export declare function eventConferencingUrl(event: NylasEvent): string | undefined; export declare function updateEvent(opts: { eventId: string; calendarId?: string; title?: string; start?: number; end?: number; description?: string; location?: string; participants?: EmailAddress[]; }): Promise; export declare function deleteEvent(opts: { eventId: string; calendarId?: string; }): Promise; export type NylasContact = { id?: string; given_name?: string; surname?: string; emails?: Array<{ email?: string; type?: string; }>; company_name?: string; }; export declare function readContacts(opts: { limit?: number; email?: string; }): Promise;