refactor: introduce dedicated identifier types for improved clarity and type safety

This commit is contained in:
2025-11-24 23:47:36 +01:00
parent 22f0c040a2
commit 70e7bda87e
79 changed files with 1567 additions and 1572 deletions
+4 -3
View File
@@ -1,4 +1,5 @@
import { safeInvoke } from '../events';
import type { DocumentId } from '../../types/identifiers';
export const CLICK_ACTIONS = {
selectSingle: 'selectSingle',
@@ -25,9 +26,9 @@ export const LONG_PRESS_DURATION_MS = 450;
export const withinThreshold = (dx: number, dy: number, thresholdSquared: number): boolean => (dx * dx + dy * dy) <= thresholdSquared;
interface PointerIntentArgs {
doc: { id: string | number };
doc: { id: string };
entryDescriptor: unknown;
selectedDocumentIds: Array<string | number>;
selectedDocumentIds: Array<string>;
metaKey: boolean;
pointerButton?: number;
pointerType?: string;
@@ -35,7 +36,7 @@ interface PointerIntentArgs {
}
export interface PointerIntent {
docId: string | number;
docId: DocumentId;
entryDescriptor: unknown;
pointerType?: string;
pointerButton?: number;