import IResult from "./result.js"; /** * The ISubscription interface. */ interface ISubscription { /** * Gets the id. * * @return {string} - The subscription id. */ getId(): string; /** * Subscribes to a node. * * @param {string} address - The address. * @return {Promise} The result. */ subscribe(address: string): Promise; /** * Subscribes to a list of nodes. * * @param {Array} addresses - The array of addresses. * @return {Promise} - The result. */ subscribeMulti(addresses: Array): Promise; /** * Replaces the current subscribed list of nodes. * * @param {Array} addresses - The array of addresses. * @return {Promise} - The result. */ modify(addresses: Array): Promise; /** * Unsubscribes the node. * IMPORTANT: If the last address has been unsubscribed from the subscription, it will be unusable and subsequent method calls return with a bad result. * * @param {string} address - The address. * @return {Promise} - The result. */ unsubscribe(address: string): Promise; /** * Unsubscribes to a list of nodes. * IMPORTANT: If the last address has been unsubscribed from the subscription, it will be unusable and subsequent method calls return with a bad result. * * @param {Array} addresses - The array of addresses. * @return {Promise} - The result. */ unsubscribeMulti(addresses: Array): Promise; /** * Unsubscribes all subscribed nodes. * IMPORTANT: The subscription will be unusable and subsequent method calls return with a bad result. * * @return {Promise} - The result. */ unsubscribeAll(): Promise; } /** * The Subscription. */ declare class Subscription implements ISubscription { /** * Creates an instance of Subscription. * * INTERNAL USAGE ONLY - NOT TO BE INSTANTIATED BY JAVASCRIPT CODE * */ constructor(); /** * Gets the id. * * @return {string} - The subscription id. */ getId(): string; /** * Subscribes to a node. * * @param {string} address - The address. * @return {Promise} - The result. */ subscribe(address: string): Promise; /** * Subscribes to a list of nodes. * * @param {Array} addresses - The array of addresses. * @return {Promise} - The result. */ subscribeMulti(addresses: Array): Promise; /** * Replaces the current subscribed list of nodes. * * @param {Array} addresses - The array of addresses. * @return {Promise} - The result. */ modify(addresses: Array): Promise; /** * Unsubscribes the node. * IMPORTANT: If the last address has been unsubscribed from the subscription, it will be unusable and subsequent method calls return with a bad result. * * @param {string} address - The address. * @return {Promise} - The result. */ unsubscribe(address: string): Promise; /** * Unsubscribes to a list of nodes. * IMPORTANT: If the last address has been unsubscribed from the subscription, it will be unusable and subsequent method calls return with a bad result. * * @param {Array} addresses - The array of addresses. * @return {Promise} - The result. */ unsubscribeMulti(addresses: Array): Promise; /** * Unsubscribes all subscribed nodes. * IMPORTANT: The subscription will be unusable and subsequent method calls return with a bad result. * * @return {Promise} - The result. */ unsubscribeAll(): Promise; private _addonInstance; } export = Subscription;