import type { drive_v3 } from "googleapis"; /** * Shared revision helpers used by `docs download --revision`, `docs read` * (recent-revisions block), and `docs diff`. Centralizing the * exportLinks-fetch + fallback logic keeps the three commands consistent and * avoids re-deriving the markdown-default behavior in each. */ export interface RecentRevision { id: string; modified: string; author: string; } /** * List the most recent `limit` revisions of a file, newest-first, with the * minimal `{id,modified,author}` shape. One page (pageSize 1000) is fetched * and sorted — Drive's revision count is effectively always well under that, * and this is a best-effort discovery aid, not the exhaustive listing that * `drive revisions` provides. */ export declare function listRecentRevisions(api: drive_v3.Drive, fileId: string, limit: number): Promise; export interface NativeRevisionExport { bytes: Buffer; /** The mime that was actually exported (may differ from the request on fallback). */ mime: string; modified: string; author: string; /** Set when the requested default (markdown) was unavailable and we fell back. */ note?: string; } /** * Export a native Google file's revision content via that revision's * `exportLinks` map. When `as` is omitted the default is `text/markdown` with a * fallback chain (`text/plain` → first available); an explicit `as` that isn't * available is an error, not a fallback. The chosen export URL is fetched with * the account's bearer token (exportLinks are arbitrary URLs, not a googleapis * method). * * Throws `REVISION_NOT_FOUND` (bad id), `EXPORT_FORMAT_REQUIRED` (format * unavailable), or `REVISION_CONTENT_UNAVAILABLE` (export GET failed). */ export declare function fetchNativeRevisionExport(api: drive_v3.Drive, account: string, fileId: string, revisionId: string, as: string | undefined): Promise;