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:
Parameter | Type | Description |
---|---|---|
fn | (shortcut: string) => string[] |
Returns:
method createNodeSpec
Signature:
createNodeSpec(extra: ApplySchemaAttributes, override: NodeSpecOverride): NodeExtensionSpec;
Parameters:
Parameter | Type | Description |
---|---|---|
extra | ApplySchemaAttributes | |
override | NodeSpecOverride |
Returns:
method createPasteRules
Signature:
createPasteRules(): NodePasteRule[];
Returns:
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:
Parameter | Type | Description |
---|---|---|
attrs | HeadingExtensionAttributes | (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