import { ReactNode } from 'react';
import { BadgeVariant } from '../../badge/src/badge';
import { BaseProps } from '../../../libraries/common-types/src/common-types';
import { BLOCK, ELEMENT, INLINE, MARK } from './constants';
export type ImageProp = undefined | ((url: string, alt?: string, contentType?: string) => ReactNode);
export type VideoPosterProp = undefined | ((url: string) => string);
export type LinkProp = undefined | ((children: React.ReactNode[], href?: string) => ReactNode);
export type NodeTypesOptions = {
    image: ImageProp;
    link: LinkProp;
    videoPoster: VideoPosterProp;
};
export type RenderFunc<T> = (node: RichTextNode<T>, children: ReactNode[]) => ReactNode;
export type RichTextNode<T = Value> = {
    content?: RichTextNode<T>[];
    value?: string | Value | (Value & T);
    marks?: Mark[];
    uri?: string;
    data?: Record<string, unknown>;
} & ({
    type: Block;
    nodeType?: never;
} | {
    nodeType: Block;
    type?: never;
});
export type NodeTypes<T = Value> = {
    [nodeType: string]: RenderFunc<T>;
};
export type RickTextElementType = (typeof ELEMENT)[keyof typeof ELEMENT];
export type RichTextProps<T> = BaseProps<"input"> & {
    /**
     * Data value.
     *
        RichTextNode<T> = {
          content?: RichTextNode<T>[] | undefined;
          type: Block;
          value?: string | Value | (Value & T) | undefined;
          marks?: "bold" | "italic" | "underline" | "code"[] | undefined;
          uri?: string | undefined;
          data?: Record<string, unknown> | undefined;
        }
     * */
    data: RichTextNode<T>;
    customNodeTypes?: NodeTypes<T>;
    noTextSpacing?: boolean;
    element?: RickTextElementType;
    image?: ImageProp;
    videoPoster?: VideoPosterProp;
    link?: LinkProp;
};
export type Inline = (typeof INLINE)[keyof typeof INLINE];
export type Block = (typeof BLOCK)[keyof typeof BLOCK];
export type Mark = (typeof MARK)[keyof typeof MARK];
type Video = {
    url: string;
};
type Image = {
    url: string;
    contentType?: string;
};
type Media = {
    image: Image;
    altText?: string;
};
export type Value = {
    url?: string;
    altText?: string;
    posterImage?: {
        altText: string;
        url: string;
    };
    video?: Video;
    image?: Image;
    title?: string;
    secondaryMedia?: Media;
    richPreamble?: string;
    teaserUrl?: string;
    tagline?: string;
    taglineType?: BadgeVariant;
};
export type KeyOfBlock = keyof typeof BLOCK;
export {};
//# sourceMappingURL=types.d.ts.map