text-editor-drcsystems
Version:
Text Editor Made with Love by DRC Systems
44 lines (43 loc) • 1.71 kB
TypeScript
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import { EditorThemeClasses, Klass, LexicalCommand, LexicalEditor, LexicalNode } from 'lexical';
import * as React from 'react';
export declare type InsertTableCommandPayload = Readonly<{
columns: string;
rows: string;
includeHeaders?: boolean;
}>;
export declare type CellContextShape = {
cellEditorConfig: null | CellEditorConfig;
cellEditorPlugins: null | JSX.Element | Array<JSX.Element>;
set: (cellEditorConfig: null | CellEditorConfig, cellEditorPlugins: null | JSX.Element | Array<JSX.Element>) => void;
};
export declare type CellEditorConfig = Readonly<{
namespace: string;
nodes?: ReadonlyArray<Klass<LexicalNode>>;
onError: (error: Error, editor: LexicalEditor) => void;
readOnly?: boolean;
theme?: EditorThemeClasses;
}>;
export declare const INSERT_NEW_TABLE_COMMAND: LexicalCommand<InsertTableCommandPayload>;
export declare const CellContext: React.Context<CellContextShape>;
export declare function TableContext({ children }: {
children: JSX.Element;
}): JSX.Element;
export declare function InsertTableDialog({ activeEditor, onClose, }: {
activeEditor: LexicalEditor;
onClose: () => void;
}): JSX.Element;
export declare function InsertNewTableDialog({ activeEditor, onClose, }: {
activeEditor: LexicalEditor;
onClose: () => void;
}): JSX.Element;
export declare function TablePlugin({ cellEditorConfig, children, }: {
cellEditorConfig: CellEditorConfig;
children: JSX.Element | Array<JSX.Element>;
}): JSX.Element | null;