@companion-module/host 0.1.0-0 → 0.1.0-1-nightly-feat-2-0-20260118-163706-cd65d67

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 (51) hide show
  1. package/dist/context.d.ts +3 -13
  2. package/dist/context.d.ts.map +1 -1
  3. package/dist/instance.d.ts +2 -1
  4. package/dist/instance.d.ts.map +1 -1
  5. package/dist/instance.js +8 -26
  6. package/dist/instance.js.map +1 -1
  7. package/dist/internal/actions.d.ts +2 -2
  8. package/dist/internal/actions.d.ts.map +1 -1
  9. package/dist/internal/actions.js +7 -35
  10. package/dist/internal/actions.js.map +1 -1
  11. package/dist/internal/feedback.d.ts +2 -3
  12. package/dist/internal/feedback.d.ts.map +1 -1
  13. package/dist/internal/feedback.js +15 -45
  14. package/dist/internal/feedback.js.map +1 -1
  15. package/package.json +5 -4
  16. package/dist/__tests__/ipc-wrapper.spec.d.ts +0 -2
  17. package/dist/__tests__/ipc-wrapper.spec.d.ts.map +0 -1
  18. package/dist/__tests__/ipc-wrapper.spec.js +0 -272
  19. package/dist/__tests__/ipc-wrapper.spec.js.map +0 -1
  20. package/dist/api.d.ts +0 -360
  21. package/dist/api.d.ts.map +0 -1
  22. package/dist/api.js +0 -8
  23. package/dist/api.js.map +0 -1
  24. package/dist/internal/__tests__/feedback.spec.d.ts +0 -2
  25. package/dist/internal/__tests__/feedback.spec.d.ts.map +0 -1
  26. package/dist/internal/__tests__/feedback.spec.js +0 -686
  27. package/dist/internal/__tests__/feedback.spec.js.map +0 -1
  28. package/dist/internal/__tests__/serializeIsVisibleFn.spec.d.ts +0 -2
  29. package/dist/internal/__tests__/serializeIsVisibleFn.spec.d.ts.map +0 -1
  30. package/dist/internal/__tests__/serializeIsVisibleFn.spec.js +0 -119
  31. package/dist/internal/__tests__/serializeIsVisibleFn.spec.js.map +0 -1
  32. package/dist/internal/__tests__/upgrade.spec.d.ts +0 -2
  33. package/dist/internal/__tests__/upgrade.spec.d.ts.map +0 -1
  34. package/dist/internal/__tests__/upgrade.spec.js +0 -280
  35. package/dist/internal/__tests__/upgrade.spec.js.map +0 -1
  36. package/dist/internal/base.d.ts +0 -4
  37. package/dist/internal/base.d.ts.map +0 -1
  38. package/dist/internal/base.js +0 -31
  39. package/dist/internal/base.js.map +0 -1
  40. package/dist/ipc-wrapper.d.ts +0 -37
  41. package/dist/ipc-wrapper.d.ts.map +0 -1
  42. package/dist/ipc-wrapper.js +0 -123
  43. package/dist/ipc-wrapper.js.map +0 -1
  44. package/dist/plugin.d.ts +0 -25
  45. package/dist/plugin.d.ts.map +0 -1
  46. package/dist/plugin.js +0 -301
  47. package/dist/plugin.js.map +0 -1
  48. package/dist/versions.d.ts +0 -10
  49. package/dist/versions.d.ts.map +0 -1
  50. package/dist/versions.js +0 -2
  51. package/dist/versions.js.map +0 -1
