diff --git a/types/react-copy-to-clipboard/index.d.ts b/types/react-copy-to-clipboard/index.d.ts index a09d7bc8be..2327c9610a 100644 --- a/types/react-copy-to-clipboard/index.d.ts +++ b/types/react-copy-to-clipboard/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for react-copy-to-clipboard 4.2 +// Type definitions for react-copy-to-clipboard 4.3 // Project: https://github.com/nkbt/react-copy-to-clipboard // Definitions by: Meno Abels // Bernabe +// Ward Delabastita // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -13,13 +14,15 @@ export = CopyToClipboard; declare namespace CopyToClipboard { interface Options { - debug: boolean; - message: string; + debug?: boolean; + format?: "text/html" | "text/plain"; + message?: string; } interface Props { + children: React.ReactNode; text: string; - onCopy?(a: string, b: boolean): void; + onCopy?(text: string, result: boolean): void; options?: Options; } } diff --git a/types/react-copy-to-clipboard/react-copy-to-clipboard-tests.tsx b/types/react-copy-to-clipboard/react-copy-to-clipboard-tests.tsx index c411139501..50e68dc79f 100644 --- a/types/react-copy-to-clipboard/react-copy-to-clipboard-tests.tsx +++ b/types/react-copy-to-clipboard/react-copy-to-clipboard-tests.tsx @@ -1,11 +1,22 @@ import * as React from "react"; import CopyToClipboard = require("react-copy-to-clipboard"); -export class Test extends React.Component { +export class OnlyRequiredProps extends React.Component { + render() { + return ( + + + + ); + } +} + +export class AllProps extends React.Component { render() { return ( {}}> + onCopy={() => {}} + options={{debug: true, message: "message", format: "text/plain"}}> Copy to clipboard with span );