import { API } from '../core/api'; import { QueryResult } from '../models'; import { ReadableStream } from 'web-streams-polyfill/ponyfill'; /** * Snapshots is an API module for managing thread snapshots * * @extends API */ export default class Snapshots extends API { /** * Snapshot all threads and push to registered cafes * * @returns Whether the snapshot process was successfull */ create(): Promise; /** * Search the network for thread snapshots * * @param wait Stops searching after 'wait' seconds have elapsed (max 30 default 2) * @returns A ReadableStream of QueryResult objects. */ search(wait?: number): Promise>; /** * Apply a single thread snapshot * @param id The snapshot id (omit to find and apply all snapshots) * @param wait Stops searching after 'wait' seconds have elapsed (max 30 default 2) * @returns A ReadableStream of QueryResult objects. */ apply(id?: string, wait?: number): Promise>; applySnapshot(snapshot: QueryResult): Promise; }