node-hue-api
Version:
Philips Hue API Library for Node.js
42 lines (41 loc) • 1.46 kB
TypeScript
import { Token, Tokens } from './http/OAuthTokens';
import { Api } from './Api';
type RemoteAccessCredentials = {
clientId: string;
clientSecret: string;
tokens: {
access?: Partial<Token>;
refresh?: Partial<Token>;
};
username: string;
};
type OptionalRemoteAccessCredentials = Partial<RemoteAccessCredentials>;
export declare class Remote {
private _hueApi;
constructor(hueApi: Api);
/**
* Exchanges the code for a token on the remote API.
* @param code The code to exchange for a new token.
* @returns The token from the remote API.
*/
getToken(code: string): Promise<Partial<Tokens>>;
/**
* Will refresh the OAuth tokens on the remote API, exchanging the existing ones for new ones.
* @returns The new access and refresh tokens.
*/
refreshTokens(): Promise<Partial<Tokens>>;
/**
* Creates a new remote user for the Hue Bridge.
*
* @param remoteBridgeId The is of the hue bridge on the remote portal
* @param deviceType The user device type identifier.
*/
createRemoteUser(remoteBridgeId: string, deviceType: string): Promise<string>;
/** Obtains the remote access credentials that are in use for the remote connection. */
getRemoteAccessCredentials(): OptionalRemoteAccessCredentials;
/** @private */
_getHueApi(): Api;
/** @private */
_getRemoteApi(): import("./http/RemoteApi").RemoteApi;
}
export {};