@react-pdf-kit/viewer 0.0.0-experimental.4 → 0.0.0-experimental.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/dist/RPLayout.module-b4b23e29.js +14 -0
  2. package/dist/assets/style.css +1 -1
  3. package/dist/assets/style.js +15 -15
  4. package/dist/components/RPConfig.js +18 -6
  5. package/dist/components/RPController.js +21 -26
  6. package/dist/components/RPDropFileZone.js +34 -28
  7. package/dist/components/RPPages.js +352 -361
  8. package/dist/components/RPProvider.js +20 -24
  9. package/dist/components/layout/LayoutContainer.js +1 -1
  10. package/dist/components/layout/LayoutWrapper.js +1 -1
  11. package/dist/components/layout/RPDefaultLayout.js +6 -7
  12. package/dist/components/layout/RPLayout.js +22 -22
  13. package/dist/components/layout/WrapperLayout.js +10 -11
  14. package/dist/components/layout/sidebar/RPSidebar.js +3 -4
  15. package/dist/components/layout/sidebar/Thumbnail.js +3 -4
  16. package/dist/components/layout/sidebar/Thumbnails.js +3 -4
  17. package/dist/components/layout/toolbar/DocumentDialog.js +5 -6
  18. package/dist/components/layout/toolbar/FileDownloadTool.js +3 -4
  19. package/dist/components/layout/toolbar/FileUploadTool.js +3 -4
  20. package/dist/components/layout/toolbar/MostPageTool.js +3 -4
  21. package/dist/components/layout/toolbar/OtherTool.js +3 -4
  22. package/dist/components/layout/toolbar/Paginate.js +3 -4
  23. package/dist/components/layout/toolbar/PrintTool.js +3 -4
  24. package/dist/components/layout/toolbar/RPMoreOptions.js +3 -4
  25. package/dist/components/layout/toolbar/RPToolbar.js +3 -6
  26. package/dist/components/layout/toolbar/RPToolbarEnd.js +3 -4
  27. package/dist/components/layout/toolbar/RotateTool.js +3 -4
  28. package/dist/components/layout/toolbar/SearchResultNavigator.js +3 -6
  29. package/dist/components/layout/toolbar/SearchTool.js +5 -8
  30. package/dist/components/layout/toolbar/ThumbnailTool.js +3 -4
  31. package/dist/components/layout/toolbar/ToolbarCustom.js +3 -4
  32. package/dist/components/layout/toolbar/ToolbarDefault.js +3 -6
  33. package/dist/components/layout/toolbar/ToolbarLayout.js +3 -6
  34. package/dist/components/layout/toolbar/ZoomTool.js +3 -4
  35. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +3 -4
  36. package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +7 -9
  37. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +3 -4
  38. package/dist/components/layout/toolbar/tools/FileUploadTool.js +3 -4
  39. package/dist/components/layout/toolbar/tools/FirstPageTool.js +7 -9
  40. package/dist/components/layout/toolbar/tools/InputPageTool.js +3 -4
  41. package/dist/components/layout/toolbar/tools/LastPageTool.js +7 -9
  42. package/dist/components/layout/toolbar/tools/NextPageTool.js +3 -4
  43. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +3 -4
  44. package/dist/components/layout/toolbar/tools/PrintTool.js +3 -4
  45. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +3 -4
  46. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +3 -4
  47. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +3 -4
  48. package/dist/components/layout/toolbar/tools/ZoomInTool.js +3 -4
  49. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +13 -14
  50. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +3 -4
  51. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +3 -6
  52. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +3 -4
  53. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +3 -4
  54. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +3 -4
  55. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +3 -4
  56. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +3 -4
  57. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +3 -4
  58. package/dist/components/page/AnnotationLayer.js +65 -66
  59. package/dist/components/page/CanvasLayer.js +3 -4
  60. package/dist/components/page/CustomElement.js +3 -4
  61. package/dist/components/page/DualPage.js +5 -11
  62. package/dist/components/page/DualPageWithCover.js +5 -11
  63. package/dist/components/page/RPPage.js +6 -12
  64. package/dist/components/page/SinglePage.js +5 -11
  65. package/dist/components/page/TextHighlightLayer.js +178 -86
  66. package/dist/components/page/TextLayer.js +170 -125
  67. package/dist/components/ui/LoadingIndicator.js +7 -8
  68. package/dist/contexts/ConfigContext.js +5 -4
  69. package/dist/contexts/DimensionPagesContext.js +5 -6
  70. package/dist/contexts/DropFileZoneContext.js +4 -5
  71. package/dist/contexts/ElementPageContext.js +5 -6
  72. package/dist/contexts/FileInputContext.js +5 -6
  73. package/dist/contexts/HighlightContext.js +7 -10
  74. package/dist/contexts/LayoutDropFileZoneContext.js +11 -0
  75. package/dist/contexts/LicenseContext.js +8 -6
  76. package/dist/contexts/PagesRotateContext.js +5 -6
  77. package/dist/contexts/PaginationContext.js +5 -6
  78. package/dist/contexts/PrintContext.js +16 -17
  79. package/dist/contexts/RPDocumentContext.js +13 -14
  80. package/dist/contexts/RenderQueueProvider.js +5 -6
  81. package/dist/contexts/RotationContext.js +8 -9
  82. package/dist/contexts/SearchContext.js +5 -8
  83. package/dist/contexts/ThumbnailsContext.js +4 -5
  84. package/dist/contexts/ZoomContext.js +5 -6
  85. package/dist/main.js +9 -9
  86. package/dist/types/components/layout/sidebar/Thumbnail.d.ts +2 -2
  87. package/dist/types/contexts/LayoutDropFileZoneContext.d.ts +9 -0
  88. package/dist/types/contexts/RPDocumentContext.d.ts +1 -1
  89. package/dist/types/contexts/RenderQueueProvider.d.ts +1 -1
  90. package/dist/types/contexts/RenderedPagesCache.d.ts +2 -2
  91. package/dist/types/main.d.ts +1 -1
  92. package/dist/types/utils/annotations.d.ts +2 -2
  93. package/dist/types/utils/getThumbnailViewport.d.ts +2 -2
  94. package/dist/types/utils/highlight.d.ts +5 -5
  95. package/dist/types/utils/hooks/useDropFileZone.d.ts +5 -0
  96. package/dist/types/utils/hooks/useFlickerSelectText.d.ts +1 -0
  97. package/dist/types/utils/hooks/useHighlight.d.ts +1 -1
  98. package/dist/types/utils/hooks/useLoadPdf.d.ts +2 -2
  99. package/dist/types/utils/hooks/useLoadWorker.d.ts +1 -5
  100. package/dist/types/utils/hooks/usePdfProperties.d.ts +1 -1
  101. package/dist/types/utils/hooks/useTextSelection.d.ts +3 -12
  102. package/dist/types/utils/link_service.d.ts +3 -2
  103. package/dist/types/utils/renderPage.d.ts +2 -2
  104. package/dist/types/utils/types.d.ts +10 -6
  105. package/dist/utils/highlight.js +158 -184
  106. package/dist/utils/hooks/useCopyText.js +22 -60
  107. package/dist/utils/hooks/useDropFileZone.js +12 -0
  108. package/dist/utils/hooks/useFileDownload.js +5 -6
  109. package/dist/utils/hooks/useFlickerSelectText.js +25 -0
  110. package/dist/utils/hooks/useHighlight.js +33 -35
  111. package/dist/utils/hooks/useLicense.js +22 -28
  112. package/dist/utils/hooks/useLoadPdf.js +70 -95
  113. package/dist/utils/hooks/useLoadWorker.js +14 -4
  114. package/dist/utils/hooks/usePageRotateContext.js +7 -8
  115. package/dist/utils/hooks/usePaginate.js +3 -4
  116. package/dist/utils/hooks/usePinch.js +10 -11
  117. package/dist/utils/hooks/usePresentPage.js +3 -4
  118. package/dist/utils/hooks/usePrint.js +55 -54
  119. package/dist/utils/hooks/useRotate.js +3 -4
  120. package/dist/utils/hooks/useScrollToPage.js +3 -4
  121. package/dist/utils/hooks/useSearch.js +15 -18
  122. package/dist/utils/hooks/useTextSelection.js +73 -2
  123. package/dist/utils/hooks/useThumbnail.js +17 -18
  124. package/dist/utils/hooks/useVirtualReactWindow.js +3 -4
  125. package/dist/utils/hooks/useWatermark.js +8 -6
  126. package/dist/utils/link_service.js +19 -18
  127. package/dist/utils/renderPage.js +1 -1
  128. package/dist/utils/types.js +3 -3
  129. package/package.json +6 -7
  130. package/dist/RPLayout.module-7766e0b4.js +0 -14
  131. package/dist/contexts/TextSelectionContext.js +0 -191
  132. package/dist/types/contexts/TextSelectionContext.d.ts +0 -14
  133. package/dist/types/utils/geometryCache.d.ts +0 -15
  134. package/dist/types/utils/glyphHitTest.d.ts +0 -12
  135. package/dist/types/utils/selectionUtils.d.ts +0 -30
  136. package/dist/utils/geometryCache.js +0 -32
  137. package/dist/utils/glyphHitTest.js +0 -29
  138. package/dist/utils/selectionUtils.js +0 -96
