node-hue-api
Version:
Philips Hue API Library for Node.js
85 lines (84 loc) • 2.73 kB
TypeScript
import { RemoteApi } from './http/RemoteApi';
import { Transport } from './http/Transport';
export type ConfigParameters = {
baseUrl: string;
bridgeName: string;
username?: string;
clientId?: string;
clientSecret?: string;
clientKey?: string;
remote?: boolean;
};
export declare class HueApiConfig {
private _config;
private readonly _remoteApi?;
private readonly _transport;
private readonly _isRemote;
constructor(config: ConfigParameters, transport: Transport, remoteApi?: RemoteApi);
/**
* Is the connection to the hue bridge remote.
*/
get isRemote(): boolean;
/**
* Gets the transport implementation that is used to connect with the Hue Bridge
*/
get transport(): Transport;
/**
* Gets the remote API in use that was used to bootstrap the remote connection.
* @throws ApiError if the connection is local network.
*/
get remote(): RemoteApi;
/**
* Gets the current username used to connect/interact with the Hue Bridge.
*/
get username(): string | undefined;
/**
* Gets the client id for the remote OAuth connection.
* @throws ApiError if the connection is not remote.
*/
get clientId(): string | undefined;
/**
* Gets the client secret for the remote OAuth connection.
* @throws ApiError if the connection is not remote.
*/
get clientSecret(): string | undefined;
/**
* The Base URL for communication with the bridge.
* @returns The base URL for the hue bridge.
*/
get baseUrl(): string;
/**
* Gets the name of the hue bridge.
* @returns string The name for the bridge.
*/
get bridgeName(): string;
/**
* Gets the client key for the entertainment API/streaming endpoints
* @throws ApiError if the connection is not local network.
*/
get clientKey(): string | undefined;
/**
* Gets the current access token.
* @returns {String}
* @throws ApiError if the connection is not remote.
*/
get accessToken(): string | undefined;
/**
* Gets the expiry timestamp of the access token.
* @returns {number} The timestamp for the expiry or -1 if not known
*/
get accessTokenExpiry(): number | undefined;
/**
* Gets the current refresh token.
* @throws ApiError if the connection is not remote.
*/
get refreshToken(): string | undefined;
/**
* Gets the expiry timestamp of the refresh token.
* @returns {number} The timestamp for the expiry or -1 if not known
*/
get refreshTokenExpiry(): number | undefined;
private getRequiredRemote;
private _requireRemote;
private _requireLocal;
}