UNPKG

@ahmic/autoit-js

Version:
54 lines (53 loc) 1.88 kB
/** * Enumeration for drive mapping flags. */ export declare enum DriveMapFlag { /** Default */ Default = 0, /** Persistant mapping */ Persistant = 1, /** Show authentication dialog if required */ Authentication = 8 } /** * Maps a network drive to a local drive letter. * * @param device The local drive letter to map. * @param share The network share to map to. * @param flags Optional flags to control the mapping behavior. * @param username Optional username for authentication. * @param password Optional password for authentication. * * @returns "1" if successful, "0" if failed. * * @example * ```typescript * import { DriveMapAddSync, DriveMapFlag } from '@ahmic/autoit-js'; * * DriveMapAddSync('Z:', '\\server\share', DriveMapFlag.Authentication, 'user', 'password'); * ``` * * @see https://www.autoitscript.com/autoit3/docs/functions/DriveMapAdd.htm */ export declare function DriveMapAddSync(device: string, share: string, flags?: DriveMapFlag, username?: string, password?: string): string; /** * Maps a network drive to a local drive letter. * * @param device The local drive letter to map. * @param share The network share to map to. * @param flags Optional flags to control the mapping behavior. * @param username Optional username for authentication. * @param password Optional password for authentication. * * @returns A promise that resolves to "1" if successful, "0" if failed. * * @example * ```typescript * import { DriveMapAdd, DriveMapFlag } from '@ahmic/autoit-js'; * * await DriveMapAdd('Z:', '\\server\share', DriveMapFlag.Authentication, 'user', 'password'); * ``` * * @see https://www.autoitscript.com/autoit3/docs/functions/DriveMapAdd.htm */ export declare function DriveMapAdd(device: string, share: string, flags?: DriveMapFlag, username?: string, password?: string): Promise<string>;