package/dist/main.js CHANGED
@@ -79,24 +79,23 @@ import "./contexts/SmoothScrollContext.js";
79
79
  import "./contexts/RenderQueueProvider.js";
80
80
  import "./utils/Queue.js";
81
81
  import "./utils/renderPage.js";
82
- import "@pdf-viewer/pdfium/compat";
82
+ import "pdfjs-dist";
83
83
  import "./contexts/GlobalCurrentPage.js";
84
- import "./contexts/TextSelectionContext.js";
85
- import "./utils/glyphHitTest.js";
86
- import "./utils/selectionUtils.js";
87
- import "./utils/geometryCache.js";
88
84
  import "./contexts/LoaderContext.js";
89
85
  import "./components/icons/LoaderIcon.js";
90
86
  import "./clsx-0c6e471a.js";
91
87
  import "./contexts/ToolComponentContext.js";
92
88
  import "./contexts/IconToolContext.js";
93
89
  import "./contexts/OtherToolContext.js";
90
+ import "./utils/hooks/useFlickerSelectText.js";
94
91
  import "./assets/style.js";
95
92
  import "./libInjectCss.js";
96
93
  import "./utils/injectPrintCSS.js";
97
94
  import "./components/page/RPPage.js";
98
95
  import "./components/page/CanvasLayer.js";
