Skip to content

Commit 4418dbd

Browse files
committed
Re-use type
1 parent 37a20ba commit 4418dbd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/lite/ui/src/routes/project/$id/workspace/OperationTarget.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ import { useMutation } from "@tanstack/react-query";
2323

2424
type DropTargetParams = Parameters<typeof dropTargetForElements>[0];
2525
type GetDataArgs = Parameters<NonNullable<DropTargetParams["getData"]>>[0];
26+
type OnDropArgs = Parameters<NonNullable<DropTargetParams["onDrop"]>>[0];
2627

27-
const getOperationTypeFromData = (data: Record<string | symbol, unknown>): OperationType | null => {
28+
type DropData = OnDropArgs["self"]["data"];
29+
30+
const getOperationTypeFromData = (data: DropData): OperationType | null => {
2831
const instruction = extractInstruction(data);
2932
if (!instruction) return null;
3033

0 commit comments

Comments
 (0)