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.
- package/dist/snail.view.d.ts +4 -2
- package/package.json +1 -1
package/dist/snail.view.d.ts
CHANGED
|
@@ -421,7 +421,7 @@ interface IObserver {
|
|
|
421
421
|
* @param fn 事件处理方法
|
|
422
422
|
* @returns 作用域,可销毁监听
|
|
423
423
|
*/
|
|
424
|
-
onEvent(target: Element | Window, name: string, fn:
|
|
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
|
-
*
|
|
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