Skip to content

Commit cd0ad68

Browse files
committed
Export component props type
1 parent e138130 commit cd0ad68

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

src/Document.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ type OnSourceError = OnError;
7171

7272
type OnSourceSuccess = () => void;
7373

74-
type DocumentProps = {
74+
export type DocumentProps = {
7575
children?: React.ReactNode;
7676
className?: ClassName;
7777
error?: NodeOrRenderer;

src/Outline.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import type { OnItemClickArgs } from './shared/types';
2222

2323
type PDFOutline = Awaited<ReturnType<PDFDocumentProxy['getOutline']>>;
2424

25-
type OutlineProps = {
25+
export type OutlineProps = {
2626
className?: string;
2727
inputRef?: React.Ref<HTMLDivElement>;
2828
onItemClick?: (props: OnItemClickArgs) => void;

src/Page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import type {
5353

5454
const defaultScale = 1;
5555

56-
type PageProps = {
56+
export type PageProps = {
5757
canvasBackground?: string;
5858
canvasRef?: React.Ref<HTMLCanvasElement>;
5959
children?: React.ReactNode;

src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ import Document from './Document';
44
import Outline from './Outline';
55
import Page from './Page';
66

7+
import type { DocumentProps } from './Document';
8+
import type { OutlineProps } from './Outline';
9+
import type { PageProps } from './Page';
10+
711
import { displayWorkerWarning } from './shared/utils';
812

913
displayWorkerWarning();
1014

1115
pdfjs.GlobalWorkerOptions.workerSrc = 'pdf.worker.js';
1216

1317
export { pdfjs, Document, Outline, Page };
18+
19+
export type { DocumentProps, OutlineProps, PageProps };

0 commit comments

Comments
 (0)