@versatiledatakit/shared
Version:
Versatile Data Kit Shared library enables reusability of shared features like: NgRx Redux, Error Handlers, Utils, Generic Components, etc.
66 lines (65 loc) • 2.17 kB
TypeScript
import { OnInit } from '@angular/core';
import { ClipboardService } from 'ngx-clipboard';
import { TaurusObject } from '../../../common';
import { Toast } from '../model';
import { ToastService } from '../service';
import * as i0 from "@angular/core";
interface ToastInternal extends Toast {
id: number;
time: Date;
error?: any;
}
export declare class ToastsComponent extends TaurusObject implements OnInit {
private readonly toastService;
private readonly clipboardService;
private static toastMessageCounter;
toasts: ToastInternal[];
constructor(toastService: ToastService, clipboardService: ClipboardService);
/**
* ** Optimize Toast rendering using tracking with auto incremented ID per Toast.
*/
trackByRendering(_index: number, toast: ToastInternal): number;
/**
* ** Returns if Toast with given index is expanded.
*/
isToastExpanded(index: number): boolean;
/**
* ** Evaluate if recommendation text for Copy and Report is visible.
*/
isReportRecommendationVisible(toast: ToastInternal, index: number): boolean;
/**
* ** Remove Toast message.
*/
removeToast(index: number): void;
/**
* ** Toggle Toast expand details (expand/collapse).
*/
toggleToastExpandDetails(index: number): void;
/**
* ** Copy to clipboard provided object.
*/
copyToClipboard(copy: ToastInternal): void;
/**
* ** Returns Toast timeout in unit seconds.
*/
getTimeout(toast: ToastInternal): number;
/**
* ** Returns text for Btn CopyToClipboard.
*/
getCopyToClipboardBtnText(toast: ToastInternal): string;
/**
* ** Returns text for Btn Expand/Collapse.
*/
getExpandBtnText(toast: ToastInternal, index: number): string;
/**
* @inheritDoc
*/
ngOnInit(): void;
private _isTypeError;
private _handleCopyActionError;
private static generateID;
private static getDateTimeNow;
static ɵfac: i0.ɵɵFactoryDeclaration<ToastsComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<ToastsComponent, "shared-toasts", never, {}, {}, never, never>;
}
export {};