Merge pull request #11896 from markwongsk/master

Added clipboard-js definitions and tests
This commit is contained in:
Arthur Ozga
2016-10-11 11:04:44 -07:00
committed by GitHub
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
/// <reference path="clipboard-js.d.ts" />
clipboard.copy("Hello World");
clipboard.copy(document.body).then(() => console.log("success"));
clipboard.paste().then(val => console.log(val));

18
clipboard-js/clipboard-js.d.ts vendored Normal file
View File

@@ -0,0 +1,18 @@
// Type definitions for clipboard-js 0.3.1
// Project: https://github.com/lgarron/clipboard.js
// Definitions by: Mark Wong Siang Kai <https://github.com/markwongsk>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace clipboard {
interface IClipboardJsStatic {
copy(val: string | Element): Promise<void>;
paste(): Promise<string>;
}
}
declare var clipboard: clipboard.IClipboardJsStatic;
declare module 'clipboard-js' {
export = clipboard;
}