mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-17 07:20:23 +00:00
Added clipboard-js definitions and tests
This commit is contained in:
@@ -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));
|
||||
Vendored
+18
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user