ng-angular-popup
Version:
A modern, lightweight, and customizable toast notification library for Angular applications
51 lines (50 loc) • 1.99 kB
TypeScript
import { OnInit, OnDestroy } from '@angular/core';
import { ToastMessage } from './toast-message.model';
import { ToastPosition } from './toaster-position.enum';
import { NgToastService } from './ng-toast.service';
import * as i0 from "@angular/core";
export declare class NgToastComponent implements OnInit, OnDestroy {
private toastService;
/**
* Input signal for the position of the toast container
*/
position: import("@angular/core").InputSignal<ToastPosition>;
/**
* Input signal for the width of the toast container in pixels
*/
width: import("@angular/core").InputSignal<number>;
/**
* Signal to track progress update intervals
*/
private progressInterval;
/**
* Computed signal that gets the messages from the service
*/
messages: import("@angular/core").Signal<ToastMessage[]>;
constructor(toastService: NgToastService);
ngOnInit(): void;
/**
* Calculates the progress width percentage for a toast message
* @param message The toast message
* @returns The progress width as a percentage (0-100)
*/
getProgressWidth(message: ToastMessage): number;
/**
* Gets the appropriate color for the progress bar based on toast type
* @param message The toast message
* @returns CSS color value for the progress bar
*/
getProgressColor(message: ToastMessage): string;
/**
* Clears the progress update interval
*/
private clearProgressInterval;
/**
* Removes a toast message
* @param message The message to remove
*/
remove(message: ToastMessage): void;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<NgToastComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NgToastComponent, "ng-toast", never, { "position": { "alias": "position"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}