UNPKG

ngx-serial-console

Version:

This is an angular library, to create a component that would connect to a serial port and display the data from the port.

56 lines (53 loc) 1.81 kB
import * as i0 from '@angular/core'; import { WritableSignal, Signal } from '@angular/core'; interface SerialMonitorState { serialAvailable: boolean; maxLines: number; outputLines: string[]; baudRate: number; vendorId: string | undefined; productId: string | undefined; theme: "CRT" | "Plain"; prevInputs: string[]; currentInput: string; } interface SerialConnectionState { connected: boolean; port: any; textDecoder: TextDecoderStream | null; textEncoder: TextEncoderStream | null; readableStreamClosed: any; writableStreamClosed: any; reader: ReadableStreamDefaultReader<string> | null; writer: WritableStreamDefaultWriter<string> | null; keepConnectionAlive: boolean; } declare class NgxSerialConsole { private scrollContainer; theme: "CRT" | "Plain"; state: WritableSignal<SerialMonitorState>; connState: SerialConnectionState; consoleOutput: Signal<string>; serial: any; themeStyles: string[]; baudRates: number[]; isUserScrolling: boolean; autoScrollEnabled: boolean; constructor(); ngAfterViewChecked(): void; send(): Promise<void>; private _send; clear(): void; clearInput(): void; unsetConnection(): Promise<void>; disconnectSerialPort(): Promise<void>; connectSerialPort(): void; handleSerialEvents(): void; openSerialPort(): Promise<void>; readSerialPort(port: any): Promise<void>; appendOutput(newData: string): void; private scrollToBottomSerialOut; static ɵfac: i0.ɵɵFactoryDeclaration<NgxSerialConsole, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NgxSerialConsole, "ngx-serial-console", never, { "theme": { "alias": "theme"; "required": false; }; }, {}, never, never, true, never>; } export { NgxSerialConsole };