Make Viewer always accessible (#4468)

# Description of Changes
Make Viewer always accessible. Also deletes some dead code I noticed
while I was working.

---------

Co-authored-by: EthanHealy01 <[email protected]>
Co-authored-by: Reece Browne <[email protected]>
This commit is contained in:
James Brunton
2025-09-22 12:11:34 +01:00
committed by GitHub
co-authored by EthanHealy01 Reece Browne
parent 28177d9509
commit f6df414425
4 changed files with 50 additions and 117 deletions
-46
View File
@@ -8,26 +8,6 @@ import { FileId, BaseFileMetadata } from './file';
// Re-export FileId for convenience
export type { FileId };
export type ModeType =
| 'viewer'
| 'pageEditor'
| 'fileEditor'
| 'merge'
| 'split'
| 'compress'
| 'ocr'
| 'convert'
| 'sanitize'
| 'addPassword'
| 'changePermissions'
| 'addWatermark'
| 'removePassword'
| 'single-large-page'
| 'repair'
| 'unlockPdfForms'
| 'removeCertificateSign'
| 'auto-rename-pdf-file';
// Normalized state types
export interface ProcessedFilePage {
thumbnail?: string;
@@ -209,32 +189,6 @@ export function revokeFileResources(record: StirlingFileStub): void {
}
}
export type OperationType = 'merge' | 'split' | 'compress' | 'add' | 'remove' | 'replace' | 'convert' | 'upload' | 'ocr' | 'sanitize';
export interface FileOperation {
id: string;
type: OperationType;
timestamp: number;
fileIds: FileId[];
status: 'pending' | 'applied' | 'failed';
data?: any;
metadata?: {
originalFileName?: string;
outputFileNames?: string[];
fileSize?: number;
pageCount?: number;
error?: string;
};
}
export interface FileOperationHistory {
fileId: FileId;
fileName: string;
operations: (FileOperation | PageOperation)[];
createdAt: number;
lastModified: number;
}
export interface ViewerConfig {
zoom: number;
currentPage: number;
+1 -1
View File
@@ -9,4 +9,4 @@ export const getDefaultWorkbench = (): WorkbenchType => 'fileEditor';
// Type guard using the same source of truth
export const isValidWorkbench = (value: string): value is WorkbenchType => {
return WORKBENCH_TYPES.includes(value as WorkbenchType);
};
};