import * as _angular_core from '@angular/core'; import { Signal, Provider, TemplateRef, Type, Injector } from '@angular/core'; import * as ng_primitives_internal from 'ng-primitives/internal'; import * as ng_primitives_toast from 'ng-primitives/toast'; import { NgpPortal } from 'ng-primitives/portal'; interface NgpToastOptions$1 { /** * The position of the toast. */ placement: NgpToastPlacement; /** * The duration of the toast in milliseconds. */ duration: number; /** * A function to register the toast instance with the manager. * @internal */ register: (toast: NgpToast) => void; /** * Whether the toast region is expanded. * @internal */ expanded: Signal; /** * Whether the toast supports swipe dismiss. * @internal */ dismissible: boolean; /** * The swipe directions supported by the toast. * @internal */ swipeDirections: NgpToastSwipeDirection[]; /** * When true, only the front toast's timer will run. * @internal */ sequential: boolean; /** * When true, the toast will not auto-dismiss and must be dismissed explicitly. * @internal */ persistent: boolean; } declare class NgpToast { private readonly manager; private readonly injector; private readonly elementRef; protected readonly config: ng_primitives_toast.NgpToastConfig; /** @internal */ readonly options: NgpToastOptions$1; private readonly interactivityChecker; private readonly isInteracting; private pointerStartRef; private dragStartTime; protected readonly swiping: _angular_core.WritableSignal; protected readonly swipeDirection: _angular_core.WritableSignal<"x" | "y" | null>; protected readonly swipeAmount: _angular_core.WritableSignal<{ x: number; y: number; }>; protected readonly swipeOutDirection: _angular_core.Signal<"top" | "right" | "bottom" | "left" | null>; /** * Get all toasts that are currently being displayed in the same position. */ private readonly toasts; /** * The number of toasts that are currently being displayed before this toast. */ protected readonly index: _angular_core.Signal; /** * Determine the position of the toast in the list of toasts. * This is the combination of the heights of all the toasts before this one, plus the gap between them. */ protected readonly offset: _angular_core.Signal; /** * Determine if this toast is visible. * Visible considers the maximum number of toasts that can be displayed at once, and the last x toasts that are currently being displayed. */ protected readonly visible: _angular_core.Signal; /** * Determine the height of the front toast. * This is used to determine the height of the toast when it is not expanded. */ protected readonly frontToastHeight: _angular_core.Signal; /** * Determine the z-index of the toast. This is the inverse of the index. * The first toast will have the highest z-index, and the last toast will have the lowest z-index. * This is used to ensure that the first toast is always on top of the others. */ protected readonly zIndex: _angular_core.Signal; /** * Whether the auto-dismiss timer is paused. */ protected readonly paused: _angular_core.Signal; /** * The height of the toast in pixels. */ protected readonly dimensions: _angular_core.Signal; /** * The x position of the toast. */ readonly x: string; /** * The y position of the toast. */ readonly y: string; /** * The toast timer instance. */ private readonly timer; constructor(); /** * The milliseconds left before the toast auto-dismisses. Not reactive. */ remaining(): number; private onPointerDown; private onPointerMove; private onPointerUp; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } type NgpToastSwipeDirection = 'top' | 'right' | 'bottom' | 'left'; type NgpToastPlacement = 'top-start' | 'top-end' | 'top-center' | 'bottom-start' | 'bottom-end' | 'bottom-center'; interface NgpToastConfig { /** * The position of the toast. */ placement: NgpToastPlacement; /** * The duration of each toast. */ duration: number; /** * The offset from the top of the viewport in pixels. */ offsetTop: number; /** * The offset from the bottom of the viewport in pixels. */ offsetBottom: number; /** * The offset from the left of the viewport in pixels. */ offsetLeft: number; /** * The offset from the right of the viewport in pixels. */ offsetRight: number; /** * Whether a toast can be dismissed by swiping. */ dismissible: boolean; /** * The amount a toast must be swiped before it is considered dismissed. */ swipeThreshold: number; /** * The default swipe directions supported by the toast. */ swipeDirections: NgpToastSwipeDirection[]; /** * The maximum number of toasts that can be displayed at once. */ maxToasts: number; /** * The aria live setting. */ ariaLive: string; /** * The gap between each toast. */ gap: number; /** * The z-index of the toast container. * This is used to ensure that the toast container is always on top of other elements. */ zIndex: number; /** * When true, only the front toast's timer will run. * When a toast is dismissed, the timer will start on the next toast. */ sequential: boolean; /** * When true, toasts will not auto-dismiss and must be dismissed explicitly. */ persistent: boolean; } /** * Provide the default Toast configuration * @param config The Toast configuration * @returns The provider */ declare function provideToastConfig(config: Partial): Provider[]; declare function injectToastContext(): T; declare class NgpToastManager { private readonly config; private readonly applicationRef; private readonly rendererFactory; private readonly renderer; private readonly injector; private readonly containers; readonly toasts: _angular_core.WritableSignal; /** Signal that tracks which placements are expanded */ private readonly expanded; /** Show a toast notification */ show(toast: TemplateRef | Type, options?: NgpToastOptions): NgpToastRef; /** Hide a toast notification */ dismiss(toast: NgpToast): Promise; /** * Lazily create or get a container for a given placement. */ private getOrCreateContainer; /** * Create a section in which toasts will be rendered for a specific placement. */ private createContainer; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵprov: _angular_core.ɵɵInjectableDeclaration; } interface NgpToastOptions { /** The position of the toast */ placement?: NgpToastPlacement; /** The duration of the toast in milliseconds */ duration?: number; /** Whether the toast is dismissible */ dismissible?: boolean; /** The swipe directions supported by the toast */ swipeDirections?: NgpToastSwipeDirection[]; /** The context to make available to the toast */ context?: T; /** When enabled, only the front toast's timer will run */ sequential?: boolean; /** When true, the toast will not auto-dismiss and must be dismissed explicitly */ persistent?: boolean; /** * The injector used to render the toast content. Provide the calling component's * injector when the toast depends on component-scoped providers. Defaults to root. */ injector?: Injector; } interface NgpToastRecord { instance: NgpToast; portal: NgpPortal; } interface NgpToastRef { dismiss(): Promise; } export { NgpToast, NgpToastManager, injectToastContext, provideToastConfig }; export type { NgpToastConfig, NgpToastOptions, NgpToastRef };