Stirling-PDF/frontend/src/components/pageEditor
James Brunton e142af2863
V2 Make FileId type opaque and use consistently throughout project (#4307)
# Description of Changes
The `FileId` type in V2 currently is just defined to be a string. This
makes it really easy to accidentally pass strings into things accepting
file IDs (such as file names). This PR makes the `FileId` type [an
opaque
type](https://www.geeksforgeeks.org/typescript/opaque-types-in-typescript/),
so it is compatible with things accepting strings (arguably not ideal
for this...) but strings are not compatible with it without explicit
conversion.

The PR also includes changes to use `FileId` consistently throughout the
project (everywhere I could find uses of `fileId: string`), so that we
have the maximum benefit from the type safety.

> [!note]
> I've marked quite a few things as `FIX ME` where we're passing names
in as IDs. If that is intended behaviour, I'm happy to remove the fix me
and insert a cast instead, but they probably need comments explaining
why we're using a file name as an ID.
2025-08-28 09:56:07 +00:00
..
commands V2 Make FileId type opaque and use consistently throughout project (#4307) 2025-08-28 09:56:07 +00:00
hooks V2 Make FileId type opaque and use consistently throughout project (#4307) 2025-08-28 09:56:07 +00:00
BulkSelectionPanel.tsx Feature/v2/page editor selection persistance (#4306) 2025-08-26 17:26:30 +01:00
constants.ts Feature/v2/pageeditor improved (#4289) 2025-08-26 15:30:58 +01:00
DragDropGrid.tsx Feature/v2/page editor selection persistance (#4306) 2025-08-26 17:26:30 +01:00
FileThumbnail.tsx V2 Make FileId type opaque and use consistently throughout project (#4307) 2025-08-28 09:56:07 +00:00
PageEditor.module.css Feature/v2/pageeditor improved (#4289) 2025-08-26 15:30:58 +01:00
PageEditor.tsx V2 Make FileId type opaque and use consistently throughout project (#4307) 2025-08-28 09:56:07 +00:00
PageEditorControls.tsx Feature/v2/page editor selection persistance (#4306) 2025-08-26 17:26:30 +01:00
PageThumbnail.tsx Feature/v2/page editor selection persistance (#4306) 2025-08-26 17:26:30 +01:00