@iotize/device-client.js
Version:
IoTize Device client for Javascript
28 lines (27 loc) • 920 B
TypeScript
import { EncoderDecoder } from '../../core';
import { ServiceCallMethodType } from '../service';
export declare type Routes = {
[key: string]: Route;
};
export interface Route {
returnTypeConverter?: string;
bodyEncoder?: string;
}
export declare class ApiConfig {
routes: Routes;
aliases: {
[key: string]: string;
};
converters: {
[key: string]: EncoderDecoder<any, any>;
};
constructor(routes: Routes, converters?: {
[key: string]: any;
}, aliases?: {
[key: string]: any;
});
getRoute(methodStr: ServiceCallMethodType, path: string): Route | undefined;
addRoute(methodStr: ServiceCallMethodType, lwm2mPath: string, route: Route, ...aliases: string[]): this;
getBodyConverter<InputType = any, OutputType = any>(id: string): EncoderDecoder<InputType, OutputType>;
resolvePath(path: string): string;
}