-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
43 lines (37 loc) · 1.56 KB
/
index.d.ts
File metadata and controls
43 lines (37 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* Checks if the script is running with elevated permissions.
* On Windows, this checks if the script is running with administrator privileges.
* On Linux, this checks if the script is running with sudo or as root.
* @returns {boolean} True if the script is running with elevated permissions, false otherwise.
*/
export function check(): boolean;
/**
* Requires the script to run with elevated permissions.
* Throws an error with a platform-specific message if the script is not running with elevated permissions.
* @throws {Error} If the script is not running with elevated permissions.
*/
export function required(): void;
/**
* Custom error message to be thrown when the script is not running with elevated permissions.
*/
export let message: string;
declare const elevated: {
/**
* Checks if the script is running with elevated permissions.
* On Windows, this checks if the script is running with administrator privileges.
* On Linux, this checks if the script is running with sudo or as root.
* @returns {boolean} True if the script is running with elevated permissions, false otherwise.
*/
check: typeof check;
/**
* Requires the script to run with elevated permissions.
* Throws an error with a platform-specific message if the script is not running with elevated permissions.
* @throws {Error} If the script is not running with elevated permissions.
*/
required: typeof required;
/**
* Custom error message to be thrown when the script is not running with elevated permissions.
*/
message: string;
};
export default elevated;