@docs.plus/extension-indent
Version:
A Tiptap extension for managing text indentation in documents
47 lines (44 loc) • 1.22 kB
text/typescript
import { Extension } from '@tiptap/core';
/**
* Configuration options for the Indent extension
*/
interface IndentOptions {
/**
* Character(s) to insert for each indentation
* @default ' ' (2 spaces)
*/
indentChars: string;
/**
* Whether the extension is enabled
* @default true
*/
enabled: boolean;
/**
* List of node types that can accept indentation
* If not provided or empty, all nodes will be indented
* @default ['paragraph', 'listItem', 'orderedList']
*/
allowedNodeTypes?: string[];
}
declare module '@tiptap/core' {
interface Commands<ReturnType> {
indent: {
/**
* Add indentation at cursor position or to selected content
*/
indent: () => ReturnType;
/**
* Remove indentation at cursor position or from selected content
*/
outdent: () => ReturnType;
};
}
}
/**
* Indent Extension for Tiptap
*
* Provides functionality to indent and outdent text in the editor.
*/
declare const Indent: Extension<IndentOptions, any>;
declare const indentCSS: null;
export { Indent, type IndentOptions, indentCSS };