diff --git a/clipboard-js/clipboard-js-tests.ts b/clipboard-js/clipboard-js-tests.ts new file mode 100644 index 0000000000..93adfda3a5 --- /dev/null +++ b/clipboard-js/clipboard-js-tests.ts @@ -0,0 +1,6 @@ +/// + +clipboard.copy("Hello World"); +clipboard.copy(document.body).then(() => console.log("success")); + +clipboard.paste().then(val => console.log(val)); diff --git a/clipboard-js/clipboard-js.d.ts b/clipboard-js/clipboard-js.d.ts new file mode 100644 index 0000000000..fafc44ef36 --- /dev/null +++ b/clipboard-js/clipboard-js.d.ts @@ -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 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace clipboard { + + interface IClipboardJsStatic { + copy(val: string | Element): Promise; + paste(): Promise; + } +} + +declare var clipboard: clipboard.IClipboardJsStatic; + +declare module 'clipboard-js' { + export = clipboard; +}