additional keys for history mode

This commit is contained in:
2024-09-03 16:34:24 +00:00
parent 7e207b7e93
commit ee85533bd1
3 changed files with 29 additions and 13 deletions

16
ambient.d.ts vendored
View File

@@ -349,7 +349,7 @@ interface Utils {
complete_do_target(actions: {self: unknown, others: unknown}): Set<string>
complete_do(this: Optional<ICommand, 'Tag'>): undefined
replace_me(_match: string, _offset: number, whole: string): string
//pad_chat(chat: HTMLDivElement): undefined
scroll(): true
}
interface Complete {
@@ -445,15 +445,25 @@ interface InputHistory {
*/
ids: Set<number> | undefined
/**
* Specific key handlers.
*/
key: Record<string, (textarea: HTMLTextAreaElement) => true>
/**
* Set or unset the readonly mode on the input.
*/
icro(textarea: HTMLTextAreaElement, readonly: boolean): true
/**
* Enter the history mode.
*/
enter(textarea: HTMLTextAreaElement, input: string, bottom: boolean, ids: Set<number>): true
/**
* Exit the history mode and optionally restore original input.
* Exit the history mode and proc the key event.
*/
exit(textarea: HTMLTextAreaElement, restore_input: boolean): true
exit(textarea: HTMLTextAreaElement, key: KeyboardEvent['key']): true
}
// FIXME spread around readonly where appropriate