add build action config
This commit is contained in:
112
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/README.md
generated
vendored
Normal file
112
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/README.md
generated
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
<p align="center">
|
||||
<img src="https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png" height="280px">
|
||||
<p align="center">React renderer for creating PDF files on the browser and server<p>
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/@react-pdf/renderer">
|
||||
<img src="https://img.shields.io/npm/v/@react-pdf/renderer?style=flat&colorA=000000&colorB=000000" />
|
||||
</a>
|
||||
<a href="https://opencollective.com/react-pdf">
|
||||
<img src="https://img.shields.io/opencollective/all/react-pdf?style=flat&colorA=000000&colorB=000000" />
|
||||
</a>
|
||||
<a href="https://github.com/diegomura/react-pdf/blob/master/LICENSE">
|
||||
<img src="https://img.shields.io/github/license/diegomura/react-pdf?style=flat&colorA=000000&colorB=000000" />
|
||||
</a>
|
||||
<a href="https://blockchain.com/btc/address/bc1qj223udztpmt5dck46dw0yap08yum63ht56h90v">
|
||||
<img src="https://img.shields.io/badge/BTC-f5f5f5?style=flat&colorA=000000&colorB=000000" />
|
||||
</a>
|
||||
<a href="https://blockchain.com/eth/address/0x4e1DB76bA0858BbCAa4DD804418D0D9EcF77B1cC">
|
||||
<img src="https://img.shields.io/badge/ETH-f5f5f5?style=flat&colorA=000000&colorB=000000" />
|
||||
</a>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
## How to install
|
||||
|
||||
```sh
|
||||
yarn add @react-pdf/renderer
|
||||
```
|
||||
|
||||
## How it works
|
||||
|
||||
```jsx
|
||||
import React from 'react';
|
||||
import { Document, Page, Text, View, StyleSheet } from '@react-pdf/renderer';
|
||||
|
||||
// Create styles
|
||||
const styles = StyleSheet.create({
|
||||
page: {
|
||||
flexDirection: 'row',
|
||||
backgroundColor: '#E4E4E4',
|
||||
},
|
||||
section: {
|
||||
margin: 10,
|
||||
padding: 10,
|
||||
flexGrow: 1,
|
||||
},
|
||||
});
|
||||
|
||||
// Create Document Component
|
||||
const MyDocument = () => (
|
||||
<Document>
|
||||
<Page size="A4" style={styles.page}>
|
||||
<View style={styles.section}>
|
||||
<Text>Section #1</Text>
|
||||
</View>
|
||||
<View style={styles.section}>
|
||||
<Text>Section #2</Text>
|
||||
</View>
|
||||
</Page>
|
||||
</Document>
|
||||
);
|
||||
```
|
||||
|
||||
### `Web.` Render in DOM
|
||||
|
||||
```jsx
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { PDFViewer } from '@react-pdf/renderer';
|
||||
|
||||
const App = () => (
|
||||
<PDFViewer>
|
||||
<MyDocument />
|
||||
</PDFViewer>
|
||||
);
|
||||
|
||||
ReactDOM.render(<App />, document.getElementById('root'));
|
||||
```
|
||||
|
||||
### `Node.` Save in a file
|
||||
|
||||
```jsx
|
||||
import React from 'react';
|
||||
import ReactPDF from '@react-pdf/renderer';
|
||||
|
||||
ReactPDF.render(<MyDocument />, `${__dirname}/example.pdf`);
|
||||
```
|
||||
|
||||
## Contributors
|
||||
|
||||
This project exists thanks to all the people who contribute. Looking to contribute? Please check our [[contribute]](https://github.com/diegomura/react-pdf/blob/master/.github/CONTRIBUTING.md) document for more details about how to setup a development environment and submitting code.
|
||||
|
||||
<a href="https://github.com/diegomura/react-pdf/blob/master/.github/CONTRIBUTING.md"><img src="https://opencollective.com/react-pdf/contributors.svg?width=890" /></a>
|
||||
|
||||
## Sponsors
|
||||
|
||||
Thank you to all our sponsors! [[Become a sponsors](https://opencollective.com/react-pdf#sponsors)]
|
||||
|
||||
<a href="https://opencollective.com/react-pdf#sponsors" target="_blank"><img src="https://opencollective.com/react-pdf/sponsors.svg?width=890"></a>
|
||||
|
||||
## Backers
|
||||
|
||||
Thank you to all our backers! [[Become a backer](https://opencollective.com/react-pdf#backer)]
|
||||
|
||||
<a href="https://opencollective.com/react-pdf#backers" target="_blank"><img src="https://opencollective.com/react-pdf/backers.svg?width=890"></a>
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Diego Muracciole](http://github.com/diegomura)
|
||||
|
||||
---
|
||||
|
||||
[](https://www.npmjs.com/package/@react-pdf/renderer)
|
||||
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/index.d.ts
generated
vendored
Normal file
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,793 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Style,
|
||||
PageSize,
|
||||
FontStore,
|
||||
PDFVersion,
|
||||
Orientation,
|
||||
SourceObject,
|
||||
SrcSet,
|
||||
Sizes,
|
||||
HyphenationCallback,
|
||||
SVGPresentationAttributes,
|
||||
Bookmark,
|
||||
PageLayout,
|
||||
PageMode,
|
||||
HitSlop,
|
||||
} from '@react-pdf/types';
|
||||
|
||||
declare class ReactPDF {
|
||||
static default: typeof ReactPDF;
|
||||
}
|
||||
|
||||
export = ReactPDF;
|
||||
|
||||
declare namespace ReactPDF {
|
||||
interface Styles {
|
||||
[key: string]: Style;
|
||||
}
|
||||
interface OnRenderProps {
|
||||
blob?: Blob;
|
||||
}
|
||||
|
||||
interface Permissions {
|
||||
printing?: 'lowResolution' | 'highResolution';
|
||||
modifying?: boolean;
|
||||
copying?: boolean;
|
||||
annotating?: boolean;
|
||||
fillingForms?: boolean;
|
||||
contentAccessibility?: boolean;
|
||||
documentAssembly?: boolean;
|
||||
}
|
||||
|
||||
interface DocumentProps {
|
||||
style?: Style | Style[];
|
||||
title?: string;
|
||||
author?: string;
|
||||
subject?: string;
|
||||
creator?: string;
|
||||
keywords?: string;
|
||||
producer?: string;
|
||||
language?: string;
|
||||
creationDate?: Date;
|
||||
modificationDate?: Date;
|
||||
pdfVersion?: PDFVersion;
|
||||
pageMode?: PageMode;
|
||||
pageLayout?: PageLayout;
|
||||
ownerPassword?: string;
|
||||
userPassword?: string;
|
||||
permissions?: Permissions;
|
||||
onRender?: (props: OnRenderProps) => any;
|
||||
}
|
||||
|
||||
/**
|
||||
* This component represent the PDF document itself. It must be the root
|
||||
* of your tree element structure, and under no circumstances should it be
|
||||
* used as children of another react-pdf component. In addition, it should
|
||||
* only have childs of type <Page />.
|
||||
*/
|
||||
export class Document extends React.Component<
|
||||
React.PropsWithChildren<DocumentProps>
|
||||
> {}
|
||||
|
||||
interface NodeProps {
|
||||
id?: string;
|
||||
style?: Style | Style[];
|
||||
/**
|
||||
* Render component in all wrapped pages.
|
||||
* @see https://react-pdf.org/advanced#fixed-components
|
||||
*/
|
||||
fixed?: boolean;
|
||||
/**
|
||||
* Force the wrapping algorithm to start a new page when rendering the
|
||||
* element.
|
||||
* @see https://react-pdf.org/advanced#page-breaks
|
||||
*/
|
||||
break?: boolean;
|
||||
/**
|
||||
* Hint that no page wrapping should occur between all sibling elements following the element within n points
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
minPresenceAhead?: number;
|
||||
}
|
||||
|
||||
interface PageProps extends NodeProps {
|
||||
/**
|
||||
* Enable page wrapping for this page.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
size?: PageSize;
|
||||
orientation?: Orientation;
|
||||
dpi?: number;
|
||||
bookmark?: Bookmark;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents single page inside the PDF document, or a subset of them if
|
||||
* using the wrapping feature. A <Document /> can contain as many pages as
|
||||
* you want, but ensure not rendering a page inside any component besides
|
||||
* Document.
|
||||
*/
|
||||
export class Page extends React.Component<
|
||||
React.PropsWithChildren<PageProps>
|
||||
> {}
|
||||
|
||||
interface ViewProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
subPageNumber: number;
|
||||
}) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* The most fundamental component for building a UI and is designed to be
|
||||
* nested inside other views and can have 0 to many children.
|
||||
*/
|
||||
export class View extends React.Component<
|
||||
React.PropsWithChildren<ViewProps>
|
||||
> {}
|
||||
|
||||
interface BaseImageProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* Works like the HTML img sizes attribute.
|
||||
* @example 300
|
||||
* @example "300"
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
}
|
||||
|
||||
interface ImageWithSrcProp extends BaseImageProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageWithSourceProp extends BaseImageProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying network or local (Node only) JPG or
|
||||
* PNG images, as well as base64 encoded image strings.
|
||||
*/
|
||||
export class Image extends React.Component<ImageProps> {}
|
||||
|
||||
interface BaseImageBackgroundProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* @example 300
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
/**
|
||||
* Style applied to the background image.
|
||||
*/
|
||||
imageStyle?: Style;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageBackgroundProps =
|
||||
| ImageBackgroundWithSrcProp
|
||||
| ImageBackgroundWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying an image behind child content.
|
||||
* Compatible with React Native's ImageBackground component.
|
||||
* @see https://reactnative.dev/docs/imagebackground
|
||||
*/
|
||||
export class ImageBackground extends React.Component<
|
||||
React.PropsWithChildren<ImageBackgroundProps>
|
||||
> {}
|
||||
|
||||
interface TextProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
totalPages: number;
|
||||
subPageNumber: number;
|
||||
subPageTotalPages: number;
|
||||
}) => React.ReactNode;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
orphans?: number;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
widows?: number;
|
||||
}
|
||||
|
||||
interface SVGTextProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x: string | number;
|
||||
y: string | number;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying text. Text supports nesting of other
|
||||
* Text or Link components to create inline styling.
|
||||
*/
|
||||
export class Text extends React.Component<
|
||||
React.PropsWithChildren<TextProps> | SVGTextProps
|
||||
> {}
|
||||
|
||||
interface LinkProps extends NodeProps {
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
href?: string;
|
||||
src?: string;
|
||||
/**
|
||||
* Extends the clickable area of the link beyond its visible bounds.
|
||||
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
|
||||
* @see https://reactnative.dev/docs/view#hitslop
|
||||
*/
|
||||
hitSlop?: HitSlop;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying a hyperlink. Link’s can be nested
|
||||
* inside a Text component, or being inside any other valid primitive.
|
||||
*/
|
||||
export class Link extends React.Component<
|
||||
React.PropsWithChildren<LinkProps>
|
||||
> {}
|
||||
|
||||
interface FormCommonProps extends NodeProps {
|
||||
name?: string;
|
||||
required?: boolean;
|
||||
noExport?: boolean;
|
||||
readOnly?: boolean;
|
||||
value?: number | string;
|
||||
defaultValue?: number | string;
|
||||
}
|
||||
|
||||
interface FieldSetProps extends NodeProps {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class FieldSet extends React.Component<
|
||||
React.PropsWithChildren<FieldSetProps>
|
||||
> {}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputFormatting {
|
||||
type:
|
||||
| 'date'
|
||||
| 'time'
|
||||
| 'percent'
|
||||
| 'number'
|
||||
| 'zip'
|
||||
| 'zipPlus4'
|
||||
| 'phone'
|
||||
| 'ssn';
|
||||
param?: string;
|
||||
nDec?: number;
|
||||
sepComma?: boolean;
|
||||
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
|
||||
currency?: string;
|
||||
currencyPrepend?: boolean;
|
||||
}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputProps extends FormCommonProps {
|
||||
align?: 'left' | 'center' | 'right';
|
||||
multiline?: boolean;
|
||||
/**
|
||||
* The text will be masked (e.g. with asterisks).
|
||||
*/
|
||||
password?: boolean;
|
||||
/**
|
||||
* If set, text entered in the field is not spell-checked
|
||||
*/
|
||||
noSpell?: boolean;
|
||||
format?: TextInputFormatting;
|
||||
/**
|
||||
* Sets the fontSize (default or 0 means auto sizing)
|
||||
*/
|
||||
fontSize?: number;
|
||||
/**
|
||||
* Sets the maximum length (characters) of the text in the field
|
||||
*/
|
||||
maxLength?: number;
|
||||
}
|
||||
|
||||
export class TextInput extends React.Component<TextInputProps> {}
|
||||
|
||||
interface CheckboxProps extends FormCommonProps {
|
||||
backgroundColor?: string;
|
||||
borderColor?: string;
|
||||
checked?: boolean;
|
||||
onState?: string;
|
||||
offState?: string;
|
||||
xMark?: boolean;
|
||||
}
|
||||
|
||||
export class Checkbox extends React.Component<CheckboxProps> {}
|
||||
|
||||
interface SelectAndListPropsBase extends FormCommonProps {
|
||||
sort?: boolean;
|
||||
edit?: boolean;
|
||||
multiSelect?: boolean;
|
||||
noSpell?: boolean;
|
||||
select?: string[];
|
||||
}
|
||||
|
||||
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
|
||||
edit: true | false;
|
||||
noSpell: boolean;
|
||||
};
|
||||
|
||||
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
|
||||
edit: boolean;
|
||||
noSpell: true | false;
|
||||
};
|
||||
|
||||
type SelectAndListProps =
|
||||
| SelectAndListPropsWithEdit
|
||||
| SelectAndListPropsWithNoSpell;
|
||||
|
||||
export class Select extends React.Component<SelectAndListProps> {}
|
||||
|
||||
export class List extends React.Component<SelectAndListProps> {}
|
||||
|
||||
interface NoteProps extends NodeProps {
|
||||
children: string;
|
||||
}
|
||||
|
||||
export class Note extends React.Component<NoteProps> {}
|
||||
|
||||
interface CanvasProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
paint: (
|
||||
painter: any,
|
||||
availableWidth: number,
|
||||
availableHeight: number,
|
||||
) => null;
|
||||
}
|
||||
|
||||
export class Canvas extends React.Component<CanvasProps> {}
|
||||
|
||||
interface SVGProps extends NodeProps, SVGPresentationAttributes {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
width?: string | number;
|
||||
height?: string | number;
|
||||
viewBox?: string;
|
||||
preserveAspectRatio?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
|
||||
*/
|
||||
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
|
||||
|
||||
interface LineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x1: string | number;
|
||||
x2: string | number;
|
||||
y1: string | number;
|
||||
y2: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Line /> element is used to create a line.
|
||||
*/
|
||||
export class Line extends React.Component<
|
||||
React.PropsWithChildren<LineProps>
|
||||
> {}
|
||||
|
||||
interface PolylineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
|
||||
*/
|
||||
export class Polyline extends React.Component<
|
||||
React.PropsWithChildren<PolylineProps>
|
||||
> {}
|
||||
|
||||
interface PolygonProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polygon /> element is used to create a graphic that contains at least three sides.
|
||||
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
|
||||
*/
|
||||
export class Polygon extends React.Component<
|
||||
React.PropsWithChildren<PolygonProps>
|
||||
> {}
|
||||
|
||||
interface PathProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
d: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
|
||||
*/
|
||||
export class Path extends React.Component<
|
||||
React.PropsWithChildren<PathProps>
|
||||
> {}
|
||||
|
||||
interface RectProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
width: string | number;
|
||||
height: string | number;
|
||||
rx?: string | number;
|
||||
ry?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
|
||||
*/
|
||||
export class Rect extends React.Component<
|
||||
React.PropsWithChildren<RectProps>
|
||||
> {}
|
||||
|
||||
interface CircleProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Circle /> element is used to create a circle.
|
||||
*/
|
||||
export class Circle extends React.Component<
|
||||
React.PropsWithChildren<CircleProps>
|
||||
> {}
|
||||
|
||||
interface EllipseProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
rx: string | number;
|
||||
ry: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Ellipse /> element is used to create an ellipse.
|
||||
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
|
||||
*/
|
||||
export class Ellipse extends React.Component<
|
||||
React.PropsWithChildren<EllipseProps>
|
||||
> {}
|
||||
|
||||
interface TspanProps extends SVGPresentationAttributes {
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
|
||||
* It allows for adjustment of the style and/or position of that subtext as needed.
|
||||
*/
|
||||
export class Tspan extends React.Component<
|
||||
React.PropsWithChildren<TspanProps>
|
||||
> {}
|
||||
|
||||
interface GProps extends SVGPresentationAttributes {
|
||||
style?: Style;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <G /> SVG element is a container used to group other SVG elements.
|
||||
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
|
||||
*/
|
||||
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
|
||||
|
||||
interface StopProps {
|
||||
offset: string | number;
|
||||
stopColor: string;
|
||||
stopOpacity?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
|
||||
*/
|
||||
export class Stop extends React.Component<
|
||||
React.PropsWithChildren<StopProps>
|
||||
> {}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface DefsProps {}
|
||||
|
||||
/**
|
||||
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
|
||||
*/
|
||||
export class Defs extends React.Component<
|
||||
React.PropsWithChildren<DefsProps>
|
||||
> {}
|
||||
|
||||
interface ClipPathProps {
|
||||
id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
|
||||
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
|
||||
*/
|
||||
export class ClipPath extends React.Component<
|
||||
React.PropsWithChildren<ClipPathProps>
|
||||
> {}
|
||||
|
||||
interface MarkerProps {
|
||||
id: string;
|
||||
viewBox?: string;
|
||||
refX?: string | number;
|
||||
refY?: string | number;
|
||||
markerWidth?: string | number;
|
||||
markerHeight?: string | number;
|
||||
orient?: 'auto' | 'auto-start-reverse' | number;
|
||||
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
|
||||
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
|
||||
*/
|
||||
export class Marker extends React.Component<
|
||||
React.PropsWithChildren<MarkerProps>
|
||||
> {}
|
||||
|
||||
interface LinearGradientProps {
|
||||
id: string;
|
||||
x1?: string | number;
|
||||
x2?: string | number;
|
||||
y1?: string | number;
|
||||
y2?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class LinearGradient extends React.Component<
|
||||
React.PropsWithChildren<LinearGradientProps>
|
||||
> {}
|
||||
|
||||
interface RadialGradientProps {
|
||||
id: string;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r?: string | number;
|
||||
fx?: string | number;
|
||||
fy?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class RadialGradient extends React.Component<
|
||||
React.PropsWithChildren<RadialGradientProps>
|
||||
> {}
|
||||
|
||||
interface BlobProviderParams {
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
loading: boolean;
|
||||
error: Error | null;
|
||||
}
|
||||
interface BlobProviderProps {
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children: (params: BlobProviderParams) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easy and declarative way of getting document's blob data without
|
||||
* showing it on screen.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class BlobProvider extends React.Component<BlobProviderProps> {}
|
||||
|
||||
interface PDFViewerProps {
|
||||
width?: number | string;
|
||||
height?: number | string;
|
||||
style?: Style | Style[];
|
||||
className?: string;
|
||||
children?: React.ReactElement<DocumentProps>;
|
||||
innerRef?: React.Ref<HTMLIFrameElement>;
|
||||
showToolbar?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iframe PDF viewer for client-side generated documents.
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFViewer extends React.Component<PDFViewerProps> {}
|
||||
|
||||
interface PDFDownloadLinkProps
|
||||
extends Omit<
|
||||
React.AnchorHTMLAttributes<HTMLAnchorElement>,
|
||||
'href' | 'children'
|
||||
> {
|
||||
/** PDF filename. Alias for anchor tag `download` attribute. */
|
||||
fileName?: string;
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children?: React.ReactNode | React.FC<BlobProviderParams>;
|
||||
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
|
||||
((
|
||||
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
|
||||
instance: UsePDFInstance,
|
||||
) => void);
|
||||
ref?: React.Ref<HTMLAnchorElement> | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Anchor tag to enable generate and download PDF documents on the fly.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
|
||||
|
||||
interface UsePDFInstance {
|
||||
loading: boolean;
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* React hook for creating and updating a PDF document instance
|
||||
* @platform web
|
||||
*/
|
||||
export function usePDF(options?: {
|
||||
document?: React.ReactElement<DocumentProps>;
|
||||
}): [
|
||||
UsePDFInstance,
|
||||
(newDocument: React.ReactElement<DocumentProps>) => void,
|
||||
];
|
||||
|
||||
export const Font: FontStore;
|
||||
|
||||
export const StyleSheet: {
|
||||
create: <T extends Styles>(styles: T) => T;
|
||||
};
|
||||
|
||||
export const version: any;
|
||||
|
||||
export const PDFRenderer: any;
|
||||
|
||||
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
|
||||
container: any;
|
||||
isDirty: () => boolean;
|
||||
toString: () => string;
|
||||
toBlob: () => Promise<Blob>;
|
||||
toBuffer: () => Promise<NodeJS.ReadableStream>;
|
||||
on: (event: 'change', callback: () => void) => void;
|
||||
updateContainer: (
|
||||
document: React.ReactElement<any>,
|
||||
callback?: () => void,
|
||||
) => void;
|
||||
removeListener: (event: 'change', callback: () => void) => void;
|
||||
};
|
||||
|
||||
export const renderToStream: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
/**
|
||||
* @deprecated use the `renderToBuffer` method
|
||||
*/
|
||||
export const renderToString: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<string>;
|
||||
|
||||
export const renderToFile: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
filePath: string,
|
||||
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
const render: typeof renderToFile;
|
||||
|
||||
/**
|
||||
* Render document into a nodejs buffer
|
||||
* @platform node
|
||||
*/
|
||||
export const renderToBuffer: (
|
||||
document: React.ReactElement<ReactPDF.DocumentProps>,
|
||||
) => Promise<Buffer>;
|
||||
}
|
||||
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.browser.d.cts
generated
vendored
Normal file
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.browser.d.cts
generated
vendored
Normal file
@@ -0,0 +1,793 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Style,
|
||||
PageSize,
|
||||
FontStore,
|
||||
PDFVersion,
|
||||
Orientation,
|
||||
SourceObject,
|
||||
SrcSet,
|
||||
Sizes,
|
||||
HyphenationCallback,
|
||||
SVGPresentationAttributes,
|
||||
Bookmark,
|
||||
PageLayout,
|
||||
PageMode,
|
||||
HitSlop,
|
||||
} from '@react-pdf/types';
|
||||
|
||||
declare class ReactPDF {
|
||||
static default: typeof ReactPDF;
|
||||
}
|
||||
|
||||
export = ReactPDF;
|
||||
|
||||
declare namespace ReactPDF {
|
||||
interface Styles {
|
||||
[key: string]: Style;
|
||||
}
|
||||
interface OnRenderProps {
|
||||
blob?: Blob;
|
||||
}
|
||||
|
||||
interface Permissions {
|
||||
printing?: 'lowResolution' | 'highResolution';
|
||||
modifying?: boolean;
|
||||
copying?: boolean;
|
||||
annotating?: boolean;
|
||||
fillingForms?: boolean;
|
||||
contentAccessibility?: boolean;
|
||||
documentAssembly?: boolean;
|
||||
}
|
||||
|
||||
interface DocumentProps {
|
||||
style?: Style | Style[];
|
||||
title?: string;
|
||||
author?: string;
|
||||
subject?: string;
|
||||
creator?: string;
|
||||
keywords?: string;
|
||||
producer?: string;
|
||||
language?: string;
|
||||
creationDate?: Date;
|
||||
modificationDate?: Date;
|
||||
pdfVersion?: PDFVersion;
|
||||
pageMode?: PageMode;
|
||||
pageLayout?: PageLayout;
|
||||
ownerPassword?: string;
|
||||
userPassword?: string;
|
||||
permissions?: Permissions;
|
||||
onRender?: (props: OnRenderProps) => any;
|
||||
}
|
||||
|
||||
/**
|
||||
* This component represent the PDF document itself. It must be the root
|
||||
* of your tree element structure, and under no circumstances should it be
|
||||
* used as children of another react-pdf component. In addition, it should
|
||||
* only have childs of type <Page />.
|
||||
*/
|
||||
export class Document extends React.Component<
|
||||
React.PropsWithChildren<DocumentProps>
|
||||
> {}
|
||||
|
||||
interface NodeProps {
|
||||
id?: string;
|
||||
style?: Style | Style[];
|
||||
/**
|
||||
* Render component in all wrapped pages.
|
||||
* @see https://react-pdf.org/advanced#fixed-components
|
||||
*/
|
||||
fixed?: boolean;
|
||||
/**
|
||||
* Force the wrapping algorithm to start a new page when rendering the
|
||||
* element.
|
||||
* @see https://react-pdf.org/advanced#page-breaks
|
||||
*/
|
||||
break?: boolean;
|
||||
/**
|
||||
* Hint that no page wrapping should occur between all sibling elements following the element within n points
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
minPresenceAhead?: number;
|
||||
}
|
||||
|
||||
interface PageProps extends NodeProps {
|
||||
/**
|
||||
* Enable page wrapping for this page.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
size?: PageSize;
|
||||
orientation?: Orientation;
|
||||
dpi?: number;
|
||||
bookmark?: Bookmark;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents single page inside the PDF document, or a subset of them if
|
||||
* using the wrapping feature. A <Document /> can contain as many pages as
|
||||
* you want, but ensure not rendering a page inside any component besides
|
||||
* Document.
|
||||
*/
|
||||
export class Page extends React.Component<
|
||||
React.PropsWithChildren<PageProps>
|
||||
> {}
|
||||
|
||||
interface ViewProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
subPageNumber: number;
|
||||
}) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* The most fundamental component for building a UI and is designed to be
|
||||
* nested inside other views and can have 0 to many children.
|
||||
*/
|
||||
export class View extends React.Component<
|
||||
React.PropsWithChildren<ViewProps>
|
||||
> {}
|
||||
|
||||
interface BaseImageProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* Works like the HTML img sizes attribute.
|
||||
* @example 300
|
||||
* @example "300"
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
}
|
||||
|
||||
interface ImageWithSrcProp extends BaseImageProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageWithSourceProp extends BaseImageProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying network or local (Node only) JPG or
|
||||
* PNG images, as well as base64 encoded image strings.
|
||||
*/
|
||||
export class Image extends React.Component<ImageProps> {}
|
||||
|
||||
interface BaseImageBackgroundProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* @example 300
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
/**
|
||||
* Style applied to the background image.
|
||||
*/
|
||||
imageStyle?: Style;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageBackgroundProps =
|
||||
| ImageBackgroundWithSrcProp
|
||||
| ImageBackgroundWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying an image behind child content.
|
||||
* Compatible with React Native's ImageBackground component.
|
||||
* @see https://reactnative.dev/docs/imagebackground
|
||||
*/
|
||||
export class ImageBackground extends React.Component<
|
||||
React.PropsWithChildren<ImageBackgroundProps>
|
||||
> {}
|
||||
|
||||
interface TextProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
totalPages: number;
|
||||
subPageNumber: number;
|
||||
subPageTotalPages: number;
|
||||
}) => React.ReactNode;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
orphans?: number;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
widows?: number;
|
||||
}
|
||||
|
||||
interface SVGTextProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x: string | number;
|
||||
y: string | number;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying text. Text supports nesting of other
|
||||
* Text or Link components to create inline styling.
|
||||
*/
|
||||
export class Text extends React.Component<
|
||||
React.PropsWithChildren<TextProps> | SVGTextProps
|
||||
> {}
|
||||
|
||||
interface LinkProps extends NodeProps {
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
href?: string;
|
||||
src?: string;
|
||||
/**
|
||||
* Extends the clickable area of the link beyond its visible bounds.
|
||||
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
|
||||
* @see https://reactnative.dev/docs/view#hitslop
|
||||
*/
|
||||
hitSlop?: HitSlop;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying a hyperlink. Link’s can be nested
|
||||
* inside a Text component, or being inside any other valid primitive.
|
||||
*/
|
||||
export class Link extends React.Component<
|
||||
React.PropsWithChildren<LinkProps>
|
||||
> {}
|
||||
|
||||
interface FormCommonProps extends NodeProps {
|
||||
name?: string;
|
||||
required?: boolean;
|
||||
noExport?: boolean;
|
||||
readOnly?: boolean;
|
||||
value?: number | string;
|
||||
defaultValue?: number | string;
|
||||
}
|
||||
|
||||
interface FieldSetProps extends NodeProps {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class FieldSet extends React.Component<
|
||||
React.PropsWithChildren<FieldSetProps>
|
||||
> {}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputFormatting {
|
||||
type:
|
||||
| 'date'
|
||||
| 'time'
|
||||
| 'percent'
|
||||
| 'number'
|
||||
| 'zip'
|
||||
| 'zipPlus4'
|
||||
| 'phone'
|
||||
| 'ssn';
|
||||
param?: string;
|
||||
nDec?: number;
|
||||
sepComma?: boolean;
|
||||
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
|
||||
currency?: string;
|
||||
currencyPrepend?: boolean;
|
||||
}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputProps extends FormCommonProps {
|
||||
align?: 'left' | 'center' | 'right';
|
||||
multiline?: boolean;
|
||||
/**
|
||||
* The text will be masked (e.g. with asterisks).
|
||||
*/
|
||||
password?: boolean;
|
||||
/**
|
||||
* If set, text entered in the field is not spell-checked
|
||||
*/
|
||||
noSpell?: boolean;
|
||||
format?: TextInputFormatting;
|
||||
/**
|
||||
* Sets the fontSize (default or 0 means auto sizing)
|
||||
*/
|
||||
fontSize?: number;
|
||||
/**
|
||||
* Sets the maximum length (characters) of the text in the field
|
||||
*/
|
||||
maxLength?: number;
|
||||
}
|
||||
|
||||
export class TextInput extends React.Component<TextInputProps> {}
|
||||
|
||||
interface CheckboxProps extends FormCommonProps {
|
||||
backgroundColor?: string;
|
||||
borderColor?: string;
|
||||
checked?: boolean;
|
||||
onState?: string;
|
||||
offState?: string;
|
||||
xMark?: boolean;
|
||||
}
|
||||
|
||||
export class Checkbox extends React.Component<CheckboxProps> {}
|
||||
|
||||
interface SelectAndListPropsBase extends FormCommonProps {
|
||||
sort?: boolean;
|
||||
edit?: boolean;
|
||||
multiSelect?: boolean;
|
||||
noSpell?: boolean;
|
||||
select?: string[];
|
||||
}
|
||||
|
||||
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
|
||||
edit: true | false;
|
||||
noSpell: boolean;
|
||||
};
|
||||
|
||||
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
|
||||
edit: boolean;
|
||||
noSpell: true | false;
|
||||
};
|
||||
|
||||
type SelectAndListProps =
|
||||
| SelectAndListPropsWithEdit
|
||||
| SelectAndListPropsWithNoSpell;
|
||||
|
||||
export class Select extends React.Component<SelectAndListProps> {}
|
||||
|
||||
export class List extends React.Component<SelectAndListProps> {}
|
||||
|
||||
interface NoteProps extends NodeProps {
|
||||
children: string;
|
||||
}
|
||||
|
||||
export class Note extends React.Component<NoteProps> {}
|
||||
|
||||
interface CanvasProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
paint: (
|
||||
painter: any,
|
||||
availableWidth: number,
|
||||
availableHeight: number,
|
||||
) => null;
|
||||
}
|
||||
|
||||
export class Canvas extends React.Component<CanvasProps> {}
|
||||
|
||||
interface SVGProps extends NodeProps, SVGPresentationAttributes {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
width?: string | number;
|
||||
height?: string | number;
|
||||
viewBox?: string;
|
||||
preserveAspectRatio?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
|
||||
*/
|
||||
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
|
||||
|
||||
interface LineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x1: string | number;
|
||||
x2: string | number;
|
||||
y1: string | number;
|
||||
y2: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Line /> element is used to create a line.
|
||||
*/
|
||||
export class Line extends React.Component<
|
||||
React.PropsWithChildren<LineProps>
|
||||
> {}
|
||||
|
||||
interface PolylineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
|
||||
*/
|
||||
export class Polyline extends React.Component<
|
||||
React.PropsWithChildren<PolylineProps>
|
||||
> {}
|
||||
|
||||
interface PolygonProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polygon /> element is used to create a graphic that contains at least three sides.
|
||||
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
|
||||
*/
|
||||
export class Polygon extends React.Component<
|
||||
React.PropsWithChildren<PolygonProps>
|
||||
> {}
|
||||
|
||||
interface PathProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
d: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
|
||||
*/
|
||||
export class Path extends React.Component<
|
||||
React.PropsWithChildren<PathProps>
|
||||
> {}
|
||||
|
||||
interface RectProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
width: string | number;
|
||||
height: string | number;
|
||||
rx?: string | number;
|
||||
ry?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
|
||||
*/
|
||||
export class Rect extends React.Component<
|
||||
React.PropsWithChildren<RectProps>
|
||||
> {}
|
||||
|
||||
interface CircleProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Circle /> element is used to create a circle.
|
||||
*/
|
||||
export class Circle extends React.Component<
|
||||
React.PropsWithChildren<CircleProps>
|
||||
> {}
|
||||
|
||||
interface EllipseProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
rx: string | number;
|
||||
ry: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Ellipse /> element is used to create an ellipse.
|
||||
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
|
||||
*/
|
||||
export class Ellipse extends React.Component<
|
||||
React.PropsWithChildren<EllipseProps>
|
||||
> {}
|
||||
|
||||
interface TspanProps extends SVGPresentationAttributes {
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
|
||||
* It allows for adjustment of the style and/or position of that subtext as needed.
|
||||
*/
|
||||
export class Tspan extends React.Component<
|
||||
React.PropsWithChildren<TspanProps>
|
||||
> {}
|
||||
|
||||
interface GProps extends SVGPresentationAttributes {
|
||||
style?: Style;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <G /> SVG element is a container used to group other SVG elements.
|
||||
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
|
||||
*/
|
||||
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
|
||||
|
||||
interface StopProps {
|
||||
offset: string | number;
|
||||
stopColor: string;
|
||||
stopOpacity?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
|
||||
*/
|
||||
export class Stop extends React.Component<
|
||||
React.PropsWithChildren<StopProps>
|
||||
> {}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface DefsProps {}
|
||||
|
||||
/**
|
||||
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
|
||||
*/
|
||||
export class Defs extends React.Component<
|
||||
React.PropsWithChildren<DefsProps>
|
||||
> {}
|
||||
|
||||
interface ClipPathProps {
|
||||
id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
|
||||
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
|
||||
*/
|
||||
export class ClipPath extends React.Component<
|
||||
React.PropsWithChildren<ClipPathProps>
|
||||
> {}
|
||||
|
||||
interface MarkerProps {
|
||||
id: string;
|
||||
viewBox?: string;
|
||||
refX?: string | number;
|
||||
refY?: string | number;
|
||||
markerWidth?: string | number;
|
||||
markerHeight?: string | number;
|
||||
orient?: 'auto' | 'auto-start-reverse' | number;
|
||||
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
|
||||
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
|
||||
*/
|
||||
export class Marker extends React.Component<
|
||||
React.PropsWithChildren<MarkerProps>
|
||||
> {}
|
||||
|
||||
interface LinearGradientProps {
|
||||
id: string;
|
||||
x1?: string | number;
|
||||
x2?: string | number;
|
||||
y1?: string | number;
|
||||
y2?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class LinearGradient extends React.Component<
|
||||
React.PropsWithChildren<LinearGradientProps>
|
||||
> {}
|
||||
|
||||
interface RadialGradientProps {
|
||||
id: string;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r?: string | number;
|
||||
fx?: string | number;
|
||||
fy?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class RadialGradient extends React.Component<
|
||||
React.PropsWithChildren<RadialGradientProps>
|
||||
> {}
|
||||
|
||||
interface BlobProviderParams {
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
loading: boolean;
|
||||
error: Error | null;
|
||||
}
|
||||
interface BlobProviderProps {
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children: (params: BlobProviderParams) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easy and declarative way of getting document's blob data without
|
||||
* showing it on screen.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class BlobProvider extends React.Component<BlobProviderProps> {}
|
||||
|
||||
interface PDFViewerProps {
|
||||
width?: number | string;
|
||||
height?: number | string;
|
||||
style?: Style | Style[];
|
||||
className?: string;
|
||||
children?: React.ReactElement<DocumentProps>;
|
||||
innerRef?: React.Ref<HTMLIFrameElement>;
|
||||
showToolbar?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iframe PDF viewer for client-side generated documents.
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFViewer extends React.Component<PDFViewerProps> {}
|
||||
|
||||
interface PDFDownloadLinkProps
|
||||
extends Omit<
|
||||
React.AnchorHTMLAttributes<HTMLAnchorElement>,
|
||||
'href' | 'children'
|
||||
> {
|
||||
/** PDF filename. Alias for anchor tag `download` attribute. */
|
||||
fileName?: string;
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children?: React.ReactNode | React.FC<BlobProviderParams>;
|
||||
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
|
||||
((
|
||||
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
|
||||
instance: UsePDFInstance,
|
||||
) => void);
|
||||
ref?: React.Ref<HTMLAnchorElement> | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Anchor tag to enable generate and download PDF documents on the fly.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
|
||||
|
||||
interface UsePDFInstance {
|
||||
loading: boolean;
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* React hook for creating and updating a PDF document instance
|
||||
* @platform web
|
||||
*/
|
||||
export function usePDF(options?: {
|
||||
document?: React.ReactElement<DocumentProps>;
|
||||
}): [
|
||||
UsePDFInstance,
|
||||
(newDocument: React.ReactElement<DocumentProps>) => void,
|
||||
];
|
||||
|
||||
export const Font: FontStore;
|
||||
|
||||
export const StyleSheet: {
|
||||
create: <T extends Styles>(styles: T) => T;
|
||||
};
|
||||
|
||||
export const version: any;
|
||||
|
||||
export const PDFRenderer: any;
|
||||
|
||||
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
|
||||
container: any;
|
||||
isDirty: () => boolean;
|
||||
toString: () => string;
|
||||
toBlob: () => Promise<Blob>;
|
||||
toBuffer: () => Promise<NodeJS.ReadableStream>;
|
||||
on: (event: 'change', callback: () => void) => void;
|
||||
updateContainer: (
|
||||
document: React.ReactElement<any>,
|
||||
callback?: () => void,
|
||||
) => void;
|
||||
removeListener: (event: 'change', callback: () => void) => void;
|
||||
};
|
||||
|
||||
export const renderToStream: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
/**
|
||||
* @deprecated use the `renderToBuffer` method
|
||||
*/
|
||||
export const renderToString: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<string>;
|
||||
|
||||
export const renderToFile: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
filePath: string,
|
||||
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
const render: typeof renderToFile;
|
||||
|
||||
/**
|
||||
* Render document into a nodejs buffer
|
||||
* @platform node
|
||||
*/
|
||||
export const renderToBuffer: (
|
||||
document: React.ReactElement<ReactPDF.DocumentProps>,
|
||||
) => Promise<Buffer>;
|
||||
}
|
||||
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.browser.d.ts
generated
vendored
Normal file
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.browser.d.ts
generated
vendored
Normal file
@@ -0,0 +1,793 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Style,
|
||||
PageSize,
|
||||
FontStore,
|
||||
PDFVersion,
|
||||
Orientation,
|
||||
SourceObject,
|
||||
SrcSet,
|
||||
Sizes,
|
||||
HyphenationCallback,
|
||||
SVGPresentationAttributes,
|
||||
Bookmark,
|
||||
PageLayout,
|
||||
PageMode,
|
||||
HitSlop,
|
||||
} from '@react-pdf/types';
|
||||
|
||||
declare class ReactPDF {
|
||||
static default: typeof ReactPDF;
|
||||
}
|
||||
|
||||
export = ReactPDF;
|
||||
|
||||
declare namespace ReactPDF {
|
||||
interface Styles {
|
||||
[key: string]: Style;
|
||||
}
|
||||
interface OnRenderProps {
|
||||
blob?: Blob;
|
||||
}
|
||||
|
||||
interface Permissions {
|
||||
printing?: 'lowResolution' | 'highResolution';
|
||||
modifying?: boolean;
|
||||
copying?: boolean;
|
||||
annotating?: boolean;
|
||||
fillingForms?: boolean;
|
||||
contentAccessibility?: boolean;
|
||||
documentAssembly?: boolean;
|
||||
}
|
||||
|
||||
interface DocumentProps {
|
||||
style?: Style | Style[];
|
||||
title?: string;
|
||||
author?: string;
|
||||
subject?: string;
|
||||
creator?: string;
|
||||
keywords?: string;
|
||||
producer?: string;
|
||||
language?: string;
|
||||
creationDate?: Date;
|
||||
modificationDate?: Date;
|
||||
pdfVersion?: PDFVersion;
|
||||
pageMode?: PageMode;
|
||||
pageLayout?: PageLayout;
|
||||
ownerPassword?: string;
|
||||
userPassword?: string;
|
||||
permissions?: Permissions;
|
||||
onRender?: (props: OnRenderProps) => any;
|
||||
}
|
||||
|
||||
/**
|
||||
* This component represent the PDF document itself. It must be the root
|
||||
* of your tree element structure, and under no circumstances should it be
|
||||
* used as children of another react-pdf component. In addition, it should
|
||||
* only have childs of type <Page />.
|
||||
*/
|
||||
export class Document extends React.Component<
|
||||
React.PropsWithChildren<DocumentProps>
|
||||
> {}
|
||||
|
||||
interface NodeProps {
|
||||
id?: string;
|
||||
style?: Style | Style[];
|
||||
/**
|
||||
* Render component in all wrapped pages.
|
||||
* @see https://react-pdf.org/advanced#fixed-components
|
||||
*/
|
||||
fixed?: boolean;
|
||||
/**
|
||||
* Force the wrapping algorithm to start a new page when rendering the
|
||||
* element.
|
||||
* @see https://react-pdf.org/advanced#page-breaks
|
||||
*/
|
||||
break?: boolean;
|
||||
/**
|
||||
* Hint that no page wrapping should occur between all sibling elements following the element within n points
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
minPresenceAhead?: number;
|
||||
}
|
||||
|
||||
interface PageProps extends NodeProps {
|
||||
/**
|
||||
* Enable page wrapping for this page.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
size?: PageSize;
|
||||
orientation?: Orientation;
|
||||
dpi?: number;
|
||||
bookmark?: Bookmark;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents single page inside the PDF document, or a subset of them if
|
||||
* using the wrapping feature. A <Document /> can contain as many pages as
|
||||
* you want, but ensure not rendering a page inside any component besides
|
||||
* Document.
|
||||
*/
|
||||
export class Page extends React.Component<
|
||||
React.PropsWithChildren<PageProps>
|
||||
> {}
|
||||
|
||||
interface ViewProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
subPageNumber: number;
|
||||
}) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* The most fundamental component for building a UI and is designed to be
|
||||
* nested inside other views and can have 0 to many children.
|
||||
*/
|
||||
export class View extends React.Component<
|
||||
React.PropsWithChildren<ViewProps>
|
||||
> {}
|
||||
|
||||
interface BaseImageProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* Works like the HTML img sizes attribute.
|
||||
* @example 300
|
||||
* @example "300"
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
}
|
||||
|
||||
interface ImageWithSrcProp extends BaseImageProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageWithSourceProp extends BaseImageProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying network or local (Node only) JPG or
|
||||
* PNG images, as well as base64 encoded image strings.
|
||||
*/
|
||||
export class Image extends React.Component<ImageProps> {}
|
||||
|
||||
interface BaseImageBackgroundProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* @example 300
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
/**
|
||||
* Style applied to the background image.
|
||||
*/
|
||||
imageStyle?: Style;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageBackgroundProps =
|
||||
| ImageBackgroundWithSrcProp
|
||||
| ImageBackgroundWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying an image behind child content.
|
||||
* Compatible with React Native's ImageBackground component.
|
||||
* @see https://reactnative.dev/docs/imagebackground
|
||||
*/
|
||||
export class ImageBackground extends React.Component<
|
||||
React.PropsWithChildren<ImageBackgroundProps>
|
||||
> {}
|
||||
|
||||
interface TextProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
totalPages: number;
|
||||
subPageNumber: number;
|
||||
subPageTotalPages: number;
|
||||
}) => React.ReactNode;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
orphans?: number;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
widows?: number;
|
||||
}
|
||||
|
||||
interface SVGTextProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x: string | number;
|
||||
y: string | number;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying text. Text supports nesting of other
|
||||
* Text or Link components to create inline styling.
|
||||
*/
|
||||
export class Text extends React.Component<
|
||||
React.PropsWithChildren<TextProps> | SVGTextProps
|
||||
> {}
|
||||
|
||||
interface LinkProps extends NodeProps {
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
href?: string;
|
||||
src?: string;
|
||||
/**
|
||||
* Extends the clickable area of the link beyond its visible bounds.
|
||||
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
|
||||
* @see https://reactnative.dev/docs/view#hitslop
|
||||
*/
|
||||
hitSlop?: HitSlop;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying a hyperlink. Link’s can be nested
|
||||
* inside a Text component, or being inside any other valid primitive.
|
||||
*/
|
||||
export class Link extends React.Component<
|
||||
React.PropsWithChildren<LinkProps>
|
||||
> {}
|
||||
|
||||
interface FormCommonProps extends NodeProps {
|
||||
name?: string;
|
||||
required?: boolean;
|
||||
noExport?: boolean;
|
||||
readOnly?: boolean;
|
||||
value?: number | string;
|
||||
defaultValue?: number | string;
|
||||
}
|
||||
|
||||
interface FieldSetProps extends NodeProps {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class FieldSet extends React.Component<
|
||||
React.PropsWithChildren<FieldSetProps>
|
||||
> {}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputFormatting {
|
||||
type:
|
||||
| 'date'
|
||||
| 'time'
|
||||
| 'percent'
|
||||
| 'number'
|
||||
| 'zip'
|
||||
| 'zipPlus4'
|
||||
| 'phone'
|
||||
| 'ssn';
|
||||
param?: string;
|
||||
nDec?: number;
|
||||
sepComma?: boolean;
|
||||
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
|
||||
currency?: string;
|
||||
currencyPrepend?: boolean;
|
||||
}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputProps extends FormCommonProps {
|
||||
align?: 'left' | 'center' | 'right';
|
||||
multiline?: boolean;
|
||||
/**
|
||||
* The text will be masked (e.g. with asterisks).
|
||||
*/
|
||||
password?: boolean;
|
||||
/**
|
||||
* If set, text entered in the field is not spell-checked
|
||||
*/
|
||||
noSpell?: boolean;
|
||||
format?: TextInputFormatting;
|
||||
/**
|
||||
* Sets the fontSize (default or 0 means auto sizing)
|
||||
*/
|
||||
fontSize?: number;
|
||||
/**
|
||||
* Sets the maximum length (characters) of the text in the field
|
||||
*/
|
||||
maxLength?: number;
|
||||
}
|
||||
|
||||
export class TextInput extends React.Component<TextInputProps> {}
|
||||
|
||||
interface CheckboxProps extends FormCommonProps {
|
||||
backgroundColor?: string;
|
||||
borderColor?: string;
|
||||
checked?: boolean;
|
||||
onState?: string;
|
||||
offState?: string;
|
||||
xMark?: boolean;
|
||||
}
|
||||
|
||||
export class Checkbox extends React.Component<CheckboxProps> {}
|
||||
|
||||
interface SelectAndListPropsBase extends FormCommonProps {
|
||||
sort?: boolean;
|
||||
edit?: boolean;
|
||||
multiSelect?: boolean;
|
||||
noSpell?: boolean;
|
||||
select?: string[];
|
||||
}
|
||||
|
||||
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
|
||||
edit: true | false;
|
||||
noSpell: boolean;
|
||||
};
|
||||
|
||||
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
|
||||
edit: boolean;
|
||||
noSpell: true | false;
|
||||
};
|
||||
|
||||
type SelectAndListProps =
|
||||
| SelectAndListPropsWithEdit
|
||||
| SelectAndListPropsWithNoSpell;
|
||||
|
||||
export class Select extends React.Component<SelectAndListProps> {}
|
||||
|
||||
export class List extends React.Component<SelectAndListProps> {}
|
||||
|
||||
interface NoteProps extends NodeProps {
|
||||
children: string;
|
||||
}
|
||||
|
||||
export class Note extends React.Component<NoteProps> {}
|
||||
|
||||
interface CanvasProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
paint: (
|
||||
painter: any,
|
||||
availableWidth: number,
|
||||
availableHeight: number,
|
||||
) => null;
|
||||
}
|
||||
|
||||
export class Canvas extends React.Component<CanvasProps> {}
|
||||
|
||||
interface SVGProps extends NodeProps, SVGPresentationAttributes {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
width?: string | number;
|
||||
height?: string | number;
|
||||
viewBox?: string;
|
||||
preserveAspectRatio?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
|
||||
*/
|
||||
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
|
||||
|
||||
interface LineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x1: string | number;
|
||||
x2: string | number;
|
||||
y1: string | number;
|
||||
y2: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Line /> element is used to create a line.
|
||||
*/
|
||||
export class Line extends React.Component<
|
||||
React.PropsWithChildren<LineProps>
|
||||
> {}
|
||||
|
||||
interface PolylineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
|
||||
*/
|
||||
export class Polyline extends React.Component<
|
||||
React.PropsWithChildren<PolylineProps>
|
||||
> {}
|
||||
|
||||
interface PolygonProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polygon /> element is used to create a graphic that contains at least three sides.
|
||||
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
|
||||
*/
|
||||
export class Polygon extends React.Component<
|
||||
React.PropsWithChildren<PolygonProps>
|
||||
> {}
|
||||
|
||||
interface PathProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
d: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
|
||||
*/
|
||||
export class Path extends React.Component<
|
||||
React.PropsWithChildren<PathProps>
|
||||
> {}
|
||||
|
||||
interface RectProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
width: string | number;
|
||||
height: string | number;
|
||||
rx?: string | number;
|
||||
ry?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
|
||||
*/
|
||||
export class Rect extends React.Component<
|
||||
React.PropsWithChildren<RectProps>
|
||||
> {}
|
||||
|
||||
interface CircleProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Circle /> element is used to create a circle.
|
||||
*/
|
||||
export class Circle extends React.Component<
|
||||
React.PropsWithChildren<CircleProps>
|
||||
> {}
|
||||
|
||||
interface EllipseProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
rx: string | number;
|
||||
ry: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Ellipse /> element is used to create an ellipse.
|
||||
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
|
||||
*/
|
||||
export class Ellipse extends React.Component<
|
||||
React.PropsWithChildren<EllipseProps>
|
||||
> {}
|
||||
|
||||
interface TspanProps extends SVGPresentationAttributes {
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
|
||||
* It allows for adjustment of the style and/or position of that subtext as needed.
|
||||
*/
|
||||
export class Tspan extends React.Component<
|
||||
React.PropsWithChildren<TspanProps>
|
||||
> {}
|
||||
|
||||
interface GProps extends SVGPresentationAttributes {
|
||||
style?: Style;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <G /> SVG element is a container used to group other SVG elements.
|
||||
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
|
||||
*/
|
||||
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
|
||||
|
||||
interface StopProps {
|
||||
offset: string | number;
|
||||
stopColor: string;
|
||||
stopOpacity?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
|
||||
*/
|
||||
export class Stop extends React.Component<
|
||||
React.PropsWithChildren<StopProps>
|
||||
> {}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface DefsProps {}
|
||||
|
||||
/**
|
||||
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
|
||||
*/
|
||||
export class Defs extends React.Component<
|
||||
React.PropsWithChildren<DefsProps>
|
||||
> {}
|
||||
|
||||
interface ClipPathProps {
|
||||
id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
|
||||
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
|
||||
*/
|
||||
export class ClipPath extends React.Component<
|
||||
React.PropsWithChildren<ClipPathProps>
|
||||
> {}
|
||||
|
||||
interface MarkerProps {
|
||||
id: string;
|
||||
viewBox?: string;
|
||||
refX?: string | number;
|
||||
refY?: string | number;
|
||||
markerWidth?: string | number;
|
||||
markerHeight?: string | number;
|
||||
orient?: 'auto' | 'auto-start-reverse' | number;
|
||||
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
|
||||
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
|
||||
*/
|
||||
export class Marker extends React.Component<
|
||||
React.PropsWithChildren<MarkerProps>
|
||||
> {}
|
||||
|
||||
interface LinearGradientProps {
|
||||
id: string;
|
||||
x1?: string | number;
|
||||
x2?: string | number;
|
||||
y1?: string | number;
|
||||
y2?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class LinearGradient extends React.Component<
|
||||
React.PropsWithChildren<LinearGradientProps>
|
||||
> {}
|
||||
|
||||
interface RadialGradientProps {
|
||||
id: string;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r?: string | number;
|
||||
fx?: string | number;
|
||||
fy?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class RadialGradient extends React.Component<
|
||||
React.PropsWithChildren<RadialGradientProps>
|
||||
> {}
|
||||
|
||||
interface BlobProviderParams {
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
loading: boolean;
|
||||
error: Error | null;
|
||||
}
|
||||
interface BlobProviderProps {
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children: (params: BlobProviderParams) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easy and declarative way of getting document's blob data without
|
||||
* showing it on screen.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class BlobProvider extends React.Component<BlobProviderProps> {}
|
||||
|
||||
interface PDFViewerProps {
|
||||
width?: number | string;
|
||||
height?: number | string;
|
||||
style?: Style | Style[];
|
||||
className?: string;
|
||||
children?: React.ReactElement<DocumentProps>;
|
||||
innerRef?: React.Ref<HTMLIFrameElement>;
|
||||
showToolbar?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iframe PDF viewer for client-side generated documents.
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFViewer extends React.Component<PDFViewerProps> {}
|
||||
|
||||
interface PDFDownloadLinkProps
|
||||
extends Omit<
|
||||
React.AnchorHTMLAttributes<HTMLAnchorElement>,
|
||||
'href' | 'children'
|
||||
> {
|
||||
/** PDF filename. Alias for anchor tag `download` attribute. */
|
||||
fileName?: string;
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children?: React.ReactNode | React.FC<BlobProviderParams>;
|
||||
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
|
||||
((
|
||||
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
|
||||
instance: UsePDFInstance,
|
||||
) => void);
|
||||
ref?: React.Ref<HTMLAnchorElement> | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Anchor tag to enable generate and download PDF documents on the fly.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
|
||||
|
||||
interface UsePDFInstance {
|
||||
loading: boolean;
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* React hook for creating and updating a PDF document instance
|
||||
* @platform web
|
||||
*/
|
||||
export function usePDF(options?: {
|
||||
document?: React.ReactElement<DocumentProps>;
|
||||
}): [
|
||||
UsePDFInstance,
|
||||
(newDocument: React.ReactElement<DocumentProps>) => void,
|
||||
];
|
||||
|
||||
export const Font: FontStore;
|
||||
|
||||
export const StyleSheet: {
|
||||
create: <T extends Styles>(styles: T) => T;
|
||||
};
|
||||
|
||||
export const version: any;
|
||||
|
||||
export const PDFRenderer: any;
|
||||
|
||||
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
|
||||
container: any;
|
||||
isDirty: () => boolean;
|
||||
toString: () => string;
|
||||
toBlob: () => Promise<Blob>;
|
||||
toBuffer: () => Promise<NodeJS.ReadableStream>;
|
||||
on: (event: 'change', callback: () => void) => void;
|
||||
updateContainer: (
|
||||
document: React.ReactElement<any>,
|
||||
callback?: () => void,
|
||||
) => void;
|
||||
removeListener: (event: 'change', callback: () => void) => void;
|
||||
};
|
||||
|
||||
export const renderToStream: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
/**
|
||||
* @deprecated use the `renderToBuffer` method
|
||||
*/
|
||||
export const renderToString: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<string>;
|
||||
|
||||
export const renderToFile: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
filePath: string,
|
||||
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
const render: typeof renderToFile;
|
||||
|
||||
/**
|
||||
* Render document into a nodejs buffer
|
||||
* @platform node
|
||||
*/
|
||||
export const renderToBuffer: (
|
||||
document: React.ReactElement<ReactPDF.DocumentProps>,
|
||||
) => Promise<Buffer>;
|
||||
}
|
||||
473
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.browser.js
generated
vendored
Normal file
473
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.browser.js
generated
vendored
Normal file
@@ -0,0 +1,473 @@
|
||||
import * as primitives from '@react-pdf/primitives';
|
||||
export * from '@react-pdf/primitives';
|
||||
import queue from 'queue';
|
||||
import { useRef, useState, useEffect, useCallback, forwardRef } from 'react';
|
||||
import FontStore from '@react-pdf/font';
|
||||
import renderPDF from '@react-pdf/render';
|
||||
import PDFDocument from '@react-pdf/pdfkit';
|
||||
import layoutDocument from '@react-pdf/layout';
|
||||
import { upperFirst } from '@react-pdf/fns';
|
||||
import Reconciler from '@react-pdf/reconciler';
|
||||
import { jsx } from 'react/jsx-runtime';
|
||||
|
||||
const omitNils = object => Object.fromEntries(Object.entries(object).filter(_ref => {
|
||||
let [, value] = _ref;
|
||||
return value !== undefined;
|
||||
}));
|
||||
|
||||
const createInstance = (type, _ref) => {
|
||||
let {
|
||||
style,
|
||||
children,
|
||||
...props
|
||||
} = _ref;
|
||||
return {
|
||||
type,
|
||||
box: {},
|
||||
style: style || {},
|
||||
props: props || {},
|
||||
children: []
|
||||
};
|
||||
};
|
||||
const createTextInstance = text => ({
|
||||
type: 'TEXT_INSTANCE',
|
||||
value: text
|
||||
});
|
||||
const appendChild = (parent, child) => {
|
||||
const isParentText = parent.type === 'TEXT' || parent.type === 'LINK' || parent.type === 'TSPAN' || parent.type === 'NOTE';
|
||||
const isChildTextInstance = child.type === 'TEXT_INSTANCE';
|
||||
const isOrphanTextInstance = isChildTextInstance && !isParentText;
|
||||
|
||||
// Ignore orphan text instances.
|
||||
// Caused by cases such as <>{name && <Text>{name}</Text>}</>
|
||||
if (isOrphanTextInstance) {
|
||||
console.warn(`Invalid '${child.value}' string child outside <Text> component`);
|
||||
return;
|
||||
}
|
||||
parent.children.push(child);
|
||||
};
|
||||
const appendChildToContainer = (parentInstance, child) => {
|
||||
if (parentInstance.type === 'ROOT') {
|
||||
parentInstance.document = child;
|
||||
} else {
|
||||
appendChild(parentInstance, child);
|
||||
}
|
||||
};
|
||||
const insertBefore = (parentInstance, child, beforeChild) => {
|
||||
var _parentInstance$child;
|
||||
const index = (_parentInstance$child = parentInstance.children) === null || _parentInstance$child === void 0 ? void 0 : _parentInstance$child.indexOf(beforeChild);
|
||||
if (index === undefined) return;
|
||||
if (index !== -1 && child) parentInstance.children.splice(index, 0, child);
|
||||
};
|
||||
const removeChild = (parentInstance, child) => {
|
||||
var _parentInstance$child2;
|
||||
const index = (_parentInstance$child2 = parentInstance.children) === null || _parentInstance$child2 === void 0 ? void 0 : _parentInstance$child2.indexOf(child);
|
||||
if (index === undefined) return;
|
||||
if (index !== -1) parentInstance.children.splice(index, 1);
|
||||
};
|
||||
const removeChildFromContainer = (parentInstance, child) => {
|
||||
var _parentInstance$child3;
|
||||
const index = (_parentInstance$child3 = parentInstance.children) === null || _parentInstance$child3 === void 0 ? void 0 : _parentInstance$child3.indexOf(child);
|
||||
if (index === undefined) return;
|
||||
if (index !== -1) parentInstance.children.splice(index, 1);
|
||||
};
|
||||
const commitTextUpdate = (textInstance, oldText, newText) => {
|
||||
textInstance.value = newText;
|
||||
};
|
||||
const commitUpdate = (instance, updatePayload, type, oldProps, newProps) => {
|
||||
const {
|
||||
style,
|
||||
...props
|
||||
} = newProps;
|
||||
instance.props = props;
|
||||
instance.style = style;
|
||||
};
|
||||
const createRenderer = _ref2 => {
|
||||
let {
|
||||
onChange = () => {}
|
||||
} = _ref2;
|
||||
return Reconciler({
|
||||
appendChild,
|
||||
appendChildToContainer,
|
||||
commitTextUpdate,
|
||||
commitUpdate,
|
||||
createInstance,
|
||||
createTextInstance,
|
||||
insertBefore,
|
||||
removeChild,
|
||||
removeChildFromContainer,
|
||||
resetAfterCommit: onChange
|
||||
});
|
||||
};
|
||||
|
||||
var version$1 = "4.5.1";
|
||||
var packageJson = {
|
||||
version: version$1};
|
||||
|
||||
const {
|
||||
version
|
||||
} = packageJson;
|
||||
const fontStore = new FontStore();
|
||||
|
||||
// We must keep a single renderer instance, otherwise React will complain
|
||||
let renderer;
|
||||
|
||||
// The pdf instance acts as an event emitter for DOM usage.
|
||||
// We only want to trigger an update when PDF content changes
|
||||
const events = {};
|
||||
const pdf = initialValue => {
|
||||
const onChange = () => {
|
||||
var _events$change;
|
||||
const listeners = ((_events$change = events.change) === null || _events$change === void 0 ? void 0 : _events$change.slice()) || [];
|
||||
for (let i = 0; i < listeners.length; i += 1) listeners[i]();
|
||||
};
|
||||
const container = {
|
||||
type: 'ROOT',
|
||||
document: null
|
||||
};
|
||||
renderer = renderer || createRenderer({
|
||||
onChange
|
||||
});
|
||||
const mountNode = renderer.createContainer(container);
|
||||
const updateContainer = (doc, callback) => {
|
||||
renderer.updateContainer(doc, mountNode, null, callback);
|
||||
};
|
||||
if (initialValue) updateContainer(initialValue);
|
||||
const render = async function (compress) {
|
||||
if (compress === void 0) {
|
||||
compress = true;
|
||||
}
|
||||
const props = container.document.props || {};
|
||||
const {
|
||||
pdfVersion,
|
||||
language,
|
||||
pageLayout,
|
||||
pageMode,
|
||||
title,
|
||||
author,
|
||||
subject,
|
||||
keywords,
|
||||
creator = 'react-pdf',
|
||||
producer = 'react-pdf',
|
||||
creationDate = new Date(),
|
||||
modificationDate,
|
||||
ownerPassword,
|
||||
userPassword,
|
||||
permissions
|
||||
} = props;
|
||||
const ctx = new PDFDocument({
|
||||
compress,
|
||||
pdfVersion,
|
||||
lang: language,
|
||||
displayTitle: true,
|
||||
autoFirstPage: false,
|
||||
ownerPassword,
|
||||
userPassword,
|
||||
permissions,
|
||||
pageLayout,
|
||||
info: omitNils({
|
||||
Title: title,
|
||||
Author: author,
|
||||
Subject: subject,
|
||||
Keywords: keywords,
|
||||
Creator: creator,
|
||||
Producer: producer,
|
||||
CreationDate: creationDate,
|
||||
ModificationDate: modificationDate
|
||||
})
|
||||
});
|
||||
if (pageMode) {
|
||||
ctx._root.data.PageMode = upperFirst(pageMode);
|
||||
}
|
||||
const layout = await layoutDocument(container.document, fontStore);
|
||||
const fileStream = renderPDF(ctx, layout);
|
||||
return {
|
||||
layout,
|
||||
fileStream
|
||||
};
|
||||
};
|
||||
const callOnRender = function (params) {
|
||||
if (params === void 0) {
|
||||
params = {};
|
||||
}
|
||||
if (container.document.props.onRender) {
|
||||
container.document.props.onRender(params);
|
||||
}
|
||||
};
|
||||
const toBlob = async () => {
|
||||
const chunks = [];
|
||||
const {
|
||||
layout: _INTERNAL__LAYOUT__DATA_,
|
||||
fileStream: instance
|
||||
} = await render();
|
||||
return new Promise((resolve, reject) => {
|
||||
instance.on('data', chunk => {
|
||||
chunks.push(chunk instanceof Uint8Array ? chunk : new Uint8Array(chunk));
|
||||
});
|
||||
instance.on('end', () => {
|
||||
try {
|
||||
const blob = new Blob(chunks, {
|
||||
type: 'application/pdf'
|
||||
});
|
||||
callOnRender({
|
||||
blob,
|
||||
_INTERNAL__LAYOUT__DATA_
|
||||
});
|
||||
resolve(blob);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// TODO: rename this method to `toStream` in next major release, because it return stream not a buffer
|
||||
const toBuffer = async () => {
|
||||
const {
|
||||
layout: _INTERNAL__LAYOUT__DATA_,
|
||||
fileStream
|
||||
} = await render();
|
||||
callOnRender({
|
||||
_INTERNAL__LAYOUT__DATA_
|
||||
});
|
||||
return fileStream;
|
||||
};
|
||||
|
||||
/*
|
||||
* TODO: remove this method in next major release. it is buggy
|
||||
* see
|
||||
* - https://github.com/diegomura/react-pdf/issues/2112
|
||||
* - https://github.com/diegomura/react-pdf/issues/2095
|
||||
*/
|
||||
const toString = async () => {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.warn('`toString` is deprecated and will be removed in next major release');
|
||||
}
|
||||
let result = '';
|
||||
const {
|
||||
fileStream: instance
|
||||
} = await render(false); // For some reason, when rendering to string if compress=true the document is blank
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
instance.on('data', buffer => {
|
||||
result += buffer;
|
||||
});
|
||||
instance.on('end', () => {
|
||||
callOnRender();
|
||||
resolve(result);
|
||||
});
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
};
|
||||
const on = (event, listener) => {
|
||||
if (!events[event]) events[event] = [];
|
||||
events[event].push(listener);
|
||||
};
|
||||
const removeListener = (event, listener) => {
|
||||
if (!events[event]) return;
|
||||
const idx = events[event].indexOf(listener);
|
||||
if (idx > -1) events[event].splice(idx, 1);
|
||||
};
|
||||
return {
|
||||
on,
|
||||
container,
|
||||
toBlob,
|
||||
toBuffer,
|
||||
toString,
|
||||
removeListener,
|
||||
updateContainer
|
||||
};
|
||||
};
|
||||
const Font = fontStore;
|
||||
const StyleSheet = {
|
||||
create: s => s
|
||||
};
|
||||
|
||||
/**
|
||||
* PDF hook
|
||||
*
|
||||
* @param {Object} [options] hook options
|
||||
* @returns {[Object, Function]} pdf state and update function
|
||||
*/
|
||||
const usePDF = function (_temp) {
|
||||
let {
|
||||
document
|
||||
} = _temp === void 0 ? {} : _temp;
|
||||
const pdfInstance = useRef(null);
|
||||
const [state, setState] = useState({
|
||||
url: null,
|
||||
blob: null,
|
||||
error: null,
|
||||
loading: !!document
|
||||
});
|
||||
|
||||
// Setup rendering queue
|
||||
useEffect(() => {
|
||||
const renderQueue = queue({
|
||||
autostart: true,
|
||||
concurrency: 1
|
||||
});
|
||||
const queueDocumentRender = () => {
|
||||
setState(prev => ({
|
||||
...prev,
|
||||
loading: true
|
||||
}));
|
||||
renderQueue.splice(0, renderQueue.length, () => state.error ? Promise.resolve() : pdfInstance.current.toBlob());
|
||||
};
|
||||
const onRenderFailed = error => {
|
||||
console.error(error);
|
||||
setState(prev => ({
|
||||
...prev,
|
||||
loading: false,
|
||||
error
|
||||
}));
|
||||
};
|
||||
const onRenderSuccessful = blob => {
|
||||
setState({
|
||||
blob,
|
||||
error: null,
|
||||
loading: false,
|
||||
url: URL.createObjectURL(blob)
|
||||
});
|
||||
};
|
||||
pdfInstance.current = pdf();
|
||||
pdfInstance.current.on('change', queueDocumentRender);
|
||||
if (document) {
|
||||
pdfInstance.current.updateContainer(document);
|
||||
}
|
||||
renderQueue.on('error', onRenderFailed);
|
||||
renderQueue.on('success', onRenderSuccessful);
|
||||
return () => {
|
||||
renderQueue.end();
|
||||
pdfInstance.current.removeListener('change', queueDocumentRender);
|
||||
};
|
||||
}, []);
|
||||
|
||||
// Revoke old unused url instances
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
if (state.url) {
|
||||
URL.revokeObjectURL(state.url);
|
||||
}
|
||||
};
|
||||
}, [state.url]);
|
||||
const update = useCallback(newDoc => {
|
||||
pdfInstance.current.updateContainer(newDoc);
|
||||
}, []);
|
||||
return [state, update];
|
||||
};
|
||||
|
||||
const PDFViewer = _ref => {
|
||||
let {
|
||||
title,
|
||||
style,
|
||||
className,
|
||||
children,
|
||||
innerRef,
|
||||
showToolbar = true,
|
||||
...props
|
||||
} = _ref;
|
||||
const [instance, updateInstance] = usePDF();
|
||||
useEffect(() => updateInstance(children), [children]);
|
||||
const src = instance.url ? `${instance.url}#toolbar=${showToolbar ? 1 : 0}` : null;
|
||||
return /*#__PURE__*/jsx("iframe", {
|
||||
src: src,
|
||||
title: title,
|
||||
ref: innerRef,
|
||||
style: style,
|
||||
className: className,
|
||||
...props
|
||||
});
|
||||
};
|
||||
|
||||
const BlobProvider = _ref => {
|
||||
let {
|
||||
document: doc,
|
||||
children
|
||||
} = _ref;
|
||||
const [instance, updateInstance] = usePDF();
|
||||
useEffect(() => updateInstance(doc), [doc]);
|
||||
if (!doc) {
|
||||
console.warn('You should pass a valid document to BlobProvider');
|
||||
return null;
|
||||
}
|
||||
return children(instance);
|
||||
};
|
||||
|
||||
const PDFDownloadLinkBase = (_ref, ref) => {
|
||||
let {
|
||||
fileName = 'document.pdf',
|
||||
document: doc,
|
||||
children,
|
||||
onClick,
|
||||
href,
|
||||
...rest
|
||||
} = _ref;
|
||||
const [instance, updateInstance] = usePDF();
|
||||
useEffect(() => updateInstance(doc), [doc]);
|
||||
if (!doc) {
|
||||
console.warn('You should pass a valid document to PDFDownloadLink');
|
||||
return null;
|
||||
}
|
||||
const handleDownloadIE = () => {
|
||||
if (instance && window.navigator.msSaveBlob) {
|
||||
// IE
|
||||
window.navigator.msSaveBlob(instance.blob, fileName);
|
||||
}
|
||||
};
|
||||
const handleClick = event => {
|
||||
handleDownloadIE();
|
||||
if (typeof onClick === 'function') onClick(event, instance);
|
||||
};
|
||||
return /*#__PURE__*/jsx("a", {
|
||||
href: instance.url,
|
||||
download: fileName,
|
||||
onClick: handleClick,
|
||||
ref: ref,
|
||||
...rest,
|
||||
children: typeof children === 'function' ? children(instance) : children
|
||||
});
|
||||
};
|
||||
const PDFDownloadLink = /*#__PURE__*/forwardRef(PDFDownloadLinkBase);
|
||||
|
||||
const throwEnvironmentError = name => {
|
||||
throw new Error(`${name} is a Node specific API. You're either using this method in a browser, or your bundler is not loading react-pdf from the appropriate web build.`);
|
||||
};
|
||||
const renderToStream = () => {
|
||||
throwEnvironmentError('renderToStream');
|
||||
};
|
||||
const renderToBuffer = () => {
|
||||
throwEnvironmentError('renderToBuffer');
|
||||
};
|
||||
const renderToString = () => {
|
||||
throwEnvironmentError('renderToString');
|
||||
};
|
||||
const renderToFile = () => {
|
||||
throwEnvironmentError('renderToFile');
|
||||
};
|
||||
const render = () => {
|
||||
throwEnvironmentError('render');
|
||||
};
|
||||
|
||||
// TODO: remove this default export in next major release because it breaks tree-shacking
|
||||
var index = {
|
||||
pdf,
|
||||
usePDF,
|
||||
Font,
|
||||
version,
|
||||
StyleSheet,
|
||||
PDFViewer,
|
||||
BlobProvider,
|
||||
PDFDownloadLink,
|
||||
renderToStream,
|
||||
renderToString,
|
||||
renderToFile,
|
||||
render,
|
||||
...primitives
|
||||
};
|
||||
|
||||
export { BlobProvider, Font, PDFDownloadLink, PDFViewer, StyleSheet, createRenderer, index as default, pdf, render, renderToBuffer, renderToFile, renderToStream, renderToString, usePDF, version };
|
||||
//# sourceMappingURL=react-pdf.browser.js.map
|
||||
1
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.browser.js.map
generated
vendored
Normal file
1
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.browser.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.browser.min.d.cts
generated
vendored
Normal file
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.browser.min.d.cts
generated
vendored
Normal file
@@ -0,0 +1,793 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Style,
|
||||
PageSize,
|
||||
FontStore,
|
||||
PDFVersion,
|
||||
Orientation,
|
||||
SourceObject,
|
||||
SrcSet,
|
||||
Sizes,
|
||||
HyphenationCallback,
|
||||
SVGPresentationAttributes,
|
||||
Bookmark,
|
||||
PageLayout,
|
||||
PageMode,
|
||||
HitSlop,
|
||||
} from '@react-pdf/types';
|
||||
|
||||
declare class ReactPDF {
|
||||
static default: typeof ReactPDF;
|
||||
}
|
||||
|
||||
export = ReactPDF;
|
||||
|
||||
declare namespace ReactPDF {
|
||||
interface Styles {
|
||||
[key: string]: Style;
|
||||
}
|
||||
interface OnRenderProps {
|
||||
blob?: Blob;
|
||||
}
|
||||
|
||||
interface Permissions {
|
||||
printing?: 'lowResolution' | 'highResolution';
|
||||
modifying?: boolean;
|
||||
copying?: boolean;
|
||||
annotating?: boolean;
|
||||
fillingForms?: boolean;
|
||||
contentAccessibility?: boolean;
|
||||
documentAssembly?: boolean;
|
||||
}
|
||||
|
||||
interface DocumentProps {
|
||||
style?: Style | Style[];
|
||||
title?: string;
|
||||
author?: string;
|
||||
subject?: string;
|
||||
creator?: string;
|
||||
keywords?: string;
|
||||
producer?: string;
|
||||
language?: string;
|
||||
creationDate?: Date;
|
||||
modificationDate?: Date;
|
||||
pdfVersion?: PDFVersion;
|
||||
pageMode?: PageMode;
|
||||
pageLayout?: PageLayout;
|
||||
ownerPassword?: string;
|
||||
userPassword?: string;
|
||||
permissions?: Permissions;
|
||||
onRender?: (props: OnRenderProps) => any;
|
||||
}
|
||||
|
||||
/**
|
||||
* This component represent the PDF document itself. It must be the root
|
||||
* of your tree element structure, and under no circumstances should it be
|
||||
* used as children of another react-pdf component. In addition, it should
|
||||
* only have childs of type <Page />.
|
||||
*/
|
||||
export class Document extends React.Component<
|
||||
React.PropsWithChildren<DocumentProps>
|
||||
> {}
|
||||
|
||||
interface NodeProps {
|
||||
id?: string;
|
||||
style?: Style | Style[];
|
||||
/**
|
||||
* Render component in all wrapped pages.
|
||||
* @see https://react-pdf.org/advanced#fixed-components
|
||||
*/
|
||||
fixed?: boolean;
|
||||
/**
|
||||
* Force the wrapping algorithm to start a new page when rendering the
|
||||
* element.
|
||||
* @see https://react-pdf.org/advanced#page-breaks
|
||||
*/
|
||||
break?: boolean;
|
||||
/**
|
||||
* Hint that no page wrapping should occur between all sibling elements following the element within n points
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
minPresenceAhead?: number;
|
||||
}
|
||||
|
||||
interface PageProps extends NodeProps {
|
||||
/**
|
||||
* Enable page wrapping for this page.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
size?: PageSize;
|
||||
orientation?: Orientation;
|
||||
dpi?: number;
|
||||
bookmark?: Bookmark;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents single page inside the PDF document, or a subset of them if
|
||||
* using the wrapping feature. A <Document /> can contain as many pages as
|
||||
* you want, but ensure not rendering a page inside any component besides
|
||||
* Document.
|
||||
*/
|
||||
export class Page extends React.Component<
|
||||
React.PropsWithChildren<PageProps>
|
||||
> {}
|
||||
|
||||
interface ViewProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
subPageNumber: number;
|
||||
}) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* The most fundamental component for building a UI and is designed to be
|
||||
* nested inside other views and can have 0 to many children.
|
||||
*/
|
||||
export class View extends React.Component<
|
||||
React.PropsWithChildren<ViewProps>
|
||||
> {}
|
||||
|
||||
interface BaseImageProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* Works like the HTML img sizes attribute.
|
||||
* @example 300
|
||||
* @example "300"
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
}
|
||||
|
||||
interface ImageWithSrcProp extends BaseImageProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageWithSourceProp extends BaseImageProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying network or local (Node only) JPG or
|
||||
* PNG images, as well as base64 encoded image strings.
|
||||
*/
|
||||
export class Image extends React.Component<ImageProps> {}
|
||||
|
||||
interface BaseImageBackgroundProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* @example 300
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
/**
|
||||
* Style applied to the background image.
|
||||
*/
|
||||
imageStyle?: Style;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageBackgroundProps =
|
||||
| ImageBackgroundWithSrcProp
|
||||
| ImageBackgroundWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying an image behind child content.
|
||||
* Compatible with React Native's ImageBackground component.
|
||||
* @see https://reactnative.dev/docs/imagebackground
|
||||
*/
|
||||
export class ImageBackground extends React.Component<
|
||||
React.PropsWithChildren<ImageBackgroundProps>
|
||||
> {}
|
||||
|
||||
interface TextProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
totalPages: number;
|
||||
subPageNumber: number;
|
||||
subPageTotalPages: number;
|
||||
}) => React.ReactNode;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
orphans?: number;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
widows?: number;
|
||||
}
|
||||
|
||||
interface SVGTextProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x: string | number;
|
||||
y: string | number;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying text. Text supports nesting of other
|
||||
* Text or Link components to create inline styling.
|
||||
*/
|
||||
export class Text extends React.Component<
|
||||
React.PropsWithChildren<TextProps> | SVGTextProps
|
||||
> {}
|
||||
|
||||
interface LinkProps extends NodeProps {
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
href?: string;
|
||||
src?: string;
|
||||
/**
|
||||
* Extends the clickable area of the link beyond its visible bounds.
|
||||
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
|
||||
* @see https://reactnative.dev/docs/view#hitslop
|
||||
*/
|
||||
hitSlop?: HitSlop;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying a hyperlink. Link’s can be nested
|
||||
* inside a Text component, or being inside any other valid primitive.
|
||||
*/
|
||||
export class Link extends React.Component<
|
||||
React.PropsWithChildren<LinkProps>
|
||||
> {}
|
||||
|
||||
interface FormCommonProps extends NodeProps {
|
||||
name?: string;
|
||||
required?: boolean;
|
||||
noExport?: boolean;
|
||||
readOnly?: boolean;
|
||||
value?: number | string;
|
||||
defaultValue?: number | string;
|
||||
}
|
||||
|
||||
interface FieldSetProps extends NodeProps {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class FieldSet extends React.Component<
|
||||
React.PropsWithChildren<FieldSetProps>
|
||||
> {}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputFormatting {
|
||||
type:
|
||||
| 'date'
|
||||
| 'time'
|
||||
| 'percent'
|
||||
| 'number'
|
||||
| 'zip'
|
||||
| 'zipPlus4'
|
||||
| 'phone'
|
||||
| 'ssn';
|
||||
param?: string;
|
||||
nDec?: number;
|
||||
sepComma?: boolean;
|
||||
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
|
||||
currency?: string;
|
||||
currencyPrepend?: boolean;
|
||||
}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputProps extends FormCommonProps {
|
||||
align?: 'left' | 'center' | 'right';
|
||||
multiline?: boolean;
|
||||
/**
|
||||
* The text will be masked (e.g. with asterisks).
|
||||
*/
|
||||
password?: boolean;
|
||||
/**
|
||||
* If set, text entered in the field is not spell-checked
|
||||
*/
|
||||
noSpell?: boolean;
|
||||
format?: TextInputFormatting;
|
||||
/**
|
||||
* Sets the fontSize (default or 0 means auto sizing)
|
||||
*/
|
||||
fontSize?: number;
|
||||
/**
|
||||
* Sets the maximum length (characters) of the text in the field
|
||||
*/
|
||||
maxLength?: number;
|
||||
}
|
||||
|
||||
export class TextInput extends React.Component<TextInputProps> {}
|
||||
|
||||
interface CheckboxProps extends FormCommonProps {
|
||||
backgroundColor?: string;
|
||||
borderColor?: string;
|
||||
checked?: boolean;
|
||||
onState?: string;
|
||||
offState?: string;
|
||||
xMark?: boolean;
|
||||
}
|
||||
|
||||
export class Checkbox extends React.Component<CheckboxProps> {}
|
||||
|
||||
interface SelectAndListPropsBase extends FormCommonProps {
|
||||
sort?: boolean;
|
||||
edit?: boolean;
|
||||
multiSelect?: boolean;
|
||||
noSpell?: boolean;
|
||||
select?: string[];
|
||||
}
|
||||
|
||||
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
|
||||
edit: true | false;
|
||||
noSpell: boolean;
|
||||
};
|
||||
|
||||
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
|
||||
edit: boolean;
|
||||
noSpell: true | false;
|
||||
};
|
||||
|
||||
type SelectAndListProps =
|
||||
| SelectAndListPropsWithEdit
|
||||
| SelectAndListPropsWithNoSpell;
|
||||
|
||||
export class Select extends React.Component<SelectAndListProps> {}
|
||||
|
||||
export class List extends React.Component<SelectAndListProps> {}
|
||||
|
||||
interface NoteProps extends NodeProps {
|
||||
children: string;
|
||||
}
|
||||
|
||||
export class Note extends React.Component<NoteProps> {}
|
||||
|
||||
interface CanvasProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
paint: (
|
||||
painter: any,
|
||||
availableWidth: number,
|
||||
availableHeight: number,
|
||||
) => null;
|
||||
}
|
||||
|
||||
export class Canvas extends React.Component<CanvasProps> {}
|
||||
|
||||
interface SVGProps extends NodeProps, SVGPresentationAttributes {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
width?: string | number;
|
||||
height?: string | number;
|
||||
viewBox?: string;
|
||||
preserveAspectRatio?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
|
||||
*/
|
||||
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
|
||||
|
||||
interface LineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x1: string | number;
|
||||
x2: string | number;
|
||||
y1: string | number;
|
||||
y2: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Line /> element is used to create a line.
|
||||
*/
|
||||
export class Line extends React.Component<
|
||||
React.PropsWithChildren<LineProps>
|
||||
> {}
|
||||
|
||||
interface PolylineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
|
||||
*/
|
||||
export class Polyline extends React.Component<
|
||||
React.PropsWithChildren<PolylineProps>
|
||||
> {}
|
||||
|
||||
interface PolygonProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polygon /> element is used to create a graphic that contains at least three sides.
|
||||
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
|
||||
*/
|
||||
export class Polygon extends React.Component<
|
||||
React.PropsWithChildren<PolygonProps>
|
||||
> {}
|
||||
|
||||
interface PathProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
d: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
|
||||
*/
|
||||
export class Path extends React.Component<
|
||||
React.PropsWithChildren<PathProps>
|
||||
> {}
|
||||
|
||||
interface RectProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
width: string | number;
|
||||
height: string | number;
|
||||
rx?: string | number;
|
||||
ry?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
|
||||
*/
|
||||
export class Rect extends React.Component<
|
||||
React.PropsWithChildren<RectProps>
|
||||
> {}
|
||||
|
||||
interface CircleProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Circle /> element is used to create a circle.
|
||||
*/
|
||||
export class Circle extends React.Component<
|
||||
React.PropsWithChildren<CircleProps>
|
||||
> {}
|
||||
|
||||
interface EllipseProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
rx: string | number;
|
||||
ry: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Ellipse /> element is used to create an ellipse.
|
||||
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
|
||||
*/
|
||||
export class Ellipse extends React.Component<
|
||||
React.PropsWithChildren<EllipseProps>
|
||||
> {}
|
||||
|
||||
interface TspanProps extends SVGPresentationAttributes {
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
|
||||
* It allows for adjustment of the style and/or position of that subtext as needed.
|
||||
*/
|
||||
export class Tspan extends React.Component<
|
||||
React.PropsWithChildren<TspanProps>
|
||||
> {}
|
||||
|
||||
interface GProps extends SVGPresentationAttributes {
|
||||
style?: Style;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <G /> SVG element is a container used to group other SVG elements.
|
||||
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
|
||||
*/
|
||||
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
|
||||
|
||||
interface StopProps {
|
||||
offset: string | number;
|
||||
stopColor: string;
|
||||
stopOpacity?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
|
||||
*/
|
||||
export class Stop extends React.Component<
|
||||
React.PropsWithChildren<StopProps>
|
||||
> {}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface DefsProps {}
|
||||
|
||||
/**
|
||||
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
|
||||
*/
|
||||
export class Defs extends React.Component<
|
||||
React.PropsWithChildren<DefsProps>
|
||||
> {}
|
||||
|
||||
interface ClipPathProps {
|
||||
id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
|
||||
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
|
||||
*/
|
||||
export class ClipPath extends React.Component<
|
||||
React.PropsWithChildren<ClipPathProps>
|
||||
> {}
|
||||
|
||||
interface MarkerProps {
|
||||
id: string;
|
||||
viewBox?: string;
|
||||
refX?: string | number;
|
||||
refY?: string | number;
|
||||
markerWidth?: string | number;
|
||||
markerHeight?: string | number;
|
||||
orient?: 'auto' | 'auto-start-reverse' | number;
|
||||
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
|
||||
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
|
||||
*/
|
||||
export class Marker extends React.Component<
|
||||
React.PropsWithChildren<MarkerProps>
|
||||
> {}
|
||||
|
||||
interface LinearGradientProps {
|
||||
id: string;
|
||||
x1?: string | number;
|
||||
x2?: string | number;
|
||||
y1?: string | number;
|
||||
y2?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class LinearGradient extends React.Component<
|
||||
React.PropsWithChildren<LinearGradientProps>
|
||||
> {}
|
||||
|
||||
interface RadialGradientProps {
|
||||
id: string;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r?: string | number;
|
||||
fx?: string | number;
|
||||
fy?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class RadialGradient extends React.Component<
|
||||
React.PropsWithChildren<RadialGradientProps>
|
||||
> {}
|
||||
|
||||
interface BlobProviderParams {
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
loading: boolean;
|
||||
error: Error | null;
|
||||
}
|
||||
interface BlobProviderProps {
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children: (params: BlobProviderParams) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easy and declarative way of getting document's blob data without
|
||||
* showing it on screen.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class BlobProvider extends React.Component<BlobProviderProps> {}
|
||||
|
||||
interface PDFViewerProps {
|
||||
width?: number | string;
|
||||
height?: number | string;
|
||||
style?: Style | Style[];
|
||||
className?: string;
|
||||
children?: React.ReactElement<DocumentProps>;
|
||||
innerRef?: React.Ref<HTMLIFrameElement>;
|
||||
showToolbar?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iframe PDF viewer for client-side generated documents.
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFViewer extends React.Component<PDFViewerProps> {}
|
||||
|
||||
interface PDFDownloadLinkProps
|
||||
extends Omit<
|
||||
React.AnchorHTMLAttributes<HTMLAnchorElement>,
|
||||
'href' | 'children'
|
||||
> {
|
||||
/** PDF filename. Alias for anchor tag `download` attribute. */
|
||||
fileName?: string;
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children?: React.ReactNode | React.FC<BlobProviderParams>;
|
||||
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
|
||||
((
|
||||
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
|
||||
instance: UsePDFInstance,
|
||||
) => void);
|
||||
ref?: React.Ref<HTMLAnchorElement> | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Anchor tag to enable generate and download PDF documents on the fly.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
|
||||
|
||||
interface UsePDFInstance {
|
||||
loading: boolean;
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* React hook for creating and updating a PDF document instance
|
||||
* @platform web
|
||||
*/
|
||||
export function usePDF(options?: {
|
||||
document?: React.ReactElement<DocumentProps>;
|
||||
}): [
|
||||
UsePDFInstance,
|
||||
(newDocument: React.ReactElement<DocumentProps>) => void,
|
||||
];
|
||||
|
||||
export const Font: FontStore;
|
||||
|
||||
export const StyleSheet: {
|
||||
create: <T extends Styles>(styles: T) => T;
|
||||
};
|
||||
|
||||
export const version: any;
|
||||
|
||||
export const PDFRenderer: any;
|
||||
|
||||
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
|
||||
container: any;
|
||||
isDirty: () => boolean;
|
||||
toString: () => string;
|
||||
toBlob: () => Promise<Blob>;
|
||||
toBuffer: () => Promise<NodeJS.ReadableStream>;
|
||||
on: (event: 'change', callback: () => void) => void;
|
||||
updateContainer: (
|
||||
document: React.ReactElement<any>,
|
||||
callback?: () => void,
|
||||
) => void;
|
||||
removeListener: (event: 'change', callback: () => void) => void;
|
||||
};
|
||||
|
||||
export const renderToStream: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
/**
|
||||
* @deprecated use the `renderToBuffer` method
|
||||
*/
|
||||
export const renderToString: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<string>;
|
||||
|
||||
export const renderToFile: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
filePath: string,
|
||||
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
const render: typeof renderToFile;
|
||||
|
||||
/**
|
||||
* Render document into a nodejs buffer
|
||||
* @platform node
|
||||
*/
|
||||
export const renderToBuffer: (
|
||||
document: React.ReactElement<ReactPDF.DocumentProps>,
|
||||
) => Promise<Buffer>;
|
||||
}
|
||||
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.browser.min.d.ts
generated
vendored
Normal file
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.browser.min.d.ts
generated
vendored
Normal file
@@ -0,0 +1,793 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Style,
|
||||
PageSize,
|
||||
FontStore,
|
||||
PDFVersion,
|
||||
Orientation,
|
||||
SourceObject,
|
||||
SrcSet,
|
||||
Sizes,
|
||||
HyphenationCallback,
|
||||
SVGPresentationAttributes,
|
||||
Bookmark,
|
||||
PageLayout,
|
||||
PageMode,
|
||||
HitSlop,
|
||||
} from '@react-pdf/types';
|
||||
|
||||
declare class ReactPDF {
|
||||
static default: typeof ReactPDF;
|
||||
}
|
||||
|
||||
export = ReactPDF;
|
||||
|
||||
declare namespace ReactPDF {
|
||||
interface Styles {
|
||||
[key: string]: Style;
|
||||
}
|
||||
interface OnRenderProps {
|
||||
blob?: Blob;
|
||||
}
|
||||
|
||||
interface Permissions {
|
||||
printing?: 'lowResolution' | 'highResolution';
|
||||
modifying?: boolean;
|
||||
copying?: boolean;
|
||||
annotating?: boolean;
|
||||
fillingForms?: boolean;
|
||||
contentAccessibility?: boolean;
|
||||
documentAssembly?: boolean;
|
||||
}
|
||||
|
||||
interface DocumentProps {
|
||||
style?: Style | Style[];
|
||||
title?: string;
|
||||
author?: string;
|
||||
subject?: string;
|
||||
creator?: string;
|
||||
keywords?: string;
|
||||
producer?: string;
|
||||
language?: string;
|
||||
creationDate?: Date;
|
||||
modificationDate?: Date;
|
||||
pdfVersion?: PDFVersion;
|
||||
pageMode?: PageMode;
|
||||
pageLayout?: PageLayout;
|
||||
ownerPassword?: string;
|
||||
userPassword?: string;
|
||||
permissions?: Permissions;
|
||||
onRender?: (props: OnRenderProps) => any;
|
||||
}
|
||||
|
||||
/**
|
||||
* This component represent the PDF document itself. It must be the root
|
||||
* of your tree element structure, and under no circumstances should it be
|
||||
* used as children of another react-pdf component. In addition, it should
|
||||
* only have childs of type <Page />.
|
||||
*/
|
||||
export class Document extends React.Component<
|
||||
React.PropsWithChildren<DocumentProps>
|
||||
> {}
|
||||
|
||||
interface NodeProps {
|
||||
id?: string;
|
||||
style?: Style | Style[];
|
||||
/**
|
||||
* Render component in all wrapped pages.
|
||||
* @see https://react-pdf.org/advanced#fixed-components
|
||||
*/
|
||||
fixed?: boolean;
|
||||
/**
|
||||
* Force the wrapping algorithm to start a new page when rendering the
|
||||
* element.
|
||||
* @see https://react-pdf.org/advanced#page-breaks
|
||||
*/
|
||||
break?: boolean;
|
||||
/**
|
||||
* Hint that no page wrapping should occur between all sibling elements following the element within n points
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
minPresenceAhead?: number;
|
||||
}
|
||||
|
||||
interface PageProps extends NodeProps {
|
||||
/**
|
||||
* Enable page wrapping for this page.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
size?: PageSize;
|
||||
orientation?: Orientation;
|
||||
dpi?: number;
|
||||
bookmark?: Bookmark;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents single page inside the PDF document, or a subset of them if
|
||||
* using the wrapping feature. A <Document /> can contain as many pages as
|
||||
* you want, but ensure not rendering a page inside any component besides
|
||||
* Document.
|
||||
*/
|
||||
export class Page extends React.Component<
|
||||
React.PropsWithChildren<PageProps>
|
||||
> {}
|
||||
|
||||
interface ViewProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
subPageNumber: number;
|
||||
}) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* The most fundamental component for building a UI and is designed to be
|
||||
* nested inside other views and can have 0 to many children.
|
||||
*/
|
||||
export class View extends React.Component<
|
||||
React.PropsWithChildren<ViewProps>
|
||||
> {}
|
||||
|
||||
interface BaseImageProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* Works like the HTML img sizes attribute.
|
||||
* @example 300
|
||||
* @example "300"
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
}
|
||||
|
||||
interface ImageWithSrcProp extends BaseImageProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageWithSourceProp extends BaseImageProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying network or local (Node only) JPG or
|
||||
* PNG images, as well as base64 encoded image strings.
|
||||
*/
|
||||
export class Image extends React.Component<ImageProps> {}
|
||||
|
||||
interface BaseImageBackgroundProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* @example 300
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
/**
|
||||
* Style applied to the background image.
|
||||
*/
|
||||
imageStyle?: Style;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageBackgroundProps =
|
||||
| ImageBackgroundWithSrcProp
|
||||
| ImageBackgroundWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying an image behind child content.
|
||||
* Compatible with React Native's ImageBackground component.
|
||||
* @see https://reactnative.dev/docs/imagebackground
|
||||
*/
|
||||
export class ImageBackground extends React.Component<
|
||||
React.PropsWithChildren<ImageBackgroundProps>
|
||||
> {}
|
||||
|
||||
interface TextProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
totalPages: number;
|
||||
subPageNumber: number;
|
||||
subPageTotalPages: number;
|
||||
}) => React.ReactNode;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
orphans?: number;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
widows?: number;
|
||||
}
|
||||
|
||||
interface SVGTextProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x: string | number;
|
||||
y: string | number;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying text. Text supports nesting of other
|
||||
* Text or Link components to create inline styling.
|
||||
*/
|
||||
export class Text extends React.Component<
|
||||
React.PropsWithChildren<TextProps> | SVGTextProps
|
||||
> {}
|
||||
|
||||
interface LinkProps extends NodeProps {
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
href?: string;
|
||||
src?: string;
|
||||
/**
|
||||
* Extends the clickable area of the link beyond its visible bounds.
|
||||
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
|
||||
* @see https://reactnative.dev/docs/view#hitslop
|
||||
*/
|
||||
hitSlop?: HitSlop;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying a hyperlink. Link’s can be nested
|
||||
* inside a Text component, or being inside any other valid primitive.
|
||||
*/
|
||||
export class Link extends React.Component<
|
||||
React.PropsWithChildren<LinkProps>
|
||||
> {}
|
||||
|
||||
interface FormCommonProps extends NodeProps {
|
||||
name?: string;
|
||||
required?: boolean;
|
||||
noExport?: boolean;
|
||||
readOnly?: boolean;
|
||||
value?: number | string;
|
||||
defaultValue?: number | string;
|
||||
}
|
||||
|
||||
interface FieldSetProps extends NodeProps {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class FieldSet extends React.Component<
|
||||
React.PropsWithChildren<FieldSetProps>
|
||||
> {}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputFormatting {
|
||||
type:
|
||||
| 'date'
|
||||
| 'time'
|
||||
| 'percent'
|
||||
| 'number'
|
||||
| 'zip'
|
||||
| 'zipPlus4'
|
||||
| 'phone'
|
||||
| 'ssn';
|
||||
param?: string;
|
||||
nDec?: number;
|
||||
sepComma?: boolean;
|
||||
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
|
||||
currency?: string;
|
||||
currencyPrepend?: boolean;
|
||||
}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputProps extends FormCommonProps {
|
||||
align?: 'left' | 'center' | 'right';
|
||||
multiline?: boolean;
|
||||
/**
|
||||
* The text will be masked (e.g. with asterisks).
|
||||
*/
|
||||
password?: boolean;
|
||||
/**
|
||||
* If set, text entered in the field is not spell-checked
|
||||
*/
|
||||
noSpell?: boolean;
|
||||
format?: TextInputFormatting;
|
||||
/**
|
||||
* Sets the fontSize (default or 0 means auto sizing)
|
||||
*/
|
||||
fontSize?: number;
|
||||
/**
|
||||
* Sets the maximum length (characters) of the text in the field
|
||||
*/
|
||||
maxLength?: number;
|
||||
}
|
||||
|
||||
export class TextInput extends React.Component<TextInputProps> {}
|
||||
|
||||
interface CheckboxProps extends FormCommonProps {
|
||||
backgroundColor?: string;
|
||||
borderColor?: string;
|
||||
checked?: boolean;
|
||||
onState?: string;
|
||||
offState?: string;
|
||||
xMark?: boolean;
|
||||
}
|
||||
|
||||
export class Checkbox extends React.Component<CheckboxProps> {}
|
||||
|
||||
interface SelectAndListPropsBase extends FormCommonProps {
|
||||
sort?: boolean;
|
||||
edit?: boolean;
|
||||
multiSelect?: boolean;
|
||||
noSpell?: boolean;
|
||||
select?: string[];
|
||||
}
|
||||
|
||||
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
|
||||
edit: true | false;
|
||||
noSpell: boolean;
|
||||
};
|
||||
|
||||
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
|
||||
edit: boolean;
|
||||
noSpell: true | false;
|
||||
};
|
||||
|
||||
type SelectAndListProps =
|
||||
| SelectAndListPropsWithEdit
|
||||
| SelectAndListPropsWithNoSpell;
|
||||
|
||||
export class Select extends React.Component<SelectAndListProps> {}
|
||||
|
||||
export class List extends React.Component<SelectAndListProps> {}
|
||||
|
||||
interface NoteProps extends NodeProps {
|
||||
children: string;
|
||||
}
|
||||
|
||||
export class Note extends React.Component<NoteProps> {}
|
||||
|
||||
interface CanvasProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
paint: (
|
||||
painter: any,
|
||||
availableWidth: number,
|
||||
availableHeight: number,
|
||||
) => null;
|
||||
}
|
||||
|
||||
export class Canvas extends React.Component<CanvasProps> {}
|
||||
|
||||
interface SVGProps extends NodeProps, SVGPresentationAttributes {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
width?: string | number;
|
||||
height?: string | number;
|
||||
viewBox?: string;
|
||||
preserveAspectRatio?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
|
||||
*/
|
||||
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
|
||||
|
||||
interface LineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x1: string | number;
|
||||
x2: string | number;
|
||||
y1: string | number;
|
||||
y2: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Line /> element is used to create a line.
|
||||
*/
|
||||
export class Line extends React.Component<
|
||||
React.PropsWithChildren<LineProps>
|
||||
> {}
|
||||
|
||||
interface PolylineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
|
||||
*/
|
||||
export class Polyline extends React.Component<
|
||||
React.PropsWithChildren<PolylineProps>
|
||||
> {}
|
||||
|
||||
interface PolygonProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polygon /> element is used to create a graphic that contains at least three sides.
|
||||
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
|
||||
*/
|
||||
export class Polygon extends React.Component<
|
||||
React.PropsWithChildren<PolygonProps>
|
||||
> {}
|
||||
|
||||
interface PathProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
d: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
|
||||
*/
|
||||
export class Path extends React.Component<
|
||||
React.PropsWithChildren<PathProps>
|
||||
> {}
|
||||
|
||||
interface RectProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
width: string | number;
|
||||
height: string | number;
|
||||
rx?: string | number;
|
||||
ry?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
|
||||
*/
|
||||
export class Rect extends React.Component<
|
||||
React.PropsWithChildren<RectProps>
|
||||
> {}
|
||||
|
||||
interface CircleProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Circle /> element is used to create a circle.
|
||||
*/
|
||||
export class Circle extends React.Component<
|
||||
React.PropsWithChildren<CircleProps>
|
||||
> {}
|
||||
|
||||
interface EllipseProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
rx: string | number;
|
||||
ry: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Ellipse /> element is used to create an ellipse.
|
||||
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
|
||||
*/
|
||||
export class Ellipse extends React.Component<
|
||||
React.PropsWithChildren<EllipseProps>
|
||||
> {}
|
||||
|
||||
interface TspanProps extends SVGPresentationAttributes {
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
|
||||
* It allows for adjustment of the style and/or position of that subtext as needed.
|
||||
*/
|
||||
export class Tspan extends React.Component<
|
||||
React.PropsWithChildren<TspanProps>
|
||||
> {}
|
||||
|
||||
interface GProps extends SVGPresentationAttributes {
|
||||
style?: Style;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <G /> SVG element is a container used to group other SVG elements.
|
||||
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
|
||||
*/
|
||||
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
|
||||
|
||||
interface StopProps {
|
||||
offset: string | number;
|
||||
stopColor: string;
|
||||
stopOpacity?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
|
||||
*/
|
||||
export class Stop extends React.Component<
|
||||
React.PropsWithChildren<StopProps>
|
||||
> {}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface DefsProps {}
|
||||
|
||||
/**
|
||||
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
|
||||
*/
|
||||
export class Defs extends React.Component<
|
||||
React.PropsWithChildren<DefsProps>
|
||||
> {}
|
||||
|
||||
interface ClipPathProps {
|
||||
id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
|
||||
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
|
||||
*/
|
||||
export class ClipPath extends React.Component<
|
||||
React.PropsWithChildren<ClipPathProps>
|
||||
> {}
|
||||
|
||||
interface MarkerProps {
|
||||
id: string;
|
||||
viewBox?: string;
|
||||
refX?: string | number;
|
||||
refY?: string | number;
|
||||
markerWidth?: string | number;
|
||||
markerHeight?: string | number;
|
||||
orient?: 'auto' | 'auto-start-reverse' | number;
|
||||
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
|
||||
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
|
||||
*/
|
||||
export class Marker extends React.Component<
|
||||
React.PropsWithChildren<MarkerProps>
|
||||
> {}
|
||||
|
||||
interface LinearGradientProps {
|
||||
id: string;
|
||||
x1?: string | number;
|
||||
x2?: string | number;
|
||||
y1?: string | number;
|
||||
y2?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class LinearGradient extends React.Component<
|
||||
React.PropsWithChildren<LinearGradientProps>
|
||||
> {}
|
||||
|
||||
interface RadialGradientProps {
|
||||
id: string;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r?: string | number;
|
||||
fx?: string | number;
|
||||
fy?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class RadialGradient extends React.Component<
|
||||
React.PropsWithChildren<RadialGradientProps>
|
||||
> {}
|
||||
|
||||
interface BlobProviderParams {
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
loading: boolean;
|
||||
error: Error | null;
|
||||
}
|
||||
interface BlobProviderProps {
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children: (params: BlobProviderParams) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easy and declarative way of getting document's blob data without
|
||||
* showing it on screen.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class BlobProvider extends React.Component<BlobProviderProps> {}
|
||||
|
||||
interface PDFViewerProps {
|
||||
width?: number | string;
|
||||
height?: number | string;
|
||||
style?: Style | Style[];
|
||||
className?: string;
|
||||
children?: React.ReactElement<DocumentProps>;
|
||||
innerRef?: React.Ref<HTMLIFrameElement>;
|
||||
showToolbar?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iframe PDF viewer for client-side generated documents.
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFViewer extends React.Component<PDFViewerProps> {}
|
||||
|
||||
interface PDFDownloadLinkProps
|
||||
extends Omit<
|
||||
React.AnchorHTMLAttributes<HTMLAnchorElement>,
|
||||
'href' | 'children'
|
||||
> {
|
||||
/** PDF filename. Alias for anchor tag `download` attribute. */
|
||||
fileName?: string;
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children?: React.ReactNode | React.FC<BlobProviderParams>;
|
||||
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
|
||||
((
|
||||
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
|
||||
instance: UsePDFInstance,
|
||||
) => void);
|
||||
ref?: React.Ref<HTMLAnchorElement> | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Anchor tag to enable generate and download PDF documents on the fly.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
|
||||
|
||||
interface UsePDFInstance {
|
||||
loading: boolean;
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* React hook for creating and updating a PDF document instance
|
||||
* @platform web
|
||||
*/
|
||||
export function usePDF(options?: {
|
||||
document?: React.ReactElement<DocumentProps>;
|
||||
}): [
|
||||
UsePDFInstance,
|
||||
(newDocument: React.ReactElement<DocumentProps>) => void,
|
||||
];
|
||||
|
||||
export const Font: FontStore;
|
||||
|
||||
export const StyleSheet: {
|
||||
create: <T extends Styles>(styles: T) => T;
|
||||
};
|
||||
|
||||
export const version: any;
|
||||
|
||||
export const PDFRenderer: any;
|
||||
|
||||
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
|
||||
container: any;
|
||||
isDirty: () => boolean;
|
||||
toString: () => string;
|
||||
toBlob: () => Promise<Blob>;
|
||||
toBuffer: () => Promise<NodeJS.ReadableStream>;
|
||||
on: (event: 'change', callback: () => void) => void;
|
||||
updateContainer: (
|
||||
document: React.ReactElement<any>,
|
||||
callback?: () => void,
|
||||
) => void;
|
||||
removeListener: (event: 'change', callback: () => void) => void;
|
||||
};
|
||||
|
||||
export const renderToStream: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
/**
|
||||
* @deprecated use the `renderToBuffer` method
|
||||
*/
|
||||
export const renderToString: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<string>;
|
||||
|
||||
export const renderToFile: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
filePath: string,
|
||||
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
const render: typeof renderToFile;
|
||||
|
||||
/**
|
||||
* Render document into a nodejs buffer
|
||||
* @platform node
|
||||
*/
|
||||
export const renderToBuffer: (
|
||||
document: React.ReactElement<ReactPDF.DocumentProps>,
|
||||
) => Promise<Buffer>;
|
||||
}
|
||||
1
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.browser.min.js
generated
vendored
Normal file
1
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.browser.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.d.cts
generated
vendored
Normal file
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.d.cts
generated
vendored
Normal file
@@ -0,0 +1,793 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Style,
|
||||
PageSize,
|
||||
FontStore,
|
||||
PDFVersion,
|
||||
Orientation,
|
||||
SourceObject,
|
||||
SrcSet,
|
||||
Sizes,
|
||||
HyphenationCallback,
|
||||
SVGPresentationAttributes,
|
||||
Bookmark,
|
||||
PageLayout,
|
||||
PageMode,
|
||||
HitSlop,
|
||||
} from '@react-pdf/types';
|
||||
|
||||
declare class ReactPDF {
|
||||
static default: typeof ReactPDF;
|
||||
}
|
||||
|
||||
export = ReactPDF;
|
||||
|
||||
declare namespace ReactPDF {
|
||||
interface Styles {
|
||||
[key: string]: Style;
|
||||
}
|
||||
interface OnRenderProps {
|
||||
blob?: Blob;
|
||||
}
|
||||
|
||||
interface Permissions {
|
||||
printing?: 'lowResolution' | 'highResolution';
|
||||
modifying?: boolean;
|
||||
copying?: boolean;
|
||||
annotating?: boolean;
|
||||
fillingForms?: boolean;
|
||||
contentAccessibility?: boolean;
|
||||
documentAssembly?: boolean;
|
||||
}
|
||||
|
||||
interface DocumentProps {
|
||||
style?: Style | Style[];
|
||||
title?: string;
|
||||
author?: string;
|
||||
subject?: string;
|
||||
creator?: string;
|
||||
keywords?: string;
|
||||
producer?: string;
|
||||
language?: string;
|
||||
creationDate?: Date;
|
||||
modificationDate?: Date;
|
||||
pdfVersion?: PDFVersion;
|
||||
pageMode?: PageMode;
|
||||
pageLayout?: PageLayout;
|
||||
ownerPassword?: string;
|
||||
userPassword?: string;
|
||||
permissions?: Permissions;
|
||||
onRender?: (props: OnRenderProps) => any;
|
||||
}
|
||||
|
||||
/**
|
||||
* This component represent the PDF document itself. It must be the root
|
||||
* of your tree element structure, and under no circumstances should it be
|
||||
* used as children of another react-pdf component. In addition, it should
|
||||
* only have childs of type <Page />.
|
||||
*/
|
||||
export class Document extends React.Component<
|
||||
React.PropsWithChildren<DocumentProps>
|
||||
> {}
|
||||
|
||||
interface NodeProps {
|
||||
id?: string;
|
||||
style?: Style | Style[];
|
||||
/**
|
||||
* Render component in all wrapped pages.
|
||||
* @see https://react-pdf.org/advanced#fixed-components
|
||||
*/
|
||||
fixed?: boolean;
|
||||
/**
|
||||
* Force the wrapping algorithm to start a new page when rendering the
|
||||
* element.
|
||||
* @see https://react-pdf.org/advanced#page-breaks
|
||||
*/
|
||||
break?: boolean;
|
||||
/**
|
||||
* Hint that no page wrapping should occur between all sibling elements following the element within n points
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
minPresenceAhead?: number;
|
||||
}
|
||||
|
||||
interface PageProps extends NodeProps {
|
||||
/**
|
||||
* Enable page wrapping for this page.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
size?: PageSize;
|
||||
orientation?: Orientation;
|
||||
dpi?: number;
|
||||
bookmark?: Bookmark;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents single page inside the PDF document, or a subset of them if
|
||||
* using the wrapping feature. A <Document /> can contain as many pages as
|
||||
* you want, but ensure not rendering a page inside any component besides
|
||||
* Document.
|
||||
*/
|
||||
export class Page extends React.Component<
|
||||
React.PropsWithChildren<PageProps>
|
||||
> {}
|
||||
|
||||
interface ViewProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
subPageNumber: number;
|
||||
}) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* The most fundamental component for building a UI and is designed to be
|
||||
* nested inside other views and can have 0 to many children.
|
||||
*/
|
||||
export class View extends React.Component<
|
||||
React.PropsWithChildren<ViewProps>
|
||||
> {}
|
||||
|
||||
interface BaseImageProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* Works like the HTML img sizes attribute.
|
||||
* @example 300
|
||||
* @example "300"
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
}
|
||||
|
||||
interface ImageWithSrcProp extends BaseImageProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageWithSourceProp extends BaseImageProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying network or local (Node only) JPG or
|
||||
* PNG images, as well as base64 encoded image strings.
|
||||
*/
|
||||
export class Image extends React.Component<ImageProps> {}
|
||||
|
||||
interface BaseImageBackgroundProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* @example 300
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
/**
|
||||
* Style applied to the background image.
|
||||
*/
|
||||
imageStyle?: Style;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageBackgroundProps =
|
||||
| ImageBackgroundWithSrcProp
|
||||
| ImageBackgroundWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying an image behind child content.
|
||||
* Compatible with React Native's ImageBackground component.
|
||||
* @see https://reactnative.dev/docs/imagebackground
|
||||
*/
|
||||
export class ImageBackground extends React.Component<
|
||||
React.PropsWithChildren<ImageBackgroundProps>
|
||||
> {}
|
||||
|
||||
interface TextProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
totalPages: number;
|
||||
subPageNumber: number;
|
||||
subPageTotalPages: number;
|
||||
}) => React.ReactNode;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
orphans?: number;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
widows?: number;
|
||||
}
|
||||
|
||||
interface SVGTextProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x: string | number;
|
||||
y: string | number;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying text. Text supports nesting of other
|
||||
* Text or Link components to create inline styling.
|
||||
*/
|
||||
export class Text extends React.Component<
|
||||
React.PropsWithChildren<TextProps> | SVGTextProps
|
||||
> {}
|
||||
|
||||
interface LinkProps extends NodeProps {
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
href?: string;
|
||||
src?: string;
|
||||
/**
|
||||
* Extends the clickable area of the link beyond its visible bounds.
|
||||
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
|
||||
* @see https://reactnative.dev/docs/view#hitslop
|
||||
*/
|
||||
hitSlop?: HitSlop;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying a hyperlink. Link’s can be nested
|
||||
* inside a Text component, or being inside any other valid primitive.
|
||||
*/
|
||||
export class Link extends React.Component<
|
||||
React.PropsWithChildren<LinkProps>
|
||||
> {}
|
||||
|
||||
interface FormCommonProps extends NodeProps {
|
||||
name?: string;
|
||||
required?: boolean;
|
||||
noExport?: boolean;
|
||||
readOnly?: boolean;
|
||||
value?: number | string;
|
||||
defaultValue?: number | string;
|
||||
}
|
||||
|
||||
interface FieldSetProps extends NodeProps {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class FieldSet extends React.Component<
|
||||
React.PropsWithChildren<FieldSetProps>
|
||||
> {}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputFormatting {
|
||||
type:
|
||||
| 'date'
|
||||
| 'time'
|
||||
| 'percent'
|
||||
| 'number'
|
||||
| 'zip'
|
||||
| 'zipPlus4'
|
||||
| 'phone'
|
||||
| 'ssn';
|
||||
param?: string;
|
||||
nDec?: number;
|
||||
sepComma?: boolean;
|
||||
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
|
||||
currency?: string;
|
||||
currencyPrepend?: boolean;
|
||||
}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputProps extends FormCommonProps {
|
||||
align?: 'left' | 'center' | 'right';
|
||||
multiline?: boolean;
|
||||
/**
|
||||
* The text will be masked (e.g. with asterisks).
|
||||
*/
|
||||
password?: boolean;
|
||||
/**
|
||||
* If set, text entered in the field is not spell-checked
|
||||
*/
|
||||
noSpell?: boolean;
|
||||
format?: TextInputFormatting;
|
||||
/**
|
||||
* Sets the fontSize (default or 0 means auto sizing)
|
||||
*/
|
||||
fontSize?: number;
|
||||
/**
|
||||
* Sets the maximum length (characters) of the text in the field
|
||||
*/
|
||||
maxLength?: number;
|
||||
}
|
||||
|
||||
export class TextInput extends React.Component<TextInputProps> {}
|
||||
|
||||
interface CheckboxProps extends FormCommonProps {
|
||||
backgroundColor?: string;
|
||||
borderColor?: string;
|
||||
checked?: boolean;
|
||||
onState?: string;
|
||||
offState?: string;
|
||||
xMark?: boolean;
|
||||
}
|
||||
|
||||
export class Checkbox extends React.Component<CheckboxProps> {}
|
||||
|
||||
interface SelectAndListPropsBase extends FormCommonProps {
|
||||
sort?: boolean;
|
||||
edit?: boolean;
|
||||
multiSelect?: boolean;
|
||||
noSpell?: boolean;
|
||||
select?: string[];
|
||||
}
|
||||
|
||||
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
|
||||
edit: true | false;
|
||||
noSpell: boolean;
|
||||
};
|
||||
|
||||
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
|
||||
edit: boolean;
|
||||
noSpell: true | false;
|
||||
};
|
||||
|
||||
type SelectAndListProps =
|
||||
| SelectAndListPropsWithEdit
|
||||
| SelectAndListPropsWithNoSpell;
|
||||
|
||||
export class Select extends React.Component<SelectAndListProps> {}
|
||||
|
||||
export class List extends React.Component<SelectAndListProps> {}
|
||||
|
||||
interface NoteProps extends NodeProps {
|
||||
children: string;
|
||||
}
|
||||
|
||||
export class Note extends React.Component<NoteProps> {}
|
||||
|
||||
interface CanvasProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
paint: (
|
||||
painter: any,
|
||||
availableWidth: number,
|
||||
availableHeight: number,
|
||||
) => null;
|
||||
}
|
||||
|
||||
export class Canvas extends React.Component<CanvasProps> {}
|
||||
|
||||
interface SVGProps extends NodeProps, SVGPresentationAttributes {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
width?: string | number;
|
||||
height?: string | number;
|
||||
viewBox?: string;
|
||||
preserveAspectRatio?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
|
||||
*/
|
||||
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
|
||||
|
||||
interface LineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x1: string | number;
|
||||
x2: string | number;
|
||||
y1: string | number;
|
||||
y2: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Line /> element is used to create a line.
|
||||
*/
|
||||
export class Line extends React.Component<
|
||||
React.PropsWithChildren<LineProps>
|
||||
> {}
|
||||
|
||||
interface PolylineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
|
||||
*/
|
||||
export class Polyline extends React.Component<
|
||||
React.PropsWithChildren<PolylineProps>
|
||||
> {}
|
||||
|
||||
interface PolygonProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polygon /> element is used to create a graphic that contains at least three sides.
|
||||
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
|
||||
*/
|
||||
export class Polygon extends React.Component<
|
||||
React.PropsWithChildren<PolygonProps>
|
||||
> {}
|
||||
|
||||
interface PathProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
d: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
|
||||
*/
|
||||
export class Path extends React.Component<
|
||||
React.PropsWithChildren<PathProps>
|
||||
> {}
|
||||
|
||||
interface RectProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
width: string | number;
|
||||
height: string | number;
|
||||
rx?: string | number;
|
||||
ry?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
|
||||
*/
|
||||
export class Rect extends React.Component<
|
||||
React.PropsWithChildren<RectProps>
|
||||
> {}
|
||||
|
||||
interface CircleProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Circle /> element is used to create a circle.
|
||||
*/
|
||||
export class Circle extends React.Component<
|
||||
React.PropsWithChildren<CircleProps>
|
||||
> {}
|
||||
|
||||
interface EllipseProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
rx: string | number;
|
||||
ry: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Ellipse /> element is used to create an ellipse.
|
||||
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
|
||||
*/
|
||||
export class Ellipse extends React.Component<
|
||||
React.PropsWithChildren<EllipseProps>
|
||||
> {}
|
||||
|
||||
interface TspanProps extends SVGPresentationAttributes {
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
|
||||
* It allows for adjustment of the style and/or position of that subtext as needed.
|
||||
*/
|
||||
export class Tspan extends React.Component<
|
||||
React.PropsWithChildren<TspanProps>
|
||||
> {}
|
||||
|
||||
interface GProps extends SVGPresentationAttributes {
|
||||
style?: Style;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <G /> SVG element is a container used to group other SVG elements.
|
||||
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
|
||||
*/
|
||||
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
|
||||
|
||||
interface StopProps {
|
||||
offset: string | number;
|
||||
stopColor: string;
|
||||
stopOpacity?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
|
||||
*/
|
||||
export class Stop extends React.Component<
|
||||
React.PropsWithChildren<StopProps>
|
||||
> {}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface DefsProps {}
|
||||
|
||||
/**
|
||||
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
|
||||
*/
|
||||
export class Defs extends React.Component<
|
||||
React.PropsWithChildren<DefsProps>
|
||||
> {}
|
||||
|
||||
interface ClipPathProps {
|
||||
id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
|
||||
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
|
||||
*/
|
||||
export class ClipPath extends React.Component<
|
||||
React.PropsWithChildren<ClipPathProps>
|
||||
> {}
|
||||
|
||||
interface MarkerProps {
|
||||
id: string;
|
||||
viewBox?: string;
|
||||
refX?: string | number;
|
||||
refY?: string | number;
|
||||
markerWidth?: string | number;
|
||||
markerHeight?: string | number;
|
||||
orient?: 'auto' | 'auto-start-reverse' | number;
|
||||
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
|
||||
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
|
||||
*/
|
||||
export class Marker extends React.Component<
|
||||
React.PropsWithChildren<MarkerProps>
|
||||
> {}
|
||||
|
||||
interface LinearGradientProps {
|
||||
id: string;
|
||||
x1?: string | number;
|
||||
x2?: string | number;
|
||||
y1?: string | number;
|
||||
y2?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class LinearGradient extends React.Component<
|
||||
React.PropsWithChildren<LinearGradientProps>
|
||||
> {}
|
||||
|
||||
interface RadialGradientProps {
|
||||
id: string;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r?: string | number;
|
||||
fx?: string | number;
|
||||
fy?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class RadialGradient extends React.Component<
|
||||
React.PropsWithChildren<RadialGradientProps>
|
||||
> {}
|
||||
|
||||
interface BlobProviderParams {
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
loading: boolean;
|
||||
error: Error | null;
|
||||
}
|
||||
interface BlobProviderProps {
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children: (params: BlobProviderParams) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easy and declarative way of getting document's blob data without
|
||||
* showing it on screen.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class BlobProvider extends React.Component<BlobProviderProps> {}
|
||||
|
||||
interface PDFViewerProps {
|
||||
width?: number | string;
|
||||
height?: number | string;
|
||||
style?: Style | Style[];
|
||||
className?: string;
|
||||
children?: React.ReactElement<DocumentProps>;
|
||||
innerRef?: React.Ref<HTMLIFrameElement>;
|
||||
showToolbar?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iframe PDF viewer for client-side generated documents.
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFViewer extends React.Component<PDFViewerProps> {}
|
||||
|
||||
interface PDFDownloadLinkProps
|
||||
extends Omit<
|
||||
React.AnchorHTMLAttributes<HTMLAnchorElement>,
|
||||
'href' | 'children'
|
||||
> {
|
||||
/** PDF filename. Alias for anchor tag `download` attribute. */
|
||||
fileName?: string;
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children?: React.ReactNode | React.FC<BlobProviderParams>;
|
||||
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
|
||||
((
|
||||
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
|
||||
instance: UsePDFInstance,
|
||||
) => void);
|
||||
ref?: React.Ref<HTMLAnchorElement> | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Anchor tag to enable generate and download PDF documents on the fly.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
|
||||
|
||||
interface UsePDFInstance {
|
||||
loading: boolean;
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* React hook for creating and updating a PDF document instance
|
||||
* @platform web
|
||||
*/
|
||||
export function usePDF(options?: {
|
||||
document?: React.ReactElement<DocumentProps>;
|
||||
}): [
|
||||
UsePDFInstance,
|
||||
(newDocument: React.ReactElement<DocumentProps>) => void,
|
||||
];
|
||||
|
||||
export const Font: FontStore;
|
||||
|
||||
export const StyleSheet: {
|
||||
create: <T extends Styles>(styles: T) => T;
|
||||
};
|
||||
|
||||
export const version: any;
|
||||
|
||||
export const PDFRenderer: any;
|
||||
|
||||
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
|
||||
container: any;
|
||||
isDirty: () => boolean;
|
||||
toString: () => string;
|
||||
toBlob: () => Promise<Blob>;
|
||||
toBuffer: () => Promise<NodeJS.ReadableStream>;
|
||||
on: (event: 'change', callback: () => void) => void;
|
||||
updateContainer: (
|
||||
document: React.ReactElement<any>,
|
||||
callback?: () => void,
|
||||
) => void;
|
||||
removeListener: (event: 'change', callback: () => void) => void;
|
||||
};
|
||||
|
||||
export const renderToStream: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
/**
|
||||
* @deprecated use the `renderToBuffer` method
|
||||
*/
|
||||
export const renderToString: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<string>;
|
||||
|
||||
export const renderToFile: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
filePath: string,
|
||||
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
const render: typeof renderToFile;
|
||||
|
||||
/**
|
||||
* Render document into a nodejs buffer
|
||||
* @platform node
|
||||
*/
|
||||
export const renderToBuffer: (
|
||||
document: React.ReactElement<ReactPDF.DocumentProps>,
|
||||
) => Promise<Buffer>;
|
||||
}
|
||||
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.d.ts
generated
vendored
Normal file
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.d.ts
generated
vendored
Normal file
@@ -0,0 +1,793 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Style,
|
||||
PageSize,
|
||||
FontStore,
|
||||
PDFVersion,
|
||||
Orientation,
|
||||
SourceObject,
|
||||
SrcSet,
|
||||
Sizes,
|
||||
HyphenationCallback,
|
||||
SVGPresentationAttributes,
|
||||
Bookmark,
|
||||
PageLayout,
|
||||
PageMode,
|
||||
HitSlop,
|
||||
} from '@react-pdf/types';
|
||||
|
||||
declare class ReactPDF {
|
||||
static default: typeof ReactPDF;
|
||||
}
|
||||
|
||||
export = ReactPDF;
|
||||
|
||||
declare namespace ReactPDF {
|
||||
interface Styles {
|
||||
[key: string]: Style;
|
||||
}
|
||||
interface OnRenderProps {
|
||||
blob?: Blob;
|
||||
}
|
||||
|
||||
interface Permissions {
|
||||
printing?: 'lowResolution' | 'highResolution';
|
||||
modifying?: boolean;
|
||||
copying?: boolean;
|
||||
annotating?: boolean;
|
||||
fillingForms?: boolean;
|
||||
contentAccessibility?: boolean;
|
||||
documentAssembly?: boolean;
|
||||
}
|
||||
|
||||
interface DocumentProps {
|
||||
style?: Style | Style[];
|
||||
title?: string;
|
||||
author?: string;
|
||||
subject?: string;
|
||||
creator?: string;
|
||||
keywords?: string;
|
||||
producer?: string;
|
||||
language?: string;
|
||||
creationDate?: Date;
|
||||
modificationDate?: Date;
|
||||
pdfVersion?: PDFVersion;
|
||||
pageMode?: PageMode;
|
||||
pageLayout?: PageLayout;
|
||||
ownerPassword?: string;
|
||||
userPassword?: string;
|
||||
permissions?: Permissions;
|
||||
onRender?: (props: OnRenderProps) => any;
|
||||
}
|
||||
|
||||
/**
|
||||
* This component represent the PDF document itself. It must be the root
|
||||
* of your tree element structure, and under no circumstances should it be
|
||||
* used as children of another react-pdf component. In addition, it should
|
||||
* only have childs of type <Page />.
|
||||
*/
|
||||
export class Document extends React.Component<
|
||||
React.PropsWithChildren<DocumentProps>
|
||||
> {}
|
||||
|
||||
interface NodeProps {
|
||||
id?: string;
|
||||
style?: Style | Style[];
|
||||
/**
|
||||
* Render component in all wrapped pages.
|
||||
* @see https://react-pdf.org/advanced#fixed-components
|
||||
*/
|
||||
fixed?: boolean;
|
||||
/**
|
||||
* Force the wrapping algorithm to start a new page when rendering the
|
||||
* element.
|
||||
* @see https://react-pdf.org/advanced#page-breaks
|
||||
*/
|
||||
break?: boolean;
|
||||
/**
|
||||
* Hint that no page wrapping should occur between all sibling elements following the element within n points
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
minPresenceAhead?: number;
|
||||
}
|
||||
|
||||
interface PageProps extends NodeProps {
|
||||
/**
|
||||
* Enable page wrapping for this page.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
size?: PageSize;
|
||||
orientation?: Orientation;
|
||||
dpi?: number;
|
||||
bookmark?: Bookmark;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents single page inside the PDF document, or a subset of them if
|
||||
* using the wrapping feature. A <Document /> can contain as many pages as
|
||||
* you want, but ensure not rendering a page inside any component besides
|
||||
* Document.
|
||||
*/
|
||||
export class Page extends React.Component<
|
||||
React.PropsWithChildren<PageProps>
|
||||
> {}
|
||||
|
||||
interface ViewProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
subPageNumber: number;
|
||||
}) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* The most fundamental component for building a UI and is designed to be
|
||||
* nested inside other views and can have 0 to many children.
|
||||
*/
|
||||
export class View extends React.Component<
|
||||
React.PropsWithChildren<ViewProps>
|
||||
> {}
|
||||
|
||||
interface BaseImageProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* Works like the HTML img sizes attribute.
|
||||
* @example 300
|
||||
* @example "300"
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
}
|
||||
|
||||
interface ImageWithSrcProp extends BaseImageProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageWithSourceProp extends BaseImageProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying network or local (Node only) JPG or
|
||||
* PNG images, as well as base64 encoded image strings.
|
||||
*/
|
||||
export class Image extends React.Component<ImageProps> {}
|
||||
|
||||
interface BaseImageBackgroundProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* @example 300
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
/**
|
||||
* Style applied to the background image.
|
||||
*/
|
||||
imageStyle?: Style;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageBackgroundProps =
|
||||
| ImageBackgroundWithSrcProp
|
||||
| ImageBackgroundWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying an image behind child content.
|
||||
* Compatible with React Native's ImageBackground component.
|
||||
* @see https://reactnative.dev/docs/imagebackground
|
||||
*/
|
||||
export class ImageBackground extends React.Component<
|
||||
React.PropsWithChildren<ImageBackgroundProps>
|
||||
> {}
|
||||
|
||||
interface TextProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
totalPages: number;
|
||||
subPageNumber: number;
|
||||
subPageTotalPages: number;
|
||||
}) => React.ReactNode;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
orphans?: number;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
widows?: number;
|
||||
}
|
||||
|
||||
interface SVGTextProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x: string | number;
|
||||
y: string | number;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying text. Text supports nesting of other
|
||||
* Text or Link components to create inline styling.
|
||||
*/
|
||||
export class Text extends React.Component<
|
||||
React.PropsWithChildren<TextProps> | SVGTextProps
|
||||
> {}
|
||||
|
||||
interface LinkProps extends NodeProps {
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
href?: string;
|
||||
src?: string;
|
||||
/**
|
||||
* Extends the clickable area of the link beyond its visible bounds.
|
||||
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
|
||||
* @see https://reactnative.dev/docs/view#hitslop
|
||||
*/
|
||||
hitSlop?: HitSlop;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying a hyperlink. Link’s can be nested
|
||||
* inside a Text component, or being inside any other valid primitive.
|
||||
*/
|
||||
export class Link extends React.Component<
|
||||
React.PropsWithChildren<LinkProps>
|
||||
> {}
|
||||
|
||||
interface FormCommonProps extends NodeProps {
|
||||
name?: string;
|
||||
required?: boolean;
|
||||
noExport?: boolean;
|
||||
readOnly?: boolean;
|
||||
value?: number | string;
|
||||
defaultValue?: number | string;
|
||||
}
|
||||
|
||||
interface FieldSetProps extends NodeProps {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class FieldSet extends React.Component<
|
||||
React.PropsWithChildren<FieldSetProps>
|
||||
> {}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputFormatting {
|
||||
type:
|
||||
| 'date'
|
||||
| 'time'
|
||||
| 'percent'
|
||||
| 'number'
|
||||
| 'zip'
|
||||
| 'zipPlus4'
|
||||
| 'phone'
|
||||
| 'ssn';
|
||||
param?: string;
|
||||
nDec?: number;
|
||||
sepComma?: boolean;
|
||||
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
|
||||
currency?: string;
|
||||
currencyPrepend?: boolean;
|
||||
}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputProps extends FormCommonProps {
|
||||
align?: 'left' | 'center' | 'right';
|
||||
multiline?: boolean;
|
||||
/**
|
||||
* The text will be masked (e.g. with asterisks).
|
||||
*/
|
||||
password?: boolean;
|
||||
/**
|
||||
* If set, text entered in the field is not spell-checked
|
||||
*/
|
||||
noSpell?: boolean;
|
||||
format?: TextInputFormatting;
|
||||
/**
|
||||
* Sets the fontSize (default or 0 means auto sizing)
|
||||
*/
|
||||
fontSize?: number;
|
||||
/**
|
||||
* Sets the maximum length (characters) of the text in the field
|
||||
*/
|
||||
maxLength?: number;
|
||||
}
|
||||
|
||||
export class TextInput extends React.Component<TextInputProps> {}
|
||||
|
||||
interface CheckboxProps extends FormCommonProps {
|
||||
backgroundColor?: string;
|
||||
borderColor?: string;
|
||||
checked?: boolean;
|
||||
onState?: string;
|
||||
offState?: string;
|
||||
xMark?: boolean;
|
||||
}
|
||||
|
||||
export class Checkbox extends React.Component<CheckboxProps> {}
|
||||
|
||||
interface SelectAndListPropsBase extends FormCommonProps {
|
||||
sort?: boolean;
|
||||
edit?: boolean;
|
||||
multiSelect?: boolean;
|
||||
noSpell?: boolean;
|
||||
select?: string[];
|
||||
}
|
||||
|
||||
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
|
||||
edit: true | false;
|
||||
noSpell: boolean;
|
||||
};
|
||||
|
||||
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
|
||||
edit: boolean;
|
||||
noSpell: true | false;
|
||||
};
|
||||
|
||||
type SelectAndListProps =
|
||||
| SelectAndListPropsWithEdit
|
||||
| SelectAndListPropsWithNoSpell;
|
||||
|
||||
export class Select extends React.Component<SelectAndListProps> {}
|
||||
|
||||
export class List extends React.Component<SelectAndListProps> {}
|
||||
|
||||
interface NoteProps extends NodeProps {
|
||||
children: string;
|
||||
}
|
||||
|
||||
export class Note extends React.Component<NoteProps> {}
|
||||
|
||||
interface CanvasProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
paint: (
|
||||
painter: any,
|
||||
availableWidth: number,
|
||||
availableHeight: number,
|
||||
) => null;
|
||||
}
|
||||
|
||||
export class Canvas extends React.Component<CanvasProps> {}
|
||||
|
||||
interface SVGProps extends NodeProps, SVGPresentationAttributes {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
width?: string | number;
|
||||
height?: string | number;
|
||||
viewBox?: string;
|
||||
preserveAspectRatio?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
|
||||
*/
|
||||
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
|
||||
|
||||
interface LineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x1: string | number;
|
||||
x2: string | number;
|
||||
y1: string | number;
|
||||
y2: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Line /> element is used to create a line.
|
||||
*/
|
||||
export class Line extends React.Component<
|
||||
React.PropsWithChildren<LineProps>
|
||||
> {}
|
||||
|
||||
interface PolylineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
|
||||
*/
|
||||
export class Polyline extends React.Component<
|
||||
React.PropsWithChildren<PolylineProps>
|
||||
> {}
|
||||
|
||||
interface PolygonProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polygon /> element is used to create a graphic that contains at least three sides.
|
||||
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
|
||||
*/
|
||||
export class Polygon extends React.Component<
|
||||
React.PropsWithChildren<PolygonProps>
|
||||
> {}
|
||||
|
||||
interface PathProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
d: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
|
||||
*/
|
||||
export class Path extends React.Component<
|
||||
React.PropsWithChildren<PathProps>
|
||||
> {}
|
||||
|
||||
interface RectProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
width: string | number;
|
||||
height: string | number;
|
||||
rx?: string | number;
|
||||
ry?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
|
||||
*/
|
||||
export class Rect extends React.Component<
|
||||
React.PropsWithChildren<RectProps>
|
||||
> {}
|
||||
|
||||
interface CircleProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Circle /> element is used to create a circle.
|
||||
*/
|
||||
export class Circle extends React.Component<
|
||||
React.PropsWithChildren<CircleProps>
|
||||
> {}
|
||||
|
||||
interface EllipseProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
rx: string | number;
|
||||
ry: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Ellipse /> element is used to create an ellipse.
|
||||
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
|
||||
*/
|
||||
export class Ellipse extends React.Component<
|
||||
React.PropsWithChildren<EllipseProps>
|
||||
> {}
|
||||
|
||||
interface TspanProps extends SVGPresentationAttributes {
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
|
||||
* It allows for adjustment of the style and/or position of that subtext as needed.
|
||||
*/
|
||||
export class Tspan extends React.Component<
|
||||
React.PropsWithChildren<TspanProps>
|
||||
> {}
|
||||
|
||||
interface GProps extends SVGPresentationAttributes {
|
||||
style?: Style;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <G /> SVG element is a container used to group other SVG elements.
|
||||
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
|
||||
*/
|
||||
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
|
||||
|
||||
interface StopProps {
|
||||
offset: string | number;
|
||||
stopColor: string;
|
||||
stopOpacity?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
|
||||
*/
|
||||
export class Stop extends React.Component<
|
||||
React.PropsWithChildren<StopProps>
|
||||
> {}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface DefsProps {}
|
||||
|
||||
/**
|
||||
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
|
||||
*/
|
||||
export class Defs extends React.Component<
|
||||
React.PropsWithChildren<DefsProps>
|
||||
> {}
|
||||
|
||||
interface ClipPathProps {
|
||||
id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
|
||||
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
|
||||
*/
|
||||
export class ClipPath extends React.Component<
|
||||
React.PropsWithChildren<ClipPathProps>
|
||||
> {}
|
||||
|
||||
interface MarkerProps {
|
||||
id: string;
|
||||
viewBox?: string;
|
||||
refX?: string | number;
|
||||
refY?: string | number;
|
||||
markerWidth?: string | number;
|
||||
markerHeight?: string | number;
|
||||
orient?: 'auto' | 'auto-start-reverse' | number;
|
||||
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
|
||||
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
|
||||
*/
|
||||
export class Marker extends React.Component<
|
||||
React.PropsWithChildren<MarkerProps>
|
||||
> {}
|
||||
|
||||
interface LinearGradientProps {
|
||||
id: string;
|
||||
x1?: string | number;
|
||||
x2?: string | number;
|
||||
y1?: string | number;
|
||||
y2?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class LinearGradient extends React.Component<
|
||||
React.PropsWithChildren<LinearGradientProps>
|
||||
> {}
|
||||
|
||||
interface RadialGradientProps {
|
||||
id: string;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r?: string | number;
|
||||
fx?: string | number;
|
||||
fy?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class RadialGradient extends React.Component<
|
||||
React.PropsWithChildren<RadialGradientProps>
|
||||
> {}
|
||||
|
||||
interface BlobProviderParams {
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
loading: boolean;
|
||||
error: Error | null;
|
||||
}
|
||||
interface BlobProviderProps {
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children: (params: BlobProviderParams) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easy and declarative way of getting document's blob data without
|
||||
* showing it on screen.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class BlobProvider extends React.Component<BlobProviderProps> {}
|
||||
|
||||
interface PDFViewerProps {
|
||||
width?: number | string;
|
||||
height?: number | string;
|
||||
style?: Style | Style[];
|
||||
className?: string;
|
||||
children?: React.ReactElement<DocumentProps>;
|
||||
innerRef?: React.Ref<HTMLIFrameElement>;
|
||||
showToolbar?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iframe PDF viewer for client-side generated documents.
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFViewer extends React.Component<PDFViewerProps> {}
|
||||
|
||||
interface PDFDownloadLinkProps
|
||||
extends Omit<
|
||||
React.AnchorHTMLAttributes<HTMLAnchorElement>,
|
||||
'href' | 'children'
|
||||
> {
|
||||
/** PDF filename. Alias for anchor tag `download` attribute. */
|
||||
fileName?: string;
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children?: React.ReactNode | React.FC<BlobProviderParams>;
|
||||
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
|
||||
((
|
||||
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
|
||||
instance: UsePDFInstance,
|
||||
) => void);
|
||||
ref?: React.Ref<HTMLAnchorElement> | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Anchor tag to enable generate and download PDF documents on the fly.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
|
||||
|
||||
interface UsePDFInstance {
|
||||
loading: boolean;
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* React hook for creating and updating a PDF document instance
|
||||
* @platform web
|
||||
*/
|
||||
export function usePDF(options?: {
|
||||
document?: React.ReactElement<DocumentProps>;
|
||||
}): [
|
||||
UsePDFInstance,
|
||||
(newDocument: React.ReactElement<DocumentProps>) => void,
|
||||
];
|
||||
|
||||
export const Font: FontStore;
|
||||
|
||||
export const StyleSheet: {
|
||||
create: <T extends Styles>(styles: T) => T;
|
||||
};
|
||||
|
||||
export const version: any;
|
||||
|
||||
export const PDFRenderer: any;
|
||||
|
||||
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
|
||||
container: any;
|
||||
isDirty: () => boolean;
|
||||
toString: () => string;
|
||||
toBlob: () => Promise<Blob>;
|
||||
toBuffer: () => Promise<NodeJS.ReadableStream>;
|
||||
on: (event: 'change', callback: () => void) => void;
|
||||
updateContainer: (
|
||||
document: React.ReactElement<any>,
|
||||
callback?: () => void,
|
||||
) => void;
|
||||
removeListener: (event: 'change', callback: () => void) => void;
|
||||
};
|
||||
|
||||
export const renderToStream: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
/**
|
||||
* @deprecated use the `renderToBuffer` method
|
||||
*/
|
||||
export const renderToString: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<string>;
|
||||
|
||||
export const renderToFile: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
filePath: string,
|
||||
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
const render: typeof renderToFile;
|
||||
|
||||
/**
|
||||
* Render document into a nodejs buffer
|
||||
* @platform node
|
||||
*/
|
||||
export const renderToBuffer: (
|
||||
document: React.ReactElement<ReactPDF.DocumentProps>,
|
||||
) => Promise<Buffer>;
|
||||
}
|
||||
368
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.js
generated
vendored
Normal file
368
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.js
generated
vendored
Normal file
@@ -0,0 +1,368 @@
|
||||
import * as primitives from '@react-pdf/primitives';
|
||||
export * from '@react-pdf/primitives';
|
||||
import fs from 'fs';
|
||||
import { Buffer } from 'buffer';
|
||||
import FontStore from '@react-pdf/font';
|
||||
import renderPDF from '@react-pdf/render';
|
||||
import PDFDocument from '@react-pdf/pdfkit';
|
||||
import layoutDocument from '@react-pdf/layout';
|
||||
import { upperFirst } from '@react-pdf/fns';
|
||||
import Reconciler from '@react-pdf/reconciler';
|
||||
|
||||
const omitNils = object => Object.fromEntries(Object.entries(object).filter(_ref => {
|
||||
let [, value] = _ref;
|
||||
return value !== undefined;
|
||||
}));
|
||||
|
||||
const createInstance = (type, _ref) => {
|
||||
let {
|
||||
style,
|
||||
children,
|
||||
...props
|
||||
} = _ref;
|
||||
return {
|
||||
type,
|
||||
box: {},
|
||||
style: style || {},
|
||||
props: props || {},
|
||||
children: []
|
||||
};
|
||||
};
|
||||
const createTextInstance = text => ({
|
||||
type: 'TEXT_INSTANCE',
|
||||
value: text
|
||||
});
|
||||
const appendChild = (parent, child) => {
|
||||
const isParentText = parent.type === 'TEXT' || parent.type === 'LINK' || parent.type === 'TSPAN' || parent.type === 'NOTE';
|
||||
const isChildTextInstance = child.type === 'TEXT_INSTANCE';
|
||||
const isOrphanTextInstance = isChildTextInstance && !isParentText;
|
||||
|
||||
// Ignore orphan text instances.
|
||||
// Caused by cases such as <>{name && <Text>{name}</Text>}</>
|
||||
if (isOrphanTextInstance) {
|
||||
console.warn(`Invalid '${child.value}' string child outside <Text> component`);
|
||||
return;
|
||||
}
|
||||
parent.children.push(child);
|
||||
};
|
||||
const appendChildToContainer = (parentInstance, child) => {
|
||||
if (parentInstance.type === 'ROOT') {
|
||||
parentInstance.document = child;
|
||||
} else {
|
||||
appendChild(parentInstance, child);
|
||||
}
|
||||
};
|
||||
const insertBefore = (parentInstance, child, beforeChild) => {
|
||||
var _parentInstance$child;
|
||||
const index = (_parentInstance$child = parentInstance.children) === null || _parentInstance$child === void 0 ? void 0 : _parentInstance$child.indexOf(beforeChild);
|
||||
if (index === undefined) return;
|
||||
if (index !== -1 && child) parentInstance.children.splice(index, 0, child);
|
||||
};
|
||||
const removeChild = (parentInstance, child) => {
|
||||
var _parentInstance$child2;
|
||||
const index = (_parentInstance$child2 = parentInstance.children) === null || _parentInstance$child2 === void 0 ? void 0 : _parentInstance$child2.indexOf(child);
|
||||
if (index === undefined) return;
|
||||
if (index !== -1) parentInstance.children.splice(index, 1);
|
||||
};
|
||||
const removeChildFromContainer = (parentInstance, child) => {
|
||||
var _parentInstance$child3;
|
||||
const index = (_parentInstance$child3 = parentInstance.children) === null || _parentInstance$child3 === void 0 ? void 0 : _parentInstance$child3.indexOf(child);
|
||||
if (index === undefined) return;
|
||||
if (index !== -1) parentInstance.children.splice(index, 1);
|
||||
};
|
||||
const commitTextUpdate = (textInstance, oldText, newText) => {
|
||||
textInstance.value = newText;
|
||||
};
|
||||
const commitUpdate = (instance, updatePayload, type, oldProps, newProps) => {
|
||||
const {
|
||||
style,
|
||||
...props
|
||||
} = newProps;
|
||||
instance.props = props;
|
||||
instance.style = style;
|
||||
};
|
||||
const createRenderer = _ref2 => {
|
||||
let {
|
||||
onChange = () => {}
|
||||
} = _ref2;
|
||||
return Reconciler({
|
||||
appendChild,
|
||||
appendChildToContainer,
|
||||
commitTextUpdate,
|
||||
commitUpdate,
|
||||
createInstance,
|
||||
createTextInstance,
|
||||
insertBefore,
|
||||
removeChild,
|
||||
removeChildFromContainer,
|
||||
resetAfterCommit: onChange
|
||||
});
|
||||
};
|
||||
|
||||
var version$1 = "4.5.1";
|
||||
var packageJson = {
|
||||
version: version$1};
|
||||
|
||||
const {
|
||||
version
|
||||
} = packageJson;
|
||||
const fontStore = new FontStore();
|
||||
|
||||
// We must keep a single renderer instance, otherwise React will complain
|
||||
let renderer;
|
||||
|
||||
// The pdf instance acts as an event emitter for DOM usage.
|
||||
// We only want to trigger an update when PDF content changes
|
||||
const events = {};
|
||||
const pdf = initialValue => {
|
||||
const onChange = () => {
|
||||
var _events$change;
|
||||
const listeners = ((_events$change = events.change) === null || _events$change === void 0 ? void 0 : _events$change.slice()) || [];
|
||||
for (let i = 0; i < listeners.length; i += 1) listeners[i]();
|
||||
};
|
||||
const container = {
|
||||
type: 'ROOT',
|
||||
document: null
|
||||
};
|
||||
renderer = renderer || createRenderer({
|
||||
onChange
|
||||
});
|
||||
const mountNode = renderer.createContainer(container);
|
||||
const updateContainer = (doc, callback) => {
|
||||
renderer.updateContainer(doc, mountNode, null, callback);
|
||||
};
|
||||
if (initialValue) updateContainer(initialValue);
|
||||
const render = async function (compress) {
|
||||
if (compress === void 0) {
|
||||
compress = true;
|
||||
}
|
||||
const props = container.document.props || {};
|
||||
const {
|
||||
pdfVersion,
|
||||
language,
|
||||
pageLayout,
|
||||
pageMode,
|
||||
title,
|
||||
author,
|
||||
subject,
|
||||
keywords,
|
||||
creator = 'react-pdf',
|
||||
producer = 'react-pdf',
|
||||
creationDate = new Date(),
|
||||
modificationDate,
|
||||
ownerPassword,
|
||||
userPassword,
|
||||
permissions
|
||||
} = props;
|
||||
const ctx = new PDFDocument({
|
||||
compress,
|
||||
pdfVersion,
|
||||
lang: language,
|
||||
displayTitle: true,
|
||||
autoFirstPage: false,
|
||||
ownerPassword,
|
||||
userPassword,
|
||||
permissions,
|
||||
pageLayout,
|
||||
info: omitNils({
|
||||
Title: title,
|
||||
Author: author,
|
||||
Subject: subject,
|
||||
Keywords: keywords,
|
||||
Creator: creator,
|
||||
Producer: producer,
|
||||
CreationDate: creationDate,
|
||||
ModificationDate: modificationDate
|
||||
})
|
||||
});
|
||||
if (pageMode) {
|
||||
ctx._root.data.PageMode = upperFirst(pageMode);
|
||||
}
|
||||
const layout = await layoutDocument(container.document, fontStore);
|
||||
const fileStream = renderPDF(ctx, layout);
|
||||
return {
|
||||
layout,
|
||||
fileStream
|
||||
};
|
||||
};
|
||||
const callOnRender = function (params) {
|
||||
if (params === void 0) {
|
||||
params = {};
|
||||
}
|
||||
if (container.document.props.onRender) {
|
||||
container.document.props.onRender(params);
|
||||
}
|
||||
};
|
||||
const toBlob = async () => {
|
||||
const chunks = [];
|
||||
const {
|
||||
layout: _INTERNAL__LAYOUT__DATA_,
|
||||
fileStream: instance
|
||||
} = await render();
|
||||
return new Promise((resolve, reject) => {
|
||||
instance.on('data', chunk => {
|
||||
chunks.push(chunk instanceof Uint8Array ? chunk : new Uint8Array(chunk));
|
||||
});
|
||||
instance.on('end', () => {
|
||||
try {
|
||||
const blob = new Blob(chunks, {
|
||||
type: 'application/pdf'
|
||||
});
|
||||
callOnRender({
|
||||
blob,
|
||||
_INTERNAL__LAYOUT__DATA_
|
||||
});
|
||||
resolve(blob);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// TODO: rename this method to `toStream` in next major release, because it return stream not a buffer
|
||||
const toBuffer = async () => {
|
||||
const {
|
||||
layout: _INTERNAL__LAYOUT__DATA_,
|
||||
fileStream
|
||||
} = await render();
|
||||
callOnRender({
|
||||
_INTERNAL__LAYOUT__DATA_
|
||||
});
|
||||
return fileStream;
|
||||
};
|
||||
|
||||
/*
|
||||
* TODO: remove this method in next major release. it is buggy
|
||||
* see
|
||||
* - https://github.com/diegomura/react-pdf/issues/2112
|
||||
* - https://github.com/diegomura/react-pdf/issues/2095
|
||||
*/
|
||||
const toString = async () => {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.warn('`toString` is deprecated and will be removed in next major release');
|
||||
}
|
||||
let result = '';
|
||||
const {
|
||||
fileStream: instance
|
||||
} = await render(false); // For some reason, when rendering to string if compress=true the document is blank
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
instance.on('data', buffer => {
|
||||
result += buffer;
|
||||
});
|
||||
instance.on('end', () => {
|
||||
callOnRender();
|
||||
resolve(result);
|
||||
});
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
};
|
||||
const on = (event, listener) => {
|
||||
if (!events[event]) events[event] = [];
|
||||
events[event].push(listener);
|
||||
};
|
||||
const removeListener = (event, listener) => {
|
||||
if (!events[event]) return;
|
||||
const idx = events[event].indexOf(listener);
|
||||
if (idx > -1) events[event].splice(idx, 1);
|
||||
};
|
||||
return {
|
||||
on,
|
||||
container,
|
||||
toBlob,
|
||||
toBuffer,
|
||||
toString,
|
||||
removeListener,
|
||||
updateContainer
|
||||
};
|
||||
};
|
||||
const Font = fontStore;
|
||||
const StyleSheet = {
|
||||
create: s => s
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {React.ReactElement} element
|
||||
* @returns {Promise<NodeJS.ReadableStream>}
|
||||
*/
|
||||
const renderToStream = async element => {
|
||||
const instance = pdf(element);
|
||||
const stream = await instance.toBuffer();
|
||||
return stream;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {React.ReactElement} element
|
||||
* @param {string} filePath
|
||||
* @param {Function} [callback]
|
||||
*/
|
||||
const renderToFile = async (element, filePath, callback) => {
|
||||
const output = await renderToStream(element);
|
||||
const stream = fs.createWriteStream(filePath);
|
||||
output.pipe(stream);
|
||||
return new Promise((resolve, reject) => {
|
||||
stream.on('finish', () => {
|
||||
if (callback) callback(output, filePath);
|
||||
resolve(output);
|
||||
});
|
||||
stream.on('error', reject);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {React.ReactElement} element
|
||||
* @returns {Promise<Buffer>}
|
||||
*/
|
||||
const renderToBuffer = element => renderToStream(element).then(stream => new Promise((resolve, reject) => {
|
||||
const chunks = [];
|
||||
stream.on('data', chunk => chunks.push(chunk));
|
||||
stream.on('end', () => resolve(Buffer.concat(chunks)));
|
||||
stream.on('error', error => reject(error));
|
||||
}));
|
||||
const renderToString = element => {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.warn('`renderToString` is deprecated and will be removed in next major release, use `renderToBuffer` instead');
|
||||
}
|
||||
return renderToBuffer(element).then(buffer => buffer.toString());
|
||||
};
|
||||
|
||||
const throwEnvironmentError = name => {
|
||||
throw new Error(`${name} is a web specific API. You're either using this component on Node, or your bundler is not loading react-pdf from the appropriate web build.`);
|
||||
};
|
||||
const usePDF = () => {
|
||||
throwEnvironmentError('usePDF');
|
||||
};
|
||||
const PDFViewer = () => {
|
||||
throwEnvironmentError('PDFViewer');
|
||||
};
|
||||
const PDFDownloadLink = () => {
|
||||
throwEnvironmentError('PDFDownloadLink');
|
||||
};
|
||||
const BlobProvider = () => {
|
||||
throwEnvironmentError('BlobProvider');
|
||||
};
|
||||
const render = renderToFile;
|
||||
|
||||
// TODO: remove this default export in next major release because it breaks tree-shacking
|
||||
var index = {
|
||||
pdf,
|
||||
Font,
|
||||
version,
|
||||
StyleSheet,
|
||||
usePDF,
|
||||
PDFViewer,
|
||||
BlobProvider,
|
||||
PDFDownloadLink,
|
||||
renderToStream,
|
||||
renderToString,
|
||||
renderToFile,
|
||||
render,
|
||||
...primitives
|
||||
};
|
||||
|
||||
export { BlobProvider, Font, PDFDownloadLink, PDFViewer, StyleSheet, createRenderer, index as default, pdf, render, renderToBuffer, renderToFile, renderToStream, renderToString, usePDF, version };
|
||||
//# sourceMappingURL=react-pdf.js.map
|
||||
1
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.js.map
generated
vendored
Normal file
1
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.min.d.cts
generated
vendored
Normal file
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.min.d.cts
generated
vendored
Normal file
@@ -0,0 +1,793 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Style,
|
||||
PageSize,
|
||||
FontStore,
|
||||
PDFVersion,
|
||||
Orientation,
|
||||
SourceObject,
|
||||
SrcSet,
|
||||
Sizes,
|
||||
HyphenationCallback,
|
||||
SVGPresentationAttributes,
|
||||
Bookmark,
|
||||
PageLayout,
|
||||
PageMode,
|
||||
HitSlop,
|
||||
} from '@react-pdf/types';
|
||||
|
||||
declare class ReactPDF {
|
||||
static default: typeof ReactPDF;
|
||||
}
|
||||
|
||||
export = ReactPDF;
|
||||
|
||||
declare namespace ReactPDF {
|
||||
interface Styles {
|
||||
[key: string]: Style;
|
||||
}
|
||||
interface OnRenderProps {
|
||||
blob?: Blob;
|
||||
}
|
||||
|
||||
interface Permissions {
|
||||
printing?: 'lowResolution' | 'highResolution';
|
||||
modifying?: boolean;
|
||||
copying?: boolean;
|
||||
annotating?: boolean;
|
||||
fillingForms?: boolean;
|
||||
contentAccessibility?: boolean;
|
||||
documentAssembly?: boolean;
|
||||
}
|
||||
|
||||
interface DocumentProps {
|
||||
style?: Style | Style[];
|
||||
title?: string;
|
||||
author?: string;
|
||||
subject?: string;
|
||||
creator?: string;
|
||||
keywords?: string;
|
||||
producer?: string;
|
||||
language?: string;
|
||||
creationDate?: Date;
|
||||
modificationDate?: Date;
|
||||
pdfVersion?: PDFVersion;
|
||||
pageMode?: PageMode;
|
||||
pageLayout?: PageLayout;
|
||||
ownerPassword?: string;
|
||||
userPassword?: string;
|
||||
permissions?: Permissions;
|
||||
onRender?: (props: OnRenderProps) => any;
|
||||
}
|
||||
|
||||
/**
|
||||
* This component represent the PDF document itself. It must be the root
|
||||
* of your tree element structure, and under no circumstances should it be
|
||||
* used as children of another react-pdf component. In addition, it should
|
||||
* only have childs of type <Page />.
|
||||
*/
|
||||
export class Document extends React.Component<
|
||||
React.PropsWithChildren<DocumentProps>
|
||||
> {}
|
||||
|
||||
interface NodeProps {
|
||||
id?: string;
|
||||
style?: Style | Style[];
|
||||
/**
|
||||
* Render component in all wrapped pages.
|
||||
* @see https://react-pdf.org/advanced#fixed-components
|
||||
*/
|
||||
fixed?: boolean;
|
||||
/**
|
||||
* Force the wrapping algorithm to start a new page when rendering the
|
||||
* element.
|
||||
* @see https://react-pdf.org/advanced#page-breaks
|
||||
*/
|
||||
break?: boolean;
|
||||
/**
|
||||
* Hint that no page wrapping should occur between all sibling elements following the element within n points
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
minPresenceAhead?: number;
|
||||
}
|
||||
|
||||
interface PageProps extends NodeProps {
|
||||
/**
|
||||
* Enable page wrapping for this page.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
size?: PageSize;
|
||||
orientation?: Orientation;
|
||||
dpi?: number;
|
||||
bookmark?: Bookmark;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents single page inside the PDF document, or a subset of them if
|
||||
* using the wrapping feature. A <Document /> can contain as many pages as
|
||||
* you want, but ensure not rendering a page inside any component besides
|
||||
* Document.
|
||||
*/
|
||||
export class Page extends React.Component<
|
||||
React.PropsWithChildren<PageProps>
|
||||
> {}
|
||||
|
||||
interface ViewProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
subPageNumber: number;
|
||||
}) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* The most fundamental component for building a UI and is designed to be
|
||||
* nested inside other views and can have 0 to many children.
|
||||
*/
|
||||
export class View extends React.Component<
|
||||
React.PropsWithChildren<ViewProps>
|
||||
> {}
|
||||
|
||||
interface BaseImageProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* Works like the HTML img sizes attribute.
|
||||
* @example 300
|
||||
* @example "300"
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
}
|
||||
|
||||
interface ImageWithSrcProp extends BaseImageProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageWithSourceProp extends BaseImageProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying network or local (Node only) JPG or
|
||||
* PNG images, as well as base64 encoded image strings.
|
||||
*/
|
||||
export class Image extends React.Component<ImageProps> {}
|
||||
|
||||
interface BaseImageBackgroundProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* @example 300
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
/**
|
||||
* Style applied to the background image.
|
||||
*/
|
||||
imageStyle?: Style;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageBackgroundProps =
|
||||
| ImageBackgroundWithSrcProp
|
||||
| ImageBackgroundWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying an image behind child content.
|
||||
* Compatible with React Native's ImageBackground component.
|
||||
* @see https://reactnative.dev/docs/imagebackground
|
||||
*/
|
||||
export class ImageBackground extends React.Component<
|
||||
React.PropsWithChildren<ImageBackgroundProps>
|
||||
> {}
|
||||
|
||||
interface TextProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
totalPages: number;
|
||||
subPageNumber: number;
|
||||
subPageTotalPages: number;
|
||||
}) => React.ReactNode;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
orphans?: number;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
widows?: number;
|
||||
}
|
||||
|
||||
interface SVGTextProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x: string | number;
|
||||
y: string | number;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying text. Text supports nesting of other
|
||||
* Text or Link components to create inline styling.
|
||||
*/
|
||||
export class Text extends React.Component<
|
||||
React.PropsWithChildren<TextProps> | SVGTextProps
|
||||
> {}
|
||||
|
||||
interface LinkProps extends NodeProps {
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
href?: string;
|
||||
src?: string;
|
||||
/**
|
||||
* Extends the clickable area of the link beyond its visible bounds.
|
||||
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
|
||||
* @see https://reactnative.dev/docs/view#hitslop
|
||||
*/
|
||||
hitSlop?: HitSlop;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying a hyperlink. Link’s can be nested
|
||||
* inside a Text component, or being inside any other valid primitive.
|
||||
*/
|
||||
export class Link extends React.Component<
|
||||
React.PropsWithChildren<LinkProps>
|
||||
> {}
|
||||
|
||||
interface FormCommonProps extends NodeProps {
|
||||
name?: string;
|
||||
required?: boolean;
|
||||
noExport?: boolean;
|
||||
readOnly?: boolean;
|
||||
value?: number | string;
|
||||
defaultValue?: number | string;
|
||||
}
|
||||
|
||||
interface FieldSetProps extends NodeProps {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class FieldSet extends React.Component<
|
||||
React.PropsWithChildren<FieldSetProps>
|
||||
> {}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputFormatting {
|
||||
type:
|
||||
| 'date'
|
||||
| 'time'
|
||||
| 'percent'
|
||||
| 'number'
|
||||
| 'zip'
|
||||
| 'zipPlus4'
|
||||
| 'phone'
|
||||
| 'ssn';
|
||||
param?: string;
|
||||
nDec?: number;
|
||||
sepComma?: boolean;
|
||||
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
|
||||
currency?: string;
|
||||
currencyPrepend?: boolean;
|
||||
}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputProps extends FormCommonProps {
|
||||
align?: 'left' | 'center' | 'right';
|
||||
multiline?: boolean;
|
||||
/**
|
||||
* The text will be masked (e.g. with asterisks).
|
||||
*/
|
||||
password?: boolean;
|
||||
/**
|
||||
* If set, text entered in the field is not spell-checked
|
||||
*/
|
||||
noSpell?: boolean;
|
||||
format?: TextInputFormatting;
|
||||
/**
|
||||
* Sets the fontSize (default or 0 means auto sizing)
|
||||
*/
|
||||
fontSize?: number;
|
||||
/**
|
||||
* Sets the maximum length (characters) of the text in the field
|
||||
*/
|
||||
maxLength?: number;
|
||||
}
|
||||
|
||||
export class TextInput extends React.Component<TextInputProps> {}
|
||||
|
||||
interface CheckboxProps extends FormCommonProps {
|
||||
backgroundColor?: string;
|
||||
borderColor?: string;
|
||||
checked?: boolean;
|
||||
onState?: string;
|
||||
offState?: string;
|
||||
xMark?: boolean;
|
||||
}
|
||||
|
||||
export class Checkbox extends React.Component<CheckboxProps> {}
|
||||
|
||||
interface SelectAndListPropsBase extends FormCommonProps {
|
||||
sort?: boolean;
|
||||
edit?: boolean;
|
||||
multiSelect?: boolean;
|
||||
noSpell?: boolean;
|
||||
select?: string[];
|
||||
}
|
||||
|
||||
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
|
||||
edit: true | false;
|
||||
noSpell: boolean;
|
||||
};
|
||||
|
||||
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
|
||||
edit: boolean;
|
||||
noSpell: true | false;
|
||||
};
|
||||
|
||||
type SelectAndListProps =
|
||||
| SelectAndListPropsWithEdit
|
||||
| SelectAndListPropsWithNoSpell;
|
||||
|
||||
export class Select extends React.Component<SelectAndListProps> {}
|
||||
|
||||
export class List extends React.Component<SelectAndListProps> {}
|
||||
|
||||
interface NoteProps extends NodeProps {
|
||||
children: string;
|
||||
}
|
||||
|
||||
export class Note extends React.Component<NoteProps> {}
|
||||
|
||||
interface CanvasProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
paint: (
|
||||
painter: any,
|
||||
availableWidth: number,
|
||||
availableHeight: number,
|
||||
) => null;
|
||||
}
|
||||
|
||||
export class Canvas extends React.Component<CanvasProps> {}
|
||||
|
||||
interface SVGProps extends NodeProps, SVGPresentationAttributes {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
width?: string | number;
|
||||
height?: string | number;
|
||||
viewBox?: string;
|
||||
preserveAspectRatio?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
|
||||
*/
|
||||
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
|
||||
|
||||
interface LineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x1: string | number;
|
||||
x2: string | number;
|
||||
y1: string | number;
|
||||
y2: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Line /> element is used to create a line.
|
||||
*/
|
||||
export class Line extends React.Component<
|
||||
React.PropsWithChildren<LineProps>
|
||||
> {}
|
||||
|
||||
interface PolylineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
|
||||
*/
|
||||
export class Polyline extends React.Component<
|
||||
React.PropsWithChildren<PolylineProps>
|
||||
> {}
|
||||
|
||||
interface PolygonProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polygon /> element is used to create a graphic that contains at least three sides.
|
||||
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
|
||||
*/
|
||||
export class Polygon extends React.Component<
|
||||
React.PropsWithChildren<PolygonProps>
|
||||
> {}
|
||||
|
||||
interface PathProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
d: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
|
||||
*/
|
||||
export class Path extends React.Component<
|
||||
React.PropsWithChildren<PathProps>
|
||||
> {}
|
||||
|
||||
interface RectProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
width: string | number;
|
||||
height: string | number;
|
||||
rx?: string | number;
|
||||
ry?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
|
||||
*/
|
||||
export class Rect extends React.Component<
|
||||
React.PropsWithChildren<RectProps>
|
||||
> {}
|
||||
|
||||
interface CircleProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Circle /> element is used to create a circle.
|
||||
*/
|
||||
export class Circle extends React.Component<
|
||||
React.PropsWithChildren<CircleProps>
|
||||
> {}
|
||||
|
||||
interface EllipseProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
rx: string | number;
|
||||
ry: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Ellipse /> element is used to create an ellipse.
|
||||
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
|
||||
*/
|
||||
export class Ellipse extends React.Component<
|
||||
React.PropsWithChildren<EllipseProps>
|
||||
> {}
|
||||
|
||||
interface TspanProps extends SVGPresentationAttributes {
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
|
||||
* It allows for adjustment of the style and/or position of that subtext as needed.
|
||||
*/
|
||||
export class Tspan extends React.Component<
|
||||
React.PropsWithChildren<TspanProps>
|
||||
> {}
|
||||
|
||||
interface GProps extends SVGPresentationAttributes {
|
||||
style?: Style;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <G /> SVG element is a container used to group other SVG elements.
|
||||
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
|
||||
*/
|
||||
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
|
||||
|
||||
interface StopProps {
|
||||
offset: string | number;
|
||||
stopColor: string;
|
||||
stopOpacity?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
|
||||
*/
|
||||
export class Stop extends React.Component<
|
||||
React.PropsWithChildren<StopProps>
|
||||
> {}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface DefsProps {}
|
||||
|
||||
/**
|
||||
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
|
||||
*/
|
||||
export class Defs extends React.Component<
|
||||
React.PropsWithChildren<DefsProps>
|
||||
> {}
|
||||
|
||||
interface ClipPathProps {
|
||||
id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
|
||||
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
|
||||
*/
|
||||
export class ClipPath extends React.Component<
|
||||
React.PropsWithChildren<ClipPathProps>
|
||||
> {}
|
||||
|
||||
interface MarkerProps {
|
||||
id: string;
|
||||
viewBox?: string;
|
||||
refX?: string | number;
|
||||
refY?: string | number;
|
||||
markerWidth?: string | number;
|
||||
markerHeight?: string | number;
|
||||
orient?: 'auto' | 'auto-start-reverse' | number;
|
||||
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
|
||||
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
|
||||
*/
|
||||
export class Marker extends React.Component<
|
||||
React.PropsWithChildren<MarkerProps>
|
||||
> {}
|
||||
|
||||
interface LinearGradientProps {
|
||||
id: string;
|
||||
x1?: string | number;
|
||||
x2?: string | number;
|
||||
y1?: string | number;
|
||||
y2?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class LinearGradient extends React.Component<
|
||||
React.PropsWithChildren<LinearGradientProps>
|
||||
> {}
|
||||
|
||||
interface RadialGradientProps {
|
||||
id: string;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r?: string | number;
|
||||
fx?: string | number;
|
||||
fy?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class RadialGradient extends React.Component<
|
||||
React.PropsWithChildren<RadialGradientProps>
|
||||
> {}
|
||||
|
||||
interface BlobProviderParams {
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
loading: boolean;
|
||||
error: Error | null;
|
||||
}
|
||||
interface BlobProviderProps {
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children: (params: BlobProviderParams) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easy and declarative way of getting document's blob data without
|
||||
* showing it on screen.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class BlobProvider extends React.Component<BlobProviderProps> {}
|
||||
|
||||
interface PDFViewerProps {
|
||||
width?: number | string;
|
||||
height?: number | string;
|
||||
style?: Style | Style[];
|
||||
className?: string;
|
||||
children?: React.ReactElement<DocumentProps>;
|
||||
innerRef?: React.Ref<HTMLIFrameElement>;
|
||||
showToolbar?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iframe PDF viewer for client-side generated documents.
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFViewer extends React.Component<PDFViewerProps> {}
|
||||
|
||||
interface PDFDownloadLinkProps
|
||||
extends Omit<
|
||||
React.AnchorHTMLAttributes<HTMLAnchorElement>,
|
||||
'href' | 'children'
|
||||
> {
|
||||
/** PDF filename. Alias for anchor tag `download` attribute. */
|
||||
fileName?: string;
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children?: React.ReactNode | React.FC<BlobProviderParams>;
|
||||
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
|
||||
((
|
||||
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
|
||||
instance: UsePDFInstance,
|
||||
) => void);
|
||||
ref?: React.Ref<HTMLAnchorElement> | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Anchor tag to enable generate and download PDF documents on the fly.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
|
||||
|
||||
interface UsePDFInstance {
|
||||
loading: boolean;
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* React hook for creating and updating a PDF document instance
|
||||
* @platform web
|
||||
*/
|
||||
export function usePDF(options?: {
|
||||
document?: React.ReactElement<DocumentProps>;
|
||||
}): [
|
||||
UsePDFInstance,
|
||||
(newDocument: React.ReactElement<DocumentProps>) => void,
|
||||
];
|
||||
|
||||
export const Font: FontStore;
|
||||
|
||||
export const StyleSheet: {
|
||||
create: <T extends Styles>(styles: T) => T;
|
||||
};
|
||||
|
||||
export const version: any;
|
||||
|
||||
export const PDFRenderer: any;
|
||||
|
||||
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
|
||||
container: any;
|
||||
isDirty: () => boolean;
|
||||
toString: () => string;
|
||||
toBlob: () => Promise<Blob>;
|
||||
toBuffer: () => Promise<NodeJS.ReadableStream>;
|
||||
on: (event: 'change', callback: () => void) => void;
|
||||
updateContainer: (
|
||||
document: React.ReactElement<any>,
|
||||
callback?: () => void,
|
||||
) => void;
|
||||
removeListener: (event: 'change', callback: () => void) => void;
|
||||
};
|
||||
|
||||
export const renderToStream: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
/**
|
||||
* @deprecated use the `renderToBuffer` method
|
||||
*/
|
||||
export const renderToString: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<string>;
|
||||
|
||||
export const renderToFile: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
filePath: string,
|
||||
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
const render: typeof renderToFile;
|
||||
|
||||
/**
|
||||
* Render document into a nodejs buffer
|
||||
* @platform node
|
||||
*/
|
||||
export const renderToBuffer: (
|
||||
document: React.ReactElement<ReactPDF.DocumentProps>,
|
||||
) => Promise<Buffer>;
|
||||
}
|
||||
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.min.d.ts
generated
vendored
Normal file
793
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.min.d.ts
generated
vendored
Normal file
@@ -0,0 +1,793 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Style,
|
||||
PageSize,
|
||||
FontStore,
|
||||
PDFVersion,
|
||||
Orientation,
|
||||
SourceObject,
|
||||
SrcSet,
|
||||
Sizes,
|
||||
HyphenationCallback,
|
||||
SVGPresentationAttributes,
|
||||
Bookmark,
|
||||
PageLayout,
|
||||
PageMode,
|
||||
HitSlop,
|
||||
} from '@react-pdf/types';
|
||||
|
||||
declare class ReactPDF {
|
||||
static default: typeof ReactPDF;
|
||||
}
|
||||
|
||||
export = ReactPDF;
|
||||
|
||||
declare namespace ReactPDF {
|
||||
interface Styles {
|
||||
[key: string]: Style;
|
||||
}
|
||||
interface OnRenderProps {
|
||||
blob?: Blob;
|
||||
}
|
||||
|
||||
interface Permissions {
|
||||
printing?: 'lowResolution' | 'highResolution';
|
||||
modifying?: boolean;
|
||||
copying?: boolean;
|
||||
annotating?: boolean;
|
||||
fillingForms?: boolean;
|
||||
contentAccessibility?: boolean;
|
||||
documentAssembly?: boolean;
|
||||
}
|
||||
|
||||
interface DocumentProps {
|
||||
style?: Style | Style[];
|
||||
title?: string;
|
||||
author?: string;
|
||||
subject?: string;
|
||||
creator?: string;
|
||||
keywords?: string;
|
||||
producer?: string;
|
||||
language?: string;
|
||||
creationDate?: Date;
|
||||
modificationDate?: Date;
|
||||
pdfVersion?: PDFVersion;
|
||||
pageMode?: PageMode;
|
||||
pageLayout?: PageLayout;
|
||||
ownerPassword?: string;
|
||||
userPassword?: string;
|
||||
permissions?: Permissions;
|
||||
onRender?: (props: OnRenderProps) => any;
|
||||
}
|
||||
|
||||
/**
|
||||
* This component represent the PDF document itself. It must be the root
|
||||
* of your tree element structure, and under no circumstances should it be
|
||||
* used as children of another react-pdf component. In addition, it should
|
||||
* only have childs of type <Page />.
|
||||
*/
|
||||
export class Document extends React.Component<
|
||||
React.PropsWithChildren<DocumentProps>
|
||||
> {}
|
||||
|
||||
interface NodeProps {
|
||||
id?: string;
|
||||
style?: Style | Style[];
|
||||
/**
|
||||
* Render component in all wrapped pages.
|
||||
* @see https://react-pdf.org/advanced#fixed-components
|
||||
*/
|
||||
fixed?: boolean;
|
||||
/**
|
||||
* Force the wrapping algorithm to start a new page when rendering the
|
||||
* element.
|
||||
* @see https://react-pdf.org/advanced#page-breaks
|
||||
*/
|
||||
break?: boolean;
|
||||
/**
|
||||
* Hint that no page wrapping should occur between all sibling elements following the element within n points
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
minPresenceAhead?: number;
|
||||
}
|
||||
|
||||
interface PageProps extends NodeProps {
|
||||
/**
|
||||
* Enable page wrapping for this page.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
size?: PageSize;
|
||||
orientation?: Orientation;
|
||||
dpi?: number;
|
||||
bookmark?: Bookmark;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents single page inside the PDF document, or a subset of them if
|
||||
* using the wrapping feature. A <Document /> can contain as many pages as
|
||||
* you want, but ensure not rendering a page inside any component besides
|
||||
* Document.
|
||||
*/
|
||||
export class Page extends React.Component<
|
||||
React.PropsWithChildren<PageProps>
|
||||
> {}
|
||||
|
||||
interface ViewProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
subPageNumber: number;
|
||||
}) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* The most fundamental component for building a UI and is designed to be
|
||||
* nested inside other views and can have 0 to many children.
|
||||
*/
|
||||
export class View extends React.Component<
|
||||
React.PropsWithChildren<ViewProps>
|
||||
> {}
|
||||
|
||||
interface BaseImageProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* Works like the HTML img sizes attribute.
|
||||
* @example 300
|
||||
* @example "300"
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
}
|
||||
|
||||
interface ImageWithSrcProp extends BaseImageProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageWithSourceProp extends BaseImageProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying network or local (Node only) JPG or
|
||||
* PNG images, as well as base64 encoded image strings.
|
||||
*/
|
||||
export class Image extends React.Component<ImageProps> {}
|
||||
|
||||
interface BaseImageBackgroundProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
cache?: boolean;
|
||||
/**
|
||||
* A comma-separated list of image sources with width descriptors.
|
||||
* Works like the HTML img srcSet attribute.
|
||||
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
|
||||
*/
|
||||
srcSet?: SrcSet;
|
||||
/**
|
||||
* The intended display width of the image, used to select the best source
|
||||
* from srcSet. Accepts a number (in points) or a string.
|
||||
* @example 300
|
||||
*/
|
||||
sizes?: Sizes;
|
||||
/**
|
||||
* Style applied to the background image.
|
||||
*/
|
||||
imageStyle?: Style;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
|
||||
src: SourceObject;
|
||||
}
|
||||
|
||||
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
|
||||
source: SourceObject;
|
||||
}
|
||||
|
||||
type ImageBackgroundProps =
|
||||
| ImageBackgroundWithSrcProp
|
||||
| ImageBackgroundWithSourceProp;
|
||||
|
||||
/**
|
||||
* A React component for displaying an image behind child content.
|
||||
* Compatible with React Native's ImageBackground component.
|
||||
* @see https://reactnative.dev/docs/imagebackground
|
||||
*/
|
||||
export class ImageBackground extends React.Component<
|
||||
React.PropsWithChildren<ImageBackgroundProps>
|
||||
> {}
|
||||
|
||||
interface TextProps extends NodeProps {
|
||||
id?: string;
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
render?: (props: {
|
||||
pageNumber: number;
|
||||
totalPages: number;
|
||||
subPageNumber: number;
|
||||
subPageTotalPages: number;
|
||||
}) => React.ReactNode;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
orphans?: number;
|
||||
/**
|
||||
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
|
||||
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
|
||||
*/
|
||||
widows?: number;
|
||||
}
|
||||
|
||||
interface SVGTextProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x: string | number;
|
||||
y: string | number;
|
||||
/**
|
||||
* Override the default hyphenation-callback
|
||||
* @see https://react-pdf.org/fonts#registerhyphenationcallback
|
||||
*/
|
||||
hyphenationCallback?: HyphenationCallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying text. Text supports nesting of other
|
||||
* Text or Link components to create inline styling.
|
||||
*/
|
||||
export class Text extends React.Component<
|
||||
React.PropsWithChildren<TextProps> | SVGTextProps
|
||||
> {}
|
||||
|
||||
interface LinkProps extends NodeProps {
|
||||
/**
|
||||
* Enable/disable page wrapping for element.
|
||||
* @see https://react-pdf.org/components#page-wrapping
|
||||
*/
|
||||
wrap?: boolean;
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
href?: string;
|
||||
src?: string;
|
||||
/**
|
||||
* Extends the clickable area of the link beyond its visible bounds.
|
||||
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
|
||||
* @see https://reactnative.dev/docs/view#hitslop
|
||||
*/
|
||||
hitSlop?: HitSlop;
|
||||
}
|
||||
|
||||
/**
|
||||
* A React component for displaying a hyperlink. Link’s can be nested
|
||||
* inside a Text component, or being inside any other valid primitive.
|
||||
*/
|
||||
export class Link extends React.Component<
|
||||
React.PropsWithChildren<LinkProps>
|
||||
> {}
|
||||
|
||||
interface FormCommonProps extends NodeProps {
|
||||
name?: string;
|
||||
required?: boolean;
|
||||
noExport?: boolean;
|
||||
readOnly?: boolean;
|
||||
value?: number | string;
|
||||
defaultValue?: number | string;
|
||||
}
|
||||
|
||||
interface FieldSetProps extends NodeProps {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class FieldSet extends React.Component<
|
||||
React.PropsWithChildren<FieldSetProps>
|
||||
> {}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputFormatting {
|
||||
type:
|
||||
| 'date'
|
||||
| 'time'
|
||||
| 'percent'
|
||||
| 'number'
|
||||
| 'zip'
|
||||
| 'zipPlus4'
|
||||
| 'phone'
|
||||
| 'ssn';
|
||||
param?: string;
|
||||
nDec?: number;
|
||||
sepComma?: boolean;
|
||||
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
|
||||
currency?: string;
|
||||
currencyPrepend?: boolean;
|
||||
}
|
||||
|
||||
// see http://pdfkit.org/docs/forms.html#text_field_formatting
|
||||
interface TextInputProps extends FormCommonProps {
|
||||
align?: 'left' | 'center' | 'right';
|
||||
multiline?: boolean;
|
||||
/**
|
||||
* The text will be masked (e.g. with asterisks).
|
||||
*/
|
||||
password?: boolean;
|
||||
/**
|
||||
* If set, text entered in the field is not spell-checked
|
||||
*/
|
||||
noSpell?: boolean;
|
||||
format?: TextInputFormatting;
|
||||
/**
|
||||
* Sets the fontSize (default or 0 means auto sizing)
|
||||
*/
|
||||
fontSize?: number;
|
||||
/**
|
||||
* Sets the maximum length (characters) of the text in the field
|
||||
*/
|
||||
maxLength?: number;
|
||||
}
|
||||
|
||||
export class TextInput extends React.Component<TextInputProps> {}
|
||||
|
||||
interface CheckboxProps extends FormCommonProps {
|
||||
backgroundColor?: string;
|
||||
borderColor?: string;
|
||||
checked?: boolean;
|
||||
onState?: string;
|
||||
offState?: string;
|
||||
xMark?: boolean;
|
||||
}
|
||||
|
||||
export class Checkbox extends React.Component<CheckboxProps> {}
|
||||
|
||||
interface SelectAndListPropsBase extends FormCommonProps {
|
||||
sort?: boolean;
|
||||
edit?: boolean;
|
||||
multiSelect?: boolean;
|
||||
noSpell?: boolean;
|
||||
select?: string[];
|
||||
}
|
||||
|
||||
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
|
||||
edit: true | false;
|
||||
noSpell: boolean;
|
||||
};
|
||||
|
||||
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
|
||||
edit: boolean;
|
||||
noSpell: true | false;
|
||||
};
|
||||
|
||||
type SelectAndListProps =
|
||||
| SelectAndListPropsWithEdit
|
||||
| SelectAndListPropsWithNoSpell;
|
||||
|
||||
export class Select extends React.Component<SelectAndListProps> {}
|
||||
|
||||
export class List extends React.Component<SelectAndListProps> {}
|
||||
|
||||
interface NoteProps extends NodeProps {
|
||||
children: string;
|
||||
}
|
||||
|
||||
export class Note extends React.Component<NoteProps> {}
|
||||
|
||||
interface CanvasProps extends NodeProps {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
paint: (
|
||||
painter: any,
|
||||
availableWidth: number,
|
||||
availableHeight: number,
|
||||
) => null;
|
||||
}
|
||||
|
||||
export class Canvas extends React.Component<CanvasProps> {}
|
||||
|
||||
interface SVGProps extends NodeProps, SVGPresentationAttributes {
|
||||
/**
|
||||
* Enables debug mode on page bounding box.
|
||||
* @see https://react-pdf.org/advanced#debugging
|
||||
*/
|
||||
debug?: boolean;
|
||||
width?: string | number;
|
||||
height?: string | number;
|
||||
viewBox?: string;
|
||||
preserveAspectRatio?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
|
||||
*/
|
||||
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
|
||||
|
||||
interface LineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x1: string | number;
|
||||
x2: string | number;
|
||||
y1: string | number;
|
||||
y2: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Line /> element is used to create a line.
|
||||
*/
|
||||
export class Line extends React.Component<
|
||||
React.PropsWithChildren<LineProps>
|
||||
> {}
|
||||
|
||||
interface PolylineProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
|
||||
*/
|
||||
export class Polyline extends React.Component<
|
||||
React.PropsWithChildren<PolylineProps>
|
||||
> {}
|
||||
|
||||
interface PolygonProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
points: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Polygon /> element is used to create a graphic that contains at least three sides.
|
||||
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
|
||||
*/
|
||||
export class Polygon extends React.Component<
|
||||
React.PropsWithChildren<PolygonProps>
|
||||
> {}
|
||||
|
||||
interface PathProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
d: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
|
||||
*/
|
||||
export class Path extends React.Component<
|
||||
React.PropsWithChildren<PathProps>
|
||||
> {}
|
||||
|
||||
interface RectProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
width: string | number;
|
||||
height: string | number;
|
||||
rx?: string | number;
|
||||
ry?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
|
||||
*/
|
||||
export class Rect extends React.Component<
|
||||
React.PropsWithChildren<RectProps>
|
||||
> {}
|
||||
|
||||
interface CircleProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Circle /> element is used to create a circle.
|
||||
*/
|
||||
export class Circle extends React.Component<
|
||||
React.PropsWithChildren<CircleProps>
|
||||
> {}
|
||||
|
||||
interface EllipseProps extends SVGPresentationAttributes {
|
||||
style?: SVGPresentationAttributes;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
rx: string | number;
|
||||
ry: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Ellipse /> element is used to create an ellipse.
|
||||
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
|
||||
*/
|
||||
export class Ellipse extends React.Component<
|
||||
React.PropsWithChildren<EllipseProps>
|
||||
> {}
|
||||
|
||||
interface TspanProps extends SVGPresentationAttributes {
|
||||
x?: string | number;
|
||||
y?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
|
||||
* It allows for adjustment of the style and/or position of that subtext as needed.
|
||||
*/
|
||||
export class Tspan extends React.Component<
|
||||
React.PropsWithChildren<TspanProps>
|
||||
> {}
|
||||
|
||||
interface GProps extends SVGPresentationAttributes {
|
||||
style?: Style;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <G /> SVG element is a container used to group other SVG elements.
|
||||
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
|
||||
*/
|
||||
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
|
||||
|
||||
interface StopProps {
|
||||
offset: string | number;
|
||||
stopColor: string;
|
||||
stopOpacity?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
|
||||
*/
|
||||
export class Stop extends React.Component<
|
||||
React.PropsWithChildren<StopProps>
|
||||
> {}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface DefsProps {}
|
||||
|
||||
/**
|
||||
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
|
||||
*/
|
||||
export class Defs extends React.Component<
|
||||
React.PropsWithChildren<DefsProps>
|
||||
> {}
|
||||
|
||||
interface ClipPathProps {
|
||||
id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
|
||||
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
|
||||
*/
|
||||
export class ClipPath extends React.Component<
|
||||
React.PropsWithChildren<ClipPathProps>
|
||||
> {}
|
||||
|
||||
interface MarkerProps {
|
||||
id: string;
|
||||
viewBox?: string;
|
||||
refX?: string | number;
|
||||
refY?: string | number;
|
||||
markerWidth?: string | number;
|
||||
markerHeight?: string | number;
|
||||
orient?: 'auto' | 'auto-start-reverse' | number;
|
||||
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
|
||||
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
|
||||
*/
|
||||
export class Marker extends React.Component<
|
||||
React.PropsWithChildren<MarkerProps>
|
||||
> {}
|
||||
|
||||
interface LinearGradientProps {
|
||||
id: string;
|
||||
x1?: string | number;
|
||||
x2?: string | number;
|
||||
y1?: string | number;
|
||||
y2?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class LinearGradient extends React.Component<
|
||||
React.PropsWithChildren<LinearGradientProps>
|
||||
> {}
|
||||
|
||||
interface RadialGradientProps {
|
||||
id: string;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
r?: string | number;
|
||||
fx?: string | number;
|
||||
fy?: string | number;
|
||||
xlinkHref?: string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
||||
}
|
||||
|
||||
/**
|
||||
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
|
||||
*/
|
||||
export class RadialGradient extends React.Component<
|
||||
React.PropsWithChildren<RadialGradientProps>
|
||||
> {}
|
||||
|
||||
interface BlobProviderParams {
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
loading: boolean;
|
||||
error: Error | null;
|
||||
}
|
||||
interface BlobProviderProps {
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children: (params: BlobProviderParams) => React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easy and declarative way of getting document's blob data without
|
||||
* showing it on screen.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class BlobProvider extends React.Component<BlobProviderProps> {}
|
||||
|
||||
interface PDFViewerProps {
|
||||
width?: number | string;
|
||||
height?: number | string;
|
||||
style?: Style | Style[];
|
||||
className?: string;
|
||||
children?: React.ReactElement<DocumentProps>;
|
||||
innerRef?: React.Ref<HTMLIFrameElement>;
|
||||
showToolbar?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iframe PDF viewer for client-side generated documents.
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFViewer extends React.Component<PDFViewerProps> {}
|
||||
|
||||
interface PDFDownloadLinkProps
|
||||
extends Omit<
|
||||
React.AnchorHTMLAttributes<HTMLAnchorElement>,
|
||||
'href' | 'children'
|
||||
> {
|
||||
/** PDF filename. Alias for anchor tag `download` attribute. */
|
||||
fileName?: string;
|
||||
document: React.ReactElement<DocumentProps>;
|
||||
children?: React.ReactNode | React.FC<BlobProviderParams>;
|
||||
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
|
||||
((
|
||||
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
|
||||
instance: UsePDFInstance,
|
||||
) => void);
|
||||
ref?: React.Ref<HTMLAnchorElement> | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Anchor tag to enable generate and download PDF documents on the fly.
|
||||
* @see https://react-pdf.org/advanced#on-the-fly-rendering
|
||||
* @platform web
|
||||
*/
|
||||
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
|
||||
|
||||
interface UsePDFInstance {
|
||||
loading: boolean;
|
||||
blob: Blob | null;
|
||||
url: string | null;
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* React hook for creating and updating a PDF document instance
|
||||
* @platform web
|
||||
*/
|
||||
export function usePDF(options?: {
|
||||
document?: React.ReactElement<DocumentProps>;
|
||||
}): [
|
||||
UsePDFInstance,
|
||||
(newDocument: React.ReactElement<DocumentProps>) => void,
|
||||
];
|
||||
|
||||
export const Font: FontStore;
|
||||
|
||||
export const StyleSheet: {
|
||||
create: <T extends Styles>(styles: T) => T;
|
||||
};
|
||||
|
||||
export const version: any;
|
||||
|
||||
export const PDFRenderer: any;
|
||||
|
||||
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
|
||||
container: any;
|
||||
isDirty: () => boolean;
|
||||
toString: () => string;
|
||||
toBlob: () => Promise<Blob>;
|
||||
toBuffer: () => Promise<NodeJS.ReadableStream>;
|
||||
on: (event: 'change', callback: () => void) => void;
|
||||
updateContainer: (
|
||||
document: React.ReactElement<any>,
|
||||
callback?: () => void,
|
||||
) => void;
|
||||
removeListener: (event: 'change', callback: () => void) => void;
|
||||
};
|
||||
|
||||
export const renderToStream: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
/**
|
||||
* @deprecated use the `renderToBuffer` method
|
||||
*/
|
||||
export const renderToString: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
) => Promise<string>;
|
||||
|
||||
export const renderToFile: (
|
||||
document: React.ReactElement<DocumentProps>,
|
||||
filePath: string,
|
||||
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
|
||||
) => Promise<NodeJS.ReadableStream>;
|
||||
|
||||
const render: typeof renderToFile;
|
||||
|
||||
/**
|
||||
* Render document into a nodejs buffer
|
||||
* @platform node
|
||||
*/
|
||||
export const renderToBuffer: (
|
||||
document: React.ReactElement<ReactPDF.DocumentProps>,
|
||||
) => Promise<Buffer>;
|
||||
}
|
||||
1
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.min.js
generated
vendored
Normal file
1
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/lib/react-pdf.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import*as e from"@react-pdf/primitives";export*from"@react-pdf/primitives";import r from"fs";import{Buffer as t}from"buffer";import o from"@react-pdf/font";import n from"@react-pdf/render";import i from"@react-pdf/pdfkit";import a from"@react-pdf/layout";import{upperFirst as s}from"@react-pdf/fns";import d from"@react-pdf/reconciler";const c=(e,r)=>{let{style:t,children:o,...n}=r;return{type:e,box:{},style:t||{},props:n||{},children:[]}},p=e=>({type:"TEXT_INSTANCE",value:e}),l=(e,r)=>{const t="TEXT"===e.type||"LINK"===e.type||"TSPAN"===e.type||"NOTE"===e.type;"TEXT_INSTANCE"!==r.type||t?e.children.push(r):console.warn(`Invalid '${r.value}' string child outside <Text> component`)},u=(e,r)=>{"ROOT"===e.type?e.document=r:l(e,r)},f=(e,r,t)=>{var o;const n=null===(o=e.children)||void 0===o?void 0:o.indexOf(t);void 0!==n&&-1!==n&&r&&e.children.splice(n,0,r)},m=(e,r)=>{var t;const o=null===(t=e.children)||void 0===t?void 0:t.indexOf(r);void 0!==o&&-1!==o&&e.children.splice(o,1)},v=(e,r)=>{var t;const o=null===(t=e.children)||void 0===t?void 0:t.indexOf(r);void 0!==o&&-1!==o&&e.children.splice(o,1)},w=(e,r,t)=>{e.value=t},y=(e,r,t,o,n)=>{const{style:i,...a}=n;e.props=a,e.style=i},h=e=>{let{onChange:r=(()=>{})}=e;return d({appendChild:l,appendChildToContainer:u,commitTextUpdate:w,commitUpdate:y,createInstance:c,createTextInstance:p,insertBefore:f,removeChild:m,removeChildFromContainer:v,resetAfterCommit:r})};var T={version:"4.5.1"};const{version:P}=T,g=new o;let b;const D={},S=e=>{const r={type:"ROOT",document:null};b=b||h({onChange:()=>{var e;const r=(null===(e=D.change)||void 0===e?void 0:e.slice())||[];for(let e=0;e<r.length;e+=1)r[e]()}});const t=b.createContainer(r),o=(e,r)=>{b.updateContainer(e,t,null,r)};e&&o(e);const d=async function(e){void 0===e&&(e=!0);const t=r.document.props||{},{pdfVersion:o,language:d,pageLayout:c,pageMode:p,title:l,author:u,subject:f,keywords:m,creator:v="react-pdf",producer:w="react-pdf",creationDate:y=new Date,modificationDate:h,ownerPassword:T,userPassword:P,permissions:b}=t,D=new i({compress:e,pdfVersion:o,lang:d,displayTitle:!0,autoFirstPage:!1,ownerPassword:T,userPassword:P,permissions:b,pageLayout:c,info:(S={Title:l,Author:u,Subject:f,Keywords:m,Creator:v,Producer:w,CreationDate:y,ModificationDate:h},Object.fromEntries(Object.entries(S).filter((e=>{let[,r]=e;return void 0!==r}))))});var S;p&&(D._root.data.PageMode=s(p));const _=await a(r.document,g);return{layout:_,fileStream:n(D,_)}},c=function(e){void 0===e&&(e={}),r.document.props.onRender&&r.document.props.onRender(e)};return{on:(e,r)=>{D[e]||(D[e]=[]),D[e].push(r)},container:r,toBlob:async()=>{const e=[],{layout:r,fileStream:t}=await d();return new Promise(((o,n)=>{t.on("data",(r=>{e.push(r instanceof Uint8Array?r:new Uint8Array(r))})),t.on("end",(()=>{try{const t=new Blob(e,{type:"application/pdf"});c({blob:t,_INTERNAL__LAYOUT__DATA_:r}),o(t)}catch(e){n(e)}}))}))},toBuffer:async()=>{const{layout:e,fileStream:r}=await d();return c({_INTERNAL__LAYOUT__DATA_:e}),r},toString:async()=>{"development"===process.env.NODE_ENV&&console.warn("`toString` is deprecated and will be removed in next major release");let e="";const{fileStream:r}=await d(!1);return new Promise(((t,o)=>{try{r.on("data",(r=>{e+=r})),r.on("end",(()=>{c(),t(e)}))}catch(e){o(e)}}))},removeListener:(e,r)=>{if(!D[e])return;const t=D[e].indexOf(r);t>-1&&D[e].splice(t,1)},updateContainer:o}},_=g,A={create:e=>e},C=async e=>{const r=S(e);return await r.toBuffer()},N=async(e,t,o)=>{const n=await C(e),i=r.createWriteStream(t);return n.pipe(i),new Promise(((e,r)=>{i.on("finish",(()=>{o&&o(n,t),e(n)})),i.on("error",r)}))},O=e=>C(e).then((e=>new Promise(((r,o)=>{const n=[];e.on("data",(e=>n.push(e))),e.on("end",(()=>r(t.concat(n)))),e.on("error",(e=>o(e)))})))),E=e=>("development"===process.env.NODE_ENV&&console.warn("`renderToString` is deprecated and will be removed in next major release, use `renderToBuffer` instead"),O(e).then((e=>e.toString()))),x=e=>{throw new Error(`${e} is a web specific API. You're either using this component on Node, or your bundler is not loading react-pdf from the appropriate web build.`)},F=()=>{x("usePDF")},L=()=>{x("PDFViewer")},I=()=>{x("PDFDownloadLink")},B=()=>{x("BlobProvider")},j=N;var R={pdf:S,Font:_,version:P,StyleSheet:A,usePDF:F,PDFViewer:L,BlobProvider:B,PDFDownloadLink:I,renderToStream:C,renderToString:E,renderToFile:N,render:j,...e};export{B as BlobProvider,_ as Font,I as PDFDownloadLink,L as PDFViewer,A as StyleSheet,h as createRenderer,R as default,S as pdf,j as render,O as renderToBuffer,N as renderToFile,C as renderToStream,E as renderToString,F as usePDF,P as version};
|
||||
67
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/package.json
generated
vendored
Normal file
67
build_temp/.next/node_modules/@react-pdf/renderer-5f716e9bc7d68b8a/package.json
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"name": "@react-pdf/renderer",
|
||||
"version": "4.5.1",
|
||||
"license": "MIT",
|
||||
"description": "Create PDF files on the browser and server",
|
||||
"author": "Diego Muracciole <diegomuracciole@gmail.com>",
|
||||
"homepage": "https://github.com/diegomura/react-pdf#readme",
|
||||
"type": "module",
|
||||
"main": "./lib/react-pdf.js",
|
||||
"browser": {
|
||||
"./lib/react-pdf.js": "./lib/react-pdf.browser.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/diegomura/react-pdf.git",
|
||||
"directory": "packages/renderer"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rimraf ./lib && rollup -c",
|
||||
"watch": "rimraf ./lib && rollup -c -w",
|
||||
"size": "size-limit",
|
||||
"lint": "eslint src",
|
||||
"test": "vitest && vitest --config vitest.browser.config.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@react-pdf/fns": "3.1.3",
|
||||
"@react-pdf/font": "^4.0.8",
|
||||
"@react-pdf/layout": "^4.6.1",
|
||||
"@react-pdf/pdfkit": "^5.1.1",
|
||||
"@react-pdf/primitives": "^4.3.0",
|
||||
"@react-pdf/reconciler": "^2.0.0",
|
||||
"@react-pdf/render": "^4.5.1",
|
||||
"@react-pdf/types": "^2.11.1",
|
||||
"events": "^3.3.0",
|
||||
"object-assign": "^4.1.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"queue": "^6.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"yarn lint",
|
||||
"prettier --write"
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
"index.d.ts"
|
||||
],
|
||||
"collective": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/react-pdf",
|
||||
"logo": "https://opencollective.com/opencollective/logo.txt"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@size-limit/preset-big-lib": "^11.0.1",
|
||||
"assert": "^2.0.0",
|
||||
"browserify-zlib": "^0.2.0",
|
||||
"buffer": "^6.0.3",
|
||||
"process": "^0.11.10",
|
||||
"size-limit": "^11.0.1",
|
||||
"util": "^0.12.4"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user