import { KeyBinding } from '@codemirror/view'; import { Extension, StateCommand, EditorState, Transaction } from '@codemirror/state'; /** Configures bracket closing behavior for a syntax (via [language data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt)) using the `"closeBrackets"` identifier. */ interface CloseBracketConfig { /** The opening brackets to close. Defaults to `["(", "[", "{", "'", '"']`. Brackets may be single characters or a triple of quotes (as in `"''''"`). */ brackets?: string[]; /** Characters in front of which newly opened brackets are automatically closed. Closing always happens in front of whitespace. Defaults to `")]}:;>"`. */ before?: string; } /** Extension to enable bracket-closing behavior. When a closeable bracket is typed, its closing bracket is immediately inserted after the cursor. When closing a bracket directly in front of a closing bracket inserted by the extension, the cursor moves over that bracket. */ declare function closeBrackets(): Extension; /** Command that implements deleting a pair of matching brackets when the cursor is between them. */ declare const deleteBracketPair: StateCommand; /** Close-brackets related key bindings. Binds Backspace to [`deleteBracketPair`](https://codemirror.net/6/docs/ref/#closebrackets.deleteBracketPair). */ declare const closeBracketsKeymap: readonly KeyBinding[]; /** Implements the extension's behavior on text insertion. If the given string counts as a bracket in the language around the selection, and replacing the selection with it requires custom behavior (inserting a closing version or skipping past a previously-closed bracket), this function returns a transaction representing that custom behavior. (You only need this if you want to programmatically insert brackets—the [`closeBrackets`](https://codemirror.net/6/docs/ref/#closebrackets.closeBrackets) extension will take care of running this for user input.) */ declare function insertBracket(state: EditorState, bracket: string): Transaction | null; export { CloseBracketConfig, closeBrackets, closeBracketsKeymap, deleteBracketPair, insertBracket };