-
Notifications
You must be signed in to change notification settings - Fork 2
/
dialog.service-model.ts
43 lines (41 loc) · 1.57 KB
/
dialog.service-model.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import {
AboutDialogOptions,
DialogTabTypes,
DialogTypes,
SelectProjectDialogOptions,
} from '@renderer/components/dialogs/dialog-definition.model';
/**
* JSDOC SOURCE dialogService
*
* Prompt the user for responses with dialogs
*/
export interface DialogService {
/**
* Shows a dialog to the user and prompts the user to respond
*
* @type `TReturn` - The type of data the dialog responds with
* @param dialogType The type of dialog to show the user
* @param options Various options for configuring the dialog that shows
* @returns Returns the user's response or `undefined` if the user cancels
*/
showDialog<DialogTabType extends DialogTabTypes>(
dialogType: DialogTabType,
options?: DialogTypes[DialogTabType]['options'],
): Promise<DialogTypes[DialogTabType]['responseType'] | undefined>;
/**
* Shows a select project dialog to the user and prompts the user to select a dialog
*
* @param options Various options for configuring the dialog that shows
* @returns Returns the user's selected project id or `undefined` if the user cancels
*/
selectProject(options?: SelectProjectDialogOptions): Promise<string | undefined>;
/**
* Shows the about dialog
*
* @param options Various options for configuring the dialog that shows
* @returns Returns the user's selected project id or `undefined` if the user cancels
*/
showAboutDialog(options?: AboutDialogOptions): Promise<string | undefined>;
}
/** Prefix on requests that indicates that the request is related to dialog operations */
export const CATEGORY_DIALOG = 'dialog';