-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider adding a component API #808
Comments
The internal export interface IRenderLayer {
/**
* Called when the terminal loses focus.
*/
onBlur(terminal: ITerminal): void;
/**
* * Called when the terminal gets focus.
*/
onFocus(terminal: ITerminal): void;
/**
* Called when the cursor is moved.
*/
onCursorMove(terminal: ITerminal): void;
/**
* Called when options change.
*/
onOptionsChanged(terminal: ITerminal): void;
/**
* Called when the theme changes.
*/
onThemeChanged(terminal: ITerminal, colorSet: IColorSet): void;
/**
* Called when the data in the grid has changed (or needs to be rendered
* again).
*/
onGridChanged(terminal: ITerminal, startRow: number, endRow: number): void;
/**
* Calls when the selection changes.
*/
onSelectionChanged(terminal: ITerminal, start: [number, number], end: [number, number]): void;
/**
* Resize the render layer.
*/
resize(terminal: ITerminal, dim: IRenderDimensions, charSizeChanged: boolean): void;
/**
* Clear the state of the render layer.
*/
reset(terminal: ITerminal): void;
} Plus exposing the convenience methods on |
Looks neat.
Would it make sense to separate grind changing and the need for re-rendering, or are they the same thing? |
RIght now they're the same thing, need to re-render is only fired on an animation frame. If we enabled third party addons we may need to reconsider. |
Hi! (Time and effort permitting) It might be wise to begin refactoring internal objects to follow a similar model so that more of XT is composable. While I admit it might mean a bit of a re-arch if you're already planning on making changes soon, doing this now might pay down a lot of technical (architectural) debt. |
Closing in favor of #1128 (comment) which is the first step |
Initially discussed in #807 (comment)
This would involve adding some interface like this that would make implementing addons much easier:
Candidates for turning into components:
/cc @mofux
The text was updated successfully, but these errors were encountered: