mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-09-22 19:46:39 +00:00
Delete dead code
This commit is contained in:
parent
ae7be50ec2
commit
edeed49e0b
@ -8,26 +8,6 @@ import { FileId, BaseFileMetadata } from './file';
|
|||||||
// Re-export FileId for convenience
|
// Re-export FileId for convenience
|
||||||
export type { FileId };
|
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
|
// Normalized state types
|
||||||
export interface ProcessedFilePage {
|
export interface ProcessedFilePage {
|
||||||
thumbnail?: string;
|
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 {
|
export interface ViewerConfig {
|
||||||
zoom: number;
|
zoom: number;
|
||||||
currentPage: number;
|
currentPage: number;
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
import { FileId } from '../types/file';
|
|
||||||
import { FileOperation } from '../types/fileContext';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates operation tracking data for FileContext integration
|
|
||||||
*/
|
|
||||||
export const createOperation = <TParams = void>(
|
|
||||||
operationType: string,
|
|
||||||
_params: TParams,
|
|
||||||
selectedFiles: File[]
|
|
||||||
): { operation: FileOperation; operationId: string; fileId: FileId } => {
|
|
||||||
const operationId = `${operationType}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
||||||
const fileId = selectedFiles.map(f => f.name).join(',') as FileId;
|
|
||||||
|
|
||||||
const operation: FileOperation = {
|
|
||||||
id: operationId,
|
|
||||||
type: operationType,
|
|
||||||
timestamp: Date.now(),
|
|
||||||
fileIds: selectedFiles.map(f => f.name),
|
|
||||||
status: 'pending',
|
|
||||||
metadata: {
|
|
||||||
originalFileName: selectedFiles[0]?.name,
|
|
||||||
fileSize: selectedFiles.reduce((sum, f) => sum + f.size, 0)
|
|
||||||
}
|
|
||||||
} as any /* FIX ME*/;
|
|
||||||
|
|
||||||
return { operation, operationId, fileId };
|
|
||||||
};
|
|
Loading…
x
Reference in New Issue
Block a user