UNPKG

alinea

Version:

[![npm](https://img.shields.io/npm/v/alinea.svg)](https://npmjs.org/package/alinea) [![install size](https://packagephobia.com/badge?p=alinea)](https://packagephobia.com/result?p=alinea)

32 lines (31 loc) 829 B
import { Infer, Schema, TextDoc } from 'alinea/core'; import { ComponentType, ReactElement } from 'react'; export declare enum Elements { h1 = "h1", h2 = "h2", h3 = "h3", h4 = "h4", h5 = "h5", h6 = "h6", p = "p", b = "b", i = "i", ul = "ul", ol = "ol", li = "li", a = "a", hr = "hr", br = "br", small = "small" } export type RichTextProps<Blocks extends Schema> = { doc: TextDoc<Blocks>; text?: ComponentType<{ children: string; }>; } & { [K in keyof typeof Elements]?: 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;