From c8e45fe39b249457eb2bf8d4f22af7d26d5a790c Mon Sep 17 00:00:00 2001 From: Sahejkm <163521239+Sahejkm@users.noreply.github.com> Date: Mon, 6 May 2024 22:45:25 +0800 Subject: [PATCH] Add flow declarations in LexicalDevtoolsCore.js.flow (#6037) --- .../flow/LexicalDevtoolsCore.js.flow | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/lexical-devtools-core/flow/LexicalDevtoolsCore.js.flow b/packages/lexical-devtools-core/flow/LexicalDevtoolsCore.js.flow index 11f5fdbc79e..a95916ab86d 100644 --- a/packages/lexical-devtools-core/flow/LexicalDevtoolsCore.js.flow +++ b/packages/lexical-devtools-core/flow/LexicalDevtoolsCore.js.flow @@ -10,3 +10,28 @@ /** * LexicalDevtoolsCore */ + +import type { + LexicalEditor, + LexicalCommand +} from 'lexical'; + +export type LexicalCommandLog = $ReadOnlyArray | {payload: mixed}>; + +declare export function generateContent( +editor: LexicalEditor, +commandsLog: $ReadOnlyArray, +exportDOM: boolean, +obfuscateText?: boolean, +): string; + +declare export function registerLexicalCommandLogger( +editor: LexicalEditor, +setLoggedCommands: ( + v: (oldValue: LexicalCommandLog) => LexicalCommandLog, +) => void, +): () => void; + +declare export function useLexicalCommandsLog( +editor: LexicalEditor, +): LexicalCommandLog; \ No newline at end of file