first commit
This commit is contained in:
47
xterminal/source/input/interface.ts
Normal file
47
xterminal/source/input/interface.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { IDisposable, IKeyPress } from "../types";
|
||||
import type { IOutputInterface } from "../output/interface";
|
||||
|
||||
/**
|
||||
* Interface: Input Component
|
||||
*/
|
||||
export interface IInputInterface extends IDisposable {
|
||||
/**
|
||||
* Blur the input element
|
||||
*/
|
||||
blur(): void;
|
||||
|
||||
/**
|
||||
* Focus the input element
|
||||
*/
|
||||
focus(): void;
|
||||
|
||||
/**
|
||||
* Deactivate the component
|
||||
*/
|
||||
pause(): void;
|
||||
|
||||
/**
|
||||
* Activate the component
|
||||
*/
|
||||
resume(): void;
|
||||
|
||||
/**
|
||||
* Callback function invoked on every key press
|
||||
*/
|
||||
onkeypress?: (ev: IKeyPress) => void;
|
||||
|
||||
/**
|
||||
* Bridge the input to the output component: cursor & input
|
||||
*/
|
||||
pipe(output: IOutputInterface): void;
|
||||
|
||||
/**
|
||||
* Set the value of the input element, updates the cursor
|
||||
*/
|
||||
setValue(str: string): void;
|
||||
|
||||
/**
|
||||
* Clears the value of the input element
|
||||
*/
|
||||
clear(): void;
|
||||
}
|
||||
Reference in New Issue
Block a user