import type { Size } from "../../render/types/Size.js"; import type { FilterProperties } from "../traits/Filters.js"; import type { Rect } from "../types/Rect.js"; import type { Shadow } from "../types/Shadow.js"; import { MotionProps, MotionStyle, Transition, Variants } from "framer-motion"; import React from "react"; import { Animatable } from "../../animation/Animatable/Animatable.js"; import { FontLoadStatus } from "../fonts/useFontLoadStatus.js"; import { NewConstraintProperties, ParentSize, PositionAbsoluteProperties, PositionFixedProperties } from "../types/NewConstraints.js"; import { RenderTarget } from "../types/RenderEnvironment.js"; import { Layer, LayerProps } from "./Layer.js"; /** * @internal */ export type TextAlignment = "left" | "right" | "center" | undefined; /** * @internal */ export type TextVerticalAlignment = "top" | "center" | "bottom"; /** * @internal */ export interface TextProps extends NewConstraintProperties, PositionFixedProperties, PositionAbsoluteProperties, Partial { rotation: Animatable | number; visible: boolean; name?: string; alignment: TextAlignment; verticalAlignment: TextVerticalAlignment; /** * @deprecated The single autoSize property will only be passed in when the supportsDomLayout platform check is NOT on, and will ultimately be removed */ autoSize?: boolean; opacity?: number; shadows: Readonly; style?: MotionStyle; text?: string; font?: string; parentSize?: ParentSize; viewportSize?: Size | null; } /** * @internal */ export interface TextProperties extends TextProps, LayerProps, Pick { rawHTML?: string; isEditable?: boolean; fonts?: string[]; fontLoadStatus: FontLoadStatus; layoutId?: string | undefined; className?: string; /** @internal */ withExternalLayout?: boolean; /** @internal for testing */ environment?(): RenderTarget; /** @internal */ innerRef?: React.MutableRefObject; transition?: Transition; variants?: Variants; /** @internal */ __fromCanvasComponent?: boolean; /** @internal */ _initialStyle?: Partial; /** @internal */ preload?: string[]; /** @internal */ __link?: string; /** @internal */ tabIndex?: number; } /** * @internal */ export declare const Text: React.ForwardRefExoticComponent & React.RefAttributes>; declare class TextComponentType extends Layer { static supportsConstraints: boolean; static defaultTextProps: TextProps; static readonly defaultProps: TextProperties; editorText: string | undefined; get frame(): Rect | null; getOverrideText(): void; get transformTemplate(): ((_: any, generated: string) => string) | undefined; } export declare const TextComponent: typeof TextComponentType; /** * If text is overriden in an override or by a variable, we take the rawHTML, * find the first styled span inside the first block, put the text in there, and * discard everything else. For example: * *

* * Hello * World from the 1st block *
*
* * *
*
* * More text in third block *
*
*

* * will become: * *

* * Text from the text prop, e.g., a variable or an override *
*
*

*/ export declare function replaceDraftHTMLWithText(rawHTML: string, text: string): string; export {}; //# sourceMappingURL=Text.d.ts.map