UNPKG

702 BTypeScriptView Raw
1/**
2 * @description 记录 scrollTop
3 * @author fangzhicong
4 */
5import Cache from '../../../../utils/data-structure/cache';
6import Editor from '../../../index';
7import { ScrollItem } from '../type';
8export default class ScrollCache extends Cache<ScrollItem> {
9 editor: Editor;
10 /**
11 * 上一次的 scrollTop
12 */
13 private last;
14 /**
15 * 编辑区容器元素节点
16 */
17 private target;
18 constructor(editor: Editor);
19 /**
20 * 给编辑区容器绑定 scroll 事件
21 */
22 observe(): void;
23 /**
24 * 保存 scrollTop 值
25 */
26 save(): this;
27 /**
28 * 撤销
29 */
30 revoke(): boolean;
31 /**
32 * 恢复
33 */
34 restore(): boolean;
35}