Merge pull request #28675 from overleaf/dp-pdf-preview-output-files-typescript-2

Convert output-files.js to typescript

GitOrigin-RevId: 32eb509f491cfd53de7f1b21b97861ba421566a5
This commit is contained in:
David
2025-09-30 08:05:45 +00:00
committed by Copybot
parent 2bf48b3774
commit 1b5887d97f
6 changed files with 97 additions and 52 deletions
@@ -25,7 +25,7 @@ import {
buildRuleDeltas,
handleLogFiles,
handleOutputFiles,
} from '../../features/pdf-preview/util/output-files'
} from '@/features/pdf-preview/util/output-files'
import { useProjectContext } from './project-context'
import { useEditorContext } from './editor-context'
import { buildFileList } from '../../features/pdf-preview/util/file-list'
@@ -81,7 +81,7 @@ export type CompileContext = {
logEntryAnnotations?: Record<string, Annotation[]>
outputFilesArchive?: string
pdfDownloadUrl?: string
pdfFile?: PdfFile
pdfFile?: PdfFile | null
pdfUrl?: string
pdfViewer?: string
position?: PdfScrollPosition
@@ -167,7 +167,7 @@ export const LocalCompileProvider: FC<React.PropsWithChildren> = ({
const { pdfViewer, syntaxValidation } = userSettings
// low level details for metrics
const [pdfFile, setPdfFile] = useState<PdfFile | undefined>()
const [pdfFile, setPdfFile] = useState<PdfFile | null | undefined>()
// the project is considered to be "uncompiled" if a doc has changed, or finished saving, since the last compile started.
const [uncompiled, setUncompiled] = useState(false)
@@ -296,7 +296,7 @@ export const LocalCompileProvider: FC<React.PropsWithChildren> = ({
}, [compiling])
const _buildLogEntryAnnotations = useCallback(
(entries: any) =>
(entries: LogEntry[]) =>
buildLogEntryAnnotations(entries, fileTreeData, lastCompileRootDocId),
[fileTreeData, lastCompileRootDocId]
)