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

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 (170) hide show
  1. package/dist/{Combination-479e39c6.js → Combination-136ff99c.js} +184 -187
  2. package/dist/RPLayout.module-b4b23e29.js +14 -0
  3. package/dist/assets/style.css +1 -1
  4. package/dist/assets/style.js +15 -15
  5. package/dist/components/RPConfig.js +16 -6
  6. package/dist/components/RPController.js +21 -26
  7. package/dist/components/RPDropFileZone.js +35 -29
  8. package/dist/components/RPPages.js +351 -360
  9. package/dist/components/RPProvider.js +20 -24
  10. package/dist/components/layout/LayoutContainer.js +1 -1
  11. package/dist/components/layout/LayoutWrapper.js +1 -1
  12. package/dist/components/layout/RPDefaultLayout.js +12 -13
  13. package/dist/components/layout/RPLayout.js +28 -28
  14. package/dist/components/layout/WrapperLayout.js +10 -11
  15. package/dist/components/layout/sidebar/RPSidebar.js +7 -8
  16. package/dist/components/layout/sidebar/Thumbnail.js +3 -4
  17. package/dist/components/layout/sidebar/Thumbnails.js +3 -4
  18. package/dist/components/layout/toolbar/DarkModeTool.js +4 -4
  19. package/dist/components/layout/toolbar/DocumentDialog.js +8 -9
  20. package/dist/components/layout/toolbar/DocumentProperties.js +6 -6
  21. package/dist/components/layout/toolbar/FileDownloadTool.js +9 -10
  22. package/dist/components/layout/toolbar/FileUploadTool.js +9 -10
  23. package/dist/components/layout/toolbar/FullScreenTool.js +6 -6
  24. package/dist/components/layout/toolbar/MenuItem.js +6 -6
  25. package/dist/components/layout/toolbar/MenuSeparator.js +6 -6
  26. package/dist/components/layout/toolbar/MostPageTool.js +9 -10
  27. package/dist/components/layout/toolbar/OtherTool.js +9 -10
  28. package/dist/components/layout/toolbar/Paginate.js +7 -8
  29. package/dist/components/layout/toolbar/PrintTool.js +9 -10
  30. package/dist/components/layout/toolbar/RPMenuItem.js +6 -6
  31. package/dist/components/layout/toolbar/RPMoreOptions.js +9 -10
  32. package/dist/components/layout/toolbar/RPToolbar.js +9 -12
  33. package/dist/components/layout/toolbar/RPToolbarEnd.js +9 -10
  34. package/dist/components/layout/toolbar/RotateTool.js +9 -10
  35. package/dist/components/layout/toolbar/ScrollModeTool.js +6 -6
  36. package/dist/components/layout/toolbar/SearchCloseButton.js +4 -4
  37. package/dist/components/layout/toolbar/SearchResultNavigator.js +7 -10
  38. package/dist/components/layout/toolbar/SearchTool.js +11 -14
  39. package/dist/components/layout/toolbar/SelectionModeTool.js +6 -6
  40. package/dist/components/layout/toolbar/ThumbnailTool.js +7 -8
  41. package/dist/components/layout/toolbar/ToolbarCustom.js +3 -4
  42. package/dist/components/layout/toolbar/ToolbarDefault.js +9 -12
  43. package/dist/components/layout/toolbar/ToolbarLayout.js +9 -12
  44. package/dist/components/layout/toolbar/ViewModeTool.js +6 -6
  45. package/dist/components/layout/toolbar/ZoomTool.js +9 -10
  46. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +8 -9
  47. package/dist/components/layout/toolbar/tools/DualPageTool.js +4 -4
  48. package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +13 -15
  49. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +7 -8
  50. package/dist/components/layout/toolbar/tools/FileUploadTool.js +7 -8
  51. package/dist/components/layout/toolbar/tools/FirstPageTool.js +13 -15
  52. package/dist/components/layout/toolbar/tools/FullScreenTool.js +4 -4
  53. package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +4 -4
  54. package/dist/components/layout/toolbar/tools/InputPageTool.js +7 -8
  55. package/dist/components/layout/toolbar/tools/LastPageTool.js +13 -15
  56. package/dist/components/layout/toolbar/tools/NextPageTool.js +7 -8
  57. package/dist/components/layout/toolbar/tools/PageScrollingTool.js +4 -4
  58. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +7 -8
  59. package/dist/components/layout/toolbar/tools/PrintTool.js +7 -8
  60. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +7 -8
  61. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +7 -8
  62. package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +4 -4
  63. package/dist/components/layout/toolbar/tools/SinglePageTool.js +4 -4
  64. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +4 -4
  65. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +7 -8
  66. package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +4 -4
  67. package/dist/components/layout/toolbar/tools/ZoomInTool.js +7 -8
  68. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +19 -20
  69. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +7 -8
  70. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +9 -12
  71. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +7 -8
  72. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +6 -6
  73. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +9 -10
  74. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +9 -10
  75. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +6 -6
  76. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +9 -10
  77. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +9 -10
  78. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +9 -10
  79. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +6 -6
  80. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +6 -6
  81. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +6 -6
  82. package/dist/components/page/AnnotationLayer.js +65 -66
  83. package/dist/components/page/CanvasLayer.js +3 -4
  84. package/dist/components/page/CustomElement.js +3 -4
  85. package/dist/components/page/DualPage.js +5 -11
  86. package/dist/components/page/DualPageWithCover.js +5 -11
  87. package/dist/components/page/RPPage.js +6 -12
  88. package/dist/components/page/SinglePage.js +5 -11
  89. package/dist/components/page/TextHighlightLayer.js +178 -86
  90. package/dist/components/page/TextLayer.js +170 -125
  91. package/dist/components/ui/Checkbox.js +2 -2
  92. package/dist/components/ui/DropDown.js +6 -6
  93. package/dist/components/ui/LoadingIndicator.js +7 -8
  94. package/dist/components/ui/RPTooltip.js +411 -197
  95. package/dist/contexts/ConfigContext.js +5 -4
  96. package/dist/contexts/DimensionPagesContext.js +5 -6
  97. package/dist/contexts/DropFileZoneContext.js +4 -5
  98. package/dist/contexts/ElementPageContext.js +5 -6
  99. package/dist/contexts/FileInputContext.js +5 -6
  100. package/dist/contexts/HighlightContext.js +7 -10
  101. package/dist/contexts/LayoutDropFileZoneContext.js +11 -0
  102. package/dist/contexts/PagesRotateContext.js +5 -6
  103. package/dist/contexts/PaginationContext.js +5 -6
  104. package/dist/contexts/PrintContext.js +16 -17
  105. package/dist/contexts/RPDocumentContext.js +13 -14
  106. package/dist/contexts/RenderQueueProvider.js +5 -6
  107. package/dist/contexts/RotationContext.js +8 -9
  108. package/dist/contexts/SearchContext.js +5 -8
  109. package/dist/contexts/ThumbnailsContext.js +4 -5
  110. package/dist/contexts/ZoomContext.js +5 -6
  111. package/dist/floating-ui.react-dom-5ec29bd6.js +1327 -0
  112. package/dist/index-61f59539.js +1198 -0
  113. package/dist/{index-ada501c4.js → index-655864a7.js} +1 -1
  114. package/dist/{index-113053cf.js → index-c0faa594.js} +2 -2
  115. package/dist/{index-23911b43.js → index-e3ee9457.js} +6 -6
  116. package/dist/main.js +15 -15
  117. package/dist/polyfills.js +8055 -0
  118. package/dist/types/components/layout/sidebar/Thumbnail.d.ts +2 -2
  119. package/dist/types/contexts/LayoutDropFileZoneContext.d.ts +9 -0
  120. package/dist/types/contexts/RPDocumentContext.d.ts +1 -1
  121. package/dist/types/contexts/RenderQueueProvider.d.ts +1 -1
  122. package/dist/types/contexts/RenderedPagesCache.d.ts +2 -2
  123. package/dist/types/main.d.ts +1 -1
  124. package/dist/types/utils/annotations.d.ts +2 -2
  125. package/dist/types/utils/getThumbnailViewport.d.ts +2 -2
  126. package/dist/types/utils/highlight.d.ts +5 -5
  127. package/dist/types/utils/hooks/useDropFileZone.d.ts +5 -0
  128. package/dist/types/utils/hooks/useFlickerSelectText.d.ts +1 -0
  129. package/dist/types/utils/hooks/useHighlight.d.ts +1 -1
  130. package/dist/types/utils/hooks/useLoadPdf.d.ts +2 -2
  131. package/dist/types/utils/hooks/useLoadWorker.d.ts +1 -5
  132. package/dist/types/utils/hooks/usePdfProperties.d.ts +1 -1
  133. package/dist/types/utils/hooks/useTextSelection.d.ts +3 -12
  134. package/dist/types/utils/link_service.d.ts +3 -2
  135. package/dist/types/utils/renderPage.d.ts +2 -2
  136. package/dist/types/utils/types.d.ts +8 -5
  137. package/dist/utils/highlight.js +158 -184
  138. package/dist/utils/hooks/useCopyText.js +22 -60
  139. package/dist/utils/hooks/useDropFileZone.js +12 -0
  140. package/dist/utils/hooks/useFileDownload.js +5 -6
  141. package/dist/utils/hooks/useFlickerSelectText.js +25 -0
  142. package/dist/utils/hooks/useHighlight.js +33 -35
  143. package/dist/utils/hooks/useLicense.js +1 -1
  144. package/dist/utils/hooks/useLoadPdf.js +70 -95
  145. package/dist/utils/hooks/useLoadWorker.js +14 -4
  146. package/dist/utils/hooks/usePageRotateContext.js +7 -8
  147. package/dist/utils/hooks/usePaginate.js +3 -4
  148. package/dist/utils/hooks/usePinch.js +10 -11
  149. package/dist/utils/hooks/usePresentPage.js +3 -4
  150. package/dist/utils/hooks/usePrint.js +55 -54
  151. package/dist/utils/hooks/useRotate.js +3 -4
  152. package/dist/utils/hooks/useScrollToPage.js +3 -4
  153. package/dist/utils/hooks/useSearch.js +15 -18
  154. package/dist/utils/hooks/useTextSelection.js +73 -2
  155. package/dist/utils/hooks/useThumbnail.js +17 -18
  156. package/dist/utils/hooks/useVirtualReactWindow.js +3 -4
  157. package/dist/utils/link_service.js +19 -18
  158. package/dist/utils/renderPage.js +1 -1
  159. package/package.json +13 -4
  160. package/dist/RPLayout.module-7766e0b4.js +0 -14
  161. package/dist/contexts/TextSelectionContext.js +0 -191
  162. package/dist/index-535ad364.js +0 -983
  163. package/dist/index-d0f0aa9a.js +0 -1542
  164. package/dist/types/contexts/TextSelectionContext.d.ts +0 -14
  165. package/dist/types/utils/geometryCache.d.ts +0 -15
  166. package/dist/types/utils/glyphHitTest.d.ts +0 -12
  167. package/dist/types/utils/selectionUtils.d.ts +0 -30
  168. package/dist/utils/geometryCache.js +0 -32
  169. package/dist/utils/glyphHitTest.js +0 -29
  170. package/dist/utils/selectionUtils.js +0 -96
