mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
refactor domain types to rename itemType
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,8 +36,8 @@ export const ActionsColumn = (props: ItemTableListInnerColumn) => {
|
||||
color: 'muted',
|
||||
size: 'md',
|
||||
}}
|
||||
onDoubleClick={handleActionDoubleClick}
|
||||
onClick={handleActionClick}
|
||||
onDoubleClick={handleActionDoubleClick}
|
||||
size="xs"
|
||||
variant="subtle"
|
||||
/>
|
||||
|
||||
@@ -70,8 +70,8 @@ const hasRequiredStateItemProperties = (
|
||||
typeof (item as any).id === 'string' &&
|
||||
'_serverId' in item &&
|
||||
typeof (item as any)._serverId === 'string' &&
|
||||
'itemType' in item &&
|
||||
typeof (item as any).itemType === 'string' &&
|
||||
'_itemType' in item &&
|
||||
typeof (item as any)._itemType === 'string' &&
|
||||
'rowId' in item &&
|
||||
typeof (item as any).rowId === 'string'
|
||||
);
|
||||
@@ -1126,7 +1126,7 @@ export const ItemTableList = ({
|
||||
typeof item === 'object' &&
|
||||
item !== null &&
|
||||
'_serverId' in item &&
|
||||
'itemType' in item
|
||||
'_itemType' in item
|
||||
) {
|
||||
return item as ItemListStateItemWithRequiredProperties;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user