textiot
Version:
A framework for building web and native (IoT) Dapps on the IPFS network
64 lines (63 loc) • 1.3 kB
TypeScript
export interface QueryOptions {
localOnly: boolean;
remoteOnly: boolean;
limit: number;
wait: number;
filter: QueryOptions.FilterType;
exclude: string[];
}
export declare namespace QueryOptions {
enum FilterType {
NO_FILTER = "NO_FILTER",
HIDE_OLDER = "HIDE_OLDER"
}
}
export interface Query {
id: string;
token: string;
type: Query.Type;
options: QueryOptions;
payload: any;
}
export declare namespace Query {
enum Type {
THREAD_SNAPSHOTS = "THREAD_SNAPSHOTS",
CONTACTS = "CONTACTS"
}
}
export interface PubSubQuery {
id: string;
type: Query.Type;
payload: any;
responseType: PubSubQuery.ResponseType;
exclude: string[];
topic: string;
timeout: number;
}
export declare namespace PubSubQuery {
enum ResponseType {
P2P = "P2P",
PUBSUB = "PUBSUB"
}
}
export interface QueryResult {
id: string;
date: string;
local: boolean;
value: any;
}
export interface QueryResults {
type: Query.Type;
items: QueryResult[];
}
export interface PubSubQueryResults {
id: string;
results: QueryResults;
}
export interface ContactQuery {
address: string;
name: string;
}
export interface ThreadSnapshotQuery {
address: string;
}