export = Api; /** * This class represents an API endpoint on Homey. When registered, realtime events are fired on the instance. */ declare class Api extends events.EventEmitter { type: string; id: string; /** * Perform a GET request. * @param {string} uri - The path to request, relative to the endpoint. * @returns {Promise} */ get(uri: string): Promise; /** * Perform a POST request. * @param {string} uri - The path to request, relative to the endpoint. * @param {any} body - The body of the request. * @returns {Promise} */ post(uri: string, body: any): Promise; /** * Perform a PUT request. * @param {string} uri - The path to request, relative to the endpoint. * @param {any} body - The body of the request. * @returns {Promise} */ put(uri: string, body: any): Promise; /** * Perform a DELETE request. * @param {string} uri - The path to request, relative to the endpoint. * @returns {Promise} */ delete(uri: string): Promise; /** * Unregister the API. * This is a shorthand method for {@link ManagerApi#unregisterApi}. */ unregister(): void; } import events = require("events");