@bettaibi/react-blocknote
Version:
A modern, versatile rich text editor component for React applications with an elegant UI and Notion-like functionality. Supports both React 18 and React 19.
80 lines (79 loc) • 2.1 kB
TypeScript
/**
* This hook is created to provide some values you can use to enable/disable UI Controls
* based on the current state of the editor.
*/
declare enum BlockNoteMark {
BOLD = "bold",
ITALIC = "italic",
UNDERLINE = "underline",
STRIKE = "strike",
CODE = "code",
HEADING = "heading",
BULLET_LIST = "bulletList",
ORDERED_LIST = "orderedList",
TASK_LIST = "taskList",
LIST_ITEM = "listItem",
PARAGRAPH = "paragraph",
CODE_BLOCK = "codeBlock",
BLOCKQUOTE = "blockquote",
TABLE = "table",
TABLE_ROW = "tableRow",
TABLE_CELL = "tableCell",
TABLE_HEADER = "tableHeader",
IMAGE = "image",
LINK = "link"
}
export declare const TextAlign: {
readonly LEFT: {
readonly textAlign: "left";
};
readonly CENTER: {
readonly textAlign: "center";
};
readonly RIGHT: {
readonly textAlign: "right";
};
};
export declare function useBlockNoteValues(): {
getActiveMark: (mark: BlockNoteMark) => boolean;
getTextAlignState: (alignment: (typeof TextAlign)[keyof typeof TextAlign]) => boolean;
TextAlign: {
readonly LEFT: {
readonly textAlign: "left";
};
readonly CENTER: {
readonly textAlign: "center";
};
readonly RIGHT: {
readonly textAlign: "right";
};
};
canUndo: boolean;
canRedo: boolean;
canBold: boolean;
canItalic: boolean;
canUnderline: boolean;
canStrike: boolean;
canCode: boolean;
canHeading1: boolean;
canHeading2: boolean;
canHeading3: boolean;
canHeading4: boolean;
canHeading5: boolean;
canHeading6: boolean;
canNormalText: boolean;
canBulletList: boolean;
canOrderedList: boolean;
canTaskList: boolean;
canCodeBlock: boolean;
canBlockquote: boolean;
canInsertTable: boolean;
canDeleteTable: boolean;
canAddColumnBefore: boolean;
canAddColumnAfter: boolean;
canDeleteColumn: boolean;
canAddRowBefore: boolean;
canAddRowAfter: boolean;
canDeleteRow: boolean;
};
export {};