[copy-text-to-clipboard] add typings (#18745)

This commit is contained in:
Dimitri Benin
2017-08-08 22:36:37 +02:00
committed by Mohamed Hegazy
parent 48ad743488
commit 39d28981ce
4 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
import copy = require('copy-text-to-clipboard');
const button: HTMLButtonElement | null = <HTMLButtonElement> document.getElementById('my-button');
if (button) {
button.addEventListener('click', () => {
copy('🦄🌈');
});
}

View File

@@ -0,0 +1,8 @@
// Type definitions for copy-text-to-clipboard 1.0
// Project: https://github.com/sindresorhus/copy-text-to-clipboard#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = copy;
declare function copy(text: string): boolean;

View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"copy-text-to-clipboard-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }