import { ProcessRenderer } from "../../../../rendering/process/process.js"; import type { MittwaldAPIV2 } from "@mittwald/api-client"; import { MittwaldAPIV2Client } from "@mittwald/api-client"; type Project = MittwaldAPIV2.Components.Schemas.ProjectProject; export interface MySQLConnectionFlags { "mysql-password": string | undefined; "mysql-charset": string | undefined; "temporary-user"?: boolean; "ssh-user"?: string; } export interface MySQLConnectionDetails { hostname: string; database: string; user: string; sshHost: string; sshUser: string; project: Project; charset: string; } export type MySQLConnectionDetailsWithPassword = MySQLConnectionDetails & { password: string; }; /** * Runs a callback function with connection details for a MySQL database. * * Depending on the flags, this function will either use the credentials * provided in the flags (or prompt for a password), or create a temporary user * for the operation, which will be cleaned up afterwards. */ export declare function runWithConnectionDetails(apiClient: MittwaldAPIV2Client, databaseId: string, p: ProcessRenderer, flags: MySQLConnectionFlags, cb: (connectionDetails: MySQLConnectionDetailsWithPassword) => Promise): Promise; export declare function getConnectionDetailsWithPassword(apiClient: MittwaldAPIV2Client, databaseId: string, p: ProcessRenderer, flags: MySQLConnectionFlags): Promise; export declare function getConnectionDetails(apiClient: MittwaldAPIV2Client, databaseId: string, sshUser: string | undefined, characterSet: string | undefined, p: ProcessRenderer): Promise; export {};