@@ -1,123 +0,0 @@
1
- import { assertNever } from '@companion-module/base';
2
- import ejson from 'ejson';
3
- const MAX_CALLBACK_ID = 1 << 28;
4
- export class IpcWrapper {
5
- #handlers;
6
- #sendMessage;
7
- #defaultTimeout;
8
- #nextCallbackId = 1;
9
- #pendingCallbacks = new Map();
10
- constructor(handlers, sendMessage, defaultTimeout) {
11
- this.#handlers = handlers;
12
- this.#sendMessage = sendMessage;
13
- this.#defaultTimeout = defaultTimeout;
14
- }
15
- async sendWithCb(name, msg, defaultResponse, timeout = 0) {
16
- if (timeout <= 0)
17
- timeout = this.#defaultTimeout;
18
- const callbacks = { timeout: undefined, resolve: () => null, reject: () => null };
19
- const promise = new Promise((resolve, reject) => {
20
- callbacks.resolve = resolve;
21
- callbacks.reject = reject;
22
- });
23
- // Reset the id when it gets really high
24
- if (this.#nextCallbackId > MAX_CALLBACK_ID)
25
- this.#nextCallbackId = 1;
26
- const id = this.#nextCallbackId++;
27
- this.#pendingCallbacks.set(id, callbacks);
28
- this.#sendMessage({
29
- direction: 'call',
30
- name: String(name),
31
- payload: ejson.stringify(msg),
32
- callbackId: id,
33
- });
34
- // Setup a timeout, creating the error in the call, so that the stack trace is useful
35
- const timeoutError = new Error('Call timed out');
36
- callbacks.timeout = setTimeout(() => {
37
- callbacks.reject(defaultResponse ? defaultResponse() : timeoutError);
38
- this.#pendingCallbacks.delete(id);
39
- }, timeout);
40
- return promise;
41
- }
42
- sendWithNoCb(name, msg) {
43
- this.#sendMessage({
44
- direction: 'call',
45
- name: String(name),
46
- payload: ejson.stringify(msg),
47
- callbackId: undefined,
48
- });
49
- }
50
- receivedMessage(msg) {
51
- const rawMsg = msg;
52
- switch (msg.direction) {
53
- case 'call': {
54
- const handler = this.#handlers[msg.name];
55
- if (!handler) {
56
- if (msg.callbackId) {
57
- this.#sendMessage({
58
- direction: 'response',
59
- callbackId: msg.callbackId,
60
- success: false,
61
- payload: ejson.stringify({ message: `Unknown command "${msg.name}"` }),
62
- });
63
- }
64
- return;
65
- }
66
- // TODO - should anything be logged here?
67
- const data = msg.payload ? ejson.parse(msg.payload) : undefined;
68
- handler(data).then((res) => {
69
- if (msg.callbackId) {
70
- this.#sendMessage({
71
- direction: 'response',
72
- callbackId: msg.callbackId,
73
- success: true,
74
- payload: ejson.stringify(res),
75
- });
76
- }
77
- }, (err) => {
78
- if (msg.callbackId) {
79
- this.#sendMessage({
80
- direction: 'response',
81
- callbackId: msg.callbackId,
82
- success: false,
83
- payload: err instanceof Error ? JSON.stringify(err, Object.getOwnPropertyNames(err)) : ejson.stringify(err),
84
- });
85
- }
86
- });
87
- break;
88
- }
89
- case 'response': {
90
- if (!msg.callbackId) {
91
- console.error(`Ipc: Response message has no callbackId`);
92
- return;
93
- }
94
- const callbacks = this.#pendingCallbacks.get(msg.callbackId);
95
- this.#pendingCallbacks.delete(msg.callbackId);
96
- if (!callbacks) {
97
- // Likely timed out, we should ignore
98
- return;
99
- }
100
- clearTimeout(callbacks.timeout);
101
- const data = msg.payload ? ejson.parse(msg.payload) : undefined;
102
- if (msg.success) {
103
- callbacks.resolve(data);
104
- }
105
- else {
106
- let err = data;
107
- if (data && typeof data === 'object' && 'message' in data) {
108
- err = new Error(data.message);
109
- if (data.stack)
110
- err.stack = data.stack;
111
- }
112
- callbacks.reject(err);
113
- }
114
- break;
115
- }
116
- default:
117
- assertNever(msg);
118
- console.error(`Ipc: Message of unknown direction "${rawMsg.direction}"`);
119
- break;
120
- }
121
- }
122
- }
123
- //# sourceMappingURL=ipc-wrapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ipc-wrapper.js","sourceRoot":"","sources":["../src/ipc-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,CAAA;AAuC/B,MAAM,OAAO,UAAU;IACtB,SAAS,CAA4B;IACrC,YAAY,CAAoE;IAChF,eAAe,CAAQ;IAEvB,eAAe,GAAG,CAAC,CAAA;IACnB,iBAAiB,GAAG,IAAI,GAAG,EAA2B,CAAA;IAEtD,YACC,QAAoC,EACpC,WAA+E,EAC/E,cAAsB;QAEtB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;QACzB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAA;QAC/B,IAAI,CAAC,eAAe,GAAG,cAAc,CAAA;IACtC,CAAC;IAED,KAAK,CAAC,UAAU,CACf,IAAO,EACP,GAA2C,EAC3C,eAA6B,EAC7B,OAAO,GAAG,CAAC;QAEX,IAAI,OAAO,IAAI,CAAC;YAAE,OAAO,GAAG,IAAI,CAAC,eAAe,CAAA;QAEhD,MAAM,SAAS,GAAoB,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAA;QAClG,MAAM,OAAO,GAAG,IAAI,OAAO,CAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACzE,SAAS,CAAC,OAAO,GAA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;gBACtB,CAAC;gBAED,MAAK;YACN,CAAC;YACD;gBACC,WAAW,CAAC,GAAG,CAAC,CAAA;gBAChB,OAAO,CAAC,KAAK,CAAC,sCAAsC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAA;gBACxE,MAAK;QACP,CAAC;IACF,CAAC;CACD"}
package/dist/plugin.d.ts DELETED
@@ -1,25 +0,0 @@
1
- import { type RemoteSurfaceConnectionInfo, type HIDDevice, type SurfaceDrawProps, type SurfacePlugin } from '@companion-surface/base';
2
- import type { SurfaceHostContext } from './context.js';
3
- import type { PluginFeatures, CheckDeviceResult, OpenDeviceResult } from './types.js';
4
- export declare class PluginWrapper<TInfo = unknown> {
5
- #private;
6
- constructor(host: SurfaceHostContext, plugin: SurfacePlugin<TInfo>);
7
- getPluginFeatures(): PluginFeatures;
8
- init(): Promise<void>;
9
- destroy(): Promise<void>;
10
- checkHidDevice(hidDevice: HIDDevice): Promise<CheckDeviceResult | null>;
11
- openHidDevice(hidDevice: HIDDevice): Promise<OpenDeviceResult | null>;
12
- scanForDevices(): Promise<CheckDeviceResult[]>;
13
- openScannedDevice(device: CheckDeviceResult): Promise<OpenDeviceResult | null>;
14
- setBrightness(surfaceId: string, brightness: number): Promise<void>;
15
- blankSurface(surfaceId: string): Promise<void>;
16
- updateConfig(surfaceId: string, config: Record<string, any>): Promise<void>;
17
- readySurface(surfaceId: string, config: Record<string, any>): Promise<void>;
18
- draw(surfaceId: string, drawProps: SurfaceDrawProps[]): Promise<void>;
19
- onVariableValue(surfaceId: string, name: string, value: any): Promise<void>;
20
- showLockedStatus(surfaceId: string, locked: boolean, characterCount: number): Promise<void>;
21
- showStatus(surfaceId: string, hostname: string, status: string): Promise<void>;
22
- setupRemoteConnections(connectionInfos: RemoteSurfaceConnectionInfo[]): Promise<void>;
23
- stopRemoteConnections(connectionIds: string[]): Promise<void>;
24
- }
25
- //# sourceMappingURL=plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.ts","source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AC;IAO3E,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAcrE,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAO3E,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO3F,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO9E,sBAAsB,CAAC,eAAe,EAAE,2BAA2B,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAUrF,qBAAqB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAUnE"}
package/dist/plugin.js DELETED
@@ -1,301 +0,0 @@
1
- import { SurfaceProxy, SurfaceProxyContext } from './surfaceProxy.js';
2
- import { createModuleLogger, } from '@companion-surface/base';
3
- import { FirmwareUpdateCheck } from './firmwareUpdateCheck.js';
4
- export class PluginWrapper {
5
- #logger = createModuleLogger('PluginWrapper');
6
- #host;
7
- #plugin;
8
- #firmwareUpdateCheck;
9
- #openSurfaces = new Map(); // Null means opening in progress
10
- constructor(host, plugin) {
11
- this.#host = host;
12
- this.#plugin = plugin;
13
- this.#firmwareUpdateCheck = new FirmwareUpdateCheck(this.#openSurfaces, (surfaceId, updateInfo) => {
14
- this.#host.surfaceEvents.firmwareUpdateInfo(surfaceId, updateInfo);
15
- });
16
- }
17
- getPluginFeatures() {
18
- return {
19
- supportsDetection: !!this.#plugin.detection,
20
- supportsHid: typeof this.#plugin.checkSupportsHidDevice === 'function',
21
- supportsScan: typeof this.#plugin.scanForSurfaces === 'function',
22
- supportsOutbound: this.#plugin.remote
23
- ? {
24
- configFields: this.#plugin.remote.configFields,
25
- configMatchesExpression: this.#plugin.remote.checkConfigMatchesExpression,
26
- }
27
- : undefined,
28
- };
29
- }
30
- async init() {
31
- if (this.#plugin.detection) {
32
- this.#logger.info('Initializing for surface detection');
33
- const rejectFn = this.#plugin.detection.rejectSurface.bind(this.#plugin.detection);
34
- // // Setup detection events
35
- // this.#plugin.detection.on('surfacesRemoved', (surfaceIds) => {
36
- // for (const surfaceId of surfaceIds) {
37
- // this.#cleanupSurfaceById(surfaceId)
38
- // }
39
- // })
40
- this.#plugin.detection.on('surfacesAdded', (surfaceInfos) => {
41
- for (const info of surfaceInfos) {
42
- this.#offerOpenDevice(info, 'detection', rejectFn).catch((e) => {
43
- this.#logger.error(`Error opening discovered device: ${e}`);
44
- });
45
- }
46
- });
47
- }
48
- if (this.#plugin.remote) {
49
- this.#logger.info('Initializing for outbound connections');
50
- const rejectFn = this.#plugin.remote.rejectSurface.bind(this.#plugin.remote);
51
- this.#plugin.remote.on('surfacesConnected', (surfaceInfos) => {
52
- for (const info of surfaceInfos) {
53
- this.#offerOpenDevice(info, 'outbound', rejectFn).catch((e) => {
54
- this.#logger.error(`Error opening discovered device: ${e}`);
55
- });
56
- }
57
- });
58
- this.#plugin.remote.on('connectionsFound', (connectionInfos) => {
59
- this.#host.connectionsFound(connectionInfos);
60
- });
61
- this.#plugin.remote.on('connectionsForgotten', (connectionIds) => {
62
- this.#host.connectionsForgotten(connectionIds);
63
- });
64
- }
65
- this.#logger.info('Initializing plugin');
66
- await this.#plugin.init();
67
- this.#firmwareUpdateCheck.init();
68
- }
69
- async destroy() {
70
- this.#firmwareUpdateCheck.destoy();
71
- // Close all open surfaces
72
- await Promise.allSettled(Array.from(this.#openSurfaces.values()).map(async (surface) => surface?.close().catch((e) => {
73
- this.#logger.error(`Error closing surface: ${e}`);
74
- })));
75
- this.#openSurfaces.clear();
76
- // Then destroy the plugin
77
- await this.#plugin.destroy();
78
- }
79
- async checkHidDevice(hidDevice) {
80
- // Disable when detection is enabled
81
- if (this.#plugin.detection)
82
- return null;
83
- // Refuse if we don't support this
84
- if (!this.#plugin.checkSupportsHidDevice)
85
- return null;
86
- // Check if hid device is supported
87
- const info = this.#plugin.checkSupportsHidDevice(hidDevice);
88
- if (!info)
89
- return null;
90
- // Report back the basic info
91
- return {
92
- surfaceId: info.surfaceId,
93
- description: info.description,
94
- };
95
- }
96
- async openHidDevice(hidDevice) {
97
- // Disable when detection is enabled
98
- if (this.#plugin.detection)
99
- return null;
100
- // Refuse if we don't support this
101
- if (!this.#plugin.checkSupportsHidDevice)
102
- return null;
103
- // Check if hid device is supported
104
- const info = this.#plugin.checkSupportsHidDevice(hidDevice);
105
- if (!info)
106
- return null;
107
- return this.#openDeviceInner(info);
108
- }
109
- async #offerOpenDevice(info, mode, rejectFn) {
110
- if (this.#openSurfaces.has(info.surfaceId)) {
111
- // Already open, assume faulty detection logic
112
- return;
113
- }
114
- // Ask host if we should open this
115
- const shouldOpen = await this.#host.shouldOpenDiscoveredSurface({
116
- surfaceId: info.surfaceId,
117
- description: info.description,
118
- });
119
- this.#logger.info(`Discovered ${mode} surface: ${info.surfaceId}, ${info.description} (shouldOpen=${shouldOpen})`);
120
- if (!shouldOpen) {
121
- // Reject the surface
122
- rejectFn(info);
123
- return;
124
- }
125
- // All clear, open it
126
- const openInfo = await this.#openDeviceInner(info);
127
- if (!openInfo)
128
- return;
129
- this.#logger.info(`Opened discovered ${mode} surface: ${openInfo.surfaceId}`);
130
- // Report back to host
131
- this.#host.notifyOpenedDiscoveredSurface(openInfo).catch((e) => {
132
- rejectFn(info);
133
- this.#logger.error(`Error reporting opened discovered ${mode} surface: ${e}`);
134
- });
135
- }
136
- async #openDeviceInner(info) {
137
- if (this.#openSurfaces.has(info.surfaceId)) {
138
- throw new Error(`Surface with id ${info.surfaceId} is already opened`);
139
- }
140
- this.#openSurfaces.set(info.surfaceId, null); // Mark as opening
141
- const surfaceContext = new SurfaceProxyContext(this.#host, info.surfaceId, (err) => {
142
- this.#logger.error(`Surface error: ${err}`);
143
- this.#cleanupSurfaceById(info.surfaceId);
144
- });
145
- // Open the surface
146
- let surface;
147
- try {
148
- surface = await this.#plugin.openSurface(info.surfaceId, info.pluginInfo, surfaceContext);
149
- await surface.surface.init();
150
- }
151
- catch (e) {
152
- // Remove from list as it has failed
153
- this.#openSurfaces.delete(info.surfaceId);
154
- // Ensure surface is closed
155
- if (surface)
156
- surface.surface?.close().catch(() => { }); // Ignore errors here
157
- throw e;
158
- }
159
- // Wrap the surface
160
- const wrapped = new SurfaceProxy(this.#host, surfaceContext, surface.surface, surface.registerProps);
161
- this.#openSurfaces.set(info.surfaceId, wrapped);
162
- // Trigger a firmware update check
163
- this.#firmwareUpdateCheck.triggerCheckSurfaceForUpdates(wrapped);
164
- // The surface is now open, report back
165
- return {
166
- surfaceId: info.surfaceId,
167
- description: info.description,
168
- supportsBrightness: surface.registerProps.brightness,
169
- surfaceLayout: surface.registerProps.surfaceLayout,
170
- transferVariables: surface.registerProps.transferVariables ?? null,
171
- location: surface.registerProps.location ?? null,
172
- configFields: structuredClone(surface.registerProps.configFields) ?? null,
173
- };
174
- }
175
- #lastScannedDevices = [];
176
- async scanForDevices() {
177
- // Perform a trigger when detection is enabled
178
- if (this.#plugin.detection) {
179
- this.#logger.info('Triggering detection scan');
180
- await this.#plugin.detection.triggerScan();
181
- // Return empty, as the detection will trigger its own events
182
- return [];
183
- }
184
- if (!this.#plugin.scanForSurfaces)
185
- return [];
186
- this.#logger.info('Triggering surface scan');
187
- const results = await this.#plugin.scanForSurfaces();
188
- // Cache these for when one is opened
189
- this.#lastScannedDevices = results;
190
- return results.map((r) => ({
191
- surfaceId: r.surfaceId,
192
- description: r.description,
193
- }));
194
- }
195
- async openScannedDevice(device) {
196
- // Disable when detection is enabled
197
- if (this.#plugin.detection)
198
- return null;
199
- const cachedInfo = this.#lastScannedDevices.find((d) => d.surfaceId === device.surfaceId);
200
- // Not found, return null
201
- if (!cachedInfo) {
202
- this.#logger.warn(`Failed to find cached surface info for scanned device ${device.surfaceId}`);
203
- return null;
204
- }
205
- this.#logger.info(`Opening scanned device ${device.surfaceId}`);
206
- return this.#openDeviceInner(cachedInfo);
207
- }
208
- #cleanupSurfaceById(surfaceId) {
209
- const surface = this.#openSurfaces.get(surfaceId);
210
- if (!surface)
211
- return;
212
- try {
213
- // cleanup
214
- this.#openSurfaces.delete(surfaceId);
215
- this.#host.surfaceEvents.disconnected(surfaceId);
216
- surface.close().catch(() => {
217
- // Ignore
218
- });
219
- }
220
- catch (_e) {
221
- // Ignore
222
- }
223
- }
224
- async setBrightness(surfaceId, brightness) {
225
- const surface = this.#openSurfaces.get(surfaceId);
226
- if (!surface)
227
- throw new Error(`Surface with id ${surfaceId} is not opened`);
228
- // Check if brightness is supported
229
- if (!surface.registerProps.brightness)
230
- return;
231
- await surface.setBrightness(brightness);
232
- }
233
- async blankSurface(surfaceId) {
234
- const surface = this.#openSurfaces.get(surfaceId);
235
- if (!surface)
236
- throw new Error(`Surface with id ${surfaceId} is not opened`);
237
- surface.blankSurface();
238
- }
239
- async updateConfig(surfaceId, config) {
240
- const surface = this.#openSurfaces.get(surfaceId);
241
- if (!surface)
242
- throw new Error(`Surface with id ${surfaceId} is not opened`);
243
- await surface.updateConfig(config);
244
- }
245
- async readySurface(surfaceId, config) {
246
- const surface = this.#openSurfaces.get(surfaceId);
247
- if (!surface)
248
- throw new Error(`Surface with id ${surfaceId} is not opened`);
249
- await surface.readySurface(config);
250
- }
251
- async draw(surfaceId, drawProps) {
252
- const surface = this.#openSurfaces.get(surfaceId);
253
- if (!surface)
254
- throw new Error(`Surface with id ${surfaceId} is not opened`);
255
- // TODO - error handling
256
- for (const props of drawProps) {
257
- const control = surface.registerProps.surfaceLayout.controls[props.controlId];
258
- if (!control)
259
- throw new Error(`Control "${props.controlId}" does not exist on surface ${surfaceId}`);
260
- await surface.draw(props);
261
- }
262
- }
263
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
264
- async onVariableValue(surfaceId, name, value) {
265
- const surface = this.#openSurfaces.get(surfaceId);
266
- if (!surface)
267
- throw new Error(`Surface with id ${surfaceId} is not opened`);
268
- surface.onVariableValue(name, value);
269
- }
270
- async showLockedStatus(surfaceId, locked, characterCount) {
271
- const surface = this.#openSurfaces.get(surfaceId);
272
- if (!surface)
273
- throw new Error(`Surface with id ${surfaceId} is not opened`);
274
- surface.showLockedStatus(locked, characterCount);
275
- }
276
- async showStatus(surfaceId, hostname, status) {
277
- const surface = this.#openSurfaces.get(surfaceId);
278
- if (!surface)
279
- throw new Error(`Surface with id ${surfaceId} is not opened`);
280
- surface.showStatus(hostname, status);
281
- }
282
- async setupRemoteConnections(connectionInfos) {
283
- if (!this.#plugin.remote)
284
- throw new Error('Plugin does not support outbound connections');
285
- this.#logger.info(`Setting up ${connectionInfos.length} remote connections:`);
286
- for (const connectionInfo of connectionInfos) {
287
- this.#logger.info(` - ${connectionInfo.connectionId} (${JSON.stringify(connectionInfo.config)})`);
288
- }
289
- await this.#plugin.remote.startConnections(connectionInfos);
290
- }
291
- async stopRemoteConnections(connectionIds) {
292
- if (!this.#plugin.remote)
293
- throw new Error('Plugin does not support outbound connections');
294
- this.#logger.info(`Stopping ${connectionIds.length} remote connections:`);
295
- for (const connectionId of connectionIds) {
296
- this.#logger.info(` - ${connectionId}`);
297
- }
298
- await this.#plugin.remote.stopConnections(connectionIds);
299
- }
300
- }
301
- //# sourceMappingURL=plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,EACN,kBAAkB,GAOlB,MAAM,yBAAyB,CAAA;AAGhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,MAAM,OAAO,aAAa;IAChB,OAAO,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAA;I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AC,gBAAgB,CAAC,eAAe,CAAC,CAAA;IAC5D,CAAC;IACD,KAAK,CAAC,qBAAqB,CAAC,aAAuB;QAClD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;QAEzF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,aAAa,CAAC,MAAM,sBAAsB,CAAC,CAAA;QACzE,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;YAC1C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,YAAY,EAAE,CAAC,CAAA;QACxC,CAAC;QAED,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,aAAa,CAAC,CAAA;IACzD,CAAC;CACD"}
@@ -1,10 +0,0 @@
1
- export declare const HostApiNodeJsIpc = "nodejs-ipc";
2
- export type ResultCallback<T> = (err: any, res: T) => void;
3
- export interface ModuleToHostEventsInit {
4
- register: (msg: ModuleRegisterMessage) => void;
5
- }
6
- export type HostToModuleEventsInit = Record<never, never>;
7
- export interface ModuleRegisterMessage {
8
- verificationToken: string;
9
- }
10
- //# sourceMappingURL=versions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../src/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,eAAe,CAAA;AAE5C,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK,IAAI,CAAA;AAE1D,MAAM,WAAW,sBAAsB;IACtC,QAAQ,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,IAAI,CAAA;CAC9C;AACD,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAEzD,MAAM,WAAW,qBAAqB;IACrC,iBAAiB,EAAE,MAAM,CAAA;CACzB"}
package/dist/versions.js DELETED
@@ -1,2 +0,0 @@
1
- export const HostApiNodeJsIpc = 'nodejs-ipc';
2
- //# sourceMappingURL=versions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"versions.js","sourceRoot":"","sources":["../src/versions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAAA"}