refactor domain types to rename itemType

This commit is contained in:
jeffvli
2025-11-13 22:04:00 -08:00
parent 173e00af3d
commit 164332d752
9 changed files with 54 additions and 40 deletions
@@ -15,8 +15,8 @@ const hasRequiredDragProperties = (
item !== null &&
'id' in item &&
typeof (item as any).id === 'string' &&
'itemType' in item &&
typeof (item as any).itemType === 'string' &&
'_itemType' in item &&
typeof (item as any)._itemType === 'string' &&
'_serverId' in item &&
typeof (item as any)._serverId === 'string'
);
@@ -87,7 +87,7 @@ export const useDefaultItemListControls = () => {
rangeItem &&
typeof rangeItem === 'object' &&
'_serverId' in rangeItem &&
'itemType' in rangeItem
'_itemType' in rangeItem
) {
const rangeRowId = internalState.extractRowId(rangeItem);
if (rangeRowId) {
@@ -73,15 +73,15 @@ export interface ItemListStateActions {
}
export interface ItemListStateItem {
_itemType: LibraryItem;
_serverId: string;
id: string;
itemType: LibraryItem;
}
export type ItemListStateItemWithRequiredProperties = Record<string, unknown> & {
_itemType: LibraryItem;
_serverId: string;
id: string;
itemType: LibraryItem;
};
/**