import * as i0 from '@angular/core'; import { ChangeDetectorRef } from '@angular/core'; import { XCorner, XStatus, XTemplate } from '@ng-nest/ui/core'; import { XAlertOption } from '@ng-nest/ui/alert'; import { XPortalOverlayRef } from '@ng-nest/ui/portal'; import { Subscription, Subject } from 'rxjs'; /** * Notification * @selector x-notification * @decorator component */ declare const XNotificationPrefix = "x-notification"; declare const XNotificationPortal = "x-notification-portal"; /** * Notification Option */ interface XNotificationOption extends XAlertOption { /** * @zh_CN 方位 * @en_US Placement * @default 'top-end' */ placement?: XCorner; /** * @zh_CN 偏移距离 * @en_US Offset distance * @default '0.5rem' */ offset?: string | string[]; /** * @zh_CN 类型 * @en_US Types of * @default 'info' */ type?: XNotificationType; /** * @zh_CN 宽度 * @en_US Width * @default '20rem' */ width?: string; /** * @zh_CN 高度 * @en_US Height */ height?: string; /** * @zh_CN 延迟关闭时间 * @en_US Delay off time * @default 4500 */ duration?: number; /** * @zh_CN 隐藏关闭按钮 * @en_US Hide close button * @default true */ hideClose?: boolean; /** * @zh_CN 显示图标 * @en_US Show icon * @default true */ showIcon?: boolean; /** * @zh_CN 延迟关闭订阅后的对象,用来释放或取消 * @en_US Delayed closing the subscribed object, used to release or cancel */ durationSubscription?: Subscription | null; /** * @zh_CN 延迟关闭订阅对象 * @en_US Delay in closing the subscription object */ durationSub?: Subject; } /** * @zh_CN 创建的消息对象 * @en_US Message object created */ interface XNotificationOverlayRef extends XPortalOverlayRef { } /** * @zh_CN 创建的消息组件定义 * @en_US Message object created */ interface XNotificationHandle { notification: XNotificationRef; cdr: ChangeDetectorRef; onClose(item: XNotificationOption): void; moveDone($event: AnimationEvent): void; onEnter(item: XNotificationOption): void; onLeave(item: XNotificationOption): void; } /** * @zh_CN 九宫格中的消息对象 * @en_US Message object in nine grid */ interface XNotificationPlacement { [property: string]: XNotificationRef; } interface XNotificationRef { ref?: XNotificationOverlayRef; list?: XNotificationOption[]; } /** * @zh_CN 类型 * @en_US Types of */ type XNotificationType = XStatus; declare class XNotificationComponent implements XNotificationHandle { notification: XNotificationRef; cdr: ChangeDetectorRef; onClose(item: XNotificationOption): void; moveDone($event: AnimationEvent): void; onEnter(item: XNotificationOption): void; onLeave(item: XNotificationOption): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class XNotificationService { notifications: XNotificationPlacement; default: XNotificationOption; private portal; info(option: XTemplate | XNotificationOption): XNotificationRef; success(option: XTemplate | XNotificationOption): XNotificationRef; warning(option: XTemplate | XNotificationOption): XNotificationRef; error(option: XTemplate | XNotificationOption): XNotificationRef; create(option: XNotificationOption): XNotificationOverlayRef; private createNotification; private createNotificationPlacement; private notificationChange; private setDuration; private removeNotification; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class XNotificationModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { XNotificationComponent, XNotificationModule, XNotificationPortal, XNotificationPrefix, XNotificationService }; export type { XNotificationHandle, XNotificationOption, XNotificationOverlayRef, XNotificationPlacement, XNotificationRef, XNotificationType };