UNPKG

haystack-nclient

Version:

Project Haystack Network Client

67 lines (66 loc) 1.99 kB
import { ClientServiceConfig } from '../ClientServiceConfig'; import { WatchApis } from './WatchApis'; import { Record } from '../../util/Record'; /** * Watch network calls using the RESTful Watch APIs. */ export declare class WatchRestApis implements WatchApis { #private; /** * Constructs a new watch operations object. * * @param serviceConfig service configuration. */ constructor(serviceConfig: ClientServiceConfig); /** * Open a new watch. * * @param ids The ids to watch. * @returns The watch open response. * @throws An error if the watch can't be created. */ open(ids: string[], display?: string): Promise<{ id: string; records: Record[]; }>; /** * Add some records to an existing watch. * * @param watchId The id of the watch. * @param ids The record ids to watch. * @returns The watch add response. * @throws An error if the watch can't be found. */ add(watchId: string, ids: string[]): Promise<Record[]>; /** * Poll an existing watch. * * @param watchId The watch id to poll. * @returns The watch poll data. * @throws An error if the watch can't be found. */ poll(watchId: string): Promise<Record[]>; /** * Refresh an existing watch. * * @param watchId The watch id to poll. * @returns The watch poll data. * @throws An error if the watch can't be found. */ refresh(watchId: string): Promise<Record[]>; /** * Remove records from an existing watch. * * @param watchId The id of the watch. * @param ids The record ids to remove. * @throws An error if the watch can't be found. */ remove(watchId: string, ids: string[]): Promise<void>; /** * Close an existing watch. * * @param watchId The id of the watch. * @throws An error if the watch can't be found. */ close(watchId: string): Promise<void>; }