Skip to main content

extension-list

package @remirror/extension-list

class BulletListExtension

Create the node for a bullet list.

Signature:

export declare class BulletListExtension extends NodeExtension<BulletListOptions> 

Extends: NodeExtension<BulletListOptions>

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

property name

Signature:

get name(): "bulletList";

method createExtensions

Signature:

createExtensions(): ListItemExtension[];

Returns:

ListItemExtension[]

method createInputRules

Signature:

createInputRules(): InputRule[];

Returns:

InputRule[]

method createNodeSpec

Signature:

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

Parameters:

ParameterTypeDescription
extraApplySchemaAttributes
overrideNodeSpecOverride

Returns:

NodeExtensionSpec

method createNodeViews

Signature:

createNodeViews(): NodeViewMethod | Record<string, never>;

Returns:

NodeViewMethod | Record<string, never>

method createTags

Signature:

createTags(): ("listContainer" | "block")[];

Returns:

("listContainer" | "block")[]

method listShortcut

Signature:

listShortcut(props: KeyBindingProps): boolean;

Parameters:

ParameterTypeDescription
propsKeyBindingProps

Returns:

boolean

method toggleBulletList

Toggle the bullet list for the current selection.

Signature:

toggleBulletList(): CommandFunction;

Returns:

CommandFunction

class ListItemExtension

Creates the node for a list item.

Signature:

export declare class ListItemExtension extends NodeExtension<ListItemOptions> 

Extends: NodeExtension<ListItemOptions>

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

property name

Signature:

get name(): "listItem";

method createExtensions

Signature:

createExtensions(): ListItemSharedExtension[];

Returns:

ListItemSharedExtension[]

method createKeymap

Signature:

createKeymap(): KeyBindings;

Returns:

KeyBindings

method createNodeSpec

Signature:

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

Parameters:

ParameterTypeDescription
extraApplySchemaAttributes
overrideNodeSpecOverride

Returns:

NodeExtensionSpec

method createNodeViews

Signature:

createNodeViews(): NodeViewMethod | Record<string, never>;

Returns:

NodeViewMethod | Record<string, never>

method createTags

Signature:

createTags(): "listItemNode"[];

Returns:

"listItemNode"[]

method liftListItemOutOfList

Lift the content inside a list item around the selection out of list

Signature:

liftListItemOutOfList(listItemType?: NodeType | undefined): CommandFunction;

Parameters:

ParameterTypeDescription
listItemTypeNodeType | undefined(Optional)

Returns:

CommandFunction

method toggleListItemClosed

Toggles the current list item.

Signature:

toggleListItemClosed(closed?: boolean | undefined): CommandFunction;

Parameters:

ParameterTypeDescription
closedboolean | undefined(Optional) the closed attribute. If it's a boolean value, then it will be set as an attribute. If it's undefined, then the closed attribuate will be toggled.

Returns:

CommandFunction

class ListItemSharedExtension

Provides some shared thing used by both listItem and taskListItem

Signature:

export declare class ListItemSharedExtension extends PlainExtension 

Extends: PlainExtension

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

property name

Signature:

get name(): "listItemShared";

method createKeymap

Signature:

createKeymap(): KeyBindings;

Returns:

KeyBindings

method createPlugin

Signature:

createPlugin(): CreateExtensionPlugin;

Returns:

CreateExtensionPlugin

class OrderedListExtension

Creates the list for the ordered list.

Signature:

export declare class OrderedListExtension extends NodeExtension 

Extends: NodeExtension

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

property name

Signature:

get name(): "orderedList";

method createExtensions

Automatically add the ListItemExtension which is required here.

Signature:

createExtensions(): ListItemExtension[];

Returns:

ListItemExtension[]

method createInputRules

Signature:

createInputRules(): InputRule[];

Returns:

InputRule[]

method createNodeSpec

Signature:

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

Parameters:

ParameterTypeDescription
extraApplySchemaAttributes
overrideNodeSpecOverride

Returns:

NodeExtensionSpec

method createTags

Signature:

createTags(): ("listContainer" | "block")[];

Returns:

("listContainer" | "block")[]

method listShortcut

Signature:

listShortcut(props: KeyBindingProps): boolean;

Parameters:

