import { EditorState } from "prosemirror-state"; import { Dispatch } from "../types"; import { PlaceholderPluginOptions, setPluginState, transition } from "./PlaceholderPlugin"; export const placeholderSetOptions = ( state: EditorState, options: Partial, dispatch?: Dispatch ): boolean => { if (dispatch !== undefined) { setPluginState({ state, dispatch }, prevPluginState => transition(prevPluginState).withOptions(options)); } return true; };