/** * Fetch-based Google API client — replaces the 110 MB googleapis package. * * Uses google-auth-library for token management and native fetch for HTTP. * All non-2xx responses throw GoogleApiError to preserve the error contract * expected by mapGoogleError() / withRetry() in errors.ts. */ import type { GDocsDocument, GDocsBatchUpdateResponse, GDocsRequest } from './google-api-types.js'; /** * Error class that preserves the contract expected by mapGoogleError() / withRetry(). * extractHttpCode() checks error.code and error.response.status. */ export declare class GoogleApiError extends Error { code: number; response: { status: number; headers?: Headers; }; body?: unknown; constructor(status: number, message: string, body?: unknown, headers?: Headers); } export type BatchUpdateBody = { requests: GDocsRequest[]; writeControl?: { requiredRevisionId?: string; }; }; /** * Lightweight Google API client backed by native fetch. * * Covers the 6 endpoints used by google-docs-core: * - Docs: getDocument, batchUpdate * - Drive: createFile, deleteFile, shareFile, exportAsDocx */ export declare class GoogleApiClient { private getAccessToken; constructor(getAccessToken: () => Promise); /** GET documents/{id}?includeTabsContent=true */ getDocument(documentId: string): Promise; /** POST documents/{id}:batchUpdate */ batchUpdate(documentId: string, body: BatchUpdateBody): Promise; /** POST drive/v3/files — create a file, return the file ID */ createFile(name: string, mimeType: string): Promise; /** DELETE drive/v3/files/{id} */ deleteFile(fileId: string): Promise; /** POST drive/v3/files/{id}/permissions — share a file */ shareFile(fileId: string, email: string, role: string): Promise; /** * GET drive/v3/files/{id}/export?mimeType=application/vnd.openxmlformats-officedocument.wordprocessingml.document * * Exports a Google Doc as a DOCX file. Returns the raw bytes as a Buffer. * * **Note:** The Drive export API has a 10 MB limit for Google Workspace files. * Files exceeding this limit will return an error. */ exportAsDocx(fileId: string): Promise; private fetchJson; private fetchRaw; } //# sourceMappingURL=api-client.d.ts.map