@@ -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;
@@ -251,7 +253,7 @@ export type DecryptedLicense = {
251
253
  };
252
254
  export interface PdfPage {
253
255
  page: PDFPageProxy;
254
- thumbnailViewport: Viewport;
256
+ thumbnailViewport: PageViewport;
255
257
  thumbnailScale: number;
256
258
  defaultRotation: number;
257
259
  }
@@ -288,7 +290,7 @@ export interface ThumbnailRenderedList {
288
290
  loading: boolean;
289
291
  page: PDFPageProxy;
290
292
  thumbnailSrc?: string;
291
- viewport: Viewport;
293
+ viewport: PageViewport;
292
294
  scale: number;
293
295
  defaultRotation: number;
294
296
  }
@@ -297,8 +299,8 @@ export declare enum ViewMode {
297
299
  DUAL_PAGE = "Dual",
298
300
  DUAL_PAGE_WITH_COVER = "DualWithCover"
299
301
  }
300
- export type PDFSrc = string | URL | ArrayBuffer | Uint8Array | undefined | null;
301
- export type RPSrc = PDFSrc;
302
+ export type PDFSrc = string | URL | TypedArray | PDFDataRangeTransport | DocumentInitParameters | undefined | null;
303
+ export type RPSrc = Omit<PDFSrc, 'DocumentInitParameters' | 'PDFDataRangeTransport'>;
302
304
  export interface FullScreenToolProps {
303
305
  isFullScreen: boolean;
304
306
  toggleFullScreen: () => void;
@@ -520,6 +522,7 @@ export interface RPDefaultLayoutProps extends PropsWithChildren, ViewportProps {
520
522
  cleanupOnLoaded?: () => void;
521
523
  }
522
524
  export interface RPLayoutProps extends PropsWithChildren, ViewportProps {
525
+ dropFileZone?: boolean | React.ReactNode | React.ComponentType;
523
526
  toolbar?: boolean | Partial<ToolbarProps>;
524
527
  style?: React.CSSProperties;
525
528
  className?: string;