@spresto/monitordog-rust 1.1.14 → 1.1.15

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 (3) hide show
  1. package/index.d.ts +55 -18
  2. package/index.js +3 -1
  3. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -1,23 +1,5 @@
1
1
  /* auto-generated by NAPI-RS */
2
2
  /* eslint-disable */
3
- export declare class MdKeyboardManager {
4
- constructor()
5
- /** Start blocking screenshot-related keyboard shortcuts */
6
- startBlocking(): void
7
- /** Stop blocking screenshot-related keyboard shortcuts */
8
- stopBlocking(): void
9
- /** Check if keyboard shortcuts are currently being blocked */
10
- get isBlocking(): boolean
11
- /** Add a custom hotkey to block */
12
- addHotkey(key: string, modifiers: Array<string>): void
13
- /** Remove a custom hotkey */
14
- removeHotkey(key: string, modifiers: Array<string>): void
15
- /** Clear all custom hotkeys */
16
- clearCustomHotkeys(): void
17
- /** Destroy the keyboard manager: stop the event loop, clear all custom hotkeys and reset state. */
18
- destroy(): void
19
- }
20
-
21
3
  export declare class MdPolicyManager {
22
4
  constructor()
23
5
  /** Check if the Snipping Tool policy is currently enabled (blocked) */
@@ -64,6 +46,30 @@ export declare class MdSystemMonitor {
64
46
  destroy(): void
65
47
  }
66
48
 
49
+ /** Main screenshot blocker class */
50
+ export declare class ScreenshotBlocker {
51
+ constructor()
52
+ /** Start blocking screenshot keystrokes */
53
+ startBlocking(config?: ScreenshotBlockerConfig | undefined | null): void
54
+ /** Stop blocking screenshot keystrokes */
55
+ stopBlocking(): void
56
+ /** Check if screenshot blocking is currently active */
57
+ isActive(): boolean
58
+ /** Enable or disable blocking without removing the hook */
59
+ setEnabled(enabled: boolean): void
60
+ /** Update the blocking configuration */
61
+ updateConfig(config: ScreenshotBlockerConfig): void
62
+ /** Get the current configuration */
63
+ getConfig(): ScreenshotBlockerConfig
64
+ /** Get current system information */
65
+ getSystemInfo(): SystemInfo
66
+ /** Check if the current process has necessary privileges */
67
+ checkPrivileges(): boolean
68
+ }
69
+
70
+ /** Global cleanup function */
71
+ export declare function cleanupScreenshotBlocker(): void
72
+
67
73
  export interface MemoryInfo {
68
74
  free: number
69
75
  available: number
@@ -73,3 +79,34 @@ export interface ProcessInfo {
73
79
  pid: number
74
80
  name: string
75
81
  }
82
+
83
+ /** Configuration for screenshot blocking behavior */
84
+ export interface ScreenshotBlockerConfig {
85
+ /** Block Print Screen key alone */
86
+ blockPrintScreen: boolean
87
+ /** Block Alt + Print Screen (window screenshot) */
88
+ blockAltPrintScreen: boolean
89
+ /** Block Windows + Print Screen (save to file) */
90
+ blockWinPrintScreen: boolean
91
+ /** Block Windows + Shift + S (Snipping Tool) */
92
+ blockSnippingTool: boolean
93
+ /** Block Windows + H (can trigger screenshot in some contexts) */
94
+ blockWinH: boolean
95
+ }
96
+
97
+ /** Error types for screenshot blocking operations */
98
+ export declare const enum ScreenshotBlockerError {
99
+ HookInstallFailed = 0,
100
+ HookRemoveFailed = 1,
101
+ AlreadyActive = 2,
102
+ NotActive = 3,
103
+ InsufficientPrivileges = 4,
104
+ ConfigError = 5,
105
+ }
106
+
107
+ /** System information structure */
108
+ export interface SystemInfo {
109
+ threadId: number
110
+ hasPrivileges: boolean
111
+ windowsVersion: string
112
+ }
package/index.js CHANGED
@@ -393,6 +393,8 @@ if (!nativeBinding) {
393
393
  }
394
394
 
395
395
  module.exports = nativeBinding
396
- module.exports.MdKeyboardManager = nativeBinding.MdKeyboardManager
397
396
  module.exports.MdPolicyManager = nativeBinding.MdPolicyManager
398
397
  module.exports.MdSystemMonitor = nativeBinding.MdSystemMonitor
398
+ module.exports.ScreenshotBlocker = nativeBinding.ScreenshotBlocker
399
+ module.exports.cleanupScreenshotBlocker = nativeBinding.cleanupScreenshotBlocker
400
+ module.exports.ScreenshotBlockerError = nativeBinding.ScreenshotBlockerError
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spresto/monitordog-rust",
3
- "version": "1.1.14",
3
+ "version": "1.1.15",
4
4
  "description": "Rust Library for MonitorDog",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -99,6 +99,6 @@
99
99
  },
100
100
  "packageManager": "yarn@4.9.2",
101
101
  "optionalDependencies": {
102
- "@spresto/monitordog-rust-win32-x64-msvc": "1.1.14"
102
+ "@spresto/monitordog-rust-win32-x64-msvc": "1.1.15"
103
103
  }
104
104
  }