import { CommandFunction } from '@remirror/core'; import { EditorState } from '@remirror/core'; import { IdentifierSchemaAttributes } from '@remirror/core'; import { KeyBindingProps } from '@remirror/core'; import { NodeWithPosition } from '@remirror/core'; import { PlainExtension } from '@remirror/core'; import { Static } from '@remirror/core'; import { Transaction } from '@remirror/core'; export declare const centerAlignOptions: Remirror.CommandDecoratorOptions; export declare const decreaseIndentOptions: Remirror.CommandDecoratorOptions; /** * Extract the indent index from a list of indents and left margin. */ export declare function extractIndent(indents: string[], marginLeft: string | null): number; /** * Extract the line height from numeric or percentage line-height values */ export declare function extractLineHeight(lineHeight: string | number | null): number | null; export declare function gatherNodes(state: Transaction | EditorState, included: string[], excluded: string[]): NodeWithPosition[]; export declare const increaseIndentOptions: Remirror.CommandDecoratorOptions; export declare const justifyAlignOptions: Remirror.CommandDecoratorOptions; export declare const leftAlignOptions: Remirror.CommandDecoratorOptions; /** * The data attribute for an indented node attribute. */ export declare const NODE_INDENT_ATTRIBUTE = "data-node-indent"; /** * The data attribute for the line height of a node. */ export declare const NODE_LINE_HEIGHT_ATTRIBUTE = "data-line-height-align"; /** * The data attribute text alignment within a block node which accepts * formatting. */ export declare const NODE_TEXT_ALIGNMENT_ATTRIBUTE = "data-node-text-align"; /** * Support consistent formatting of nodes within your editor. */ declare class NodeFormattingExtension extends PlainExtension { get name(): "nodeFormatting"; /** * Set up the extra attributes which are applied to the formattable node * blocks. */ createSchemaAttributes(): IdentifierSchemaAttributes[]; setLineHeight(lineHeight: number): CommandFunction; /** * Set the text alignment for the selected nodes. */ setTextAlignment(alignment: NodeTextAlignment): CommandFunction; /** * Set the indent level for the selected nodes. */ setIndent(level: number | '+1' | '-1'): CommandFunction; /** * Center the text within current block node. */ centerAlign(): CommandFunction; /** * Justify the text within the current block node. */ justifyAlign(): CommandFunction; /** * Left align the text within the current block node. */ leftAlign(): CommandFunction; /** * Right align the text within the current block node. */ rightAlign(): CommandFunction; /** * Increase the indentation level of the current block node, if applicable. */ increaseIndent(): CommandFunction; /** * Decrease the indentation of the current block node. */ decreaseIndent(): CommandFunction; centerAlignShortcut(props: KeyBindingProps): boolean; justifyAlignShortcut(props: KeyBindingProps): boolean; leftAlignShortcut(props: KeyBindingProps): boolean; rightAlignShortcut(props: KeyBindingProps): boolean; increaseIndentShortcut(props: KeyBindingProps): boolean; decreaseIndentShortcut(props: KeyBindingProps): boolean; /** * Add an indentation attribute to the formattable node blocks. */ private nodeIndent; /** * Add the `nodeTextAlignment` attribute to the formattable block nodes. */ private nodeTextAlignment; /** * Add a `line height` attribute to all the formattable block nodes selected. */ private nodeLineHeight; private setNodeAttribute; } export { NodeFormattingExtension } export { NodeFormattingExtension as NodeFormattingExtension_alias_1 } export declare interface NodeFormattingOptions { /** * The nodes to exclude from being included in the formattable collection. */ excludeNodes?: Static; /** * The list of available indent levels. * * The first item (0-index) is ignored. By default the indents start at index * `1`. */ indents?: Static; } export declare type NodeTextAlignment = 'none' | 'left' | 'right' | 'center' | 'justify' | 'start' | 'end'; export declare const rightAlignOptions: Remirror.CommandDecoratorOptions; export { } declare global { namespace Remirror { interface Attributes { /** * The indentation level for the formattable node. */ nodeIndent?: number; /** * Set the text alignment fpr the formattable node. */ nodeTextAlignment?: NodeTextAlignment; /** * A ratio with a minimum value of `1` (100%) for the line height of a * formattable node. */ nodeLineHeight?: number; } interface AllExtensions { nodeFormatting: NodeFormattingExtension; } } }