Add extension API for using the same file browser dialog that's used for Restore (#24151)

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
This commit is contained in:
Cory Rivera
2023-08-17 14:39:55 -07:00
committed by GitHub
parent 0e7942913b
commit a2336a2617
11 changed files with 124 additions and 14 deletions

View File

@@ -2011,6 +2011,27 @@ declare module 'azdata' {
*/
isPrimary: boolean;
}
export interface FileFilters {
/**
* The label to display in the file filter field next to the list of filters.
*/
label: string;
/**
* The filters to limit what files are visible in the file browser (e.g. '*.sql' for SQL files).
*/
filters: string[];
}
/**
* Opens a dialog to select a file path on the specified server's machine. Note: The dialog for just browsing local
* files without any connection is opened via vscode.window.showOpenDialog.
* @param connectionUri The URI of the connection to the target server
* @param targetPath The file path on the server machine to open by default in the dialog
* @param fileFilters The filters used to limit which files are displayed in the file browser
* @returns The path of the file chosen from the dialog, and undefined if the dialog is closed without selecting anything.
*/
export function openServerFileBrowserDialog(connectionUri: string, targetPath: string, fileFilters: FileFilters[]): Thenable<string | undefined>;
}
export interface TableComponent {