UNPKG

@gravityforms/gulp-tasks

Version:
66 lines (65 loc) 2.55 kB
import { UtilsGDrive } from '..'; /** * Values for identifying a file or folder in Google Drive. * `fileName` is required if `fileId` is not specified. * If `fileName` is specified and there are multiple files * or folders in Google Drive with that filename, * `parentId` or `parentName` should also be specified. */ export interface Identifiers { /** * Id of the file or folder. */ fileId?: string; /** * Name of the file or folder. */ fileName?: string; /** * Id of the file or folder's parent. */ parentId?: string; /** * Name of the file or folder's parent. */ parentName?: string; } export declare function resolveId(utilsGDrive: UtilsGDrive, identifiers?: Identifiers | string): string | Promise<string>; export declare function resolveIdString(utilsGDrive: UtilsGDrive, str: string): Promise<string>; /** * Metadata for identifying files and folders to be overwritten in Google Drive. */ export interface FileMetadata$Overwrite { /** * Name of file or folder being written or created. */ name: string; /** * MIME type of file or folder beign written or created. */ mimeType: string; /** * Ids of parents of file or folder being written or created. */ parents: string[]; } export declare function overwrite(utilsGDrive: UtilsGDrive, fileMetadata: FileMetadata$Overwrite): Promise<void>; /** * Check if a folder with a given name exists under a parent folder. * @param utilsGDrive The UtilsGDrive instance. * @param folderName The name of the folder to check. * @param parentId The ID of the parent folder. * @param isSharedDrive Whether or not to check in a shared drive. * @param sharedDriveId Optional ID of the shared drive. * @returns Promise that resolves to the folder ID if it exists, null otherwise. */ export declare function checkFolderExistence(utilsGDrive: UtilsGDrive, folderName: string, parentId: string, isSharedDrive: boolean, sharedDriveId?: string): Promise<string | null>; /** * Check if a file with a given name exists under a parent folder. * @param utilsGDrive The UtilsGDrive instance. * @param fileName The name of the file to check. * @param parentId The ID of the parent folder. * @param sharedDriveId Optional ID of the shared drive. * @returns Promise that resolves to the file ID if it exists, null otherwise. */ export declare function checkFileExistence(utilsGDrive: UtilsGDrive, fileName: string, parentId: string, sharedDriveId?: string): Promise<string | null>;