diff --git a/types/copy-text-to-clipboard/copy-text-to-clipboard-tests.ts b/types/copy-text-to-clipboard/copy-text-to-clipboard-tests.ts new file mode 100644 index 0000000000..4a1e63b28c --- /dev/null +++ b/types/copy-text-to-clipboard/copy-text-to-clipboard-tests.ts @@ -0,0 +1,8 @@ +import copy = require('copy-text-to-clipboard'); + +const button: HTMLButtonElement | null = document.getElementById('my-button'); +if (button) { + button.addEventListener('click', () => { + copy('🦄🌈'); + }); +} diff --git a/types/copy-text-to-clipboard/index.d.ts b/types/copy-text-to-clipboard/index.d.ts new file mode 100644 index 0000000000..56493778d0 --- /dev/null +++ b/types/copy-text-to-clipboard/index.d.ts @@ -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 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = copy; + +declare function copy(text: string): boolean; diff --git a/types/copy-text-to-clipboard/tsconfig.json b/types/copy-text-to-clipboard/tsconfig.json new file mode 100644 index 0000000000..71b4595292 --- /dev/null +++ b/types/copy-text-to-clipboard/tsconfig.json @@ -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" + ] +} diff --git a/types/copy-text-to-clipboard/tslint.json b/types/copy-text-to-clipboard/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/copy-text-to-clipboard/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }