minutool 1.0.30 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +25 -1
- package/dist/minutool.js +603 -582
- package/dist/minutool.js.map +1 -1
- package/dist/minutool.umd.cjs +5 -5
- package/dist/minutool.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -190,8 +190,32 @@ export declare const bindKeyUp: (element: EventTarget | string, payload: (event:
|
|
|
190
190
|
* 绑定对象移动事件
|
|
191
191
|
* @param element - 要移动的元素
|
|
192
192
|
* @param handle - 拖动句柄,默认为元素本身
|
|
193
|
+
* @param options - 移动选项
|
|
194
|
+
* @param options.lockInView - 是否限制元素四边不超出视口,默认 false
|
|
195
|
+
* @param options.onStart - 开始拖动时的回调,返回 false 可阻止拖动
|
|
196
|
+
* @param options.onEnd - 结束拖动时的回调,参数为元素的最终 left 和 top 值
|
|
197
|
+
* @param options.onMove - 拖动过程中触发的回调,参数为元素的当前 left 和 top 值
|
|
198
|
+
* @returns 一个函数,用于解绑移动事件并恢复元素的初始样式
|
|
193
199
|
*/
|
|
194
|
-
export declare const bindNodeMove: (element: HTMLElement | string, handle?: HTMLElement | string | null) => () => void;
|
|
200
|
+
export declare const bindNodeMove: (element: HTMLElement | string, handle?: HTMLElement | string | null, { lockInView, onStart, onEnd, onMove: onMoving, }?: BindNodeMoveOptions) => () => void;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* 移动元素的选项接口
|
|
204
|
+
*/
|
|
205
|
+
declare interface BindNodeMoveOptions {
|
|
206
|
+
lockInView?: boolean;
|
|
207
|
+
onStart?: () => void | false;
|
|
208
|
+
onEnd?: (left: number, top: number) => void;
|
|
209
|
+
onMove?: (left: number, top: number) => void;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* 为指定的 localStorage key 绑定变化事件
|
|
214
|
+
* @param key - localStorage 的 key
|
|
215
|
+
* @param callback - 回调,参数为新的值
|
|
216
|
+
* @returns { destroy } - 解绑函数
|
|
217
|
+
*/
|
|
218
|
+
export declare const bindStorageEvent: (key: string, callback: (value: string | null) => void) => (() => void);
|
|
195
219
|
|
|
196
220
|
/**
|
|
197
221
|
* 转换 Blob 数据到 Base64 Data URL
|