import type PptxGenJs from "pptxgenjs"; import React from "react"; import { InternalImageSrc, InternalPresentation, InternalText, InternalTextPart, InternalTextPartBaseStyle } from "./normalizer"; import { ChildElement } from "./util"; export declare enum NodeTypes { SHAPE = "shape", LINE = "line", TEXT_LINK = "text-link", TEXT_BULLET = "text-bullet", SLIDE = "slide", MASTER_SLIDE = "master-slide", IMAGE = "image", TABLE_CELL = "table-cell", PRESENTATION = "presentation" } type VisualBaseProps = { style?: { x: number | string; y: number | string; w: number | string; h: number | string; }; }; interface TextNodeBaseStyle extends Omit { color?: string; } type TextNodeBaseProps = Pick; export type TextLinkProps = TextNodeBaseProps & { children: string; tooltip?: string; style?: TextNodeBaseStyle; } & ({ url: string; } | { slide: number; }); export declare const isTextLink: (el: React.ReactElement) => el is React.ReactElement>; export type TextBulletProps = TextNodeBaseProps & { children: TextChild; style?: TextNodeBaseStyle; } & Omit, "style">; export declare const isTextBullet: (el: React.ReactElement) => el is React.ReactElement>; export type TextChild = string | number | ChildElement | ChildElement | TextChild[]; export type TextProps = TextNodeBaseProps & { children?: TextChild; style?: Partial> & TextNodeBaseStyle & { align?: InternalText["style"]["align"]; verticalAlign?: InternalText["style"]["verticalAlign"]; }; }; export declare const Text: React.FC & { Link: React.FC; Bullet: React.FC; }; export declare const isText: (el: React.ReactElement) => el is React.FunctionComponentElement; export type ImageProps = VisualBaseProps & { src: InternalImageSrc; style?: { /** * @deprecated no longer has any effect and will be removed soon! Use sizing.fit instead */ backgroundSize?: "contain" | "cover"; sizing?: { fit: "contain" | "cover" | "crop"; imageWidth?: number; imageHeight?: number; }; }; }; export declare const Image: React.FC; export declare const isImage: (el: React.ReactElement) => el is React.ReactElement>; export type ShapeProps = VisualBaseProps & { type: keyof typeof PptxGenJs.ShapeType; children?: TextChild; style?: { backgroundColor?: string; borderWidth?: number; borderColor?: string; }; }; export declare const Shape: React.FC; export declare const isShape: (el: React.ReactElement) => el is React.ReactElement>; export type TableCellProps = TextProps & { colSpan?: number; rowSpan?: number; }; export declare const TableCell: React.FC; export declare const isTableCell: (el: React.ReactElement) => el is React.ReactElement>; export type TableProps = VisualBaseProps & { rows: Array>>; style?: { borderWidth?: number; borderColor?: string; width?: number; margin?: number; }; }; export declare const Table: React.FC & { Cell: React.FC; }; export declare const isTable: (el: React.ReactElement) => el is React.FunctionComponentElement; export type LineProps = { x1: number; x2: number; y1: number; y2: number; style?: { color?: string; width?: number; }; }; export declare const Line: React.FC; export declare const isLine: (el: React.ReactElement) => el is React.ReactElement>; export type VisualProps = TextProps | ImageProps | ShapeProps; export type Visual = typeof Text | typeof Image | typeof Shape; export type SlideProps = { children?: ChildElement; masterName?: string; hidden?: boolean; style?: { backgroundColor?: string; backgroundImage?: InternalImageSrc; }; notes?: string; }; export declare const Slide: React.FC; export type MasterSlideProps = { name: string; children?: ChildElement; style?: { backgroundColor?: string; backgroundImage?: InternalImageSrc; }; }; export declare const MasterSlide: React.FC; export type PresentationProps = Omit & { children?: ChildElement; layout?: InternalPresentation["layout"]; }; export declare const Presentation: React.FC; export declare const isReactPPTXComponent: (node: React.ReactElement) => boolean; export {};