import * as React from 'react'; import { ITranslator } from '@jupyterlab/translation'; import { IKeybinding, IShortcutRegistry, IShortcutTarget, IShortcutUI } from '../types'; export declare const CONFLICT_CONTAINER_CLASS = "jp-Shortcuts-ConflictContainer"; export interface IConflicts { keys: string[]; conflictsWith: IShortcutTarget[]; overwrite: () => void; cancel: () => void; } export interface IShortcutInputProps { addKeybinding: IShortcutUI['addKeybinding']; replaceKeybinding: IShortcutUI['replaceKeybinding']; deleteKeybinding: IShortcutUI['deleteKeybinding']; findConflictsFor: IShortcutRegistry['findConflictsFor']; displayConflicts: (conflicts: IConflicts) => void; toggleInput: () => void; shortcut: IShortcutTarget; keybinding?: IKeybinding; toSymbols: (value: string) => string; displayInput: boolean; placeholder: string; translator: ITranslator; } export interface IShortcutInputState { value: string; userInput: string; isAvailable: boolean; isFunctional: boolean; keys: string[]; currentChain: string; selected: boolean; } export declare class ShortcutInput extends React.Component { constructor(props: IShortcutInputProps); /** Whether this input replaces existing keybinding or creates a new one */ private get _isReplacingExistingKeybinding(); private _emitConflicts; handleSubmit: () => Promise; private _updateShortcut; private _handleOverwrite; /** Parse user input for chained shortcuts */ parseChaining: (event: React.KeyboardEvent, value: string, userInput: string, keys: Array, currentChain: string) => Array; /** * Check if shortcut being typed will work * (does not end with ctrl, alt, command, or shift) * */ checkNonFunctional: () => boolean; /** Check if shortcut being typed is already taken */ checkShortcutAvailability: (userInput: string, keys: string[], currentChain: string) => IShortcutTarget[]; /** Parse and normalize user input */ handleInput: (event: React.KeyboardEvent) => void; render(): JSX.Element; private _handleBlur; private _ref; }