import { OverlayRef } from '@angular/cdk/overlay'; import { EventEmitter, Injector, TemplateRef, Type } from '@angular/core'; export type OnClickCallback = (instance: T) => (false | void | {}) | Promise; export type ModalType = 'default' | 'confirm' | 'custom'; export type ConfirmType = 'confirm' | 'success' | 'warn'; export declare enum ModalSize { Small = "small", Medium = "medium", Large = "large" } /** * Duration when perform animations (ms) * @docs-private */ export declare const MODAL_ANIMATE_DURATION = 300; export interface ModalOptions { kbqModalType?: ModalType; kbqVisible?: boolean; kbqWidth?: number | string; kbqSize?: ModalSize; kbqWrapClassName?: string; kbqClassName?: string; kbqStyle?: object; kbqTitle?: string | TemplateRef<{}>; kbqContent?: string | TemplateRef<{}> | Type; kbqComponent?: Type; /** @deprecated. Use field data and KBQ_MODAL_DATA */ kbqComponentParams?: any; kbqClosable?: boolean; kbqMask?: boolean; kbqMaskClosable?: boolean; kbqMaskStyle?: object; kbqBodyStyle?: object; kbqFooter?: string | TemplateRef<{}> | IModalButtonOptions[]; kbqGetContainer?: HTMLElement | OverlayRef | (() => HTMLElement | OverlayRef) | null; kbqAfterOpen?: EventEmitter; kbqAfterClose?: EventEmitter; kbqCloseByESC?: boolean; kbqRestoreFocus?: boolean; kbqOkText?: string; kbqOkType?: string; kbqOkLoading?: boolean; kbqOnOk?: EventEmitter | OnClickCallback; kbqCancelText?: string; kbqCancelLoading?: boolean; kbqOnCancel?: EventEmitter | OnClickCallback; /** Data being injected into the child component. */ data?: any; } export interface IModalOptionsForService extends ModalOptions { kbqOnOk?: OnClickCallback; kbqOnCancel?: OnClickCallback; /** * The injector used to create the component that will be attached. * If specified, it overrides the injector provided by `KbqModalService`. */ injector?: Injector; } export interface IModalButtonOptions { label: string; type?: string; shape?: string; ghost?: boolean; size?: string; autoLoading?: boolean; show?: boolean | ((this: IModalButtonOptions, contentComponentInstance?: T) => boolean); loading?: boolean | ((this: IModalButtonOptions, contentComponentInstance?: T) => boolean); disabled?: boolean | ((this: IModalButtonOptions, contentComponentInstance?: T) => boolean); autoFocus?: boolean; kbqModalMainAction?: boolean; onClick?(this: IModalButtonOptions, contentComponentInstance?: T): (void | {}) | Promise; }