import { BlockBlot } from 'parchment'; import Quill from '../core/quill'; import Module from '../core/module'; import { BlockEmbed } from '../blots/block'; import { Range } from '../core/selection'; declare const SHORTKEY: string; interface Context { collapsed: boolean; empty: boolean; offset: number; prefix: string; suffix: string; format: Record; event: KeyboardEvent; line: BlockEmbed | BlockBlot; } interface BindingObject extends Partial> { key: number | string | string[]; shortKey?: boolean | null; shiftKey?: boolean | null; altKey?: boolean | null; metaKey?: boolean | null; ctrlKey?: boolean | null; prefix?: RegExp; suffix?: RegExp; format?: Record | string[]; handler?: (this: { quill: Quill; }, range: Range, curContext: Context, binding: NormalizedBinding) => boolean | void; } declare type Binding = BindingObject | string | number; interface NormalizedBinding extends Omit { key: string | number; } interface KeyboardOptions { bindings: Record; } interface KeyboardOptions { bindings: Record; } declare class Keyboard extends Module { static match(evt: KeyboardEvent, binding: any): boolean; bindings: Record; constructor(quill: Quill, options: Partial); addBinding(keyBinding: Binding, context?: Required | Partial>, handler?: Required | Partial>): void; listen(): void; handleBackspace(range: Range, context: Context): void; handleDelete(range: Range, context: Context): void; handleDeleteRange(range: Range): void; handleEnter(range: Range, context: Context): void; } declare function normalize(binding: Binding): BindingObject; declare function deleteRange({ quill, range }: { quill: Quill; range: Range; }): void; export { Keyboard as default, SHORTKEY, normalize, deleteRange };