mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-12-14 19:42:14 +03:00
Lexical API: Added content module, testing and documented
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import {createTestContext} from "lexical/__tests__/utils";
|
||||
import {EditorApi} from "../api";
|
||||
import {EditorUiContext} from "../../ui/framework/core";
|
||||
import {LexicalEditor} from "lexical";
|
||||
|
||||
|
||||
/**
|
||||
* Create an instance of the EditorApi and EditorUiContext.
|
||||
*/
|
||||
export function createEditorApiInstance(): { api: EditorApi; context: EditorUiContext } {
|
||||
export function createEditorApiInstance(): { api: EditorApi; context: EditorUiContext, editor: LexicalEditor} {
|
||||
const context = createTestContext();
|
||||
const api = new EditorApi(context);
|
||||
return {api, context};
|
||||
return {api, context, editor: context.editor};
|
||||
}
|
||||
Reference in New Issue
Block a user