refactor: introduce dedicated identifier types for improved clarity and type safety
This commit is contained in:
@@ -20,7 +20,7 @@ export const isPrimaryPointerEvent = (event?: PointerEventLike | null): boolean
|
||||
export type EntryType = 'document' | 'folder';
|
||||
|
||||
export interface WorkspaceEntry {
|
||||
id: string | number;
|
||||
id: string;
|
||||
key?: string;
|
||||
type: EntryType;
|
||||
[key: string]: unknown;
|
||||
@@ -28,7 +28,7 @@ export interface WorkspaceEntry {
|
||||
|
||||
interface UseEntryPointerOptions {
|
||||
onSelectEntry?: (entry: WorkspaceEntry, event?: PointerEventLike | null, metadata?: EntryPointerMetadata) => void;
|
||||
onDocumentActivate?: (id: string | number, metadata?: EntryPointerMetadata) => void;
|
||||
onDocumentActivate?: (id: string, metadata?: EntryPointerMetadata) => void;
|
||||
}
|
||||
|
||||
export interface EntryPointerMetadata {
|
||||
@@ -36,7 +36,7 @@ export interface EntryPointerMetadata {
|
||||
primaryClick: boolean;
|
||||
rowKey: string;
|
||||
type: EntryType;
|
||||
id: string | number;
|
||||
id: string;
|
||||
}
|
||||
|
||||
export const useEntryPointer = ({
|
||||
|
||||
Reference in New Issue
Block a user