textiot
Version:
A framework for building web and native (IoT) Dapps on the IPFS network
32 lines (31 loc) • 1.14 kB
TypeScript
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<boolean>;
/**
* 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<ReadableStream<QueryResult>>;
/**
* 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<ReadableStream<QueryResult>>;
applySnapshot(snapshot: QueryResult): Promise<boolean>;
}