@headless-tree/core 0.0.0-20250921152257 → 0.0.0-20250928101953

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @headless-tree/core
2
2
 
3
- ## 0.0.0-20250921152257
3
+ ## 0.0.0-20250928101953
4
4
 
5
5
  ### Minor Changes
6
6
 
package/dist/index.d.mts CHANGED
@@ -527,11 +527,11 @@ type HotkeyName = MergedFeatures<RegisteredFeatures<any>>["hotkeys"];
527
527
  type HotkeysConfig<T> = Record<HotkeyName, HotkeyConfig<T>>;
528
528
  type CustomHotkeysConfig<T> = Partial<Record<HotkeyName | `custom${string}`, Partial<HotkeyConfig<T>>>>;
529
529
  type MayReturnNull<T extends (...x: any[]) => any> = (...args: Parameters<T>) => ReturnType<T> | null;
530
- type ItemInstanceOpts<Key extends keyof ItemInstance<any>> = {
531
- item: ItemInstance<any>;
532
- tree: TreeInstance<any>;
530
+ type ItemInstanceOpts<T, Key extends keyof ItemInstance<any>> = {
531
+ item: ItemInstance<T>;
532
+ tree: TreeInstance<T>;
533
533
  itemId: string;
534
- prev?: MayReturnNull<ItemInstance<any>[Key]>;
534
+ prev?: MayReturnNull<ItemInstance<T>[Key]>;
535
535
  };
536
536
  type TreeInstanceOpts<Key extends keyof TreeInstance<any>> = {
537
537
  tree: TreeInstance<any>;
@@ -548,7 +548,7 @@ type FeatureImplementation<T = any> = {
548
548
  [key in keyof TreeInstance<T>]?: (opts: TreeInstanceOpts<key>, ...args: Parameters<TreeInstance<T>[key]>) => void;
549
549
  };
550
550
  itemInstance?: {
551
- [key in keyof ItemInstance<T>]?: (opts: ItemInstanceOpts<key>, ...args: Parameters<ItemInstance<T>[key]>) => void;
551
+ [key in keyof ItemInstance<T>]?: (opts: ItemInstanceOpts<T, key>, ...args: Parameters<ItemInstance<T>[key]>) => void;
552
552
  };
553
553
  onTreeMount?: (instance: TreeInstance<T>, treeElement: HTMLElement) => void;
554
554
  onTreeUnmount?: (instance: TreeInstance<T>, treeElement: HTMLElement) => void;
package/dist/index.d.ts CHANGED
@@ -527,11 +527,11 @@ type HotkeyName = MergedFeatures<RegisteredFeatures<any>>["hotkeys"];
527
527
  type HotkeysConfig<T> = Record<HotkeyName, HotkeyConfig<T>>;
528
528
  type CustomHotkeysConfig<T> = Partial<Record<HotkeyName | `custom${string}`, Partial<HotkeyConfig<T>>>>;
529
529
  type MayReturnNull<T extends (...x: any[]) => any> = (...args: Parameters<T>) => ReturnType<T> | null;
530
- type ItemInstanceOpts<Key extends keyof ItemInstance<any>> = {
531
- item: ItemInstance<any>;
532
- tree: TreeInstance<any>;
530
+ type ItemInstanceOpts<T, Key extends keyof ItemInstance<any>> = {
531
+ item: ItemInstance<T>;
532
+ tree: TreeInstance<T>;
533
533
  itemId: string;
534
- prev?: MayReturnNull<ItemInstance<any>[Key]>;
534
+ prev?: MayReturnNull<ItemInstance<T>[Key]>;
535
535
  };
536
536
  type TreeInstanceOpts<Key extends keyof TreeInstance<any>> = {
537
537
  tree: TreeInstance<any>;
@@ -548,7 +548,7 @@ type FeatureImplementation<T = any> = {
548
548
  [key in keyof TreeInstance<T>]?: (opts: TreeInstanceOpts<key>, ...args: Parameters<TreeInstance<T>[key]>) => void;
549
549
  };
550
550
  itemInstance?: {
551
- [key in keyof ItemInstance<T>]?: (opts: ItemInstanceOpts<key>, ...args: Parameters<ItemInstance<T>[key]>) => void;
551
+ [key in keyof ItemInstance<T>]?: (opts: ItemInstanceOpts<T, key>, ...args: Parameters<ItemInstance<T>[key]>) => void;
552
552
  };
553
553
  onTreeMount?: (instance: TreeInstance<T>, treeElement: HTMLElement) => void;
554
554
  onTreeUnmount?: (instance: TreeInstance<T>, treeElement: HTMLElement) => void;
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "checkbox",
14
14
  "hook"
15
15
  ],
16
- "version": "0.0.0-20250921152257",
16
+ "version": "0.0.0-20250928101953",
17
17
  "main": "dist/index.d.ts",
18
18
  "module": "dist/index.mjs",
19
19
  "types": "dist/index.d.mts",
package/src/types/core.ts CHANGED
@@ -93,11 +93,11 @@ type MayReturnNull<T extends (...x: any[]) => any> = (
93
93
  ...args: Parameters<T>
94
94
  ) => ReturnType<T> | null;
95
95
 
96
- export type ItemInstanceOpts<Key extends keyof ItemInstance<any>> = {
97
- item: ItemInstance<any>;
98
- tree: TreeInstance<any>;
96
+ export type ItemInstanceOpts<T, Key extends keyof ItemInstance<any>> = {
97
+ item: ItemInstance<T>;
98
+ tree: TreeInstance<T>;
99
99
  itemId: string;
100
- prev?: MayReturnNull<ItemInstance<any>[Key]>;
100
+ prev?: MayReturnNull<ItemInstance<T>[Key]>;
101
101
  };
102
102
 
103
103
  export type TreeInstanceOpts<Key extends keyof TreeInstance<any>> = {
@@ -131,7 +131,7 @@ export type FeatureImplementation<T = any> = {
131
131
 
132
132
  itemInstance?: {
133
133
  [key in keyof ItemInstance<T>]?: (
134
- opts: ItemInstanceOpts<key>,
134
+ opts: ItemInstanceOpts<T, key>,
135
135
  ...args: Parameters<ItemInstance<T>[key]>
136
136
  ) => void;
137
137
  };