Skip to content

Commit

Permalink
Merge pull request #50 from DenisCarriere/master
Browse files Browse the repository at this point in the history
Implement Typescript definition for module
  • Loading branch information
sudodoki authored Jul 17, 2017
2 parents d61b8fb + b34ca88 commit a5232c3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,9 @@ This project has some automated tests, that will run using [nightwatch](nightwat
npm i
npm test
```
# Typescript
This library has built-in Typescript definitions.

```
import * as copy from 'copy-to-clipboard';
```
12 changes: 12 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Type definitions for copy-to-clipboard 3.0
// Project: https://github.com/sudodoki/copy-to-clipboard
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>

interface Options {
debug?: boolean;
message?: string;
}

declare function copy(text: string, options?: Options): void;
declare namespace copy {}
export = copy;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "3.0.6",
"description": "Copy stuff into clipboard using JS with fallbacks",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"pretest": "browserify ./index.js -o ./example/index.js --standalone copyToClipboard",
"test": "nightwatch"
Expand Down

0 comments on commit a5232c3

Please sign in to comment.