UNPKG

@omnia/foundation

Version:

Provide omnia foundation typings and tooling work on client side for omnia extension

48 lines (47 loc) 1.49 kB
import { DialogRef, ModalComponent, CloseGuard } from 'angular2-modal'; import { BSModalContext } from 'angular2-modal/plugins/bootstrap'; export declare class ConfirmationDialogData extends BSModalContext { title: string; body: string; okCallback: any; cancelCallBack: any; } export declare class CustomDialogData extends BSModalContext { title: string; body: string; buttons: Array<IDialogButton>; } /** * A Sample of how simple it is to create a new window, with its own injects. */ export declare class ConfirmationDialog implements CloseGuard, ModalComponent<ConfirmationDialogData> { dialog: DialogRef<ConfirmationDialogData>; context: ConfirmationDialogData; constructor(dialog: DialogRef<ConfirmationDialogData>); okCallback: () => void; cancelCallback: () => void; close: () => void; beforeDismiss(): boolean; beforeClose(): boolean; } /** *** Custom dialog **/ export interface IDialogButton { name: string; clickHandler: Function; isPrimary: boolean; } export interface CustomDialogScope { title: string; body: string; buttons: Array<IDialogButton>; close: () => void; } export declare class CustomDialog implements CloseGuard, ModalComponent<CustomDialogData> { dialog: DialogRef<CustomDialogData>; context: CustomDialogData; scope: CustomDialogScope; constructor(dialog: DialogRef<CustomDialogData>); close: () => void; }