@types/clipboard
Advanced tools
Comparing version 1.5.30 to 1.5.31
@@ -1,2 +0,2 @@ | ||
// Type definitions for clipboard.js 1.5.9 | ||
// Type definitions for clipboard.js 1.5 | ||
// Project: https://github.com/zenorocha/clipboard.js | ||
@@ -6,54 +6,53 @@ // Definitions by: Andrei Kurosh <https://github.com/impworks> | ||
declare module 'clipboard' { | ||
class Clipboard { | ||
constructor(selector: (string | Element | NodeListOf<Element>), options?: Clipboard.Options); | ||
declare class Clipboard { | ||
constructor(selector: (string | Element | NodeListOf<Element>), options?: Clipboard.Options); | ||
/** | ||
* Subscribes to events that indicate the result of a copy/cut operation. | ||
* @param type {"success" | "error"} Event type ('success' or 'error'). | ||
* @param handler Callback function. | ||
*/ | ||
on(type: "success" | "error", handler: (e: Clipboard.Event) => void): this; | ||
on(type: string, handler: (...args: any[]) => void): this; | ||
/** | ||
* Clears all event bindings. | ||
*/ | ||
destroy(): void; | ||
} | ||
declare namespace Clipboard { | ||
interface Options { | ||
/** | ||
* Subscribes to events that indicate the result of a copy/cut operation. | ||
* @param type {String} Event type ('success' or 'error'). | ||
* @param handler Callback function. | ||
* Overwrites default command ('cut' or 'copy'). | ||
* @param {Element} elem Current element | ||
* @returns {String} Only 'cut' or 'copy'. | ||
*/ | ||
on(type: "success", handler: (e: Clipboard.Event) => void): this; | ||
on(type: "error", handler: (e: Clipboard.Event) => void): this; | ||
on(type: string, handler: (e: Clipboard.Event) => void): this; | ||
action?: (elem: Element) => string; | ||
/** | ||
* Clears all event bindings. | ||
* Overwrites default target input element. | ||
* @param {Element} elem Current element | ||
* @returns {Element} <input> element to use. | ||
*/ | ||
destroy(): void; | ||
target?: (elem: Element) => Element; | ||
/** | ||
* Returns the explicit text to copy. | ||
* @param {Element} elem Current element | ||
* @returns {String} Text to be copied. | ||
*/ | ||
text?: (elem: Element) => string; | ||
} | ||
namespace Clipboard { | ||
interface Options { | ||
/** | ||
* Overwrites default command ('cut' or 'copy'). | ||
* @param {Element} elem Current element | ||
* @returns {String} Only 'cut' or 'copy'. | ||
*/ | ||
action?: (elem: Element) => string; | ||
interface Event { | ||
action: string; | ||
text: string; | ||
trigger: Element; | ||
clearSelection(): void; | ||
} | ||
} | ||
/** | ||
* Overwrites default target input element. | ||
* @param {Element} elem Current element | ||
* @returns {Element} <input> element to use. | ||
*/ | ||
target?: (elem: Element) => Element; | ||
export = Clipboard; | ||
/** | ||
* Returns the explicit text to copy. | ||
* @param {Element} elem Current element | ||
* @returns {String} Text to be copied. | ||
*/ | ||
text?: (elem: Element) => string; | ||
} | ||
interface Event { | ||
action: string; | ||
text: string; | ||
trigger: Element; | ||
clearSelection(): void; | ||
} | ||
} | ||
export = Clipboard; | ||
} | ||
export as namespace Clipboard; |
{ | ||
"name": "@types/clipboard", | ||
"version": "1.5.30", | ||
"description": "TypeScript definitions for clipboard.js 1.5.9", | ||
"version": "1.5.31", | ||
"description": "TypeScript definitions for clipboard.js", | ||
"license": "MIT", | ||
@@ -15,4 +15,4 @@ "author": "Andrei Kurosh <https://github.com/impworks>", | ||
"peerDependencies": {}, | ||
"typings": "index.d.ts", | ||
"typesPublisherContentHash": "559fb8d0429c05529c5f08311db89388543bde49e9c16d539fe1ab51015cc401" | ||
"typesPublisherContentHash": "dc8f0df414c4a31fe866acf5169ec51af76e9ffade216891cedf8d3135b4f18d", | ||
"typeScriptVersion": "2.0" | ||
} |
@@ -5,15 +5,14 @@ # Installation | ||
# Summary | ||
This package contains type definitions for clipboard.js 1.5.9 (https://github.com/zenorocha/clipboard.js). | ||
This package contains type definitions for clipboard.js (https://github.com/zenorocha/clipboard.js). | ||
# Details | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/clipboard | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/clipboard | ||
Additional Details | ||
* Last updated: Mon, 14 Nov 2016 19:34:55 GMT | ||
* File structure: DeclareModule | ||
* Last updated: Sun, 25 Dec 2016 16:45:39 GMT | ||
* Library Dependencies: none | ||
* Module Dependencies: none | ||
* Global values: none | ||
* Global values: Clipboard | ||
# Credits | ||
These definitions were written by Andrei Kurosh <https://github.com/impworks>. |
{ | ||
"authors": "Andrei Kurosh <https://github.com/impworks>", | ||
"definitionFilename": "index.d.ts", | ||
"libraryDependencies": [], | ||
@@ -8,9 +7,11 @@ "moduleDependencies": [], | ||
"libraryMinorVersion": 5, | ||
"libraryName": "clipboard.js 1.5.9", | ||
"typeScriptVersion": "2.0", | ||
"libraryName": "clipboard.js", | ||
"typingsPackageName": "clipboard", | ||
"projectName": "https://github.com/zenorocha/clipboard.js", | ||
"sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped", | ||
"sourceBranch": "types-2.0", | ||
"kind": "DeclareModule", | ||
"globals": [], | ||
"sourceBranch": "master", | ||
"globals": [ | ||
"Clipboard" | ||
], | ||
"declaredModules": [ | ||
@@ -23,3 +24,3 @@ "clipboard" | ||
"hasPackageJson": false, | ||
"contentHash": "559fb8d0429c05529c5f08311db89388543bde49e9c16d539fe1ab51015cc401" | ||
"contentHash": "dc8f0df414c4a31fe866acf5169ec51af76e9ffade216891cedf8d3135b4f18d" | ||
} |
3553
70
18