UNPKG

json-joy

Version:

Collection of libraries for building collaborative editing apps.

14 lines (13 loc) 994 B
import type { JsonMlNode } from 'very-small-parser/lib/html/json-ml/types'; import type { THtmlToken } from 'very-small-parser/lib/html/types'; import type { PeritextMlNode } from '../block/types'; import type { SliceRegistry } from '../registry/SliceRegistry'; import type { ViewStyle, ViewRange } from '../editor/types'; export declare const toViewRange: (node: PeritextMlNode) => ViewRange; export declare const fromJsonMl: (jsonml: JsonMlNode, registry: SliceRegistry) => PeritextMlNode; export declare const fromHast: (hast: THtmlToken, registry: SliceRegistry) => PeritextMlNode; export declare const fromHtml: (html: string, registry: SliceRegistry) => PeritextMlNode; export declare const htmlToHast: (html: string) => THtmlToken; export declare const textFromHtml: (html: string) => string; export declare const importHtml: (html: string, registry: SliceRegistry) => [view?: ViewRange, style?: ViewStyle[]]; export declare const importStyle: (html: string) => ViewStyle[] | undefined;