@portabletext/plugin-markdown-shortcuts
Version:
Adds helpful Markdown shortcuts to the editor
45 lines (40 loc) • 1.25 kB
TypeScript
import type {EditorSchema} from '@portabletext/editor'
import {JSX} from 'react'
declare type MarkdownBehaviorsConfig = {
horizontalRuleObject?: (context: {schema: EditorSchema}) =>
| {
name: string
value?: {
[prop: string]: unknown
}
}
| undefined
defaultStyle?: (context: {schema: EditorSchema}) => string | undefined
headingStyle?: (context: {
schema: EditorSchema
level: number
}) => string | undefined
blockquoteStyle?: (context: {schema: EditorSchema}) => string | undefined
unorderedList?: (context: {schema: EditorSchema}) => string | undefined
orderedList?: (context: {schema: EditorSchema}) => string | undefined
}
/**
* @beta
*/
export declare function MarkdownShortcutsPlugin(
props: MarkdownShortcutsPluginProps,
): JSX.Element
/**
* @beta
*/
export declare type MarkdownShortcutsPluginProps = MarkdownBehaviorsConfig & {
boldDecorator?: ({schema}: {schema: EditorSchema}) => string | undefined
codeDecorator?: ({schema}: {schema: EditorSchema}) => string | undefined
italicDecorator?: ({schema}: {schema: EditorSchema}) => string | undefined
strikeThroughDecorator?: ({
schema,
}: {
schema: EditorSchema
}) => string | undefined
}
export {}