import type PptxGenJs from "pptxgenjs"; import React, { ReactElement } from "react"; import { PresentationProps, TextChild } from "./nodes"; export type HexColor = string; export type ComplexColor = { type: "solid"; color: HexColor; alpha: number; }; type Position = number | `${number}%`; type ObjectBase = { style: { x: Position; y: Position; w: Position; h: Position; }; }; type PptxGenJsTextStyles = Pick; export interface InternalTextPartBaseStyle extends PptxGenJsTextStyles { color: HexColor | null; verticalAlign?: "top" | "bottom" | "middle"; backgroundColor?: HexColor | ComplexColor | null; } type PptxGenJsTextOptions = Pick; export type InternalTextPart = PptxGenJsTextOptions & { text: string; style: Partial; link?: { tooltip?: string; } & ({ url: string; } | { slide: number; }); bullet?: true | Exclude; }; export type InternalText = ObjectBase & { kind: "text"; text: InternalTextPart[]; style: InternalTextPartBaseStyle & { align?: "left" | "right" | "center"; verticalAlign?: "top" | "bottom" | "middle"; }; }; export type InternalImage = ObjectBase & { kind: "image"; src: InternalImageSrc; style: { sizing: { fit: "contain" | "cover" | "crop"; imageWidth?: number; imageHeight?: number; } | null; }; }; export type InternalShape = ObjectBase & { kind: "shape"; type: keyof typeof PptxGenJs.ShapeType; text: InternalTextPart[] | null; style: { backgroundColor: HexColor | ComplexColor | null; borderColor: HexColor | null; borderWidth: number | null; }; }; export type InternalTableStyle = { borderColor: HexColor | null; borderWidth: number | null; margin: number | null; }; export type InternalTableCell = InternalText & { colSpan?: number; rowSpan?: number; }; export type InternalTable = ObjectBase & { kind: "table"; rows: Array>; style: InternalTableStyle; }; export type InternalLine = { kind: "line"; x1: number; y1: number; x2: number; y2: number; style: { color: HexColor | null; width: number | null; }; }; export type InternalSlideObject = InternalText | InternalImage | InternalShape | InternalTable | InternalTableCell | InternalLine; export type InternalImageSrc = { kind: "data"; data: string; } | { kind: "path"; path: string; }; export type InternalSlide = { masterName: string | null; objects: InternalSlideObject[]; backgroundColor: HexColor | ComplexColor | null; backgroundImage: InternalImageSrc | null; hidden: boolean; notes?: string; }; export type InternalMasterSlide = { name: string; objects: InternalSlideObject[]; backgroundColor: HexColor | ComplexColor | null; backgroundImage: InternalImageSrc | null; }; export type InternalPresentation = { slides: InternalSlide[]; masterSlides: { [name: string]: InternalMasterSlide; }; layout: "16x9" | "16x10" | "4x3" | "wide" | "custom" | { width: number; height: number; }; author?: string; company?: string; revision?: string; subject?: string; title?: string; }; export declare const normalizeHexColor: (colorString: string) => HexColor; export declare const normalizeHexOrComplexColor: (colorString: string) => HexColor | ComplexColor; export declare const normalizeText: (t: TextChild) => InternalTextPart[]; export declare const normalizeCoordinate: (x: string | number | null | undefined, _default: number) => `${number}%` | number; export declare const normalizeJsx: ({ props, }: React.ReactElement) => InternalPresentation; export {};