Merge pull request #14994 from mabels/master

added react-copy-to-clipboard typedefinition
This commit is contained in:
Mine Starks
2017-03-08 16:22:28 -08:00
committed by GitHub
4 changed files with 69 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
// Type definitions for react-copy-to-clipboard 4.2
// Project: https://github.com/nkbt/react-copy-to-clipboard
// Definitions by: Meno Abels <https://github.com/mabels>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
import * as React from "react";
export as namespace CopyToClipboard;
export = CopyToClipboard;
declare namespace CopyToClipboard {
export interface Options {
debug: boolean;
message: string;
}
export interface Props {
text: string;
onCopy?: (a: string) => void,
options?: Options;
}
}
declare class CopyToClipboard extends React.Component<CopyToClipboard.Props, {}> {
}
@@ -0,0 +1,14 @@
import * as React from "react";
import * as CopyToClipboard from "react-copy-to-clipboard";
export class Test extends React.Component<any, any> {
render() {
return (
<CopyToClipboard text={"Hello World"}
onCopy={() => {}}>
<span>Copy to clipboard with span</span>
</CopyToClipboard>
);
}
}
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"jsx": "react",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"react-copy-to-clipboard-tests.tsx"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "../tslint.json" }