import { Bookmark, Orientation, PageLayout, PageMode, PageSize, PDFVersion, SourceObject, Style, SVGPresentationAttributes } from '@react-pdf/types'; import { ComponentChild, ComponentFactory, VNode } from 'preact'; 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; } export 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; }) => VNode; } export declare const View: ComponentFactory; export declare const Page: ComponentFactory; export interface OnRenderProps { blob?: Blob; } export 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; onRender?: (props: OnRenderProps) => any; } export declare const Document: ComponentFactory; export 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; }) => VNode; /** * Override the default hyphenation-callback * @see https://react-pdf.org/fonts#registerhyphenationcallback */ /** * 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; } export declare const Text: ComponentFactory; export interface BaseImageProps extends NodeProps { /** * Enables debug mode on page bounding box. * @see https://react-pdf.org/advanced#debugging */ debug?: boolean; cache?: boolean; } export interface ImageWithSrcProp extends BaseImageProps { src: SourceObject; } export interface ImageWithSourceProp extends BaseImageProps { source: SourceObject; } export type ImageProps = ImageWithSrcProp | ImageWithSourceProp; export declare const Image: ComponentFactory; export declare const Link: ComponentFactory<{ style?: any; }>; export declare const Note: ComponentFactory<{ style?: any; }>; export declare const Canvas: ComponentFactory<{ style?: any; }>; export 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; } export declare const Svg: ComponentFactory; export interface LineProps extends SVGPresentationAttributes { style?: SVGPresentationAttributes; x1: string | number; x2: string | number; y1: string | number; y2: string | number; } export declare const Line: ComponentFactory; export interface PolylineProps extends SVGPresentationAttributes { style?: SVGPresentationAttributes; points: string; } export declare const Polyline: ComponentFactory; export interface PolygonProps extends SVGPresentationAttributes { style?: SVGPresentationAttributes; points: string; } export declare const Polygon: ComponentFactory; export interface PathProps extends SVGPresentationAttributes { style?: SVGPresentationAttributes; d: string; } export declare const Path: ComponentFactory; export interface RectProps extends SVGPresentationAttributes { style?: SVGPresentationAttributes; x?: string | number; y?: string | number; width: string | number; height: string | number; rx?: string | number; ry?: string | number; } export declare const Rect: ComponentFactory; export interface CircleProps extends SVGPresentationAttributes { style?: SVGPresentationAttributes; cx?: string | number; cy?: string | number; r: string | number; } export declare const Circle: ComponentFactory; export interface EllipseProps extends SVGPresentationAttributes { style?: SVGPresentationAttributes; cx?: string | number; cy?: string | number; rx: string | number; ry: string | number; } export declare const Ellipse: ComponentFactory; export interface TspanProps extends SVGPresentationAttributes { style?: never; x?: string | number; y?: string | number; } export declare const Tspan: ComponentFactory; export interface GProps extends SVGPresentationAttributes { style?: Style; } export declare const G: ComponentFactory; export interface StopProps { style?: never; offset: string | number; stopColor: string; stopOpacity?: string | number; } export declare const Stop: ComponentFactory; export interface DefsProps { } export declare const Defs: ComponentFactory; export interface ClipPathProps { style?: never; id?: string; } export declare const ClipPath: ComponentFactory; export interface LinearGradientProps { style?: never; id: string; x1?: string | number; x2?: string | number; y1?: string | number; y2?: string | number; xlinkHref?: string; gradientTransform?: string; gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox'; } export declare const LinearGradient: ComponentFactory; export interface RadialGradientProps { style?: never; id: string; cx?: string | number; cy?: string | number; r?: string | number; fx?: string | number; fy?: string | number; xlinkHref?: string; gradientTransform?: string; gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox'; } export declare const RadialGradient: ComponentFactory; export {};