import { extension , InputRule , PlainExtension , plainInputRule } from '@remirror/core' ; export interface ShortcutsOptions { } const SHORTCUTS = [ [ /--$/ , '—' ] , [ /\.{3}$/ , '…' ] , [ /<-$/ , '←' ] , [ /->$/ , '→' ] , [ /←>$/ , '↔' ] , [ /\(c\)$/ , '©' ] , [ /\(tm\)$/ , '™' ] , [ /\(r\)$/ , '®' ] , [ /1\/2$/ , '½' ] , [ /\+\/-$/ , '±' ] , [ /!=$/ , '≠' ] , [ /<<$/ , '«' ] , [ />>$/ , '»' ] , [ /\^2$/ , '²' ] , [ /\^3$/ , '³' ] , [ /1\/4$/ , '¼' ] , [ /3\/4$/ , '¾' ] , ] ; /**
 * Replace characters with keyboard shortcuts
 *
 * Inspired by Tiptap's extension-typography
 */ @ extension < ShortcutsOptions > ( { defaultOptions : { } , } ) export class ShortcutsExtension extends PlainExtension < ShortcutsOptions > { get name ( ) { return 'shortcuts' as const ; } /**
     * Manage input rules for keyboard shortcuts
     */ createInputRules ( ) { return SHORTCUTS . map ( ( [ regexp , replace ] ) => { return plainInputRule ( { regexp , transformMatch : ( ) => replace , } ) ; } ) ; } } declare global { namespace Remirror { interface AllExtensions { template : ShortcutsExtension ; } } }