shocket
Version:
A user-friendly wrapper for the PiShock websocket API.
32 lines • 910 B
TypeScript
import { Shocker } from "./shocker";
export declare class ShockHub {
#private;
constructor(hubId: number);
/**
* Retrieve all of the shockers connected to the hub and attempt to connect to all of them
* @param username
* @param apiKey
*/
init(username: string, apiKey: string): Promise<void>;
id(): number;
name(): string;
userId(): number;
/**
* Retrieve a shocker by it's ID
* @param id
* @returns `Shocker` if it's found, `undefined` if it isn't
*/
shocker(id: number): Shocker | undefined;
/**
* Retrieve a shocker by it's name
* @param name
* @returns `Shocker` if it's found, `undefined` if it isn't
*/
shockerByName(name: string): Shocker | null;
/**
* Retrieve a map of all owned shockers
* @returns
*/
allShockers(): Map<number, Shocker>;
}
//# sourceMappingURL=hub.d.ts.map