@joker.front/core 1.3.76 → 1.3.81

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.
@@ -1,42 +1,46 @@
1
1
  import { Watcher } from "./watcher";
2
2
  /**
3
- * 作为观察者和对象代理中间的关系桥
4
- * 数据变更时:Ob->dep->watcher
5
- * 设置依赖时:watcher->dep
3
+ * Dependency manager acting as a bridge between watchers and proxied objects
4
+ * Data change flow: Ob -> dep -> watcher
5
+ * Dependency setup flow: watcher -> dep
6
6
  */
7
7
  export declare class Dep {
8
8
  /**
9
- * 当前目标的监听者
9
+ * Current target watcher
10
10
  *
11
- * 在更改值之前,设置该静态值,使其在值变更时收集相应的依赖关系
12
- * 设置完毕后清除该值
11
+ * Set this static value before changing a value to collect dependencies,
12
+ * clear it after setup.
13
13
  *
14
- * 之所以采用静态值,不采用方法的原因:
15
- * 可能存在多值变更,或者读取
14
+ * Using a static value instead of a method allows handling
15
+ * multiple value changes/reads.
16
16
  */
17
17
  static target?: Watcher<any>;
18
18
  watchers: Map<string | symbol | number, Watcher<any>[]>;
19
19
  /**
20
- * 设置依赖
21
- * @param key
20
+ * Establish a dependency for a key
21
+ * @param key Property key to depend on
22
22
  */
23
23
  depend(key: string | symbol | number): void;
24
24
  /**
25
- * 添加观察者
26
- * @param key
27
- * @param watcher
25
+ * Add a watcher for a key
26
+ * @param key Property key to watch
27
+ * @param watcher Watcher instance to add
28
28
  */
29
29
  addWatcher(key: string | symbol | number, watcher: Watcher<any>): void;
30
30
  /**
31
- * 删除观察者
32
- * @param key
33
- * @param watcher
31
+ * Remove a watcher for a key
32
+ * @param key Property key to unwatch
33
+ * @param watcher Watcher instance to remove
34
34
  */
35
35
  removeWatcher(key: string | symbol | number, watcher: Watcher<any>): void;
36
36
  /**
37
- * 通知key下面的观察者
38
- * @param key
37
+ * Notify watchers of a key change
38
+ * @param key Property key that changed
39
39
  */
40
40
  notify(key: string | symbol | number): void;
41
41
  }
42
+ /**
43
+ * Notify groups of dependencies in a batch
44
+ * @param list Map of Dep instances to their respective keys
45
+ */
42
46
  export declare function notifyGroupDeps(list: Map<Dep, Array<string | symbol | number>>): void;
@@ -1,27 +1,25 @@
1
1
  /**
2
- * 存放劫持对象的Dep的Key
2
+ * Symbol key for storing the Dep instance of a proxied object
3
3
  */
4
4
  export declare const OBJECTPROXY_DEPID: unique symbol;
5
5
  /**
6
- * 数据劫持
7
- * @param data 数据
8
- * @param clone 是否clone
9
- * @returns 返回可观察对象
6
+ * Create a reactive version of an object
7
+ * @param data Object to observe
8
+ * @param clone Whether to clone the object before observing
9
+ * @returns Reactive object
10
10
  */
11
11
  export declare function observer<T extends Object>(data: T, clone?: boolean): T;
12
12
  /**
13
- * 定义可劫持观察的属性
14
- *
15
- * 该方法会污染value深层,如想纯净数据,自行clone
16
- * @param target
17
- * @param key
18
- * @param value
13
+ * Define a reactive property on an object
14
+ * @param target Object to define property on
15
+ * @param key Property key
16
+ * @param value Property value
19
17
  */
20
18
  export declare function defineObserverProperty(target: any, key: string | symbol | number, value: any): void;
21
19
  declare const JOKER_SHALLOW_OBSERVER_TAG: unique symbol;
22
20
  /**
23
- * 浅劫持监听,不污染数据源,只对根值监听,不对属性监听
24
- * @returns
21
+ * Shallow observer that watches only the root value
22
+ * @returns Shallow observer instance
25
23
  */
26
24
  export declare class ShallowObserver<T> {
27
25
  private data;
@@ -29,21 +27,19 @@ export declare class ShallowObserver<T> {
29
27
  private dep;
30
28
  constructor(data: T);
31
29
  /**
32
- * 是否有变更
30
+ * Flag indicating if the value has changed
33
31
  */
34
32
  isChanged: boolean;
35
33
  get value(): T;
36
34
  set value(newVal: T);
37
35
  }
38
36
  /**
39
- * 组合回复,针对大量值变更,又不想频繁更新DOM,
40
- * 可通过该方法实现一个作用域内的统一组合回复
41
- * @param func 处理方法
42
- * @returns
37
+ * Combine multiple dependency updates into a single notification
38
+ * @param func Function containing changes to combine
43
39
  */
44
40
  export declare function combinedReply(func: Function): void;
45
41
  /**
46
- * 判断一个值是否是已被数据代理劫持
42
+ * Check if an object is being observed
47
43
  */
48
44
  export declare function isObserverData(data: any): boolean;
49
45
  export {};
@@ -1,9 +1,10 @@
1
1
  import { Dep } from "./dep";
2
2
  export declare const BREAK_WATCH_UPDATE: unique symbol;
3
3
  /**
4
- * 观察者
4
+ * Observer
5
5
  *
6
- * 负责观察对象,并收集依赖关系,并在值变更时做出回调响应
6
+ * Manages object observation, collects dependency relationships,
7
+ * and triggers callback responses when values change
7
8
  */
8
9
  export declare class Watcher<T extends object = any> {
9
10
  private ob;
@@ -14,33 +15,32 @@ export declare class Watcher<T extends object = any> {
14
15
  isDestroy: boolean;
15
16
  updating: boolean;
16
17
  /**
17
- * 运行时的关系收集
18
+ * Runtime relationship collection
18
19
  *
19
- * 主要作用是:运行时做基本的重复过滤,并收集当前“有效的”Dep关系
20
- * 一个Dep 肯定对应一个对象, 对象的key不会出现重复
20
+ * Main purpose: filter duplicates at runtime and collect "valid" Dep relationships
21
+ * Each Dep corresponds to an object, and object keys do not repeat
21
22
  */
22
23
  private runRelations;
23
24
  /**
24
- * 实际关系
25
+ * Actual dependency relations
25
26
  */
26
27
  relations: Map<Dep, Array<string | symbol | number>>;
27
28
  /**
28
- *
29
- * @param ob 数据源
30
- * @param expOrFn 表达式(string|Function)
31
- * @param updateCallBack update回调
32
- * @param forceCallBack 是否强制回调, 有些值未变更时也会强制回调
29
+ * @param ob Data source to observe (object or getter function)
30
+ * @param updateCallBack Callback function for value changes
31
+ * @param expOrFn Expression string or value extraction function
32
+ * @param forceCallBack Force callback even if value appears unchanged
33
33
  */
34
34
  constructor(ob: T | (() => T), updateCallBack: Function, expOrFn?: string | ((obj: T) => any | void) | Function, forceCallBack?: boolean | undefined);
35
35
  getValue(): any;
36
36
  /**
37
- * 添加Dep关系
38
- * @param dep
39
- * @param key
37
+ * Add Dep relationship
38
+ * @param dep Dependency instance
39
+ * @param key Observed property key
40
40
  */
41
41
  addDep(dep: Dep, key: string | symbol | number): void;
42
42
  /**
43
- * 更新值,并对其进行响应
43
+ * Update observed value and trigger response
44
44
  */
45
45
  update(): void;
46
46
  destroy(): void;
@@ -7,56 +7,56 @@ export type ObType = Component & Record<string, any>;
7
7
  export declare class ParserTemplate {
8
8
  asts: AST.Node[];
9
9
  ob: ObType;
10
- /** VNode */
10
+ /** VNode root */
11
11
  root: VNode.Root;
12
- /** VNode ref索引集 */
12
+ /** VNode ref index set */
13
13
  refs: Record<string, Array<VNode.Node>>;
14
14
  sleeped: boolean;
15
15
  promiseQueue: Set<Promise<any>>;
16
16
  /**
17
- * node变更观察者
17
+ * Node change observer
18
18
  */
19
19
  nodeWatcherEvents: Record<string, Array<(node: VNode.Node, type: NodeChangeType, propertyKey?: string) => void>>;
20
- /** VNode 渲染处理程序 (依赖注入) */
20
+ /** VNode rendering handler (dependency injection) */
21
21
  render: Render.IRender;
22
22
  constructor(asts: AST.Node[], ob: ObType, parent?: VNode.Node);
23
23
  parser(): void;
24
24
  /**
25
- * VNode挂载
25
+ * Mount VNode
26
26
  * @param root
27
27
  */
28
28
  mount(root: any): void;
29
29
  /**
30
- * 编译AST子集
30
+ * Compile AST subset
31
31
  * @param asts
32
32
  * @param parent
33
33
  */
34
34
  parserNodes(asts: AST.Node[], parent: VNode.Node, ob?: Component & Record<string, any>): void;
35
35
  /**
36
- * 添加ref
37
- * @param refName ref
38
- * @param node VNode节点
36
+ * Add ref
37
+ * @param refName ref value
38
+ * @param node VNode node
39
39
  */
40
40
  addRef(refKey: string, node: VNode.Node): void;
41
41
  /**
42
- * 移除Node所在ref
43
- * @param node VNode节点
42
+ * Remove ref where Node is located
43
+ * @param node VNode node
44
44
  */
45
45
  removeRef(node: VNode.Node): void;
46
46
  /**
47
- * 添加节点变更观察者
47
+ * Add node change observer
48
48
  * @param ref
49
49
  * @param callBack
50
50
  */
51
51
  addNodeWatcher(ref: string, callBack: (node: VNode.Node, type: NodeChangeType) => void): void;
52
52
  /**
53
- * 移除节点变更观察者
53
+ * Remove node change observer
54
54
  * @param ref
55
55
  * @param callBack
56
56
  */
57
57
  removeNodeWatcher(ref: string, callBack: Function): void;
58
58
  /**
59
- * 响应节点变更,通知观察者
59
+ * Respond to node changes and notify observers
60
60
  * @param ref
61
61
  * @param node
62
62
  * @param nodeChangeType
@@ -65,10 +65,10 @@ export declare class ParserTemplate {
65
65
  sleep(node?: VNode.Node): void;
66
66
  private weakup;
67
67
  /**
68
- * 销毁
68
+ * Destroy
69
69
  */
70
70
  destroy(keepalive?: boolean): void;
71
- /** 清除所有监听,用于优化嵌套组件销毁时 自定义销毁事件再次触发watcher问题 */
71
+ /** Clear all watches to optimize nested component destruction when custom destroy events trigger watchers again */
72
72
  destroyWathcers(): void;
73
73
  reSetAsts(asts: AST.Node[], keepalive?: boolean): void;
74
74
  nodeTransition(node: VNode.Node | undefined, mode: "enter" | "leave", name?: string, callBack?: Function, type?: "transition" | "animation"): boolean;
@@ -63,7 +63,7 @@ export declare abstract class IParser<T extends AST.Node, N extends VNode.Node>
63
63
  * @param ob 数据源
64
64
  * @returns
65
65
  */
66
- protected runExpress(express: string, ob: any): any;
66
+ protected runExpress(express: string, ob: any, customLog: () => string | void): any;
67
67
  /**
68
68
  * 运行表达式方法,并返回运行后的值(带观察者)
69
69
  * @param express 表达式 string|function
@@ -72,7 +72,7 @@ export declare abstract class IParser<T extends AST.Node, N extends VNode.Node>
72
72
  * @param forceCallBack 是否强制回调
73
73
  * @returns
74
74
  */
75
- protected runExpressWithWatcher(express: string | Function, ob: any, updateCallBack: (newVal: any, oldVal: any, isEqul: boolean, wathcer: Watcher) => void, forceCallBack?: boolean): any;
75
+ protected runExpressWithWatcher(express: string | Function, ob: any, updateCallBack: (newVal: any, oldVal: any, isEqul: boolean, wathcer: Watcher) => void, forceCallBack?: boolean, customLog?: () => string | void): any;
76
76
  /**
77
77
  * 添加观察者
78
78
  * @param watcher
@@ -2,72 +2,72 @@ import { VNode } from "./vnode";
2
2
  type TransitionType = "transition" | "animation";
3
3
  export declare namespace Render {
4
4
  /**
5
- * 注入TagId
5
+ * Inversion of Control tag ID for rendering
6
6
  */
7
7
  const IRENDERIOCTAGID: unique symbol;
8
8
  let ROOT_CONTAINER: string;
9
9
  /**
10
- * 备注:在渲染时执行appendNode,最终执行一次mount挂载
11
- * 不会出现根目录append的场景,因为指令group会优先占位
12
- *
13
- * append remove方法不会存在 parent的参数,因为一次挂载后
14
- * 会存在关系,根据关系直接执行
15
- * 上游调用也无需关心parent,特别是在watch周期内
10
+ * Note: appendNode is executed during rendering, and mount is called once at the end.
11
+ * There will be no scenario where the root is appended because command groups take precedence.
12
+ * append and remove methods do not require a parent parameter because after mounting,
13
+ * the relationship is established, and they are executed directly based on that relationship.
14
+ * Upstream calls do not need to care about the parent, especially during watch cycles.
16
15
  */
17
16
  interface IRender {
18
17
  /**
19
- * 挂载
20
- * @param root 挂载根
21
- * 不限制root类型,为后面做多端兼容
18
+ * Mount the rendering to a root container
19
+ * @param root Root container (element or component)
20
+ * Root type is not restricted for multi-platform compatibility
22
21
  */
23
22
  mount(root: any): void;
24
23
  /**
25
- * 添加节点
26
- * @param node NodeInfo
24
+ * Append a node to the rendering
25
+ * @param node VNode to append
26
+ * @param index Optional index for insertion
27
27
  */
28
28
  appendNode(node: VNode.Node, index?: number): void;
29
29
  /**
30
- * 更新节点
31
- * @param node NodeInfo
32
- * @param propertyKey 更新属性名称
30
+ * Update a node's properties
31
+ * @param node VNode to update
32
+ * @param propertyKey Property to update (optional)
33
33
  */
34
34
  updateNode(node: VNode.Node, propertyKey?: string): void;
35
35
  /**
36
- * 删除节点
37
- * @param {VNode.Node} node
38
- * @param {VNode.Node} parent 如果为空则带表root跟节点下集
39
- * @param {boolean} reserveOutPut 是否需要保留out产物
36
+ * Remove a node from the rendering
37
+ * @param node VNode to remove
38
+ * @param parent Optional parent node (root if undefined)
39
+ * @param reserveOutPut Whether to retain the output
40
40
  */
41
41
  removeNode(node: VNode.Node, reserveOutPut?: boolean): void;
42
42
  /**
43
- * 销毁,卸载DOM并释放变量
43
+ * Destroy the renderer, unmount DOM and release resources
44
44
  */
45
45
  destroy(): void;
46
46
  /**
47
- * element节点transition enter
47
+ * Handle element transition enter animation
48
48
  */
49
49
  elementToEnter(node: VNode.Element, name: string, type?: TransitionType, callBack?: Function): void;
50
50
  /**
51
- * element节点transition leave
51
+ * Handle element transition leave animation
52
52
  */
53
53
  elementToLeave(node: VNode.Element, name: string, type?: TransitionType, callBack?: Function): void;
54
54
  /**
55
- * 触发组件事件
56
- * @param node
57
- * @param eventName
58
- * @returns false 则代表停止广播
55
+ * Trigger a component event
56
+ * @param node Component node
57
+ * @param eventName Event name
58
+ * @returns false to stop propagation
59
59
  */
60
60
  triggerEvent(node: VNode.Component, eventName: string, e: VNode.Event): void | false;
61
61
  }
62
62
  /**
63
- * 默认Render,采用H5-DOM模式进行输出
63
+ * Default renderer using HTML DOM
64
64
  */
65
65
  class DomRender implements IRender {
66
66
  elements: DocumentFragment;
67
67
  constructor();
68
68
  mount(root: Element | VNode.Component): void;
69
69
  appendNode(node: VNode.Node, index?: number): void;
70
- updateNode(node: VNode.Node, propertyKey?: string | undefined): void;
70
+ updateNode(node: VNode.Node, propertyKey?: string): void;
71
71
  removeNode(node: VNode.Node, reserveOutPut?: boolean): void;
72
72
  destroy(): void;
73
73
  elementToEnter(node: VNode.Element, name: string, type?: TransitionType, callBack?: Function): void;
@@ -5,20 +5,20 @@ import { SectionType } from "../component";
5
5
  import { IParser } from "./parser";
6
6
  export declare const JOKER_VNODE_TAG: unique symbol;
7
7
  /**
8
- * 虚拟DOM
8
+ * Virtual DOM (VNode)
9
9
  *
10
- * 该控件分类区别于AST,分类是按照实际输出类型作为划分
10
+ * This control classification differs from AST, as it is divided based on the actual output type.
11
11
  */
12
12
  export declare namespace VNode {
13
13
  const PARSERKEY: unique symbol;
14
14
  /**
15
- * VNode 基类
15
+ * Base class for VNode
16
16
  */
17
17
  class Node {
18
18
  parent?: Node | undefined;
19
19
  [JOKER_VNODE_TAG]: boolean;
20
20
  /**
21
- * 是否是静态节点,非动态节点。例如:elementtextcomment
21
+ * Whether it is a static node (non-dynamic), such as element, text, comment, etc.
22
22
  */
23
23
  static?: boolean;
24
24
  output?: any;
@@ -26,43 +26,48 @@ export declare namespace VNode {
26
26
  childrens?: Node[];
27
27
  ref?: string;
28
28
  /**
29
- * 当前节点是否睡眠
29
+ * Whether the current node is in sleep state
30
30
  */
31
31
  sleep: boolean;
32
32
  constructor(parent?: Node | undefined);
33
33
  /**
34
- * 上一个节点
34
+ * Previous node
35
35
  */
36
36
  get prev(): Node | undefined;
37
37
  /**
38
- * 下一个节点
38
+ * Next node
39
39
  */
40
40
  get next(): Node | undefined;
41
41
  /**
42
- * 匹配第一个符合要求的祖先元素
43
- * @param filter 过滤条件 返回true 则返回当前节点
44
- * @param shouldBreak 自定义停止条件,若返回true,则不再向上查询
45
- * @returns
42
+ * Find the first ancestor element that matches the filter
43
+ * @param filter Filter condition: return true to select the current node
44
+ * @param shouldBreak Custom stop condition: return true to stop searching upwards
45
+ * @returns The matched ancestor node or undefined
46
46
  */
47
47
  closest<T extends VNode.Node = VNode.Element & VNode.Component>(filter: (node: VNode.Node) => true | any, shouldBreak?: (node: VNode.Node) => true | any): T | undefined;
48
48
  /**
49
- * 返回所有匹配的子元素
50
- * @param filter 返回true则记录
51
- * @param shouldBreak 自定义停止条件,若返回true,则不再向下查询
52
- * @param deepSearch 是否深度查询,默认为false,若为true 匹配成功项也会向下查询
53
- * @returns
49
+ * Find all child elements that match the filter
50
+ * @param filter Return true to include the node
51
+ * @param shouldBreak Custom stop condition: return true to stop searching downwards
52
+ * @param deepSearch Whether to search deeply (default: false). If true, continue searching after matching.
53
+ * @returns Array of matched nodes
54
54
  */
55
55
  find<T extends VNode.Node = VNode.Element & VNode.Component>(filter: (node: VNode.Node) => true | any, shouldBreak?: (node: VNode.Node) => true | any, deepSearch?: boolean, _childrens?: Array<VNode.Node>, _out?: Array<VNode.Node>): Array<T>;
56
56
  /**
57
- * 是否包含
58
- * @param filter 返回true则记录,返回false则跳过该元素的子集
59
- * @returns
57
+ * Check if any child node matches the filter
58
+ * @param filter Return true to include the node, return false to skip its children
59
+ * @returns True if any child matches, false otherwise
60
60
  */
61
61
  contains(filter: (node: VNode.Node) => true | any, childrens?: Array<VNode.Node>): boolean;
62
+ /**
63
+ * Find the first child node that matches the filter
64
+ * @param filter Return true to select the node
65
+ * @returns The first matched child node or undefined
66
+ */
62
67
  first<T extends VNode.Node = VNode.Element & VNode.Component>(filter: (node: VNode.Node) => true | any, childrens?: Array<VNode.Node>): T | undefined;
63
68
  }
64
69
  /**
65
- * 根节点
70
+ * Root node
66
71
  */
67
72
  class Root<T extends IComponent = IComponent & Record<string, any>> extends Node {
68
73
  childrens: Node[];
@@ -70,7 +75,7 @@ export declare namespace VNode {
70
75
  constructor();
71
76
  }
72
77
  /**
73
- * 文本类型节点
78
+ * Text node
74
79
  */
75
80
  class Text extends Node {
76
81
  text: string;
@@ -78,16 +83,17 @@ export declare namespace VNode {
78
83
  constructor(text: string, parent: Node);
79
84
  }
80
85
  /**
81
- * Html节点
86
+ * HTML node
82
87
  */
83
88
  class Html extends Node {
84
89
  html: string;
85
90
  notShadow?: boolean | undefined;
86
91
  static: boolean;
92
+ scopedId?: string;
87
93
  constructor(html: string, parent: Node, notShadow?: boolean | undefined);
88
94
  }
89
95
  /**
90
- * 注释节点
96
+ * Comment node
91
97
  */
92
98
  class Comment extends Node {
93
99
  text: string;
@@ -95,7 +101,7 @@ export declare namespace VNode {
95
101
  constructor(text: string, parent: Node);
96
102
  }
97
103
  /**
98
- * Element节点
104
+ * Element node
99
105
  */
100
106
  class Element extends Node {
101
107
  tagName: string;
@@ -107,56 +113,56 @@ export declare namespace VNode {
107
113
  callBack: EventCallBack;
108
114
  }]>;
109
115
  /**
110
- * 协助事件存储,用于存储辅助事件,例如outside等事件
116
+ * Auxiliary event storage for storing assist events like 'outside'
111
117
  */
112
118
  _assistEventCache?: Array<[string, (e: any) => void]>;
113
119
  constructor(tagName: string, parent: Node);
114
120
  }
115
121
  type Event<T = undefined, N extends VNode.Node = VNode.Element | VNode.Component | VNode.Root> = {
116
122
  /**
117
- * 事件名称
123
+ * Event name
118
124
  */
119
125
  eventName: string;
120
126
  /**
121
- * 原生event,对应运行平台
127
+ * Native event corresponding to the runtime platform
122
128
  */
123
129
  event?: any;
124
- /** 触发事件目标元素 */
130
+ /** Target element that triggered the event */
125
131
  target?: N;
126
- /** 阻止默认事件 */
132
+ /** Prevent default event behavior */
127
133
  preventDefault(): void;
128
- /** 阻止事件传播 */
134
+ /** Stop event propagation */
129
135
  stopPropagation(): void;
130
- /** 参数 */
136
+ /** Event parameters */
131
137
  data: T;
132
138
  };
133
139
  type EventCallBack<T = any> = (e: Event<T>) => void;
134
140
  /**
135
- * 组件节点
141
+ * Component node
136
142
  */
137
143
  class Component<T extends ComponentClass = ComponentClass<any> & Record<string, any>> extends Node {
138
- /** 组件名(template标签名) */
144
+ /** Component name (template tag name) */
139
145
  name?: string;
140
- /** 组件实例 */
146
+ /** Component instance */
141
147
  component: T;
142
- /** 事件 */
148
+ /** Events */
143
149
  events: Array<[string, {
144
150
  modifiers?: string[];
145
151
  callBack: EventCallBack;
146
152
  }]>;
147
- /** 参数 */
153
+ /** Properties values */
148
154
  propValues: Record<string, any>;
149
- /** 是否保持存活 */
155
+ /** Whether to keep the component alive */
150
156
  keepalive?: boolean;
151
157
  /**
152
- * 当前组件第一个element vnode
158
+ * First element VNode of the current component
153
159
  */
154
160
  get firstElement(): Element | undefined;
155
- /** 获取根element 节点 包含VNode.Html */
161
+ /** Get root element nodes (including VNode.Html) */
156
162
  get rootElements(): (Element | Html)[];
157
163
  }
158
164
  /**
159
- * 条件节点
165
+ * Condition node
160
166
  */
161
167
  class Condition extends Node {
162
168
  cmdName: AST.IfCommand["kind"];
@@ -166,13 +172,13 @@ export declare namespace VNode {
166
172
  constructor(cmdName: AST.IfCommand["kind"], parent: Node);
167
173
  }
168
174
  /**
169
- * 列表节点,内部包含多组列表项
175
+ * List node, containing multiple list items
170
176
  */
171
177
  class List extends Node {
172
178
  childrens: ListItem[];
173
179
  }
174
180
  /**
175
- * 循环列表项
181
+ * List item for looping
176
182
  */
177
183
  class ListItem extends Node {
178
184
  ob: ObType;
@@ -180,7 +186,7 @@ export declare namespace VNode {
180
186
  constructor(ob: ObType, parent: VNode.Node);
181
187
  }
182
188
  /**
183
- * 插槽节点
189
+ * Render section node (slot)
184
190
  */
185
191
  class RenderSection extends Node {
186
192
  id: string;
package/types/props.d.ts CHANGED
@@ -6,4 +6,11 @@ export type PropTypeFullModel = {
6
6
  validate?: (val: any) => Boolean;
7
7
  };
8
8
  export type PropType = PropValueType | Array<PropValueType> | PropTypeFullModel;
9
+ /**
10
+ * Get and validate a prop value based on its definition
11
+ * @param propsData Source props data
12
+ * @param key Prop key
13
+ * @param propsType Prop type definition
14
+ * @returns Validated and processed prop value
15
+ */
9
16
  export declare function getPropValue(propsData: Readonly<Record<string | symbol, any>>, key: string | symbol, propsType?: Record<string | symbol, any>): any;
@@ -1,15 +1,26 @@
1
1
  type Constructor<T = any> = new (...args: any[]) => T;
2
2
  /**
3
- * IOC依赖注入容器
3
+ * IOC Dependency Injection Container
4
4
  *
5
- * IOC依赖注入适用场景:
6
- * 内部已规划的API、Interface,需要在外部对其进行逻辑注入的场景
7
- * 区分于plugin,plugin是根据整体声明周期做的切面注入
5
+ * Applicable scenarios for IOC dependency injection:
6
+ * APIs and Interfaces that are internally planned but need external logic injection.
7
+ * Different from plugins, which are aspect injections based on the overall lifecycle.
8
8
  */
9
9
  export declare namespace IContainer {
10
+ /**
11
+ * Bind a tag identifier to a constructor
12
+ * @param tagId Unique identifier for the binding
13
+ * @returns Object with 'to' method to specify the target constructor
14
+ */
10
15
  function bind<T>(tagId: symbol | string): {
11
16
  to: (target: Constructor<T>) => void;
12
17
  };
18
+ /**
19
+ * Resolve a dependency by tag identifier
20
+ * @param tagId Unique identifier for the binding
21
+ * @param params Parameters to pass to the constructor
22
+ * @returns New instance of the bound constructor, or undefined if not found
23
+ */
13
24
  function get<T>(tagId: symbol | string, ...params: any[]): T | undefined;
14
25
  }
15
26
  export {};