@microsoft/sp-dialog
Version:
SharePoint Framework support for displaying dialog boxes
71 lines • 3.08 kB
TypeScript
import type { Guid } from '@microsoft/sp-core-library';
import type BaseDialog from './BaseDialog';
import type DialogManager from './DialogManager';
import type { IAlertOptions, IDialogShowOptions, IPromptOptions } from './IDialog';
/**
* This interface handles calls to show a secondary dialog. It's only available by calling
* this.secondaryManagerProvider inside a dialog.
*
* @remarks
* Secondary dialogs do not need to request permission from dialog manager, because the primary dialog
* already has permission. Therefore, the secondary dialog will be immediately shown. This causes the primary dialog
* to hide until the secondary dialog is closed. There can be only one secondary dialog at a time. Additional requests
* to show more secondary dialogs are rejected.
*
* See {@link BaseDialog.secondaryDialogProvider} for how to use this.
*
* @public
*/
export interface ISecondaryDialogProvider {
/**
* Similar to {@link Dialog.alert}. The only difference is that the dialog is immediately shown
* if there are no other secondary dialogs. Otherwise, the promise rejects.
*
* @param options - Dialog showing options. See {@link IDialogShowOptions} for more information.
*/
alert(message: string, options?: IAlertOptions): Promise<void>;
/**
* Similar to {@link Dialog.prompt}. The only difference is that the dialog is immediately shown
* if there are no other secondary dialogs. Otherwise, the promise rejects.
*
* @param options - Dialog showing options. The confirmOpen option will be ignored.
* See {@link IDialogShowOptions} for more information.
*/
prompt(message: string, options?: IPromptOptions): Promise<string | undefined>;
/**
* Similar to {@link BaseDialog.show}. The dialog to show is passed in as parameter and the dialog is immediately
* shown if there are no other secondary dialogs. Otherwise, the promise rejects.
*
* @param options - Dialog showing options. The confirmOpen option will be ignored.
* See {@link IDialogShowOptions} for more information.
*/
show(dialog: BaseDialog, options?: IDialogShowOptions): Promise<void>;
}
/**
* {@inheritDoc ISecondaryDialogProvider}
*/
export default class SecondaryDialogProvider {
private _ownerRequestId;
private _primaryManager;
/**
* Creates a SecondaryDialogProvider.
* @param primaryManager - Dialog manager.
* @param ownerRequestId - Request id of the owner.
*
* @internal
*/
constructor(primaryManager: DialogManager, ownerRequestId: Guid);
/**
* {@inheritDoc ISecondaryDialogProvider.alert}
*/
alert(message: string, options?: IAlertOptions): Promise<void>;
/**
* {@inheritDoc ISecondaryDialogProvider.prompt}
*/
prompt(message: string, options?: IPromptOptions): Promise<string | undefined>;
/**
* {@inheritDoc ISecondaryDialogProvider.prompt}
*/
show(dialog: BaseDialog, options?: IDialogShowOptions): Promise<void>;
}
//# sourceMappingURL=SecondaryDialogProvider.d.ts.map