mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 14:38:20 +08:00
[copy-text-to-clipboard] add typings (#18745)
This commit is contained in:
committed by
Mohamed Hegazy
parent
48ad743488
commit
39d28981ce
@@ -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('🦄🌈');
|
||||
});
|
||||
}
|
||||
8
types/copy-text-to-clipboard/index.d.ts
vendored
Normal file
8
types/copy-text-to-clipboard/index.d.ts
vendored
Normal 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;
|
||||
23
types/copy-text-to-clipboard/tsconfig.json
Normal file
23
types/copy-text-to-clipboard/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/copy-text-to-clipboard/tslint.json
Normal file
1
types/copy-text-to-clipboard/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user