Skip to main content

extension-heading

package @remirror/extension-heading

class HeadingExtension

Signature:

export declare class HeadingExtension extends NodeExtension<HeadingOptions> 

Extends: NodeExtension<HeadingOptions>

(Some inherited members may not be shown because they are not represented in the documentation.)

property name

Signature:

get name(): "heading";

method createInputRules

Signature:

createInputRules(): InputRule[];

Returns:

InputRule[]

method createKeymap

Dynamically create the shortcuts for the heading extension.

Signature:

createKeymap(fn: (shortcut: string) => string[]): KeyBindings;

Parameters:

ParameterTypeDescription
fn(shortcut: string) => string[]

Returns:

KeyBindings

method createNodeSpec

Signature:

createNodeSpec(extra: ApplySchemaAttributes, override: NodeSpecOverride): NodeExtensionSpec;

Parameters:

ParameterTypeDescription
extraApplySchemaAttributes
overrideNodeSpecOverride

Returns:

NodeExtensionSpec

method createPasteRules

Signature:

createPasteRules(): NodePasteRule[];

Returns:

NodePasteRule[]

method createTags

Signature:

createTags(): ("formattingNode" | "block" | "textBlock")[];

Returns:

("formattingNode" | "block" | "textBlock")[]

method toggleHeading

Toggle the heading for the current block. If you don't provide the level it will use the options.defaultLevel.

Signature:

toggleHeading(attrs?: HeadingExtensionAttributes): CommandFunction;

Parameters:

ParameterTypeDescription
attrsHeadingExtensionAttributes(Optional)

Returns:

CommandFunction

interface HeadingOptions

Signature:

export interface HeadingOptions 

property defaultLevel

The default level heading to use.

Signature:

defaultLevel?: Static<number>;

property levels

The numerical value of the supporting headings.

Signature:

levels?: Static<number[]>;

type HeadingExtensionAttributes

Signature:

export type HeadingExtensionAttributes = ProsemirrorAttributes<{
level?: number;
}>;

References: ProsemirrorAttributes