@svelte-put/shortcut
Advanced tools
Comparing version 1.0.5 to 1.1.0
@@ -120,5 +120,7 @@ /****************************************************************************** | ||
* @param params - svelte action parameters | ||
* @returns svelte action interface | ||
* @returns svelte {@link ActionReturn} | ||
*/ | ||
function shortcut(node, params) { | ||
var shortcut = function (node, params) { | ||
if (!(params === null || params === void 0 ? void 0 : params.trigger)) | ||
throw new Error('@svelte-put/shortcut requires a parameter object with a `trigger` property'); | ||
var _a = params.enabled, enabled = _a === void 0 ? true : _a, trigger = params.trigger, _b = params.type, type = _b === void 0 ? 'keydown' : _b; | ||
@@ -177,5 +179,5 @@ var handler = function (event) { | ||
}; | ||
} | ||
}; | ||
export { shortcut }; | ||
//# sourceMappingURL=index.js.map |
@@ -0,8 +1,3 @@ | ||
import type { Action } from 'svelte/action'; | ||
import type { ShortcutParameters, ShortcutAttributes } from './types'; | ||
declare global { | ||
export namespace svelteHTML { | ||
interface HTMLAttributes extends ShortcutAttributes { | ||
} | ||
} | ||
} | ||
/** | ||
@@ -101,8 +96,5 @@ * Listen for keyboard event and trigger `shortcut` {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent | CustomEvent } | ||
* @param params - svelte action parameters | ||
* @returns svelte action interface | ||
* @returns svelte {@link ActionReturn} | ||
*/ | ||
export declare function shortcut(node: HTMLElement, params: ShortcutParameters): { | ||
update: (update: ShortcutParameters) => void; | ||
destroy: () => void; | ||
}; | ||
export declare const shortcut: Action<HTMLElement, ShortcutParameters, ShortcutAttributes>; | ||
//# sourceMappingURL=shortcut.d.ts.map |
{ | ||
"name": "@svelte-put/shortcut", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "Action to move node on mousedown & mousemove", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
37174
470