@synapticon/motion-master-client 2.3.0-beta.0 → 6.0.0-alpha.100

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.
Files changed (72) hide show
  1. package/LICENSE +21 -0
  2. package/dist/api-error.d.ts +25 -0
  3. package/dist/api-error.js +52 -0
  4. package/dist/client.d.ts +20 -0
  5. package/dist/client.js +37 -0
  6. package/dist/constants.d.ts +2 -0
  7. package/dist/constants.js +8 -0
  8. package/dist/eni.d.ts +197 -0
  9. package/dist/eni.js +61 -0
  10. package/dist/generated/Api.d.ts +1886 -0
  11. package/dist/generated/Api.js +1293 -0
  12. package/dist/generated/data-contracts.d.ts +2282 -0
  13. package/dist/generated/data-contracts.js +12 -0
  14. package/dist/generated/http-client.d.ts +60 -0
  15. package/dist/generated/http-client.js +171 -0
  16. package/dist/hex.d.ts +2 -0
  17. package/dist/hex.js +20 -0
  18. package/dist/index.d.ts +13 -7
  19. package/dist/index.js +20 -22
  20. package/dist/lan.d.ts +4 -0
  21. package/dist/lan.js +59 -0
  22. package/dist/mmpd.d.ts +53 -0
  23. package/dist/mmpd.js +322 -0
  24. package/dist/sdo.d.ts +17 -0
  25. package/dist/sdo.js +219 -0
  26. package/dist/web-socket-connection.d.ts +70 -0
  27. package/dist/web-socket-connection.js +237 -0
  28. package/dist/wire-time.d.ts +2 -0
  29. package/dist/wire-time.js +18 -0
  30. package/package.json +29 -35
  31. package/.vscode/launch.json +0 -23
  32. package/README.md +0 -118
  33. package/box.config.json +0 -7
  34. package/dist/index.d.ts.map +0 -1
  35. package/dist/index.js.map +0 -1
  36. package/dist/motion-master-client-web-socket-connection.d.ts +0 -43
  37. package/dist/motion-master-client-web-socket-connection.d.ts.map +0 -1
  38. package/dist/motion-master-client-web-socket-connection.js +0 -91
  39. package/dist/motion-master-client-web-socket-connection.js.map +0 -1
  40. package/dist/motion-master-client.d.ts +0 -105
  41. package/dist/motion-master-client.d.ts.map +0 -1
  42. package/dist/motion-master-client.js +0 -348
  43. package/dist/motion-master-client.js.map +0 -1
  44. package/dist/motion-master-notification-subscribe-data.d.ts +0 -8
  45. package/dist/motion-master-notification-subscribe-data.d.ts.map +0 -1
  46. package/dist/motion-master-notification-subscribe-data.js +0 -3
  47. package/dist/motion-master-notification-subscribe-data.js.map +0 -1
  48. package/dist/motion-master-notification-web-socket-connection.d.ts +0 -56
  49. package/dist/motion-master-notification-web-socket-connection.d.ts.map +0 -1
  50. package/dist/motion-master-notification-web-socket-connection.js +0 -115
  51. package/dist/motion-master-notification-web-socket-connection.js.map +0 -1
  52. package/dist/motion-master-notification.d.ts +0 -31
  53. package/dist/motion-master-notification.d.ts.map +0 -1
  54. package/dist/motion-master-notification.js +0 -44
  55. package/dist/motion-master-notification.js.map +0 -1
  56. package/dist/util.d.ts +0 -16
  57. package/dist/util.d.ts.map +0 -1
  58. package/dist/util.js +0 -24
  59. package/dist/util.js.map +0 -1
  60. package/licenses.format.json +0 -4
  61. package/motion-master-client.config.json +0 -7
  62. package/smm_data_dic.json +0 -1213
  63. package/src/index.ts +0 -7
  64. package/src/motion-master-client-web-socket-connection.ts +0 -104
  65. package/src/motion-master-client.ts +0 -468
  66. package/src/motion-master-notification-subscribe-data.ts +0 -7
  67. package/src/motion-master-notification-web-socket-connection.ts +0 -143
  68. package/src/motion-master-notification.ts +0 -51
  69. package/src/util.ts +0 -22
  70. package/test.sh +0 -122
  71. package/tsconfig.json +0 -63
  72. package/tslint.json +0 -118
