/** * Drive module — list, search, download, upload, share, and manage files. * * All functions take an OAuth2Client as first argument. * Use `getAuth('drive', 'account@email.com')` from the auth module. */ import type { OAuth2Client } from 'google-auth-library'; import type { DriveFile, DrivePermission, ListResult, WriteResult, ListFilesOptions, SearchFilesOptions, UploadOptions, ShareOptions, ExportFormat } from './types.js'; export type { DriveFile, DrivePermission, ListResult, WriteResult, ListFilesOptions, SearchFilesOptions, UploadOptions, ShareOptions, ExportFormat, }; /** * List files in a folder or matching a query. * * @example * ```ts * // List root folder * const files = await listFiles(auth); * * // List specific folder * const files = await listFiles(auth, { folderId: 'folder-id' }); * * // Query by metadata * const files = await listFiles(auth, { query: "name contains 'report'" }); * ``` */ export declare function listFiles(auth: OAuth2Client, opts?: ListFilesOptions): Promise>; /** * Full-text search inside file contents. * * @example * ```ts * const results = await searchFiles(auth, { query: 'quarterly revenue' }); * ``` */ export declare function searchFiles(auth: OAuth2Client, opts: SearchFilesOptions): Promise>; /** * Get a single file's metadata by ID. */ export declare function getFile(auth: OAuth2Client, fileId: string): Promise; /** * Download a file's content as a Buffer. * For Google Workspace files (Docs, Sheets, Slides), use `exportFile()` instead. */ export declare function downloadFile(auth: OAuth2Client, fileId: string): Promise<{ data: Buffer; mimeType: string; name: string; }>; /** * Export a Google Workspace file (Doc, Sheet, Slides) to a standard format. * * @example * ```ts * const { data } = await exportFile(auth, 'doc-id', 'pdf'); * ``` */ export declare function exportFile(auth: OAuth2Client, fileId: string, format: ExportFormat): Promise<{ data: Buffer; mimeType: string; name: string; }>; /** * Upload a file to Google Drive. * * WRITE operation — no safety gate (reversible via trash). */ export declare function uploadFile(auth: OAuth2Client, localPath: string, opts?: UploadOptions): Promise; /** * Create a folder in Google Drive. * * WRITE operation — no safety gate. */ export declare function createFolder(auth: OAuth2Client, name: string, parentId?: string): Promise; /** * Move a file to a different folder. * * WRITE operation — no safety gate (reversible). */ export declare function moveFile(auth: OAuth2Client, fileId: string, newParentId: string): Promise; /** * Rename a file. * * WRITE operation — no safety gate. */ export declare function renameFile(auth: OAuth2Client, fileId: string, newName: string): Promise; /** * Copy a file. * * WRITE operation — no safety gate. */ export declare function copyFile(auth: OAuth2Client, fileId: string, name?: string, parentId?: string): Promise; /** * Trash a file. * * ⚠️ DESTRUCTIVE — requires safety confirmation. */ export declare function trashFile(auth: OAuth2Client, fileId: string): Promise; /** * List permissions on a file. */ export declare function listPermissions(auth: OAuth2Client, fileId: string): Promise; /** * Share a file with a user, group, domain, or anyone. * * ⚠️ DESTRUCTIVE when sharing with 'anyone' — requires safety confirmation. * WRITE for user/group/domain sharing. */ export declare function shareFile(auth: OAuth2Client, fileId: string, opts: ShareOptions): Promise; /** * Remove a sharing permission from a file. * * ⚠️ DESTRUCTIVE — requires safety confirmation. */ export declare function unshareFile(auth: OAuth2Client, fileId: string, permissionId: string): Promise; //# sourceMappingURL=index.d.ts.map