Files
node-intellicenter/dist/unit.d.ts
Parnic 7daf47ac18 Fleshing out more messages
Getting a feel for how the development experience is with this setup. With the previous idea of abstracting the request into a getSystemInfo() function on the Unit itself, the documentation for what to expect from GetSystemInfo either had to live in two places or be presented as a link to the canonical location. Neither felt great, so I think the caller can just call send(GetRequest()) themselves.

Also added the first "set" message which is capable of toggling a body or circuit.
2025-01-03 16:01:58 -06:00

16 lines
483 B
TypeScript

import { EventEmitter } from "events";
import { ICRequest } from "./messages/request.js";
import { ICResponse } from "./messages/response.js";
export declare class Unit extends EventEmitter {
endpoint: string;
port: number;
private client?;
private pingTimeout?;
constructor(endpoint: string, port?: number);
connect(): Promise<void>;
close(): void;
private heartbeat;
private onClientMessage;
send(request: ICRequest): Promise<ICResponse>;
}