# @types/slate-html-serializer

> TypeScript definitions for slate-html-serializer

Latest version **0.6.8** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/slate-html-serializer
pnpm add @types/slate-html-serializer
yarn add @types/slate-html-serializer
bun add @types/slate-html-serializer
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.6.8 |
| Published | 2023-11-07 |
| First published | 2018-07-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51432 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/slate-html-serializer
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/slate-html-serializer
- npm.io page: https://npm.io/package/@types/slate-html-serializer

## Dependencies (2)

- [@types/react](https://npm.io/package/@types/react.md) *
- [@types/slate](https://npm.io/package/@types/slate.md) *

## Recent versions

- 0.6.8 (latest) — 2023-11-07
- 0.6.5 (ts3.9) — 2021-07-06
- 0.6.4 (ts3.5) — 2020-05-27
- 0.6.3 (ts2.8) — 2018-12-18
- 0.6.1 (ts2.6) — 2018-07-21
- 0.6.7 — 2023-10-18
- 0.6.6 — 2023-09-25
- 0.6.2 — 2018-08-06
- 0.6.0 — 2018-07-06

## README

# Installation
> `npm install --save @types/slate-html-serializer`

# Summary
This package contains type definitions for slate-html-serializer (https://github.com/ianstormtaylor/slate).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/slate-html-serializer.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/slate-html-serializer/index.d.ts)
````ts
import * as React from "react";
import { BlockProperties, Leaf, Mark, Node as SlateNode, Value, ValueJSON } from "slate";

export interface Rule {
    deserialize?:
        | ((el: Element, next: (elements: Element[] | NodeList | Array<Node & ChildNode>) => any) => any)
        | undefined;
    serialize?: ((obj: any, children: string) => React.ReactNode) | undefined;
}

export interface HtmlOptions {
    rules?: Rule[] | undefined;
    defaultBlock?: BlockProperties | string | undefined;
    parseHtml?: ((html: string) => HTMLElement) | undefined;
}

export default class Html {
    constructor(options?: HtmlOptions);

    deserialize(html: string, options: { toJSON: true }): ValueJSON;
    deserialize(html: string, options?: { toJSON?: false | undefined }): Value;

    serialize(value: Value, options?: { render?: true | undefined }): string;
    serialize(value: Value, options: { render: false }): Element[];

    protected rules: Rule[];
    protected defaultBlock: BlockProperties;
    protected parseHtml: (html: string) => HTMLElement;

    protected deserializeElements: (elements: HTMLElement[]) => SlateNode[];
    protected deserializeElement: (element: HTMLElement) => any;
    protected deserializeMark: (mark: Mark) => SlateNode[];

    protected serializeNode: (node: SlateNode) => string;
    protected serializeLeaf: (leaf: Leaf) => string;
    protected serializeString: (string: string) => string;
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: [@types/react](https://npmjs.com/package/@types/react), [@types/slate](https://npmjs.com/package/@types/slate)

# Credits
These definitions were written by [Brandon Shelton](https://github.com/YangusKhan).

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