-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.d.ts
40 lines (33 loc) · 1.23 KB
/
index.d.ts
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
declare module 'windows-network-drive' {
interface DriveInfo
{
/** Status of the network drive. A falsy value might indicate connectivity issues */
status: boolean
/** Drive letter */
driveLetter: string
/** Path to the network drive */
path: string
/**
* Status string, describing the status of the network drive.
* This is a textual value depending on the local Windows system language.
*/
statusMessage: string
}
/** Finds if a path is already mounted and returns all drive letters that point to that exact path. */
function find(drivePath: string): Promise<DriveInfo[]>;
/** List all network drives and their paths. */
function list(): Promise<{ [driveLetter: string]: DriveInfo }>;
/** Mounts a network drive path and returns the new drive letter. */
function mount(
drivePath: string,
driveLetter?: string,
username?: string,
password?: string,
): Promise<string>;
/** Unmounts a network drive. */
function unmount(driveLetter: string): Promise<void>;
/** Converts a valid file system path to a Windows friendly path. */
function pathToWindowsPath(drivePath: string): Promise<string>;
/** Test the current OS is Windows. */
function isWinOs(): boolean;
}