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)

24 lines (23 loc) 1.05 kB
import { FieldOptions, Schema, TextDoc, WithoutLabel } from 'alinea/core'; import { RichTextField } from 'alinea/core/field/RichTextField'; /** Optional settings to configure a rich text field */ export interface RichTextOptions<Blocks extends Schema> extends FieldOptions<TextDoc<Blocks>> { /** Allow these blocks to be created between text fragments */ schema?: Blocks; /** Width of the field in the dashboard UI (0-1) */ width?: number; /** Add instructional text to a field */ help?: string; /** Field is optional */ optional?: boolean; /** Display a minimal version */ inline?: boolean; /** A default value */ initialValue?: TextDoc<Blocks>; /** Hide this rich text field */ hidden?: boolean; /** Make this rich text field read-only */ readOnly?: boolean; } /** Create a rich text field configuration */ export declare function richText<Blocks extends Schema = {}>(label: string, options?: WithoutLabel<RichTextOptions<Blocks>>): RichTextField<Blocks, RichTextOptions<Blocks>>;