snail.view 1.0.7 → 1.0.9

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.
@@ -421,7 +421,7 @@ interface IObserver {
421
421
  * @param fn 事件处理方法
422
422
  * @returns 作用域,可销毁监听
423
423
  */
424
- onEvent(target: Element | Window, name: string, fn: EventListenerOrEventListenerObject): IScope;
424
+ onEvent(target: Element | Window, name: string, fn: (...args: any[]) => void): IScope;
425
425
  /**
426
426
  * 监听元素尺寸变化
427
427
  * - scope销毁时自动移除监听
@@ -456,13 +456,15 @@ type ElementSize = {
456
456
 
457
457
  /**
458
458
  * 视图观察者
459
- * 1、观察元素尺寸、位置变化
459
+ *
460
460
  * 注意事项:
461
461
  * 1、不提供全局【观察者】对象;这个涉到不少子scope的销毁,在全局挂着始终不好
462
462
  */
463
463
 
464
464
  /**
465
465
  * 使用【观察者】
466
+ * - 观察元素尺寸、位置变化
467
+ * - 观察事件,scope销毁时自动清理事件监听
466
468
  * @returns 全新的【观察者】+作用域
467
469
  */
468
470
  declare function useObserver(): IObserver & IScope;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "对视图界面做的一些封装。如样式计算助手方法,常用样式less混入、变量等;dom相关助手类",
4
4
  "author": "snail_dev@163.com",
5
5
  "license": "MIT",
6
- "version": "1.0.7",
6
+ "version": "1.0.9",
7
7
  "type": "module",
8
8
  "main": "dist/snail.view.js",
9
9
  "module": "dist/snail.view.js",