@@ -0,0 +1,12 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+ // @ts-nocheck
4
+ /*
5
+ * ---------------------------------------------------------------
6
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
7
+ * ## ##
8
+ * ## AUTHOR: acacode ##
9
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
10
+ * ---------------------------------------------------------------
11
+ */
12
+ export {};
@@ -0,0 +1,60 @@
1
+ export type QueryParamsType = Record<string | number, any>;
2
+ export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
3
+ export interface FullRequestParams extends Omit<RequestInit, "body"> {
4
+ /** set parameter to `true` for call `securityWorker` for this request */
5
+ secure?: boolean;
6
+ /** request path */
7
+ path: string;
8
+ /** content type of request body */
9
+ type?: ContentType;
10
+ /** query params */
11
+ query?: QueryParamsType;
12
+ /** format of response (i.e. response.json() -> format: "json") */
13
+ format?: ResponseFormat;
14
+ /** request body */
15
+ body?: unknown;
16
+ /** base url */
17
+ baseUrl?: string;
18
+ /** request cancellation token */
19
+ cancelToken?: CancelToken;
20
+ }
21
+ export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
22
+ export interface ApiConfig<SecurityDataType = unknown> {
23
+ baseUrl?: string;
24
+ baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
25
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
26
+ customFetch?: typeof fetch;
27
+ }
28
+ export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
29
+ data: D;
30
+ error: E;
31
+ }
32
+ type CancelToken = Symbol | string | number;
33
+ export declare enum ContentType {
34
+ Json = "application/json",
35
+ JsonApi = "application/vnd.api+json",
36
+ FormData = "multipart/form-data",
37
+ UrlEncoded = "application/x-www-form-urlencoded",
38
+ Text = "text/plain"
39
+ }
40
+ export declare class HttpClient<SecurityDataType = unknown> {
41
+ baseUrl: string;
42
+ private securityData;
43
+ private securityWorker?;
44
+ private abortControllers;
45
+ private customFetch;
46
+ private baseApiParams;
47
+ constructor(apiConfig?: ApiConfig<SecurityDataType>);
48
+ setSecurityData: (data: SecurityDataType | null) => void;
49
+ protected encodeQueryParam(key: string, value: any): string;
50
+ protected addQueryParam(query: QueryParamsType, key: string): string;
51
+ protected addArrayQueryParam(query: QueryParamsType, key: string): any;
52
+ protected toQueryString(rawQuery?: QueryParamsType): string;
53
+ protected addQueryParams(rawQuery?: QueryParamsType): string;
54
+ private contentFormatters;
55
+ protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams;
56
+ protected createAbortSignal: (cancelToken: CancelToken) => AbortSignal | undefined;
57
+ abortRequest: (cancelToken: CancelToken) => void;
58
+ request: <T = any, E = any>({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }: FullRequestParams) => Promise<HttpResponse<T, E>>;
59
+ }
60
+ export {};
@@ -0,0 +1,171 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+ // @ts-nocheck
4
+ /*
5
+ * ---------------------------------------------------------------
6
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
7
+ * ## ##
8
+ * ## AUTHOR: acacode ##
9
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
10
+ * ---------------------------------------------------------------
11
+ */
12
+ export var ContentType;
13
+ (function (ContentType) {
14
+ ContentType["Json"] = "application/json";
15
+ ContentType["JsonApi"] = "application/vnd.api+json";
16
+ ContentType["FormData"] = "multipart/form-data";
17
+ ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
18
+ ContentType["Text"] = "text/plain";
19
+ })(ContentType || (ContentType = {}));
20
+ export class HttpClient {
21
+ baseUrl = "https://local.motion-master.synapticon.com:61447";
22
+ securityData = null;
23
+ securityWorker;
24
+ abortControllers = new Map();
25
+ customFetch = (...fetchParams) => fetch(...fetchParams);
26
+ baseApiParams = {
27
+ credentials: "same-origin",
28
+ headers: {},
29
+ redirect: "follow",
30
+ referrerPolicy: "no-referrer",
31
+ };
32
+ constructor(apiConfig = {}) {
33
+ Object.assign(this, apiConfig);
34
+ }
35
+ setSecurityData = (data) => {
36
+ this.securityData = data;
37
+ };
38
+ encodeQueryParam(key, value) {
39
+ const encodedKey = encodeURIComponent(key);
40
+ return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`;
41
+ }
42
+ addQueryParam(query, key) {
43
+ return this.encodeQueryParam(key, query[key]);
44
+ }
45
+ addArrayQueryParam(query, key) {
46
+ const value = query[key];
47
+ return value.map((v) => this.encodeQueryParam(key, v)).join("&");
48
+ }
49
+ toQueryString(rawQuery) {
50
+ const query = rawQuery || {};
51
+ const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]);
52
+ return keys
53
+ .map((key) => Array.isArray(query[key])
54
+ ? this.addArrayQueryParam(query, key)
55
+ : this.addQueryParam(query, key))
56
+ .join("&");
57
+ }
58
+ addQueryParams(rawQuery) {
59
+ const queryString = this.toQueryString(rawQuery);
60
+ return queryString ? `?${queryString}` : "";
61
+ }
62
+ contentFormatters = {
63
+ [ContentType.Json]: (input) => input !== null && (typeof input === "object" || typeof input === "string")
64
+ ? JSON.stringify(input)
65
+ : input,
66
+ [ContentType.JsonApi]: (input) => input !== null && (typeof input === "object" || typeof input === "string")
67
+ ? JSON.stringify(input)
68
+ : input,
69
+ [ContentType.Text]: (input) => input !== null && typeof input !== "string"
70
+ ? JSON.stringify(input)
71
+ : input,
72
+ [ContentType.FormData]: (input) => {
73
+ if (input instanceof FormData) {
74
+ return input;
75
+ }
76
+ return Object.keys(input || {}).reduce((formData, key) => {
77
+ const property = input[key];
78
+ formData.append(key, property instanceof Blob
79
+ ? property
80
+ : typeof property === "object" && property !== null
81
+ ? JSON.stringify(property)
82
+ : `${property}`);
83
+ return formData;
84
+ }, new FormData());
85
+ },
86
+ [ContentType.UrlEncoded]: (input) => this.toQueryString(input),
87
+ };
88
+ mergeRequestParams(params1, params2) {
89
+ return {
90
+ ...this.baseApiParams,
91
+ ...params1,
92
+ ...(params2 || {}),
93
+ headers: {
94
+ ...(this.baseApiParams.headers || {}),
95
+ ...(params1.headers || {}),
96
+ ...((params2 && params2.headers) || {}),
97
+ },
98
+ };
99
+ }
100
+ createAbortSignal = (cancelToken) => {
101
+ if (this.abortControllers.has(cancelToken)) {
102
+ const abortController = this.abortControllers.get(cancelToken);
103
+ if (abortController) {
104
+ return abortController.signal;
105
+ }
106
+ return void 0;
107
+ }
108
+ const abortController = new AbortController();
109
+ this.abortControllers.set(cancelToken, abortController);
110
+ return abortController.signal;
111
+ };
112
+ abortRequest = (cancelToken) => {
113
+ const abortController = this.abortControllers.get(cancelToken);
114
+ if (abortController) {
115
+ abortController.abort();
116
+ this.abortControllers.delete(cancelToken);
117
+ }
118
+ };
119
+ request = async ({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }) => {
120
+ const secureParams = ((typeof secure === "boolean" ? secure : this.baseApiParams.secure) &&
121
+ this.securityWorker &&
122
+ (await this.securityWorker(this.securityData))) ||
123
+ {};
124
+ const requestParams = this.mergeRequestParams(params, secureParams);
125
+ const queryString = query && this.toQueryString(query);
126
+ const payloadFormatter = this.contentFormatters[type || ContentType.Json];
127
+ const responseFormat = format || requestParams.format;
128
+ return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
129
+ ...requestParams,
130
+ headers: {
131
+ ...(requestParams.headers || {}),
132
+ ...(type && type !== ContentType.FormData
133
+ ? { "Content-Type": type }
134
+ : {}),
135
+ },
136
+ signal: (cancelToken
137
+ ? this.createAbortSignal(cancelToken)
138
+ : requestParams.signal) || null,
139
+ body: typeof body === "undefined" || body === null
140
+ ? null
141
+ : payloadFormatter(body),
142
+ }).then(async (response) => {
143
+ const r = response;
144
+ r.data = null;
145
+ r.error = null;
146
+ const responseToParse = responseFormat ? response.clone() : response;
147
+ const data = !responseFormat
148
+ ? r
149
+ : await responseToParse[responseFormat]()
150
+ .then((data) => {
151
+ if (r.ok) {
152
+ r.data = data;
153
+ }
154
+ else {
155
+ r.error = data;
156
+ }
157
+ return r;
158
+ })
159
+ .catch((e) => {
160
+ r.error = e;
161
+ return r;
162
+ });
163
+ if (cancelToken) {
164
+ this.abortControllers.delete(cancelToken);
165
+ }
166
+ if (!response.ok)
167
+ throw data;
168
+ return data;
169
+ });
170
+ };
171
+ }
package/dist/hex.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare function formatHex(value: number, width?: number, prefix?: boolean): string;
2
+ export declare function parseHexBytes(input: string): number[] | null;
package/dist/hex.js ADDED
@@ -0,0 +1,20 @@
1
+ // Format a number as an uppercase hex string, zero-padded to `width` digits. With `prefix`
2
+ // (the default) it carries the conventional "0x"; pass false for bare digits — e.g. a subindex
3
+ // rendered after a colon ("0x6040:00"). The display inverse of parseHexBytes.
4
+ export function formatHex(value, width = 4, prefix = true) {
5
+ return `${prefix ? '0x' : ''}${value.toString(16).toUpperCase().padStart(width, '0')}`;
6
+ }
7
+ // Parse a string of hex bytes ("0A FF", "0x0AFF", "0a,ff") into a byte array.
8
+ // Returns null when the input is empty or not a valid even-length hex string.
9
+ export function parseHexBytes(input) {
10
+ const cleaned = input.replace(/0x/gi, '').replace(/[\s,]+/g, '');
11
+ if (cleaned.length === 0 || cleaned.length % 2 !== 0)
12
+ return null;
13
+ if (!/^[0-9a-fA-F]+$/.test(cleaned))
14
+ return null;
15
+ const bytes = [];
16
+ for (let i = 0; i < cleaned.length; i += 2) {
17
+ bytes.push(parseInt(cleaned.slice(i, i + 2), 16));
18
+ }
19
+ return bytes;
20
+ }
package/dist/index.d.ts CHANGED
@@ -1,7 +1,13 @@
1
- export { MotionMasterClientWebSocketConnection } from './motion-master-client-web-socket-connection';
2
- export { MotionMasterClient } from './motion-master-client';
3
- export { IMotionMasterNotificationSubscribeData } from './motion-master-notification-subscribe-data';
4
- export { MotionMasterNotificationWebSocketConnection } from './motion-master-notification-web-socket-connection';
5
- export { MotionMasterNotification } from './motion-master-notification';
6
- export * from './util';
7
- //# sourceMappingURL=index.d.ts.map
1
+ export * from './generated/http-client.js';
2
+ export * from './generated/data-contracts.js';
3
+ export * from './generated/Api.js';
4
+ export * from './api-error.js';
5
+ export * from './constants.js';
6
+ export * from './web-socket-connection.js';
7
+ export * from './client.js';
8
+ export * from './lan.js';
9
+ export * from './eni.js';
10
+ export * from './hex.js';
11
+ export * from './sdo.js';
12
+ export * from './mmpd.js';
13
+ export * from './wire-time.js';
package/dist/index.js CHANGED
@@ -1,22 +1,20 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- var motion_master_client_web_socket_connection_1 = require("./motion-master-client-web-socket-connection");
14
- Object.defineProperty(exports, "MotionMasterClientWebSocketConnection", { enumerable: true, get: function () { return motion_master_client_web_socket_connection_1.MotionMasterClientWebSocketConnection; } });
15
- var motion_master_client_1 = require("./motion-master-client");
16
- Object.defineProperty(exports, "MotionMasterClient", { enumerable: true, get: function () { return motion_master_client_1.MotionMasterClient; } });
17
- var motion_master_notification_web_socket_connection_1 = require("./motion-master-notification-web-socket-connection");
18
- Object.defineProperty(exports, "MotionMasterNotificationWebSocketConnection", { enumerable: true, get: function () { return motion_master_notification_web_socket_connection_1.MotionMasterNotificationWebSocketConnection; } });
19
- var motion_master_notification_1 = require("./motion-master-notification");
20
- Object.defineProperty(exports, "MotionMasterNotification", { enumerable: true, get: function () { return motion_master_notification_1.MotionMasterNotification; } });
21
- __exportStar(require("./util"), exports);
22
- //# sourceMappingURL=index.js.map
1
+ // Public entry point for @synapticon/motion-master-client.
2
+ //
3
+ // `src/generated/` is the swagger-typescript-api output — regenerate with `pnpm generate`, never
4
+ // hand-edit. Everything else here is the hand-written SDK layer (facade + WebSocket connection).
5
+ export * from './generated/http-client.js';
6
+ export * from './generated/data-contracts.js';
7
+ export * from './generated/Api.js';
8
+ export * from './api-error.js';
9
+ export * from './constants.js';
10
+ export * from './web-socket-connection.js';
11
+ export * from './client.js';
12
+ // Pure, framework-agnostic helpers (no DOM/React): hex formatting, CoE SDO value
13
+ // encode/decode, SOMANET file-list parsing, the ENI export, and the LAN hostname mapping that lets
14
+ // a browser reach a server on another machine under a name the bundled certificate covers.
15
+ export * from './lan.js';
16
+ export * from './eni.js';
17
+ export * from './hex.js';
18
+ export * from './sdo.js';
19
+ export * from './mmpd.js';
20
+ export * from './wire-time.js';
package/dist/lan.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export declare const LAN_DOMAIN = "ip.motion-master.synapticon.com";
2
+ export declare function isIpv4(value: string): boolean;
3
+ export declare function lanHostname(host: string): string;
4
+ export declare function lanAddress(host: string): string | null;
package/dist/lan.js ADDED
@@ -0,0 +1,59 @@
1
+ // Reaching a Motion Master that runs on another machine (an appliance on the workshop LAN, say)
2
+ // over TLS, from a page served at https://motion-master.synapticon.com.
3
+ //
4
+ // The obvious address — https://192.168.1.50:61447 — cannot work: no public CA will issue a
5
+ // certificate for a private IP, and a cross-origin fetch() offers no click-through for a
6
+ // self-signed one. The way out is a real, publicly-trusted name pointing at the private address.
7
+ // Names under `ip.motion-master.synapticon.com` write the address into their leftmost label, and
8
+ // the certificate every server ships carries the `*.ip.motion-master.synapticon.com` wildcard, so
9
+ // any such name validates with nothing to install.
10
+ //
11
+ // These names are resolved on the client machine by a hosts-file entry, not by public DNS — which
12
+ // is sufficient, because TLS checks a certificate against the name and never against how the name
13
+ // was resolved.
14
+ //
15
+ // The mapping is *offered* to the user, never applied behind their back: connecting straight to the
16
+ // IP address is a legitimate second path. It works once that origin has been opened in a tab and its
17
+ // certificate warning accepted, and it is the only path when the Console is being viewed from a
18
+ // phone or tablet — those cannot edit a hosts file, and it is the *browser's* machine that needs
19
+ // the entry, not the one running Motion Master. So these helpers convert on request; the caller
20
+ // decides.
21
+ // The subdomain whose leftmost label encodes an IPv4 address.
22
+ export const LAN_DOMAIN = 'ip.motion-master.synapticon.com';
23
+ // True when `value` is a dotted-quad IPv4 literal (each octet 0-255). Hostnames, IPv6 literals,
24
+ // and anything with a port or scheme attached are not.
25
+ export function isIpv4(value) {
26
+ const octets = value.trim().split('.');
27
+ if (octets.length !== 4) {
28
+ return false;
29
+ }
30
+ return octets.every((octet) => /^\d{1,3}$/.test(octet) && Number(octet) <= 255);
31
+ }
32
+ // Map a host to the name the bundled certificate covers: an IPv4 literal becomes its dashed form
33
+ // under LAN_DOMAIN (192.168.1.50 -> 192-168-1-50.ip.motion-master.synapticon.com); anything else
34
+ // is already a hostname and is returned trimmed but otherwise untouched — so a user who types
35
+ // `local.motion-master.synapticon.com`, or the dashed name itself, is left alone.
36
+ //
37
+ // Loopback is not special-cased: 127.0.0.1 maps to 127-0-0-1.ip.… which the same certificate
38
+ // covers. For a same-machine server the shorter `local.motion-master.synapticon.com` is still the
39
+ // better answer, since it is a public A record and so needs no hosts entry at all.
40
+ export function lanHostname(host) {
41
+ const trimmed = host.trim();
42
+ if (!isIpv4(trimmed)) {
43
+ return trimmed;
44
+ }
45
+ return `${trimmed.split('.').join('-')}.${LAN_DOMAIN}`;
46
+ }
47
+ // The inverse of lanHostname: recovers the address a LAN hostname encodes, or null if the host is
48
+ // not one of ours. Used to build the hosts-file line the user needs, since these names resolve
49
+ // nowhere until they add it.
50
+ export function lanAddress(host) {
51
+ const trimmed = host.trim().toLowerCase();
52
+ const suffix = `.${LAN_DOMAIN}`;
53
+ if (!trimmed.endsWith(suffix)) {
54
+ return null;
55
+ }
56
+ const label = trimmed.slice(0, -suffix.length);
57
+ const address = label.split('-').join('.');
58
+ return isIpv4(address) ? address : null;
59
+ }
package/dist/mmpd.d.ts ADDED
@@ -0,0 +1,53 @@
1
+ export interface MmpdPdoEntry {
2
+ index: number;
3
+ subindex: number;
4
+ isOutput: boolean;
5
+ dataType: number;
6
+ bitLength: number;
7
+ bitOffset: number;
8
+ name: string;
9
+ }
10
+ export interface MmpdDevice {
11
+ slavePosition: number;
12
+ vendorId: number;
13
+ productCode: number;
14
+ revisionNumber: number;
15
+ serialNumber: number;
16
+ name: string;
17
+ entries: MmpdPdoEntry[];
18
+ }
19
+ export interface MmpdHeader {
20
+ formatVersion: number;
21
+ flags: number;
22
+ startSequence: bigint;
23
+ rowCount: number;
24
+ inputBytes: number;
25
+ outputBytes: number;
26
+ devices: MmpdDevice[];
27
+ }
28
+ export interface MmpdRow {
29
+ sequence: bigint;
30
+ timestampNs: bigint;
31
+ inputs: Uint8Array;
32
+ outputs: Uint8Array;
33
+ }
34
+ export declare class MmpdFile {
35
+ readonly header: MmpdHeader;
36
+ private readonly u8;
37
+ private readonly dv;
38
+ private readonly rowsStart;
39
+ constructor(header: MmpdHeader, u8: Uint8Array, dv: DataView, rowsStart: number);
40
+ get rowCount(): number;
41
+ get rowStride(): number;
42
+ rowAt(i: number): MmpdRow;
43
+ timestampsUs(): Float64Array;
44
+ decodeSeries(entry: MmpdPdoEntry): (number | null)[];
45
+ }
46
+ export declare function parseMmpd(data: ArrayBuffer | Uint8Array): MmpdFile;
47
+ export declare function fetchProcessDataDump(baseUrl: string, options?: {
48
+ fetch?: typeof fetch;
49
+ signal?: AbortSignal;
50
+ }): Promise<MmpdFile>;
51
+ export declare function extractBits(src: Uint8Array, bitOffset: number, bitLength: number): Uint8Array;
52
+ export declare function decodeMmpdValue(dataType: number, bytes: Uint8Array): number | bigint | string | null;
53
+ export declare function isPlottableDataType(dataType: number): boolean;