UNPKG

982 BTypeScriptView Raw
1// Type definitions for react-copy-to-clipboard 5.0
2// Project: https://github.com/nkbt/react-copy-to-clipboard
3// Definitions by: Meno Abels <https://github.com/mabels>
4// Bernabe <https://github.com/BernabeFelix>
5// Ward Delabastita <https://github.com/wdlb>
6// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
8import * as React from 'react';
9
10export as namespace CopyToClipboard;
11
12declare class CopyToClipboard extends React.PureComponent<CopyToClipboard.Props> {}
13
14declare namespace CopyToClipboard {
15 class CopyToClipboard extends React.PureComponent<Props> {}
16
17 interface Options {
18 debug?: boolean | undefined;
19 message?: string | undefined;
20 format?: string | undefined; // MIME type
21 }
22
23 interface Props {
24 children?: React.ReactNode;
25 text: string;
26 onCopy?(text: string, result: boolean): void;
27 options?: Options | undefined;
28 }
29}
30
31export = CopyToClipboard;