99
96
  import "./components/page/TextLayer.js";
97
+ import "./utils/highlight.js";
98
+ import "./utils/charators.js";
100
99
  import "./components/page/AnnotationLayer.js";
101
100
  import "./utils/link_service.js";
102
101
  import "./utils/annotations.js";
@@ -105,8 +104,6 @@ import "./utils/dateFormatter.js";
105
104
  import "./components/page/TextHighlightLayer.js";
106
105
  import "./components/page/searchHighlight.js";
107
106
  import "./utils/const.js";
108
- import "./utils/highlight.js";
109
- import "./utils/charators.js";
110
107
  import "./components/page/CustomElement.js";
111
108
  import "./utils/withRef.js";
112
109
  import "./utils/hooks/useVirtualReactWindow.js";
@@ -121,12 +118,14 @@ import "./utils/hooks/useDebounce.js";
121
118
  import "./components/ui/PasswordModal.js";
122
119
  import "./utils/hooks/usePresentPage.js";
123
120
  import "./components/layout/LayoutContainer.js";
124
- import "./RPLayout.module-7766e0b4.js";
121
+ import "./RPLayout.module-b4b23e29.js";
125
122
  import "./contexts/ThemeContext.js";
126
123
  import "./components/layout/LayoutWrapper.js";
127
124
  import "./utils/hooks/useCopyText.js";
