UNPKG

jslib-nightly

Version:

SheerID JavaScript Library

27 lines (26 loc) 691 B
/** * Wrap a button or link with copy-to-clipboard behavior. * * Example Use: <CopyToClipboard textToCopy={htmlSource} notificationText={<FormattedMessage id="copied" />}> <LinkButton ... /> </CopyToClipboard> */ import React from 'react'; interface Props { textToCopy: string; notificationTimeout?: number; notificationText?: string | JSX.Element; } interface State { isShowing: boolean; } declare class CopyToClipboard extends React.Component<Props, State> { notificationTimeout: number; timeoutRef: any; constructor(props: any); componentWillUnmount(): void; doCopy(): void; render(): JSX.Element; } export { CopyToClipboard };