Skip to content

Commit 35b5e36

Browse files
committed
feat: add ROTATION_DEGREES constant for valid PDF page rotations
1 parent 51089ea commit 35b5e36

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/constants.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,9 @@ const PDF_PASSWORD_FORM_RESPONSES = {
3333
INCORRECT_PASSWORD: 2,
3434
};
3535

36-
export {PAGE_BORDER, LARGE_SCREEN_SIDE_SPACING, DEFAULT_DOCUMENT_OPTIONS, DEFAULT_EXTERNAL_LINK_TARGET, PDF_PASSWORD_FORM_RESPONSES};
36+
/**
37+
* Valid rotation angles for PDF pages, in degrees clockwise.
38+
*/
39+
const ROTATION_DEGREES = [0, 90, 180, 270] as const;
40+
41+
export {PAGE_BORDER, LARGE_SCREEN_SIDE_SPACING, DEFAULT_DOCUMENT_OPTIONS, DEFAULT_EXTERNAL_LINK_TARGET, PDF_PASSWORD_FORM_RESPONSES, ROTATION_DEGREES};

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import PDFPreviewer from './PDFPreviewer.js';
2+
import {ROTATION_DEGREES} from './constants.js';
23
import type {RotationDegrees} from './types.js';
34

45
const PACKAGE_NAME = 'react-fast-pdf';
56

6-
export {PDFPreviewer};
7+
export {PDFPreviewer, ROTATION_DEGREES};
78
export type {RotationDegrees};
89

910
export default {

0 commit comments

Comments
 (0)