125
+ import "./utils/hooks/useTextSelection.js";
128
126
  import "./utils/approximateFragtion.js";
129
127
  import "./contexts/ConfigContext.js";
128
+ import "./utils/hooks/useLoadWorker.js";
130
129
  import "./components/layout/toolbar/RPToolbar.js";
131
130
  import "./RPToolbar.module-27d7fe77.js";
132
131
  import "./components/layout/toolbar/Paginate.js";
@@ -203,6 +202,8 @@ import "./components/layout/WrapperLayout.js";
203
202
  import "./components/RPDropFileZone.js";
204
203
  import "./components/icons/LightPdfIcon.js";
205
204
  import "./components/icons/DarkPdfIcon.js";
205
+ import "./utils/hooks/useDropFileZone.js";
206
+ import "./contexts/LayoutDropFileZoneContext.js";
206
207
  import "./components/layout/SkipLink.js";
207
208
  import "./components/layout/toolbar/ToolbarLayout.js";
208
209
  import "./components/layout/toolbar/ToolbarDefault.js";
@@ -212,7 +213,6 @@ import "./utils/hooks/useDarkMode.js";
212
213
  import "./utils/smoothScrollTo.js";
213
214
  import "./utils/getScrollDistance.js";
214
215
  import "./utils/hooks/useLoadPdf.js";
215
- import "@pdf-viewer/pdfium";
216
216
  import "./utils/hooks/usePdfProperties.js";
217
217
  import "./utils/convertPdfDate.js";
218
218
  import "./utils/formatFileSize.js";
@@ -1,10 +1,10 @@
1
1
  import { FC } from 'react';
2
- import { Viewport } from '@pdf-viewer/pdfium/compat';
2
+ import { PageViewport } from 'pdfjs-dist/types/web/interfaces';
3
3
  interface Props {
4
4
  pageNumber: number;
5
5
  loading: boolean;
6
6
  isFocused: boolean;
7
- viewport: Viewport;
7
+ viewport: PageViewport;
8
8
  defaultRotation: number;
9
9
  }
10
10
  export declare const Thumbnail: FC<Props>;
@@ -0,0 +1,9 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ interface LayoutDropFileZoneProviderProps extends PropsWithChildren {
3
+ value: LayoutDropFileZoneValue;
4
+ }
5
+ type LayoutDropFileZoneValue = boolean | React.ReactNode | React.ComponentType;
6
+ export declare const LayoutDropFileZoneContext: import('react').Context<LayoutDropFileZoneValue>;
7
+ export declare const useLayoutDropFileZoneContext: () => LayoutDropFileZoneValue;
8
+ export declare const LayoutDropFileZoneProvider: FC<LayoutDropFileZoneProviderProps>;
9
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
2
  import { DocumentContextType, RPSrc, CharacterMap, LoadPDFOptions } from '../utils/types';
