@iotize/tap
Version:
IoTize Device client for Javascript
39 lines (38 loc) • 1.91 kB
TypeScript
import '@iotize/tap/service/impl/variable';
import '@iotize/tap/service/impl/target';
import '@iotize/tap/service/impl/interface';
import { ProgressState } from '@iotize/common/progress/api';
import { Tap } from '@iotize/tap';
import { Observer } from 'rxjs';
import { TapBundleConfig, TapVariableConfig } from '../target-variable/tap-bundle/tap-bundle';
import { KeyTypeType } from '../utility/editable-data-stream';
import { TypedDataManager } from './data-manager';
export interface TapDataManagerConfig<DataType> {
bundles: BundlesConfig<DataType>;
}
export declare type BundlesConfig<DataType> = Record<keyof DataType, TapBundleConfig<keyof DataType[keyof DataType]>>;
export declare function createTapBundlesFromConfig<DataType>(tap: Tap, bundles: BundlesConfig<DataType>): any;
export declare function createDataManagerFromTapConfig<DataType>(tap: Tap, config: TapDataManagerConfig<DataType>): TypedDataManager<DataType>;
export declare namespace DataManagerSync {
type Event = {
progress: ProgressState;
} & ({
step: 'start-read-variable-config';
profileData: Record<string, Uint8Array>;
} | {
step: 'read-variable';
variableId: number;
} | {
step: 'end-read-variable-config';
});
}
export declare function readDataManagerTapConfigFromTap<ExpectedDataType extends Record<KeyTypeType, TapBundleConfig<KeyTypeType>> = Record<KeyTypeType, TapBundleConfig<KeyTypeType>>>(tap: Tap, config?: {
bundleIdNameMap?: Record<number, string>;
variableIdNameMap?: Record<number, string>;
observer?: Observer<DataManagerSync.Event>;
}): Promise<ExpectedDataType>;
export declare function readTapVariableConfigFromTap<ExpectedType = any>(tap: Tap, variableId: number, variableName?: string): Promise<{
bundleId: number;
variableName: string;
config: TapVariableConfig<ExpectedType>;
}>;