You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
846 B
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**
* @description 定义数据类型
* @author fangzhicong
*/
/**
* 差异备份:节点相对位置信息
*/
export interface TargetPosition {
type: 'before' | 'after' | 'parent';
target: Node;
}
/**
* 差异备份Node 节点
*/
export interface DiffNodes {
add?: Node[];
remove?: Node[];
}
/**
* 差异备份:处理后的 MutationRecord 对象
*/
export interface Compile {
type: 'node' | 'text' | 'attr';
target: Element | Node;
attr: string;
value: string;
oldValue: string;
nodes: DiffNodes;
position: TargetPosition;
}
/**
* Range 缓存
*/
export interface RangeItem {
start: [Node, number];
end: [Node, number];
root: Node;
collapsed: boolean;
}
/**
* scroll 数据。[last-scrollTop, current-scrollTop]
*/
export declare type ScrollItem = [number, number];