import type PptxGenJs from "pptxgenjs"; import React from "react"; import { InternalImageSrc, InternalPresentation, InternalText, InternalTextPartBaseStyle } from "./normalizer"; import { ChildElement } from "./util"; export declare enum NodeTypes { SHAPE = "shape", TEXT_LINK = "text-link", TEXT_BULLET = "text-bullet", SLIDE = "slide", IMAGE = "image", PRESENTATION = "presentation" } declare type VisualBaseProps = { style?: { x: number | string; y: number | string; w: number | string; h: number | string; }; }; interface TextNodeBaseStyle { bold?: InternalTextPartBaseStyle["bold"]; color?: string; fontFace?: string; fontSize?: number; italic?: InternalTextPartBaseStyle["italic"]; } export declare type TextLinkProps = { children: string; tooltip?: string; style?: TextNodeBaseStyle; } & ({ url: string; } | { slide: number; }); export declare const isTextLink: (el: React.ReactElement) => el is React.FunctionComponentElement; export declare type TextBulletProps = { children: string; style?: TextNodeBaseStyle; } & Omit, "style">; export declare const isTextBullet: (el: React.ReactElement) => el is React.FunctionComponentElement; export declare type TextChild = string | number | ChildElement | ChildElement | TextChild[]; export declare type TextProps = { 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 declare type ImageProps = VisualBaseProps & { src: InternalImageSrc; style?: { /** * @deprecated no longer has any effect and will be removed soon! Use imageFit 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.FunctionComponentElement; export declare 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.FunctionComponentElement; export declare type VisualProps = TextProps | ImageProps | ShapeProps; export declare type Visual = typeof Text | typeof Image | typeof Shape; export declare type SlideProps = { children?: ChildElement; hidden?: boolean; style?: { backgroundColor?: string; backgroundImage?: InternalImageSrc; }; }; export declare const Slide: React.FC; export declare type PresentationProps = { children?: ChildElement; layout?: InternalPresentation["layout"]; }; export declare const Presentation: React.FC; export declare const isReactPPTXComponent: (node: React.ReactElement) => boolean; export {};