3
- import { PDFDocumentProxy } from '@pdf-viewer/pdfium/compat';
3
+ import { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api';
4
4
  declare const DocumentContext: React.Context<DocumentContextType>;
5
5
  interface Props extends PropsWithChildren, LoadPDFOptions {
6
6
  src?: RPSrc;
@@ -1,6 +1,6 @@
1
1
  import { Queue } from '../utils/Queue';
2
2
  import { FC } from 'react';
3
- import { PDFPageProxy } from '@pdf-viewer/pdfium/compat';
3
+ import { PDFPageProxy } from 'pdfjs-dist';
4
4
  import { RenderOptions } from '../utils/types';
5
5
  interface RenderData {
6
6
  page: PDFPageProxy;
@@ -1,7 +1,7 @@
1
- import { Viewport } from '@pdf-viewer/pdfium/compat';
1
+ import { PageViewport } from 'pdfjs-dist';
2
2
  import { FC, PropsWithChildren } from 'react';
3
3
  interface CacheContext {
4
- viewports: Map<number, Viewport>;
4
+ viewports: Map<number, PageViewport>;
5
5
  pages: Map<number, any>;
6
6
  }
7
7
  export declare const RenderedPagesCacheContext: import('react').Context<CacheContext>;
@@ -21,7 +21,7 @@ export { useHighlightContext } from './contexts/HighlightContext';
21
21
  export { useFullScreenContext } from './contexts/FullScreenContext';
22
22
  export { usePageRotateContext } from './utils/hooks/usePageRotateContext';
23
23
  export { useElementPageContext } from './contexts/ElementPageContext';
24
- export { type PDFDocumentProxy } from '@pdf-viewer/pdfium/compat';
24
+ export { type PDFDocumentProxy } from 'pdfjs-dist';
25
25
  export { SearchTool } from './components/layout/toolbar/SearchTool';
26
26
  export { ThemeSwitcherTool } from './components/layout/toolbar/tools/ThemeSwitcherTool';
27
27
  export { ThumbnailTool } from './components/layout/toolbar/tools/ThumbnailTool';
@@ -1,10 +1,10 @@
1
- import { Viewport, PDFDocumentProxy } from '@pdf-viewer/pdfium/compat';
1
+ import { PageViewport, PDFDocumentProxy } from 'pdfjs-dist';
2
2
  import { Annotation, AnnotationEventPayload } from './types';
3
3
  export declare const insertDateText: (annotationLayer: HTMLDivElement | null) => void;
4
4
  export declare function bindLayerEvents(annotatedLayer: HTMLDivElement, handler: (event: Event) => void): void;
5
5
  export declare function unbindLayerEvents(annotatedLayer: HTMLDivElement, handler: (event: Event) => void): void;
6
6
  export declare function handleAnnotationLink(annotation: Annotation): void;
7
- export declare function handleAnnotationWidget(annotation: Annotation, viewport: Viewport, canvasMap: Map<string, HTMLCanvasElement>): void;
7
+ export declare function handleAnnotationWidget(annotation: Annotation, viewport: PageViewport, canvasMap: Map<string, HTMLCanvasElement>): void;
8
8
  /**
9
9
  * Fixes tabindex values greater than 0 in annotation layer elements
10
10
  * WCAG 2.1 requires tabindex to be 0, -1, or not set (for natural tab order)
@@ -1,5 +1,5 @@
1
- import { PDFPageProxy } from '@pdf-viewer/pdfium/compat';
1
+ import { PDFPageProxy } from 'pdfjs-dist/types/web/interfaces';
2
2
  export declare const getThumbnailViewport: (page: PDFPageProxy, rotation?: number) => {
3
3
  scale: number;
4
- thumbnailViewport: import('@pdf-viewer/pdfium/compat').Viewport;
4
+ thumbnailViewport: import('pdfjs-dist/types/src/display/display_utils').PageViewport;
5
5
  };
@@ -1,14 +1,14 @@
1
- import { TextContentCompat } from '@pdf-viewer/pdfium/compat';
1
+ import { TextContent } from 'pdfjs-dist/types/src/display/text_layer';
2
2
  import { SearchOptions, Match, MatchHighlight } from './types';
3
- export declare function findMatches(queries: (string | RegExp)[], textContent: TextContentCompat, pageIndex: number, options: SearchOptions): Match[];
3
+ export declare function findMatches(queries: (string | RegExp)[], textContent: TextContent, pageIndex: number, options: SearchOptions): Match[];
4
4
  export declare function isMatchEntireWord(content: string, startIdx: number, length: number): boolean;
5
- export declare function highlightMatches(matches: Match[], textContent: TextContentCompat, textDivs: HTMLElement[]): {
5
+ export declare function highlightMatches(matches: Match[], textContent: TextContent, textDivs: HTMLElement[]): {
6
6
  element: HTMLElement;
7
7
  index: number;
8
8
  }[];
9
- export declare function resetDivs(textContent: TextContentCompat, textDivs: HTMLElement[]): void;
9
+ export declare function resetDivs(textContent: TextContent, textDivs: HTMLElement[]): void;
10
10
  export declare function getHighlightOptionsWithDefaults(options?: SearchOptions): SearchOptions;
11
- export declare function highlightMultipleColorMatches(matches: MatchHighlight[], textContent: TextContentCompat, textDivs: HTMLElement[]): {
11
+ export declare function highlightMultipleColorMatches(matches: MatchHighlight[], textContent: TextContent, textDivs: HTMLElement[]): {
12
12
  element: HTMLElement;
13
13
  index: number;
14
14
  }[];
@@ -0,0 +1,5 @@
1
+ export declare const useDropFileZone: () => {
2
+ DropFileZoneLayout: import('react').ReactNode | import('react').ComponentType<{}>;
3
+ DropFileZoneTool: import('react').ReactNode | import('react').ComponentType<{}>;
4
+ DropFileZoneToolbar: import('react').ReactNode | import('react').ComponentType<{}>;
5
+ };
@@ -0,0 +1 @@
1
+ export declare const useFlickerSelectText: () => void;
@@ -1,4 +1,4 @@
1
- import { PDFDocumentProxy } from '@pdf-viewer/pdfium/compat';
1
+ import { PDFDocumentProxy } from 'pdfjs-dist';
2
2
  import { MatchHighlight, TextHighlight } from '../types';
3
3
  interface UseHighlight {
4
4
  highlight: (value: TextHighlight[]) => Promise<void>;
@@ -1,6 +1,6 @@
1
- import { PDFDocumentProxy } from '@pdf-viewer/pdfium/compat';
1
+ import { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api.js';
2
2
  import { PdfPage, RPSrc, CharacterMap, LoadPDFOptions, ErrorType } from '../types';
3
- export declare const useLoadPdf: (src?: RPSrc, _characterMap?: CharacterMap, options?: LoadPDFOptions) => {
3
+ export declare const useLoadPdf: (src?: RPSrc, characterMap?: CharacterMap, options?: LoadPDFOptions) => {
4
4
  pdf: PDFDocumentProxy | undefined;
5
5
  pages: Map<number, PdfPage>;
6
6
  loading: boolean;
@@ -1,7 +1,3 @@
1
- /**
2
- * @deprecated No longer needed — PDFium uses WASM directly without a web worker.
3
- * Kept for backward compatibility in case external code references it.
4
- */
5
- export declare const useLoadWorker: (_workerUrl?: string) => {
1
+ export declare const useLoadWorker: (workerUrl?: string) => {
6
2
  workerUrlAdded: boolean;
7
3
  };
@@ -1,4 +1,4 @@
1
- import { PDFDocumentProxy } from '@pdf-viewer/pdfium/compat';
1
+ import { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api';
2
2
  import { PdfProperties, PDFSrc } from '../types';
3
3
  type CMapSource = {
4
4
  url: string;
@@ -1,16 +1,7 @@
1
- /**
2
- * Legacy hook — selection logic has moved to TextSelectionContext.
3
- *
4
- * This file is kept so existing call sites compile without changes.
5
- * The TextSelectionProvider (in contexts/TextSelectionContext.tsx) now
6
- * manages all pointer-event-based text selection via glyph hit-testing
7
- * and fires `onTextSelect` through EventCallbackContext.
8
- *
9
- * This hook is intentionally a no-op. Remove the call site when convenient.
10
- */
1
+ import { TextSelectionData } from '../types';
11
2
  interface UseTextSelectionOptions {
12
- onTextSelect?: ((selection: unknown) => void) | undefined;
3
+ onTextSelect?: (selection: TextSelectionData | null) => void;
13
4
  pagesRef: HTMLElement | null;
14
5
  }
15
- export declare const useTextSelection: (_options: UseTextSelectionOptions) => void;
6
+ export declare const useTextSelection: ({ onTextSelect, pagesRef }: UseTextSelectionOptions) => void;
16
7
  export {};
@@ -1,5 +1,6 @@
1
- import { PDFDocumentProxy, LinkService } from '@pdf-viewer/pdfium/compat';
2
- declare class SimpleLinkService implements LinkService {
1
+ import { PDFDocumentProxy } from 'pdfjs-dist';
2
+ import { IPDFLinkService } from 'pdfjs-dist/types/web/interfaces';
3
+ declare class SimpleLinkService implements IPDFLinkService {
3
4
  externalLinkEnabled: boolean;
4
5
  pdfDocument: PDFDocumentProxy | undefined;
5
6
  constructor(pdfDocument: PDFDocumentProxy, goToPage: (page: number) => void);
@@ -1,3 +1,3 @@
1
- import { PDFPageProxy, RenderTask } from '@pdf-viewer/pdfium/compat';
1
+ import { PDFPageProxy } from 'pdfjs-dist/types/web/interfaces';
2
2
  import { RenderOptions } from './types';
3
- export declare const renderPage: (page: PDFPageProxy, canvasElem: HTMLCanvasElement, options?: RenderOptions) => RenderTask;
3
+ export declare const renderPage: (page: PDFPageProxy, canvasElem: HTMLCanvasElement, options?: RenderOptions) => import('pdfjs-dist/types/src/display/api').RenderTask;
@@ -1,4 +1,6 @@
1
- import { PDFDocumentProxy, PDFPageProxy, Viewport } from '@pdf-viewer/pdfium/compat';
1
+ import { PDFPageProxy } from 'pdfjs-dist';
2
+ import { DocumentInitParameters, PDFDataRangeTransport, PDFDocumentProxy, TypedArray } from 'pdfjs-dist/types/src/display/api';
3
+ import { PageViewport } from 'pdfjs-dist/types/web/interfaces';
2
4
  import { Dispatch, FC, PropsWithChildren, SetStateAction } from 'react';
3
5
  export interface DocumentContextType {
4
6
  pdf?: PDFDocumentProxy;
@@ -239,7 +241,8 @@ export interface License {
239
241
  export declare enum LicenseType {
240
242
  Organization = "organization",
241
243
  Developer = "developer",
242
- FreeTrial = "free-trial"
244
+ FreeTrial = "free-trial",
245
+ Custom = "custom"
243
246
  }
244
247
  export type DecryptedLicense = {
245
248
  exp: number;
@@ -251,7 +254,7 @@ export type DecryptedLicense = {
251
254
  };
252
255
  export interface PdfPage {
253
256
  page: PDFPageProxy;
254
- thumbnailViewport: Viewport;
257
+ thumbnailViewport: PageViewport;
255
258
  thumbnailScale: number;
256
259
  defaultRotation: number;
257
260
  }
@@ -288,7 +291,7 @@ export interface ThumbnailRenderedList {
288
291
  loading: boolean;
289
292
  page: PDFPageProxy;
290
293
  thumbnailSrc?: string;
291
- viewport: Viewport;
294
+ viewport: PageViewport;
292
295
  scale: number;
293
296
  defaultRotation: number;
294
297
  }
@@ -297,8 +300,8 @@ export declare enum ViewMode {
297
300
  DUAL_PAGE = "Dual",
298
301
  DUAL_PAGE_WITH_COVER = "DualWithCover"
299
302
  }
300
- export type PDFSrc = string | URL | ArrayBuffer | Uint8Array | undefined | null;
301
- export type RPSrc = PDFSrc;
303
+ export type PDFSrc = string | URL | TypedArray | PDFDataRangeTransport | DocumentInitParameters | undefined | null;
304
+ export type RPSrc = Omit<PDFSrc, 'DocumentInitParameters' | 'PDFDataRangeTransport'>;
302
305
  export interface FullScreenToolProps {
303
306
  isFullScreen: boolean;
304
307
  toggleFullScreen: () => void;
@@ -520,6 +523,7 @@ export interface RPDefaultLayoutProps extends PropsWithChildren, ViewportProps {
520
523
  cleanupOnLoaded?: () => void;
521
524
  }
522
525
  export interface RPLayoutProps extends PropsWithChildren, ViewportProps {
526
+ dropFileZone?: boolean | React.ReactNode | React.ComponentType;
523
527
  toolbar?: boolean | Partial<ToolbarProps>;
524
528
  style?: React.CSSProperties;
525
529
  className?: string;