alinea
Version:
Headless git-based CMS
17 lines (16 loc) • 746 B
TypeScript
import type { Infer } from 'alinea/core/Infer';
import type { Schema } from 'alinea/core/Schema';
import { type TextDoc } from 'alinea/core/TextDoc';
import type { RichTextElements } from 'alinea/core/shape/RichTextShape';
import { type ComponentType, type ReactElement } from 'react';
export type RichTextProps<Blocks extends Schema> = {
doc: TextDoc<Blocks>;
text?: ComponentType<{
children: string;
}>;
} & {
[K in keyof typeof RichTextElements]?: ComponentType<JSX.IntrinsicElements[K]> | ReactElement;
} & {
[K in keyof Blocks]?: ComponentType<Infer<Blocks[K]>>;
};
export declare function RichText<Blocks extends Schema>({ doc, ...views }: RichTextProps<Blocks>): import("react/jsx-runtime").JSX.Element | null;