prosekit/preact
Interfaces
Section titled “Interfaces”ProseKitProps
Section titled “ProseKitProps”Properties
Section titled “Properties”-
children?:
ComponentChildren
UseExtensionOptions
Section titled “UseExtensionOptions”Properties
Section titled “Properties”-
The editor to add the extension to. If not provided, it will use the editor from the nearest
ProseKit
component.
Variables
Section titled “Variables”ProseKit
Section titled “ProseKit”-
const ProseKit:
ComponentType
<ProseKitProps
> -
The root component for a ProseKit editor.
Functions
Section titled “Functions”useDocChange()
Section titled “useDocChange()”-
function useDocChange(
handler
: (doc
:ProseMirrorNode
) =>void
,options?
:UseExtensionOptions
):void
-
Calls the given handler whenever the editor document changes.
useEditor()
Section titled “useEditor()”-
Retrieves the editor instance from the nearest ProseKit component.
useExtension()
Section titled “useExtension()”-
function useExtension(
extension
:null
|Extension
<ExtensionTyping
<any
,any
,any
>>,options?
:UseExtensionOptions
):void
-
Add an extension to the editor.
useKeymap()
Section titled “useKeymap()”-
function useKeymap(
keymap
:Keymap
,options?
:UseExtensionOptions
):void
useStateUpdate()
Section titled “useStateUpdate()”-
function useStateUpdate(
handler
: (state
:EditorState
) =>void
,options?
:UseExtensionOptions
):void
-
Calls the given handler whenever the editor state changes.