ParameterTypeDescription
propsKeyBindingProps

Returns:

boolean

method toggleOrderedList

Toggle the ordered list for the current selection.

Signature:

toggleOrderedList(): CommandFunction;

Returns:

CommandFunction

class TaskListExtension

Create the node for a task list.

Signature:

export declare class TaskListExtension extends NodeExtension 

Extends: NodeExtension

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

property name

Signature:

get name(): "taskList";

method createExtensions

Signature:

createExtensions(): TaskListItemExtension[];

Returns:

TaskListItemExtension[]

method createNodeSpec

Signature:

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

Parameters:

ParameterTypeDescription
extraApplySchemaAttributes
overrideNodeSpecOverride

Returns:

NodeExtensionSpec

method createTags

Signature:

createTags(): ("listContainer" | "block")[];

Returns:

("listContainer" | "block")[]

method listShortcut

Signature:

listShortcut(props: KeyBindingProps): boolean;

Parameters:

ParameterTypeDescription
propsKeyBindingProps

Returns:

boolean

method toggleTaskList

Toggle the task list for the current selection.

Signature:

toggleTaskList(): CommandFunction;

Returns:

CommandFunction

class TaskListItemExtension

Creates the node for a task list item.

Signature:

export declare class TaskListItemExtension extends NodeExtension 

Extends: NodeExtension

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

property name

Signature:

get name(): "taskListItem";

method createExtensions

Signature:

createExtensions(): ListItemSharedExtension[];

Returns:

ListItemSharedExtension[]

method createInputRules

Signature:

createInputRules(): InputRule[];

Returns:

InputRule[]

method createKeymap

Signature:

createKeymap(): KeyBindings;

Returns:

KeyBindings

method createNodeSpec

Signature:

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

Parameters:

ParameterTypeDescription
extraApplySchemaAttributes
overrideNodeSpecOverride

Returns:

NodeExtensionSpec

method createNodeViews

Signature:

createNodeViews(): NodeViewMethod | Record<string, never>;

Returns:

NodeViewMethod | Record<string, never>

method createTags

Signature:

createTags(): "listItemNode"[];

Returns:

"listItemNode"[]

method toggleCheckboxChecked

Toggles the current checkbox state and transform a normal list item into a checkbox list item when necessary.

Signature:

toggleCheckboxChecked(props?: {
checked?: boolean;
$pos?: ResolvedPos;
} | boolean): CommandFunction;

Parameters:

ParameterTypeDescription
props{ checked?: boolean; $pos?: ResolvedPos; } | boolean(Optional)

Returns:

CommandFunction

function dedentList()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

A helper function to dedent selected list items.

Signature:

export declare function dedentList(tr: Transaction): boolean;

Parameters:

ParameterTypeDescription
trTransaction

Returns:

boolean

function indentList()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

A helper function to indent selected list items.

Signature:

export declare function indentList(tr: Transaction): boolean;

Parameters:

ParameterTypeDescription
trTransaction

Returns:

boolean

function sharedLiftListItem()

Warning: This API is now obsolete.

use dedentList instead.

Create a command to lift the list item around the selection up intoa wrapping list. Use this function if you get multiple list item nodes in your schema.

Signature:

export declare function sharedLiftListItem(allExtensions: AnyExtension[]): CommandFunction;

Parameters:

ParameterTypeDescription
allExtensionsAnyExtension[]

Returns:

CommandFunction

function sharedSinkListItem()

Warning: This API is now obsolete.

use indentList instead.

Create a command to sink the list item around the selection down into an inner list. Use this function if you get multiple list item nodes in your schema.

Signature:

export declare function sharedSinkListItem(allExtensions: AnyExtension[]): CommandFunction;

Parameters:

ParameterTypeDescription
allExtensionsAnyExtension[]

Returns:

CommandFunction

function toggleList()

Toggles a list.

Signature:

export declare function toggleList(listType: NodeType, itemType: NodeType): CommandFunction;

Parameters:

ParameterTypeDescription
listTypeNodeTypethe list node type
itemTypeNodeTypethe list item node type

Returns:

CommandFunction

Remarks:

When the provided list wrapper is inactive (e.g. ul) then wrap the list with this type. When it is active then remove the selected line from the list.