textiot
Version:
A framework for building web and native (IoT) Dapps on the IPFS network
36 lines (35 loc) • 974 B
TypeScript
import { API } from '../../core/api';
import { Node, FileIndex } from '../../models';
/**
* Schemas is an API module for managing Textile schemas
*
* @extends API
*/
export default class Schemas extends API {
/**
* Default Textile schemas
* @returns An object with various commonly used schemas
*/
defaults(): Promise<{
[key: string]: object;
}>;
/**
* Default Textile schemas
* @returns An object with various commonly used schemas
*/
defaultByName(name: string): Promise<object | undefined>;
/**
* Creates and validates a new schema from input JSON
*
* @param schema Input JSON-based thread schema
* @returns The milled schema as a file index
*/
add(schema: object): Promise<FileIndex>;
/**
* Retrieves a schema by thread ID
*
* @param thread ID of the thread
* @returns The schema of the target thread
*/
get(thread: string): Promise<Node>;
}