editor-react-parser
Version:
A renderer for editorjs block data for react
41 lines (40 loc) • 846 B
TypeScript
import React from "react";
import { OutputBlockData } from "../BlockParser";
/**
* Output of a list block
*/
export interface ListItem {
/**
* list item text content
*/
content: string;
/**
* Meta information of each list item
*/
meta: object;
/**
* sublist items
*/
items: ListItem[];
}
export type EditorJsList = {
style: ListStyle;
meta: object;
items: ListItem[] | string[];
};
export declare enum ListStyle {
ordered = "ordered",
unordered = "unordered"
}
export type ListConfig = {
classNames: {
unordered?: string;
ordered?: string;
};
};
export interface ListProps {
item: OutputBlockData<EditorJsList>;
config?: ListConfig;
}
declare const ListBlock: ({ item, config }: ListProps) => React.JSX.Element;
export default ListBlock;