export = ManagerApi; /** * @hideconstructor * @classdesc * You can access this manager through the {@link Homey} instance as `this.homey.api` */ declare class ManagerApi extends Manager { static ID: string; /** * Perform a GET request. * @param {string} uri - The path to request, relative to /api. * @returns {Promise} */ get(uri: string): Promise; /** * Perform a POST request. * @param {string} uri - The path to request, relative to /api. * @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 /api. * @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 /api. * @returns {Promise} */ delete(uri: string): Promise; /** * Emit a `realtime` event. * @param {string} event - The name of the event * @param {any} data - The data of the event */ realtime(event: string, data: any): any; /** * Create an {@link Api} instance, to receive realtime events. * @param {string} uri The URI of the endpoint, e.g. `homey:manager:webserver` * @returns {Api} */ getApi(uri: string): Api; hasApi(uri: any): boolean; /** * Create an {@link ApiApp} instance, to receive realtime events. * @param {string} appId The ID of the App, e.g. `com.athom.foo` * @returns {ApiApp} */ getApiApp(appId: string): ApiApp; hasApiApp(appId: any): boolean; /** * Unregister an {@link Api} instance. * @param {Api} api */ unregisterApi(api: Api): void; /** * Starts a new API session on behalf of the homey owner and returns the API token. * The API Token expires after not being used for two weeks. * * > Requires the `homey:manager:api` permission. * > For more information about permissions read the [Permissions tutorial](https://app.gitbook.com/@athom/s/homey-apps/the-basics/app/permissions). * * @returns {Promise} */ getOwnerApiToken(): Promise; /** * Returns the url for local access. * * > Requires the `homey:manager:api` permission. * > For more information about permissions read the [Permissions tutorial](https://app.gitbook.com/@athom/s/homey-apps/the-basics/app/permissions). * * @returns {Promise} */ getLocalUrl(): Promise; } import Manager = require("../lib/Manager.js"); import Api = require("../lib/Api.js"); import ApiApp = require("../lib/ApiApp.js");