@formant/data-sdk 0.0.76 → 0.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data-sdk.es.js +218 -1
- package/dist/data-sdk.umd.js +7 -7
- package/dist/types/data-sdk/src/Device.d.ts +9 -1
- package/dist/types/data-sdk/src/Fleet.d.ts +2 -0
- package/dist/types/data-sdk/src/Manipulator.d.ts +2 -2
- package/dist/types/data-sdk/src/PeerDevice.d.ts +36 -0
- package/dist/types/data-sdk/src/RequestDataChannel.d.ts +4 -3
- package/dist/types/data-sdk/src/main.d.ts +2 -0
- package/dist/types/data-sdk/src/model/IStreamCurrentValue.d.ts +13 -0
- package/package.json +1 -1
|
@@ -59,7 +59,15 @@ export declare enum SessionType {
|
|
|
59
59
|
Teleop = 1,
|
|
60
60
|
Observe = 3
|
|
61
61
|
}
|
|
62
|
-
export
|
|
62
|
+
export interface IRealtimeDevice {
|
|
63
|
+
startRealtimeConnection(sessionType?: SessionType): Promise<void>;
|
|
64
|
+
startListeningToRealtimeDataStream(stream: RealtimeDataStream): Promise<void>;
|
|
65
|
+
stopListeningToRealtimeDataStream(stream: RealtimeDataStream): Promise<void>;
|
|
66
|
+
addRealtimeListener(listener: RealtimeListener): void;
|
|
67
|
+
removeRealtimeListener(listener: RealtimeListener): void;
|
|
68
|
+
createCustomDataChannel(channelName: string, rtcConfig?: RTCDataChannelInit): Promise<DataChannel>;
|
|
69
|
+
}
|
|
70
|
+
export declare class Device implements IRealtimeDevice {
|
|
63
71
|
id: string;
|
|
64
72
|
name: string;
|
|
65
73
|
private organizationId;
|
|
@@ -4,6 +4,7 @@ import { IEventQuery } from "./model/IEventQuery";
|
|
|
4
4
|
import { IEvent } from "./model/IEvent";
|
|
5
5
|
import { IQuery } from "./model/IQuery";
|
|
6
6
|
import { IStreamData } from "./model/IStreamData";
|
|
7
|
+
import { PeerDevice } from "./PeerDevice";
|
|
7
8
|
export interface TelemetryResult {
|
|
8
9
|
deviceId: string;
|
|
9
10
|
name: string;
|
|
@@ -18,6 +19,7 @@ export declare class Fleet {
|
|
|
18
19
|
static knownContext: WeakRef<Device>[];
|
|
19
20
|
static setDefaultDevice(deviceId: string): Promise<void>;
|
|
20
21
|
static getCurrentDevice(): Promise<Device>;
|
|
22
|
+
static getPeerDevice(url: string): Promise<PeerDevice>;
|
|
21
23
|
static getDevice(deviceId: string): Promise<Device>;
|
|
22
24
|
static getDevices(): Promise<Device[]>;
|
|
23
25
|
static getOnlineDevices(): Promise<Device[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RealtimeDataStream, IJointState, RealtimeMessage, IRealtimeDevice } from "./Device";
|
|
2
2
|
export declare type RealtimeManipulatorConfig = {
|
|
3
3
|
currentJointStateStream: RealtimeDataStream;
|
|
4
4
|
plannedJointStateStream?: RealtimeDataStream;
|
|
@@ -12,7 +12,7 @@ export declare class Manipulator {
|
|
|
12
12
|
private device;
|
|
13
13
|
private config;
|
|
14
14
|
currentListeners: ((js: IJointState) => void)[];
|
|
15
|
-
constructor(device:
|
|
15
|
+
constructor(device: IRealtimeDevice, config: RealtimeManipulatorConfig);
|
|
16
16
|
synchronize(): Promise<void>;
|
|
17
17
|
desynchronize(): Promise<void>;
|
|
18
18
|
onRealtimeMessage: (_peerId: string, message: RealtimeMessage) => void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { RtcClient } from "@formant/realtime-sdk";
|
|
2
|
+
import { DataChannel } from "./DataChannel";
|
|
3
|
+
import { Manipulator } from "./Manipulator";
|
|
4
|
+
import { TextRequestDataChannel, BinaryRequestDataChannel } from "./RequestDataChannel";
|
|
5
|
+
import { ConfigurationDocument, IRealtimeDevice, RealtimeDataStream, RealtimeListener, RealtimeVideoStream, SessionType } from "./Device";
|
|
6
|
+
import { IStreamCurrentValue } from "./model/IStreamCurrentValue";
|
|
7
|
+
export declare class PeerDevice implements IRealtimeDevice {
|
|
8
|
+
peer_url: string;
|
|
9
|
+
rtcClient: RtcClient | undefined;
|
|
10
|
+
remoteDevicePeerId: string | undefined;
|
|
11
|
+
realtimeListeners: RealtimeListener[];
|
|
12
|
+
id: string;
|
|
13
|
+
constructor(peer_url: string);
|
|
14
|
+
getLatestTelemetry(): Promise<IStreamCurrentValue[]>;
|
|
15
|
+
getDeviceId(): Promise<string>;
|
|
16
|
+
getConfiguration(): Promise<ConfigurationDocument>;
|
|
17
|
+
private handleMessage;
|
|
18
|
+
getRealtimeStatus(): "disconnected" | "connecting" | "connected";
|
|
19
|
+
getRealtimePing(): number | undefined;
|
|
20
|
+
startRealtimeConnection(_sessionType?: SessionType): Promise<void>;
|
|
21
|
+
addRealtimeListener(listener: RealtimeListener): void;
|
|
22
|
+
removeRealtimeListener(listener: RealtimeListener): void;
|
|
23
|
+
getRealtimeVideoStreams(): Promise<RealtimeVideoStream[]>;
|
|
24
|
+
getRealtimeManipulators(): Promise<Manipulator[]>;
|
|
25
|
+
startListeningToRealtimeVideo(stream: RealtimeVideoStream): Promise<void>;
|
|
26
|
+
stopListeningToRealtimeVideo(stream: RealtimeVideoStream): Promise<void>;
|
|
27
|
+
startListeningToRealtimeDataStream(stream: RealtimeDataStream): Promise<void>;
|
|
28
|
+
stopListeningToRealtimeDataStream(stream: RealtimeDataStream): Promise<void>;
|
|
29
|
+
enableRealtimeTelemetryPriorityIngestion(streamName: string): Promise<void>;
|
|
30
|
+
disableRealtimeTelemetryPriorityIngestion(streamName: string): Promise<void>;
|
|
31
|
+
getRemotePeer(): Promise<import("@formant/realtime-sdk/dist/model/IRtcPeer").IRtcPeer>;
|
|
32
|
+
stopRealtimeConnection(): Promise<void>;
|
|
33
|
+
createCustomDataChannel(channelName: string, rtcConfig?: RTCDataChannelInit): Promise<DataChannel>;
|
|
34
|
+
createCustomRequestDataChannel(channelName: string, timeout?: number): TextRequestDataChannel;
|
|
35
|
+
createCustomBinaryRequestDataChannel(channelName: string, timeout?: number): BinaryRequestDataChannel;
|
|
36
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DataChannel } from "./main";
|
|
2
|
+
import { IRealtimeDevice } from "./Device";
|
|
2
3
|
declare abstract class RequestDataChannel {
|
|
3
|
-
protected device:
|
|
4
|
+
protected device: IRealtimeDevice;
|
|
4
5
|
protected channel_name: string;
|
|
5
6
|
protected timeout: number;
|
|
6
7
|
protected channel: undefined | DataChannel;
|
|
7
8
|
protected requestIdToResponseMap: Map<string, any>;
|
|
8
|
-
constructor(device:
|
|
9
|
+
constructor(device: IRealtimeDevice, channel_name: string, timeout: number);
|
|
9
10
|
}
|
|
10
11
|
export declare class BinaryRequestDataChannel extends RequestDataChannel {
|
|
11
12
|
private RESPONSE_SUCCESS_BYTE;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./Fleet";
|
|
2
2
|
export * from "./Authentication";
|
|
3
3
|
export * from "./Device";
|
|
4
|
+
export * from "./PeerDevice";
|
|
4
5
|
export * from "./DataChannel";
|
|
5
6
|
export * from "./CaptureStream";
|
|
6
7
|
export * from "./Manipulator";
|
|
@@ -78,6 +79,7 @@ export * from "./model/IsoDate";
|
|
|
78
79
|
export * from "./model/ISpreadsheetIdRange";
|
|
79
80
|
export * from "./model/IStreamData";
|
|
80
81
|
export * from "./model/IStreamTypeMap";
|
|
82
|
+
export * from "./model/IStreamCurrentValue";
|
|
81
83
|
export * from "./model/ISystemEvent";
|
|
82
84
|
export * from "./model/ITaggedUsers";
|
|
83
85
|
export * from "./model/ITagParameters";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IsoDate } from "./IsoDate";
|
|
2
|
+
import { IStreamTypeMap } from "./IStreamTypeMap";
|
|
3
|
+
import { ITags } from "./ITags";
|
|
4
|
+
import { StreamType } from "./StreamType";
|
|
5
|
+
import { Uuid } from "./Uuid";
|
|
6
|
+
export interface IStreamCurrentValue<T extends StreamType = any> {
|
|
7
|
+
deviceId: Uuid;
|
|
8
|
+
streamName: string;
|
|
9
|
+
streamType: StreamType;
|
|
10
|
+
tags: ITags;
|
|
11
|
+
currentValue: IStreamTypeMap[T];
|
|
12
|
+
currentValueTime: IsoDate;
|
|
13
|
+
}
|