stratum-rs-overlay 3.0.1 → 4.1.0-beta.0

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/README.md CHANGED
@@ -93,13 +93,14 @@ app.whenReady().then(() => {
93
93
  // eventType: focus | move | blur
94
94
  // x, y, width, height, targetName
95
95
  console.log('[STRATUM-RS]', event);
96
- },
97
- {
98
- cursorPollIntervalMs: 100,
99
- cursorEmitIntervalMs: 100,
100
- idlePollIntervalMs: 100,
101
96
  }
102
97
  );
98
+
99
+ stratumOverlay.startMouseTracking(undefined, {
100
+ cursorPollIntervalMs: 100,
101
+ cursorEmitIntervalMs: 100,
102
+ idlePollIntervalMs: 100,
103
+ });
103
104
  });
104
105
  ```
105
106
 
@@ -107,7 +108,9 @@ app.whenReady().then(() => {
107
108
  - `init(licenseKeyHex: string): boolean`
108
109
  - `setOverlayPid(pid: number): void`
109
110
  - `setOverlayHwnd(hwnd: number): void`
110
- - `startTracking(targets, callback, options): void`
111
+ - `startTracking(targets, callback): void`
112
+ - `startMouseTracking(targetName?, options?): boolean`
113
+ - `stopMouseTracking(): boolean`
111
114
  - `focusLastTarget(): boolean`
112
115
  - `stopTracking(): boolean`
113
116
 
package/dist/index.d.ts CHANGED
@@ -12,18 +12,39 @@ export interface TargetConfig {
12
12
  mode: Mode
13
13
  }
14
14
  export interface OverlayEvent {
15
+ /** "focus" | "move" | "blur" | "cursor" | "cursor-leave" | "error" */
15
16
  eventType: string
17
+ /** 매칭된 대상 이름. "error" 이벤트에서는 실패 사유 */
16
18
  targetName: string
19
+ /** DWMWA_EXTENDED_FRAME_BOUNDS 기준 창 좌표 (타이틀바/테두리 포함). cursor 이벤트에서는 창 기준 커서 좌표 */
17
20
  x: number
18
21
  y: number
19
22
  width: number
20
23
  height: number
24
+ /** 대상 창의 프로세스 ID (focus/move/cursor, 그 외 0) */
25
+ pid: number
26
+ /** 대상 창 핸들 (focus/move/cursor, 그 외 0) */
27
+ hwnd: number
28
+ /**
29
+ * 클라이언트 영역 화면 좌표 (GetClientRect + ClientToScreen, 타이틀바/테두리 제외).
30
+ * cursor 이벤트에서는 클라이언트 영역 기준 커서 좌표 (clientWidth/clientHeight = 0)
31
+ */
32
+ clientX: number
33
+ clientY: number
34
+ clientWidth: number
35
+ clientHeight: number
36
+ /** focus 이벤트에만 존재. SHQueryUserNotificationState == QUNS_RUNNING_D3D_FULL_SCREEN */
37
+ fullscreenExclusive?: boolean
21
38
  }
22
- export interface TrackingOptions {
39
+ export interface MouseTrackingOptions {
23
40
  cursorPollIntervalMs?: number
24
41
  cursorEmitIntervalMs?: number
25
42
  idlePollIntervalMs?: number
26
43
  }
44
+ export interface TrackingOptions {
45
+ /** 대상 창이 포그라운드를 잃은 뒤 blur 를 보내기 전 유예 시간(ms). 기본 0 = 즉시 blur */
46
+ blurGraceMs?: number
47
+ }
27
48
  /**
28
49
  * License Key Verification
29
50
  * @param License Key
@@ -35,13 +56,13 @@ export declare function setOverlayHwnd(hwnd: number): void
35
56
  export declare function focusLastTarget(): boolean
36
57
  export declare function areKeysPressed(vkCodes: Array<number>): boolean
37
58
  export declare function stopMouseTracking(): boolean
38
- export declare function startMouseTracking(targetName?: string | undefined | null): boolean
59
+ export declare function startMouseTracking(targetName?: string | undefined | null, options?: MouseTrackingOptions | undefined | null): boolean
39
60
  export declare function stopTracking(): boolean
40
61
  /**
41
62
  * Start Tracking
42
63
  * @param targets: Vec<TargetConfig>
43
64
  * @param callback: ThreadsafeFunction<OverlayEvent, ErrorStrategy::CalleeHandled>
44
- * @param options: TrackingOptions (optional)
45
- * @return Result<()>
65
+ * @param options: TrackingOptions (optional, blurGraceMs)
66
+ * @return Result<()> - 훅 등록 실패 시 Err
46
67
  */
47
68
  export declare function startTracking(targets: Array<TargetConfig>, callback: (err: Error | null, event?: OverlayEvent) => void, options?: TrackingOptions | undefined | null): void
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stratum-rs-overlay",
3
- "version": "3.0.1",
3
+ "version": "4.1.0-beta.0",
4
4
  "description": "A high-performance, non-intrusive game overlay library for Electron powered by Rust.",
5
5
  "os": [
6
6
  "win32"