import React from 'react'; import './CopyToClipboard.less'; export interface ICopyToClipboardProps { analyticsLabel?: string; buttonInnerNode?: React.ReactNode; displayText?: boolean; text: string; toolTip?: string; className?: string; stopPropagation?: boolean; } interface ICopyToClipboardState { tooltipCopy: boolean | string; shouldUpdatePosition: boolean; } /** * Places text in an invisible input field so we can auto-focus and select the text * then copy it to the clipboard onClick. Used in labels found in components like * ManifestStatus to make it easier to grab data from the UI. * * This component mimics utils/clipboard/copyToClipboard.component.ts but * since the text is placed in an invisible input its very easy to select * if the copy fails. */ export declare class CopyToClipboard extends React.Component { static defaultProps: { displayText: boolean; }; private inputRef; private mounted; constructor(props: ICopyToClipboardProps); componentDidMount(): void; componentWillUnmount(): void; /** * Focuses on the input element and attempts to copy to the clipboard. * Also updates state.tooltipCopy with a success/fail message, which is * reset after 3s. The selection is immediately blur'd so you shouldn't * see much of it during the copy. */ handleClick: (e: React.SyntheticEvent) => void; private renderTooltip; resetToolTip: () => void; render(): JSX.Element; } export {};