Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide TypeScript declaration #25

Closed
til-schneider opened this issue Mar 6, 2019 · 1 comment
Closed

Provide TypeScript declaration #25

til-schneider opened this issue Mar 6, 2019 · 1 comment

Comments

@til-schneider
Copy link

til-schneider commented Mar 6, 2019

You should provide a TypeScript declaration, so copy-text-to-clipboard can seamlessly be used in TypeScript. This would also provide auto-completion for JavaScript users in some editors.

Just add a file called index.d.ts with the following content:

/**
 * Copy `text` to the clipboard.
 * Must be called in response to a user gesture event, like `click` or `keyup`.
 *
 * @return whether copying succeeded
 */
export default function copy(text: string): boolean
@sindresorhus
Copy link
Owner

Fixed by #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants