@splicetree/core 0.2.0 → 0.3.0

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +5 -1
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -5,6 +5,10 @@
5
5
  * - 若传入 `D`,表示函数可选择性接收该参数类型
6
6
  */
7
7
  type Fn<T, D = undefined> = [D] extends [undefined] ? () => T : (data?: D) => T;
8
+ /** 可能是数组的类型 */
9
+ type MaybeArray<T> = T | T[];
10
+ /** 可能是函数的类型 */
11
+ type MaybeFn<T, Args extends any[] = []> = T | ((...args: Args) => T);
8
12
  /**
9
13
  * 输入数据的通用结构
10
14
  * - 表示原始树数据的任意键值对对象
@@ -279,4 +283,4 @@ type CreateSpliceTree = <T = SpliceTreeData>(data: T[], options?: UseSpliceTreeO
279
283
  */
280
284
  declare function createSpliceTree<T extends SpliceTreeData = SpliceTreeData>(data: T[], options?: UseSpliceTreeOptions<T>): SpliceTreeInstance<T>;
281
285
  //#endregion
282
- export { CreateSpliceTree, Fn, SpliceTreeConfiguration, SpliceTreeData, SpliceTreeEventName, SpliceTreeEventPayload, SpliceTreeEventPayloadMap, SpliceTreeEvents, SpliceTreeInstance, SpliceTreeNode, SpliceTreePlugin, SpliceTreePluginContext, UseSpliceTreeOptions, createSpliceTree };
286
+ export { CreateSpliceTree, Fn, MaybeArray, MaybeFn, SpliceTreeConfiguration, SpliceTreeData, SpliceTreeEventName, SpliceTreeEventPayload, SpliceTreeEventPayloadMap, SpliceTreeEvents, SpliceTreeInstance, SpliceTreeNode, SpliceTreePlugin, SpliceTreePluginContext, UseSpliceTreeOptions, createSpliceTree };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@splicetree/core",
3
3
  "type": "module",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "author": {
6
6
  "email": "michael.cocova@gmail.com",
7
7
  "name": "Michael Cocova"