@stacksjs/desktop 0.2.119 → 0.2.121

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.
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Subscribe and start polling in one call, returning a single teardown.
3
+ *
4
+ * The two halves are easy to leak apart — `onChange` without `watch` never
5
+ * fires, and `watch` without a matching `stop` keeps the timer alive across a
6
+ * page reload.
7
+ */
8
+ export declare function watchScreenSharing(cb: (state: ScreenSharingState) => void, intervalMs?: number): Promise<() => void>;
9
+ /** Interval bounds enforced natively; mirrored here so callers get the same clamp. */
10
+ export declare const MIN_WATCH_INTERVAL_MS: 250;
11
+ export declare const MAX_WATCH_INTERVAL_MS: unknown;
12
+ export declare const DEFAULT_WATCH_INTERVAL_MS: 2000;
13
+ export declare const screenSharing: ScreenSharingAPI;
14
+ export declare interface ScreenSharingSource {
15
+ app: string
16
+ window: string
17
+ kind: ScreenSharingKind
18
+ }
19
+ export declare interface ScreenSharingSignals {
20
+ systemScreenShare: boolean
21
+ remoteSession: boolean
22
+ conferenceSharing: boolean
23
+ screenRecording: boolean
24
+ }
25
+ export declare interface ScreenSharingState {
26
+ sharing: boolean
27
+ signals: ScreenSharingSignals
28
+ sources: ScreenSharingSource[]
29
+ }
30
+ export declare interface ScreenSharingAPI {
31
+ getState: () => Promise<ScreenSharingState>
32
+ watch: (intervalMs?: number) => Promise<number>
33
+ stop: () => Promise<void>
34
+ onChange: (cb: (state: ScreenSharingState) => void) => () => void
35
+ }
36
+ /** Which signal produced a detection. */
37
+ export type ScreenSharingKind = 'system' | 'remote' | 'conference' | 'recording';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/desktop",
3
3
  "type": "module",
4
- "version": "0.2.119",
4
+ "version": "0.2.121",
5
5
  "description": "Native desktop application framework for stx (powered by Craft)",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -28,6 +28,10 @@
28
28
  "types": "./dist/index.d.ts",
29
29
  "import": "./dist/index.js"
30
30
  },
31
+ "./browser": {
32
+ "types": "./dist/browser.d.ts",
33
+ "import": "./dist/browser.js"
34
+ },
31
35
  "./test-utils": {
32
36
  "types": "./dist/test-utils.d.ts",
33
37
  "import": "./dist/test-utils.js"
@@ -55,6 +59,6 @@
55
59
  "typecheck": "bun tsc --noEmit"
56
60
  },
57
61
  "dependencies": {
58
- "craft-native": ">=0.0.51"
62
+ "craft-native": ">=0.0.55"
59
63
  }
60
64
  }