123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- import { EditorState, Transaction, Plugin, Command } from 'prosemirror-state';
- import { NodeType, Attrs, Node } from 'prosemirror-model';
- declare class InputRule {
- inCode: boolean | "only";
-
- constructor(
-
- match: RegExp, handler: string | ((state: EditorState, match: RegExpMatchArray, start: number, end: number) => Transaction | null), options?: {
-
- undoable?: boolean;
-
- inCode?: boolean | "only";
- });
- }
- type PluginState = {
- transform: Transaction;
- from: number;
- to: number;
- text: string;
- } | null;
- declare function inputRules({ rules }: {
- rules: readonly InputRule[];
- }): Plugin<PluginState>;
- declare const undoInputRule: Command;
- declare const emDash: InputRule;
- declare const ellipsis: InputRule;
- declare const openDoubleQuote: InputRule;
- declare const closeDoubleQuote: InputRule;
- declare const openSingleQuote: InputRule;
- declare const closeSingleQuote: InputRule;
- declare const smartQuotes: readonly InputRule[];
- declare function wrappingInputRule(regexp: RegExp, nodeType: NodeType, getAttrs?: Attrs | null | ((matches: RegExpMatchArray) => Attrs | null), joinPredicate?: (match: RegExpMatchArray, node: Node) => boolean): InputRule;
- declare function textblockTypeInputRule(regexp: RegExp, nodeType: NodeType, getAttrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null)): InputRule;
- export { InputRule, closeDoubleQuote, closeSingleQuote, ellipsis, emDash, inputRules, openDoubleQuote, openSingleQuote, smartQuotes, textblockTypeInputRule, undoInputRule, wrappingInputRule };
|