import { Action } from '@ngrx/store'; import { ComponentType } from '@angular/cdk/portal'; import { MatDialogConfig } from '@angular/material'; import { IWithIdentifier } from '@digitaix/types'; export declare enum DialogActionTypes { OpenDialogWithViewContainer = "[Dialog] Open Dialog With View Container", OpenDialog = "[Dialog] Open Dialog", CloseDialog = "[Dialog] Close Dialog", DialogClosed = "[Dialog] Dialog Closed", OpenConfirmationDialog = "[Dialog] Open Confirmation Dialog", ConfirmationDialogClosed = "[Dialog] Confirmation Dialog Closed", OpenDialogWithActionResult = "[Dialog] OpenDialogWithActionResult" } export declare type WithComponentRef

= P & { componentRef: ComponentType; }; export interface SimpleDialogContext { getTitle?: (row: D) => string; [key: string]: any; } export interface DialogContextWithDocumentId extends SimpleDialogContext { getTitle?: (row: D) => string; collectionPath: string; documentId: string; formId?: string; } export interface DialogContextWithDocument extends SimpleDialogContext { getTitle?: (row: D) => string; document: D; formId?: string; } export interface DialogContextWithTableId extends SimpleDialogContext { tableId: string; row: R; collectionPath: string; formId?: string; } export declare type DialogContext = SimpleDialogContext | DialogContextWithDocumentId | DialogContextWithTableId | DialogContextWithDocument; export interface CloseIfDefinition { actionType: string; filter?: (action: A) => boolean; } export declare type WithCloseIf = { /** * close the dialog if a action with a defined action-type * is dispatch. An optional filter allows further filtering */ closeIf?: CloseIfDefinition; } & P; export interface OpenDialogPayloadWithComponentRef { /** * componentRef Type of the component to load into the dialog. */ componentRef: ComponentType; /** * config Extra configuration options. */ config?: MatDialogConfig; } export interface OpenDialogPayloadWithTableId { config: MatDialogConfig>; } export declare type OpenDialogWithViewContainerPayload = WithCloseIf> | OpenDialogPayloadWithTableId>; export declare type OpenDialogPayload = WithCloseIf, A>; export declare function isDialogContextWithTableId(context: DialogContext): context is DialogContextWithTableId; export declare function isDialogContextWithDocumentId(context: DialogContext): context is DialogContextWithDocumentId; export declare function isDialogContextWithDocument(context: DialogContext): context is DialogContextWithDocument; export declare class OpenDialog implements Action { payload: OpenDialogPayload; tracer?: string; readonly type = DialogActionTypes.OpenDialog; constructor(payload: OpenDialogPayload, tracer?: string); } export declare class OpenDialogWithActionResult implements Action { payload: OpenDialogPayload; tracer?: string; readonly type = DialogActionTypes.OpenDialogWithActionResult; constructor(payload: OpenDialogPayload, tracer?: string); } /** * Opens a modal dialog containing the given component. * @param componentOrTemplateRef Type of the component to load into the dialog, * or a TemplateRef to instantiate as the dialog content. * @param config Extra configuration options. * @param tracer a unique string to trace the dialog. If a tracer is set a DialogClosed * Action with the dialog result will be dispatch after the dialog closed */ export declare class OpenDialogWithViewContainer implements Action { payload: OpenDialogWithViewContainerPayload; tracer?: string; readonly type = DialogActionTypes.OpenDialogWithViewContainer; constructor(payload: OpenDialogWithViewContainerPayload, tracer?: string); } /** * Closed a model dialog * @param tracer a unique string to trace a dialog */ export declare class CloseDialog implements Action { tracer: string; readonly type = DialogActionTypes.CloseDialog; constructor(tracer: string); } /** * Dispatch after a model dialog is closed * @param result of the closed dialog * @param tracer a unique string to trace a dialog */ export declare class DialogClosed implements Action { result: T | null; tracer: string; readonly type = DialogActionTypes.DialogClosed; constructor(result: T | null, tracer: string); } export interface ConfirmationDialogContext { message?: string; title?: string; yesResult?: YesResult; noResult?: NoResult; } export declare class OpenConfirmationDialog implements Action { tracer: string; context?: ConfirmationDialogContext; config?: MatDialogConfig; readonly type = DialogActionTypes.OpenConfirmationDialog; constructor(tracer: string, context?: ConfirmationDialogContext, config?: MatDialogConfig); } export declare type DialogActions = OpenDialogWithViewContainer | CloseDialog | OpenConfirmationDialog | DialogClosed;