Skip to content

Commit 8cbef31

Browse files
nathanael-ruflukasbach
authored andcommitted
Fix ItemInstanceOpts generic type
1 parent 043e325 commit 8cbef31

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/core/src/types/core.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ type MayReturnNull<T extends (...x: any[]) => any> = (
9393
...args: Parameters<T>
9494
) => ReturnType<T> | null;
9595

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>;
9999
itemId: string;
100-
prev?: MayReturnNull<ItemInstance<any>[Key]>;
100+
prev?: MayReturnNull<ItemInstance<T>[Key]>;
101101
};
102102

103103
export type TreeInstanceOpts<Key extends keyof TreeInstance<any>> = {
@@ -131,7 +131,7 @@ export type FeatureImplementation<T = any> = {
131131

132132
itemInstance?: {
133133
[key in keyof ItemInstance<T>]?: (
134-
opts: ItemInstanceOpts<key>,
134+
opts: ItemInstanceOpts<T, key>,
135135
...args: Parameters<ItemInstance<T>[key]>
136136
) => void;
137137
};

0 commit comments

Comments
 (0)