@progress/kendo-angular-dialog
Version:
Dialog Package for Angular
44 lines (43 loc) • 2.32 kB
TypeScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { ComponentRef } from '@angular/core';
import { Observable } from 'rxjs';
import { DialogComponent } from '../dialog.component';
import { DialogResult } from './dialog-result';
/**
* Holds references to the Dialog instance and published events when you open a Dialog through the `DialogService`.
*
* Use the `DialogRef` class to control and interact with Dialogs opened programmatically. ([See example.]({% slug api_dialog_dialogservice %}#toc-open))
*
*/
export declare class DialogRef {
/**
* Emits events when the Dialog is closed either through the **Close** button of the title bar or through the action buttons. If the **Close** button of the title bar is clicked, `DialogResult` is a `DialogCloseResult` instance. If the Dialog is closed through the action buttons, `DialogResult` contains the object that was passed when the Dialog was opened. When `close` is called with an argument, the result is the passed argument.
*/
result: Observable<DialogResult>;
/**
* A reference to the Dialog instance.
*/
dialog: ComponentRef<DialogComponent>;
/**
* A reference to the child component of the Dialog. Available when the Dialog is opened with [component content](slug:service_dialog#toc-rendering-the-content-area).
*/
content: ComponentRef<any>;
/**
* Closes the Dialog programmatically. When called without a value, the resulting Observable emits an empty `DialogCloseResult` object. When called with a value, the resulting Observable emits the provided value.
*
* ```ts
* // Close without arguments: Returns an empty `DialogCloseResult` object.
* dialogRef.close();
*
* // Simulate clicking an action button: Pass a `DialogAction` object.
* dialogRef.close({ text: 'OK', primary: true });
*
* // Return custom data: Pass a custom object.
* dialogRef.close({ success: true, data: { id: 123 } });
* ```
*/
close: Function;
}