mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
[clipboard] isSupported() is a static method. (#22931)
This commit is contained in:
committed by
Wesley Wigham
parent
496c843d48
commit
b9a24abe42
@@ -1,28 +1,28 @@
|
||||
import * as Clipboard from 'clipboard';
|
||||
import * as Clipboard from "clipboard";
|
||||
|
||||
const cb1 = new Clipboard('.btn');
|
||||
const cb2 = new Clipboard(document.getElementById('id'), {
|
||||
action: elem => 'copy'
|
||||
const cb1 = new Clipboard(".btn");
|
||||
const cb2 = new Clipboard(document.getElementById("id"), {
|
||||
action: elem => "copy"
|
||||
});
|
||||
const cb3 = new Clipboard(document.querySelectorAll('query'), {
|
||||
const cb3 = new Clipboard(document.querySelectorAll("query"), {
|
||||
text: elem => null
|
||||
});
|
||||
const cb4 = new Clipboard('.btn', {
|
||||
const cb4 = new Clipboard(".btn", {
|
||||
target: elem => null
|
||||
});
|
||||
const cb5 = new Clipboard('.btn', {
|
||||
action: elem => 'copy',
|
||||
const cb5 = new Clipboard(".btn", {
|
||||
action: elem => "copy",
|
||||
target: elem => null
|
||||
});
|
||||
|
||||
cb1.destroy();
|
||||
cb1.isSupported();
|
||||
Clipboard.isSupported();
|
||||
|
||||
cb2.on('success', e => {
|
||||
console.info('Action:', e.action);
|
||||
console.info('Text:', e.text);
|
||||
console.info('Trigger:', e.trigger);
|
||||
cb2.on("success", e => {
|
||||
console.info("Action:", e.action);
|
||||
console.info("Text:", e.text);
|
||||
console.info("Trigger:", e.trigger);
|
||||
|
||||
e.clearSelection();
|
||||
});
|
||||
cb2.on('error', e => { });
|
||||
cb2.on("error", e => {});
|
||||
|
||||
Vendored
+5
-2
@@ -4,7 +4,10 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare class Clipboard {
|
||||
constructor(selector: (string | Element | NodeListOf<Element>), options?: Clipboard.Options);
|
||||
constructor(
|
||||
selector: string | Element | NodeListOf<Element>,
|
||||
options?: Clipboard.Options
|
||||
);
|
||||
|
||||
/**
|
||||
* Subscribes to events that indicate the result of a copy/cut operation.
|
||||
@@ -22,7 +25,7 @@ declare class Clipboard {
|
||||
/**
|
||||
* Checks if clipboard.js is supported
|
||||
*/
|
||||
isSupported(): boolean;
|
||||
static isSupported(): boolean;
|
||||
}
|
||||
|
||||
declare namespace Clipboard {
|
||||
|
||||
Reference in New Issue
Block a user