@jetcrab/pi-desk-sdk 1.1.14 → 1.1.16-dev
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/browser.d.ts +18 -0
- package/package.json +1 -1
package/dist/browser.d.ts
CHANGED
|
@@ -161,8 +161,26 @@ export interface BrowserPluginGlobalStateHost {
|
|
|
161
161
|
getSnapshot(): PluginJsonObject | null;
|
|
162
162
|
subscribe(listener: () => void): PluginDisposer;
|
|
163
163
|
}
|
|
164
|
+
export interface BrowserTunnelSnapshot {
|
|
165
|
+
readonly status: 'connecting' | 'ready' | 'recovering' | 'failed' | 'closed';
|
|
166
|
+
readonly localPort: number | null;
|
|
167
|
+
readonly path: 'direct' | 'relay' | 'unknown' | null;
|
|
168
|
+
readonly error: string | null;
|
|
169
|
+
}
|
|
170
|
+
export interface BrowserTunnelHandle {
|
|
171
|
+
getSnapshot(): BrowserTunnelSnapshot;
|
|
172
|
+
subscribe(listener: () => void): PluginDisposer;
|
|
173
|
+
close(): Promise<void>;
|
|
174
|
+
}
|
|
175
|
+
export interface BrowserTunnelHost {
|
|
176
|
+
open(input: {
|
|
177
|
+
remotePort: number;
|
|
178
|
+
}): BrowserTunnelHandle;
|
|
179
|
+
}
|
|
164
180
|
export interface BrowserPluginHost {
|
|
165
181
|
readonly settings: HostSettings;
|
|
182
|
+
/** 映射当前工作台后端的已发布 TCP 端口;旧宿主或无原生能力时不可用。 */
|
|
183
|
+
readonly tunnels?: BrowserTunnelHost;
|
|
166
184
|
notify(input: BrowserNotificationInput): void;
|
|
167
185
|
readonly globalState: BrowserPluginGlobalStateHost;
|
|
168
186
|
readonly piDesk: PiDeskBrowserChannel;
|
package/package.json
CHANGED