import * as i0 from '@angular/core'; import { ChangeDetectorRef } from '@angular/core'; import { XPlace, XStatus, XMessageConfig, XTemplate } from '@ng-nest/ui/core'; import { XAlertOption } from '@ng-nest/ui/alert'; import { Subscription, Subject } from 'rxjs'; import { XPortalOverlayRef } from '@ng-nest/ui/portal'; /** * Message * @selector x-message * @decorator component */ declare const XMessagePrefix = "x-message"; declare const XMessagePortal = "x-message-portal"; declare const X_MESSAGE_CONFIG_NAME = "message"; /** * Message Option */ interface XMessageOption extends XAlertOption { /** * @zh_CN 消息框的 id * @en_US Message id */ id?: string; /** * @zh_CN 方位,九宫格 * @en_US Direction, nine grid * @default 'top' * @withConfig true */ placement?: XPlace; /** * @zh_CN 偏移距离 * @en_US Offset distance * @default '2rem' * @withConfig true */ offset?: string | string[]; /** * @zh_CN 类型 * @en_US Types of * @default 'info' * @withConfig true */ type?: XMessageType; /** * @zh_CN 多个消息的时候,显示类型 * @en_US When multiple messages, the display type * @default 'list' * @withConfig true */ displayType?: XMessageDisplayType; /** * @zh_CN 宽度 * @en_US Width * @withConfig true */ width?: string; /** * @zh_CN 高度 * @en_US Height */ height?: string; /** * @zh_CN 延迟关闭时间 * @en_US Delay off time * @default 3000 * @withConfig true */ duration?: number; /** * @zh_CN 隐藏关闭按钮 * @en_US Hide close button * @default true * @withConfig true */ hideClose?: boolean; /** * @zh_CN 显示图标 * @en_US Show icon * @default true * @withConfig 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 XMessageOverlayRef extends XPortalOverlayRef { } /** * @zh_CN 创建的消息组件定义 * @en_US Message object created */ interface XMessageHandle { message: XMessagePlacementRef; cdr: ChangeDetectorRef; onClose(item: XMessageOption): void; moveDone($event: AnimationEvent): void; onEnter(item: XMessageOption): void; onLeave(item: XMessageOption): void; } /** * @zh_CN 九宫格中的消息对象 * @en_US Message object in Jiugongge */ interface XMessagePlacement { [property: string]: XMessagePlacementRef; } /** * @zh_CN 九宫格中的消息对象 * @en_US Message object in Jiugongge */ interface XMessagePlacementRef { /** * @zh_CN 方位对应的 overlayRef * @en_US Placement overlayRef */ ref: XMessageOverlayRef; /** * @zh_CN 对应的消息 list 数据 * @en_US Corresponding message list data */ list: XMessageOption[]; /** * @zh_CN 关闭所有数据 * @en_US Close all data */ closeAll: () => void; } /** * @zh_CN 类型 * @en_US Types of */ type XMessageType = XStatus; /** * @zh_CN 多个消息的时候,显示类型 * @en_US When multiple messages, the display type */ type XMessageDisplayType = 'list' | 'single'; declare class XMessageComponent implements XMessageHandle { message: XMessagePlacementRef; cdr: ChangeDetectorRef; onClose(item: XMessageOption): void; moveDone($event: AnimationEvent): void; onEnter(item: XMessageOption): void; onLeave(item: XMessageOption): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class XMessageRef { option: XMessageOption; constructor(option: XMessageOption); close: () => void; opened: () => void; closeAll: () => void; update: (_option: XMessageOption) => void; } declare class XMessageService { messages: XMessagePlacement; default: XMessageOption; private portal; private configService; configDefault?: XMessageConfig; constructor(); info(option: XTemplate | XMessageOption): XMessageRef; success(option: XTemplate | XMessageOption): XMessageRef; warning(option: XTemplate | XMessageOption): XMessageRef; error(option: XTemplate | XMessageOption): XMessageRef; loading(option: XTemplate | XMessageOption): XMessageRef; create(option: XTemplate | XMessageOption, type: XMessageType): XMessageRef; private createMessage; private closeAll; private createMessagePlacement; private messageChange; private setDuration; private removeMessage; private updateMessage; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class XMessageModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { XMessageComponent, XMessageModule, XMessagePortal, XMessagePrefix, XMessageRef, XMessageService, X_MESSAGE_CONFIG_NAME }; export type { XMessageDisplayType, XMessageHandle, XMessageOption, XMessageOverlayRef, XMessagePlacement, XMessagePlacementRef, XMessageType };