yale-doorman
Version:
SDK for Yale Doorman through the Yale cloud API
43 lines • 2.06 kB
TypeScript
import { LockState } from "../index.js";
import type { Area, RfAddress, Zone } from "./@types/responses/GetDeviceList";
import type { Configuration } from "./@types/Configuration";
import type { GetDeviceList, GetEventHistory } from "./@types/responses";
/**
* SDK class that expose the Yale doorman SDK.
*
* Note that `login()` does not need to be called explicitly.
* The SDK will lazily call `login()` to (re)authenticate when necessary.
*/
export declare class YaleDoorman<Test extends boolean = false> {
#private;
/** The generic type parameter should be either omitted or `false` in production. */
constructor(email: string, password: string, configuration?: Configuration<Test>);
/** Send a REST request to the Sector API */
private httpRequest;
/** Returns a boolean indicating success */
private loginWithRefreshToken;
/** Authenticate using the credentials specified in the constructor.
*
* This function is used internally and does not need to be called directly.
*/
login(): Promise<void>;
/** Fetch a list of devices connected to the Yale hub. */
getDevices(): Promise<GetDeviceList>;
/** Convenience method to filter the set of Yale devices down the only doors. Only returns the metadata required for changing door states. */
getDoors(): Promise<{
name: string;
zone: Zone;
area: Area;
address: RfAddress;
state?: LockState;
}[]>;
/** Fetch events from the Yale hub. */
getEventHistory(): Promise<GetEventHistory>;
/** Locks a specific door. This request tends to take ~10 sec.
The Zone, Area and RfAddress arguments may be retrieved using the getDevices() method. */
lockDoor(zone: Zone, area: Area, rfAddress: RfAddress): Promise<void>;
/** Unlocks a specific door. This request tends to take ~10 sec.
The Zone and Area arguments may be retrieved using the getDevices() method. */
unlockDoor(zone: Zone, area: Area, pincode: string): Promise<void>;
}
//# sourceMappingURL=YaleDoorman.d.ts.map