@alfresco/adf-core
Version:
32 lines (31 loc) • 1.25 kB
TypeScript
import { NotificationService } from '../notifications/services/notification.service';
import * as i0 from "@angular/core";
export declare class ClipboardService {
private document;
private notificationService;
constructor(document: any, notificationService: NotificationService);
/**
* Checks if the target element can have its text copied.
*
* @param target Target HTML element
* @returns True if the text can be copied, false otherwise
*/
isTargetValid(target: HTMLInputElement | HTMLTextAreaElement): boolean;
/**
* Copies text from an HTML element to the clipboard.
*
* @param target HTML element to be copied
* @param message Snackbar message to alert when copying happens
*/
copyToClipboard(target: HTMLInputElement | HTMLTextAreaElement, message?: string): void;
/**
* Copies a text string to the clipboard.
*
* @param content Text to copy
* @param message Snackbar message to alert when copying happens
*/
copyContentToClipboard(content: string, message: string): void;
private notify;
static ɵfac: i0.ɵɵFactoryDeclaration<ClipboardService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ClipboardService>;
}