refactor: introduce dedicated identifier types for improved clarity and type safety
This commit is contained in:
@@ -10,8 +10,8 @@ interface SelectionEntry {
|
||||
}
|
||||
|
||||
interface WorkspaceSelectionOptions {
|
||||
onDocumentActivate?: (id: string | number) => void;
|
||||
onInspectFolder?: (id: string | number) => void;
|
||||
onDocumentActivate?: (id: string) => void;
|
||||
onInspectFolder?: (id: string) => void;
|
||||
}
|
||||
|
||||
const identity = <T,>(value: T) => value;
|
||||
@@ -71,7 +71,7 @@ export const useWorkspaceSelection = ({
|
||||
);
|
||||
|
||||
const inspectDocument = useCallback(
|
||||
(documentId?: string | number) => {
|
||||
(documentId?: string) => {
|
||||
if (!documentId) return;
|
||||
onDocumentActivate(documentId);
|
||||
},
|
||||
@@ -79,7 +79,7 @@ export const useWorkspaceSelection = ({
|
||||
);
|
||||
|
||||
const inspectFolder = useCallback(
|
||||
(folderId?: string | number) => {
|
||||
(folderId?: string) => {
|
||||
if (!folderId) return;
|
||||
onInspectFolder(folderId);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user