mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #14994 from mabels/master
added react-copy-to-clipboard typedefinition
This commit is contained in:
Vendored
+30
@@ -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>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user