json-joy
Version:
Collection of libraries for building collaborative editing apps.
23 lines (22 loc) • 911 B
TypeScript
import * as React from 'react';
import { PeritextSurfaceState } from '../state';
import type { PeritextPlugin } from './types';
import type { Peritext } from '../../../json-crdt-extensions';
export interface PeritextViewProps {
peritext: Peritext;
/**
* Array of plugins use to render editor content and provide additional
* functionality. The plugin list must be memorized and not recreated on
* every render. If omitted, a default set of plugins will be used.
*/
plugins?: PeritextPlugin[];
/**
* Called when the editor is started, DOM is created, main DOM handlers have
* been initialized. Receives the {@link PeritextSurfaceState} instance used
* to manage the editor.
*
* @param state json-joy Peritext state manager.
*/
onStart?: (state: PeritextSurfaceState) => void;
}
export declare const PeritextView: React.FC<PeritextViewProps>;