UNPKG

@iotize/tap

Version:

IoTize Device client for Javascript

44 lines (43 loc) 2.15 kB
import { DecoderFct } from '@iotize/common/converter/api'; import { ProgressState } from '@iotize/common/progress/api'; import { TapClientInterface, TapRequestFrame } from '@iotize/tap/client/api'; import { Observable } from 'rxjs'; import { ServiceCallType } from './definitions'; import { TapResponse } from './response-impl'; export declare namespace ServiceCallRunner { interface AppendProgress extends ProgressState { /** * Currently sent byte offset */ byteOffset: number; } } export declare function serviceCallToString(call: ServiceCallType<any, any>, options?: { skipBody?: boolean; }): string; export declare class ServiceCallRunner { client: TapClientInterface; options: { chunkSize: number; }; constructor(client: TapClientInterface, options?: { chunkSize: number; }); get(path: string, body?: Uint8Array): Promise<TapResponse<Uint8Array>>; put(path: string, body?: Uint8Array): Promise<TapResponse<Uint8Array>>; post(path: string, body?: Uint8Array): Promise<TapResponse<Uint8Array>>; prepare<BodyType, ReturnType>(call: ServiceCallType<BodyType, ReturnType>): Observable<TapResponse<ReturnType>>; execute<BodyType, ReturnType>(call: ServiceCallType<BodyType, ReturnType>): Promise<TapResponse<ReturnType>>; createAppendCalls(call: ServiceCallType<Uint8Array>, chunkSize?: number): ServiceCallType<Uint8Array, void>[]; prepareAppendCall(call: ServiceCallType<Uint8Array>, chunkSize?: number): Observable<ServiceCallRunner.AppendProgress>; static toTapRequest<BodyType, ReturnType>(call: ServiceCallType<BodyType, ReturnType>): TapRequestFrame; static resolveResponseBodyDecoder<BodyType, ReturnType>(call: ServiceCallType<BodyType, ReturnType>): DecoderFct<Uint8Array, ReturnType> | undefined; static resolvePathParameters(info: { path: string; pathParameters?: Record<string, string | number>; }): string; /** * Encode body according to options and configuration */ static encodeBody(options: ServiceCallType): Uint8Array | undefined; }