提交 ea1a4197 编写于 作者: fxy060608's avatar fxy060608

fix(types): UniElement

上级 6808de7c
...@@ -50,27 +50,27 @@ type NodeAction<T extends Parameters<any>> = [/* nodeId */ number, ...T] ...@@ -50,27 +50,27 @@ type NodeAction<T extends Parameters<any>> = [/* nodeId */ number, ...T]
export type InsertAction = [ export type InsertAction = [
typeof ACTION_TYPE_INSERT, typeof ACTION_TYPE_INSERT,
...NodeAction<Parameters<UniElement['insert']>> ...NodeAction<Parameters<UniElement<any>['insert']>>
] ]
export type RemoveAction = [ export type RemoveAction = [
typeof ACTION_TYPE_REMOVE, typeof ACTION_TYPE_REMOVE,
...NodeAction<Parameters<UniElement['remove']>> ...NodeAction<Parameters<UniElement<any>['remove']>>
] ]
export type SetAttributeAction = [ export type SetAttributeAction = [
typeof ACTION_TYPE_SET_ATTRIBUTE, typeof ACTION_TYPE_SET_ATTRIBUTE,
...NodeAction<Parameters<UniElement['setAttr']>> ...NodeAction<Parameters<UniElement<any>['setAttr']>>
] ]
export type RemoveAttributeAction = [ export type RemoveAttributeAction = [
typeof ACTION_TYPE_REMOVE_ATTRIBUTE, typeof ACTION_TYPE_REMOVE_ATTRIBUTE,
...NodeAction<Parameters<UniElement['removeAttr']>> ...NodeAction<Parameters<UniElement<any>['removeAttr']>>
] ]
export type SetTextAction = [ export type SetTextAction = [
typeof ACTION_TYPE_SET_TEXT, typeof ACTION_TYPE_SET_TEXT,
...NodeAction<Parameters<UniElement['setText']>> ...NodeAction<Parameters<UniElement<any>['setText']>>
] ]
export type PageUpdateAction = export type PageUpdateAction =
......
...@@ -16,7 +16,7 @@ import { UniNode } from './elements/UniNode' ...@@ -16,7 +16,7 @@ import { UniNode } from './elements/UniNode'
const elements = new Map<number, UniNode>() const elements = new Map<number, UniNode>()
export function $(id: number) { export function $(id: number) {
return elements.get(id) as UniElement return elements.get(id) as UniElement<any>
} }
export function createElement(id: number, tag: string | number) { export function createElement(id: number, tag: string | number) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册