* fix: resolve lint warnings/errors and apply formatting Fix 10 oxlint issues (2 errors, 8 warnings): - Remove unused catch parameters in Security.tsx and ImportDialog.tsx - Remove stray expression in Generator.tsx - Add eslint-disable for debounced useCallback in FilterControl.tsx - Remove unnecessary deps (resolveDB, store) in bindStoreToDevice.ts - Prefix unused variant param in AppSidebar.tsx - Memoize tabs arrays in DeviceConfig, RadioConfig, ModuleConfig - Fix channels type in RadioConfig TabItem Also applies oxfmt formatting across all files. * updating lock file * update protobuf package * fix: regenerate pnpm-lock.yaml and exclude jsr protobufs from minimumReleaseAge * prevented http card from always being polled * updated pnpm config fiile * updated actions * removed biome config and lint system leftovers * updating protobuf package
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import type { Types } from "@meshtastic/core";
|
|
import { Utils } from "@meshtastic/core";
|
|
|
|
export class TransportDeno implements Types.Transport {
|
|
private _toDevice: WritableStream<Uint8Array>;
|
|
private _fromDevice: ReadableStream<Types.DeviceOutput>;
|
|
private connection: Deno.Conn | undefined;
|
|
|
|
public static async create(hostname: string): Promise<TransportDeno> {
|
|
const connection = await Deno.connect({
|
|
hostname,
|
|
port: 4403,
|
|
});
|
|
return new TransportDeno(connection);
|
|
}
|
|
|
|
constructor(connection: Deno.Conn) {
|
|
this.connection = connection;
|
|
const toDeviceStream = Utils.toDeviceStream();
|
|
toDeviceStream.readable.pipeTo(this.connection.writable);
|
|
|
|
this._toDevice = toDeviceStream.writable;
|
|
this._fromDevice = this.connection.readable.pipeThrough(Utils.fromDeviceStream());
|
|
}
|
|
|
|
get toDevice(): WritableStream<Uint8Array> {
|
|
return this._toDevice;
|
|
}
|
|
|
|
get fromDevice(): ReadableStream<Types.DeviceOutput> {
|
|
return this._fromDevice;
|
|
}
|
|
|
|
disconnect(): Promise<void> {
|
|
this.connection.close();
|
|
this.connection = undefined;
|
|
return Promise.resolve();
|
|
}
|
|
}
|