ng-terminal
Version:
NgTerminal is a terminal component on Angular 16 or higher.
80 lines (79 loc) • 2.31 kB
TypeScript
import { ElementRef, OnDestroy } from '@angular/core';
import { Observable } from 'rxjs';
import * as i0 from "@angular/core";
/**
*
* In the past, indivisual property changes caused very unexpected behavior on NgTerminal.
* To solve issues related to property changes, Queue is applied.
*/
export declare class LinearRenderService implements OnDestroy {
private hostRef;
constructor(hostRef: ElementRef);
private handlerToCheckElementConnection?;
/**
* This queue has items to have a influence on the view and items are handled in order.
*/
private propertyChangeQueue;
private itemsToBeHandled;
get renderObservable(): Observable<PropertyChangeSet>;
/**
* {@link handleNextOne()} calls {@link handleImmediate()} if an element is connected.
* Otherwise, {@link pollAndHandle()} is called.
*/
handleNextOne(lazy?: boolean): void;
/**
* This method pushes item into {@link propertyChangeQueue}.
* @param item
*/
pushAndHandle(item: PropertyChangeSet, lazy?: boolean): void;
/**
* {@link pollAndHandle()} continues checking whether new item is put on a queue to call {@link handleImmediate()}.
*/
private pollAndHandle;
/**
* Handle a next set of changes if it exists.
*/
private handleImmediate;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<LinearRenderService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<LinearRenderService>;
}
export type PropertyChangeSet = {
time: Date;
type: 'rowChanged';
} | {
time: Date;
type: 'columnChanged';
} | {
time: Date;
type: 'dragged';
dragged: {
draggedWidth: string;
draggedHeight: string;
};
} | {
time: Date;
type: 'hostResized';
hostResized: {
width: string;
height: string;
};
} | {
time: Date;
type: 'detectBoxResized';
detectBoxResized: {
width: string;
};
} | {
time: Date;
type: 'xtermViewportExceedingOuterDiv';
xtermViewportExceedingOuterDiv: {
width: string;
height: string;
outerDivWidth: string;
outerDivHeight: string;
};
} | {
time: Date;
type: 'none';
};