import * as _angular_core from '@angular/core'; import { InjectionToken, EnvironmentProviders, OnDestroy } from '@angular/core'; import { ClassValue } from 'clsx'; import { ExternalToast } from '@shival99/ngx-sonner'; import { ZIcon } from '@shival99/z-ui/components/z-icon'; import * as class_variance_authority_types from 'class-variance-authority/types'; import { VariantProps } from 'class-variance-authority'; type ZToastTheme = 'light' | 'dark' | 'system'; type ZToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; type ZToastDir = 'ltr' | 'rtl' | 'auto'; type ZToastType = 'default' | 'success' | 'error' | 'warning' | 'info' | 'loading'; declare const Z_TOAST_DATA: InjectionToken; declare const Z_TOASTER_CONFIG: InjectionToken; interface ZToastOptions extends ExternalToast { description?: string; duration?: number; id?: string | number; } interface ZToastPromiseMessages { loading: string; success: string | ((data: T) => string); error: string | ((error: unknown) => string); } interface ZToasterConfig { zTheme?: ZToastTheme; zPosition?: ZToastPosition; zRichColors?: boolean; zExpand?: boolean; zDuration?: number; zVisibleToasts?: number; zCloseButton?: boolean; zDir?: ZToastDir; } declare const Z_TOASTER_DEFAULT_CONFIG: ZToasterConfig; interface ZCustomToastAction { label: string; onClick: (toastId: string | number) => void; zType?: 'primary' | 'secondary' | 'outline' | 'text' | 'danger'; } interface ZCustomToastConfig { title: string; description?: string; type?: 'success' | 'error' | 'warning' | 'info' | 'avatar' | 'image' | 'progress' | 'default'; icon?: string; avatarUrl?: string; avatarOnline?: boolean; avatarBadgeIcon?: string; imageUrl?: string; progress?: number; actions?: ZCustomToastAction[]; closeable?: boolean; toastId?: string | number; } declare class ZToastComponent { private readonly _themeService; private readonly _config; readonly class: _angular_core.InputSignal; readonly zVariant: _angular_core.InputSignal<"default" | "success" | "error" | "warning" | "info" | null | undefined>; readonly zTheme: _angular_core.InputSignal; readonly zPosition: _angular_core.InputSignal; readonly zRichColors: _angular_core.InputSignal; readonly zExpand: _angular_core.InputSignal; readonly zDuration: _angular_core.InputSignal; readonly zVisibleToasts: _angular_core.InputSignal; readonly zCloseButton: _angular_core.InputSignal; readonly zToastOptions: _angular_core.InputSignal; readonly zDir: _angular_core.InputSignal; protected readonly effectiveTheme: _angular_core.Signal; protected readonly effectivePosition: _angular_core.Signal; protected readonly effectiveRichColors: _angular_core.Signal; protected readonly effectiveExpand: _angular_core.Signal; protected readonly effectiveDuration: _angular_core.Signal; protected readonly effectiveVisibleToasts: _angular_core.Signal; protected readonly effectiveCloseButton: _angular_core.Signal; protected readonly effectiveDir: _angular_core.Signal; protected readonly zClasses: _angular_core.Signal; protected readonly detectTheme: _angular_core.Signal<"light" | "dark">; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class ZToastCustomComponent { private readonly _toastService; readonly config: _angular_core.InputSignal; protected dismiss(): void; protected handleAction(action: ZCustomToastAction): void; protected getFeaturedIconName(): ZIcon; protected getFeaturedIconContainerClasses(): string; protected getActionClasses(action: ZCustomToastAction): string; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } /** * Provides global toast configuration options * Use this in app.config.ts: providers: [provideZToast({ zPosition: 'top-right' })] * * @param config - Partial configuration to override default options * @returns EnvironmentProviders for the toast service * * @example * ```typescript * // In app.config.ts * export const appConfig: ApplicationConfig = { * providers: [ * provideZToast({ * zPosition: 'top-right', * zDuration: 5000, * zCloseButton: true, * }), * ], * }; * ``` */ declare function provideZToast(config?: Partial): EnvironmentProviders; declare class ZToastService implements OnDestroy { private readonly _overlay; private readonly _injector; private readonly _platformId; private readonly _document; private readonly _ngZone; private readonly _providedConfig; private readonly _zTranslate; private _overlayRef; private _toasterAttached; private _mutationObserver; create(config?: ZToasterConfig): void; show(message: string, options?: ZToastOptions): string | number; success(message: string, options?: ZToastOptions): string | number; error(message: string, options?: ZToastOptions): string | number; warning(message: string, options?: ZToastOptions): string | number; info(message: string, options?: ZToastOptions): string | number; loading(message: string, options?: ZToastOptions): string | number; promise(promise: Promise, messages: ZToastPromiseMessages): string | number | undefined; custom(config: ZCustomToastConfig, options?: ZToastOptions): string | number; dismiss(toastId?: string | number): void; dismissAll(): void; destroy(): void; ngOnDestroy(): void; private _ensureToasterAttached; private _moveToTop; private _setupOverlayObserver; private _disconnectObserver; private _attachToaster; private _createOverlay; private _translate; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵprov: _angular_core.ɵɵInjectableDeclaration; } declare const zToastVariants: (props?: ({ zVariant?: "default" | "success" | "error" | "warning" | "info" | null | undefined; } & class_variance_authority_types.ClassProp) | undefined) => string; type ZToastVariants = VariantProps; export { ZToastComponent, ZToastCustomComponent, ZToastService, Z_TOASTER_CONFIG, Z_TOASTER_DEFAULT_CONFIG, Z_TOAST_DATA, provideZToast, zToastVariants }; export type { ZCustomToastAction, ZCustomToastConfig, ZToastDir, ZToastOptions, ZToastPosition, ZToastPromiseMessages, ZToastTheme, ZToastType, ZToastVariants, ZToasterConfig };