# @flowup/rich-text-types

> Rich text type definitions (JSON Schema & Typescript)

Latest version **1.0.3** (published 2020-09-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @flowup/rich-text-types
pnpm add @flowup/rich-text-types
yarn add @flowup/rich-text-types
bun add @flowup/rich-text-types
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-09-02 |
| First published | 2020-09-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 31.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | hello@flowup.cz |
| Maintainers | gelidus, helloflowup, matejchalk, mrkpks, paveltobias, vmasek |

## Links

- npm: https://www.npmjs.com/package/@flowup/rich-text-types
- Repository: https://github.com/flowup/rich-text-types
- Homepage: https://github.com/flowup/rich-text-types#readme
- Issues: https://github.com/flowup/rich-text-types/issues
- npm.io page: https://npm.io/package/@flowup/rich-text-types

## Recent versions

- 1.0.3 (latest) — 2020-09-02
- 1.0.2 — 2020-09-02
- 1.0.1 — 2020-09-02
- 1.0.0 — 2020-09-01

## README

# rich-text-types

Type definitions for rich text fields for Headless.

## Installation

```sh
npm i [-D] @flowup/rich-text-types
```

## Usage

Use Typescript type annotations:

```ts
import { RichTextDocument } from '@flowup/rich-text-types';

const document: RichTextDocument = {
  type: 'document',
  children: [
    {
      type: 'paragraph',
      children: [{ type: 'text', value: 'Hello, world.' }],
    },
  ],
};
```

Use JSON schema (e.g. for runtime validation):

```js
import { richTextSchema } from '@flowup/rich-text-types';
import { validate } from 'jsonschema';

console.log(
  validate(
    {
      type: 'document',
      children: [
        {
          type: 'heading-1',
          children: [{ type: 'text', value: 'Hello, world!' }],
        },
      ],
    },
    richTextSchema,
  ),
);
```

---
_Source: https://npm.io/package/@flowup/rich-text-types · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
