@types/prosemirror-schema-list

  • Version 1.0.3
  • Published
  • 6.6 kB
  • 3 dependencies
  • MIT license

Install

npm i @types/prosemirror-schema-list
yarn add @types/prosemirror-schema-list
pnpm add @types/prosemirror-schema-list

Overview

TypeScript definitions for prosemirror-schema-list

Index

Variables

variable bulletList

let bulletList: NodeSpec;
  • A bullet list node spec, represented in the DOM as <ul>.

variable listItem

let listItem: NodeSpec;
  • A list item (<li>) spec.

variable orderedList

let orderedList: NodeSpec;
  • An ordered list [node spec](#model.NodeSpec). Has a single attribute, order, which determines the number at which the list starts counting, and defaults to 1. Represented as an <ol> element.

Functions

function addListNodes

addListNodes: <N extends string = any>(
nodes: any,
itemContent: string,
listGroup?: string
) => any;
  • Convenience function for adding list-related node types to a map specifying the nodes for a schema. Adds [orderedList](#schema-list.orderedList) as "ordered_list", [bulletList](#schema-list.bulletList) as "bullet_list", and [listItem](#schema-list.listItem) as "list_item".

    itemContent determines the content expression for the list items. If you want the commands defined in this module to apply to your list structure, it should have a shape like "paragraph block*" or "paragraph (ordered_list | bullet_list)*". listGroup can be given to assign a group name to the list node types, for example "block".

function liftListItem

liftListItem: <S extends Schema = any>(
itemType: NodeType<S>
) => (state: EditorState<S>, dispatch?: (tr: Transaction<S>) => void) => boolean;
  • Create a command to lift the list item around the selection up into a wrapping list.

function sinkListItem

sinkListItem: <S extends Schema = any>(
itemType: NodeType<S>
) => (state: EditorState<S>, dispatch?: (tr: Transaction<S>) => void) => boolean;
  • Create a command to sink the list item around the selection down into an inner list.

function splitListItem

splitListItem: <S extends Schema = any>(
itemType: NodeType<S>
) => (state: EditorState<S>, dispatch?: (tr: Transaction<S>) => void) => boolean;
  • Build a command that splits a non-empty textblock at the top level of a list item by also splitting that list item.

function wrapInList

wrapInList: <S extends Schema = any>(
listType: NodeType<S>,
attrs?: { [key: string]: any }
) => (state: EditorState<S>, dispatch?: (tr: Transaction<S>) => void) => boolean;
  • Returns a command function that wraps the selection in a list with the given type an attributes. If dispatch is null, only return a value to indicate whether this is possible, but don't actually perform the change.

Package Files (1)

Dependencies (3)

Dev Dependencies (0)

No dev dependencies.

Peer Dependencies (0)

No peer dependencies.

Badge

To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/prosemirror-schema-list.

  • Markdown
    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/prosemirror-schema-list)
  • HTML
    <a href="https://www.jsdocs.io/package/@types/prosemirror-schema-list"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>