Skip to main content

@paprize/react

PageInfo

Defined in: react/src/internal/eventHelper.ts:9

Context information for a paginated page.

Properties

PropertyTypeDescription
pageIndexnumberIndex of this page within its section.
totalPagesnumberTotal number of pages in the section that contains this page.

ReportInfo

Defined in: react/src/internal/eventHelper.ts:50

Context information for pagination cycle.

Properties

PropertyTypeDescription
sectionsSectionInfo[]All paginated section within the report.

SectionInfo

Defined in: react/src/internal/eventHelper.ts:23

Context information for a paginated section.

Properties

PropertyTypeDescription
isPaginatedbooleanIndicates whether pagination for this section has completed.
isSuspendedbooleanIndicates whether pagination for this section is suspended and waiting for the suspension to be resolved.
pagesPageInfo[]All paginated pages that belong to this section.
sectionIdstringUnique identifier of the section.
sectionIndexnumberIndex of the section within the report.

SectionProps

Defined in: react/src/components/Section.tsx:15

Configuration options for a section.

Extends

  • Omit<{ hyphen?: string; hyphenationDisabled?: boolean; id: string; keepOnSamePage?: boolean; margin?: PageMargin; orientation?: "portrait" | "landscape"; plugins?: PaginationPlugin[]; size: PageSize; suspense?: Promise<unknown>[]; }, "id" | "suspense">

Properties

PropertyTypeDefault valueDescription
hyphen?string"-"Specifies the character used for hyphenation when a word is broken across lines.
hyphenationDisabled?booleanfalseDisables automatic word hyphenation. When disabled, if a word (a sequence of text without whitespace) does not fit on the current page, it will move to the next page instead of being split with a hyphen character.
id?stringundefinedUnique id of the section within the report. If not set, a random id will be used.
keepOnSamePage?booleanfalsePrevents an element from being split across pages. If an element does not fit in the available space on the current page, it will be moved entirely to the next page. If it still does not fit on an empty page, it will be skipped and not rendered.
margin?PageMarginundefinedPage margins for this section.
orientation?"portrait" | "landscape"undefinedPage orientation used for this section. Default portrait
plugins?PaginationPlugin[]undefinedList of plugins to use during pagination.
sizePageSizeundefinedPage size used for this section.

SectionSuspension

Defined in: react/src/components/useSectionSuspension.ts:8

Controls the section suspension.

Properties

PropertyTypeDescription
release() => voidReleases the suspension. The pagination engine will paginate this section immediately.
reset() => voidMarks the suspension as pending again if it was previously resolved. During the next pagination cycle (for example, if pagination is retriggered by changes to the page content), this section will not be paginated until release is called again.

usePageInfo()

usePageInfo(): PageInfo

Defined in: react/src/components/usePageInfo.ts:8

React hook that returns information about the current page.

Returns

PageInfo


useReportInfo()

useReportInfo(): ReportInfo

Defined in: react/src/components/useReportInfo.ts:12

React hook that returns information about the report.

Returns

ReportInfo


useSectionInfo()

useSectionInfo(): SectionInfo

Defined in: react/src/components/useSectionInfo.ts:10

React hook that returns information about the current section.

Returns

SectionInfo


useSectionSuspension()

Call Signature

useSectionSuspension(promise): void

Defined in: react/src/components/useSectionSuspension.ts:28

Suspends pagination for this section.

Parameters

ParameterTypeDescription
promisePromise<unknown> | Promise<void>The suspension is tied to this promise. Once the promise is resolved, the suspension is released and the pagination engine will paginate this section.

Returns

void

Call Signature

useSectionSuspension(): object

Defined in: react/src/components/useSectionSuspension.ts:35

Suspends pagination for this section. You need to call the release method of the returned value; otherwise, the pagination engine will never paginate this section.

Returns

NameTypeDescription
release()() => voidReleases the suspension. The pagination engine will paginate this section immediately.
reset()() => voidMarks the suspension as pending again if it was previously resolved. During the next pagination cycle (for example, if pagination is retriggered by changes to the page content), this section will not be paginated until release is called again.