import * as i0 from '@angular/core'; import { InjectionToken, TemplateRef, Signal, OnInit, OnDestroy, Injector } from '@angular/core'; import * as i1 from '@angular/common'; import * as i2 from 'ngx-tethys/shared'; import * as i3 from '@angular/cdk/overlay'; import { OverlayRef, Overlay, ComponentType } from '@angular/cdk/overlay'; import * as i4 from '@angular/cdk/portal'; import * as i5 from 'ngx-tethys/icon'; import { ComponentTypeOrTemplateRef } from 'ngx-tethys/core'; import * as rxjs from 'rxjs'; type ThyMessageType = 'success' | 'error' | 'warning' | 'info' | 'loading'; interface ThyGlobalMessageConfig { pauseOnHover?: boolean; duration?: number; maxStack?: number; offset?: string; showClose?: boolean; } declare const THY_MESSAGE_DEFAULT_CONFIG: InjectionToken; declare const THY_MESSAGE_DEFAULT_CONFIG_VALUE: ThyGlobalMessageConfig; declare const THY_MESSAGE_DEFAULT_CONFIG_PROVIDER: { provide: InjectionToken; useValue: ThyGlobalMessageConfig; }; interface ThyMessageBaseConfig { id?: string; type?: string; pauseOnHover?: boolean; duration?: number; content?: string | ComponentTypeOrTemplateRef; hostClass?: string | string[]; } interface ThyMessageConfig extends ThyMessageBaseConfig { type?: ThyMessageType; content?: string | TemplateRef; showClose?: boolean; } /** * @internal */ declare abstract class ThyAbstractMessageContainerComponent { private elementRef; get offset(): string; abstract defaultConfig: ThyGlobalMessageConfig; toOverlayTop(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } interface IThyAbstractMessageQueue { queues: Signal; setQueues(newValue: TReferences[]): void; } declare class ThyAbstractMessageRef { id?: string; config: TConfig; private overlayRef; private queueService; private _afterClosed; constructor(config: TConfig, overlayRef: OverlayRef, queueService: IThyAbstractMessageQueue); close(): void; afterClosed(): rxjs.Observable; getOverlayRef(): OverlayRef; } /** * @internal */ declare class ThyAbstractMessageQueue implements IThyAbstractMessageQueue { queues: i0.WritableSignal; protected defaultConfig: ThyGlobalMessageConfig; setQueues(newValue: TReference[]): void; constructor(defaultConfig: ThyGlobalMessageConfig); add(messageRef: TReference): void; remove(id: string | undefined): void; } declare const ANIMATION_IN_DURATION = 100; declare const ANIMATION_OUT_DURATION = 150; declare const HIDE_STYLE: { transform: string; opacity: number; height: number; paddingTop: number; paddingBottom: number; margin: number; }; /** * @internal */ declare abstract class ThyAbstractMessageComponent implements OnInit, OnDestroy { private _ngZone; animationState?: string; iconName: string; private closeTimer; protected abstract queue: ThyAbstractMessageQueue; readonly config: i0.InputSignal; ngOnInit(): void; mouseenter(): void; mouseleave(): void; close(): void; private createCloseTimer; private clearCloseTimer; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, never, never, { "config": { "alias": "thyConfig"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } /** * @internal */ declare class ThyAbstractMessageService { private overlay; private injector; protected container?: TContainer; protected overlayRef: OverlayRef; private queue; constructor(overlay: Overlay, injector: Injector, queue: ThyAbstractMessageQueue); protected createContainer(container: ComponentType): TContainer; remove(id?: string): void; } declare class ThyMessageRef extends ThyAbstractMessageRef { } /** * @internal */ declare class ThyMessageQueue extends ThyAbstractMessageQueue { constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * @internal */ declare class ThyMessageContainer extends ThyAbstractMessageContainerComponent { messageQueue: ThyMessageQueue; defaultConfig: { pauseOnHover?: boolean; duration?: number; maxStack?: number; offset?: string; showClose?: boolean; }; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * @internal */ declare class ThyMessage extends ThyAbstractMessageComponent { animationState: string; private hostRenderer; protected queue: ThyMessageQueue; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ThyMessageModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class ThyMessageService extends ThyAbstractMessageService { private messageQueue; private _lastMessageId; private defaultConfig; constructor(); /** * 打开 success 类型的 Message */ success(content: string | TemplateRef, config?: ThyMessageConfig): ThyMessageRef; /** * 打开 error 类型的 Message */ error(content: string | TemplateRef, config?: ThyMessageConfig): ThyMessageRef; /** * 打开 info 类型的 Message */ info(content: string | TemplateRef, config?: ThyMessageConfig): ThyMessageRef; /** * 打开 warning 类型的 Message */ warning(content: string | TemplateRef, config?: ThyMessageConfig): ThyMessageRef; /** * 打开 loading 类型的 Message */ loading(content: string | TemplateRef, config?: ThyMessageConfig): ThyMessageRef; protected show(config: ThyMessageConfig): ThyMessageRef; private formatOptions; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { ANIMATION_IN_DURATION, ANIMATION_OUT_DURATION, HIDE_STYLE, THY_MESSAGE_DEFAULT_CONFIG, THY_MESSAGE_DEFAULT_CONFIG_PROVIDER, THY_MESSAGE_DEFAULT_CONFIG_VALUE, ThyAbstractMessageComponent, ThyAbstractMessageContainerComponent, ThyAbstractMessageQueue, ThyAbstractMessageRef, ThyAbstractMessageService, ThyMessage, ThyMessageContainer, ThyMessageModule, ThyMessageQueue, ThyMessageRef, ThyMessageService }; export type { IThyAbstractMessageQueue, ThyGlobalMessageConfig, ThyMessageBaseConfig, ThyMessageConfig, ThyMessageType };