/// <reference path="./sigApi.ApiBase.d.ts" />
/// <reference path="./sigApi.DriveInfos.d.ts" />
/// <reference path="./sigApi.File.d.ts" />
/// <reference path="./sigApi.ProgressCallbackObject.d.ts" />

declare namespace SigApi {
    interface ApiFileManager extends ApiBase {
        /**
         * Reads the root directory
         * 
         * @param {number} [uid=undefined] a unique identifier
         * 
         * @returns {Promise} Promise -> resolve: ({uid: number, root: {@link File}}) => void, reject: ({uid: number, status: number, errortxt: string}) => void
         * 
         * A promise that is resolved with an Object having an identifier as uid attribute, and the root directoy represented as File Object as attribute root
         * 
         * The actual Folders which are in the root directory are stored as File Objects in the nodes attribute of the root object (-> parent.getNodes())
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to reads the root directory -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        getRoot(uid?: number): Promise<{ uid: number, root: File }>
        /**
         * Reads the entries of a directory
         * 
         * @param {string} dir the directory, that should be read
         * @param {string} [filefilter='*.*'] filter for the files in the directories (e.g. '*.txt' returns only txt-files)
         * @param {number} [filter1='0'] filters for attributes, that contain result files or result directories
         * @param {number} [filter2='0'] filters for attributes, that do not contain result files or result directories
         * @param {number} [uid=undefined] a unique identifier
         * 
         * @returns {Promise} Promise -> resolve: ({uid: number, parent: {@link File}}) => void, reject: ({uid: number, status: number, errortxt: string}) => void
         * 
         * A promise that is resolved with an Object having an identifier as uid attribute, and the directory which was read as File Object as attribute parent
         * 
         * The actual Files and Folders which are in the directory are stored as File Objects in the nodes attribute of the parent (-> parent.getNodes())
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to reads the entries of a directory -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x0106 -> DS_ERROR_FILE_NAME_INVALID -> filename or directory is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        readDir(
            dir: string,
            filefilter?: string,
            filter1?: number,
            filter2?: number,
            uid?: number
        ): Promise<{ uid: number, parent: File }>
        /**
         * Creates a new directory
         * 
         * @param {string} dir the directory, that should be created
         * @param {number} [uid=undefined] a unique identifier
         * 
         * @returns {Promise} Promise -> resolve: ({uid: number, dir: string}) => void, reject: ({uid: number, status: number, errortxt: string}) => void
         * 
         * A Promise that is resolved with an object containing the identifier as attribute uid, and the path to the new folder as attribute dir
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to create a new directory -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x0106 -> DS_ERROR_FILE_NAME_INVALID -> filename or directory is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        makeDir(
            dir: string,
            uid?: number
        ): Promise<{ uid: number, dir: string }>
        /**
         * Removes a file or a directory
         * Note: this command can be canceled with cancelCommand(uid)
         * 
         * @param {string} dir the file or directory, that should be deleted
         * @param {Function} [progress] a callback function - invoked, when remove progresses (returns an object with parameter 'uid' and 'progress' (in a resolution of 0,1%))
         *  {Function} ({uid: number, progress: number}): void
         * @param {Function} [begin} a callback function - invoked, when remove begins (returns an object with parameter 'uid')
         *  {Function} ({uid: number}): void
         * @param {Function} [end] a callback function - invoked, when remove ends (returns an object with parameter 'uid')
         *  {Function} ({uid: number}): void
         * @param {number} [uid=undefined] a unique identifier
         * 
         * @returns {Promise} Promise -> resolve: ({uid: number}) => void, reject: ({uid: number, status: number, errortxt: string}) => void
         * 
         * A Promise that is resolved, if the process is finished
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to removes a file or a directory -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x0106 -> DS_ERROR_FILE_NAME_INVALID -> filename or directory is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        remove(
            dir: string,
            progress?: (progressCallbackObject: ProgressCallbackObject) => void,
            begin?: (progressCallbackObject: ProgressCallbackObject) => void,
            end?: (progressCallbackObject: ProgressCallbackObject) => void,
            uid?: number
        ): Promise<{ uid: number }>
        /**
         * Renames a file or a directory
         * 
         * @param {string} newname new dpne drive, path, name and extension of the file or directory, that should be rename (e.g. 'c:\\temp\\test.txt')
         * @param {string} oldname old dpne drive, path, name and extension of the file or directory, that should be rename (e.g. 'c:\\temp\\test.txt')
         * @param {number} [uid=undefined] a unique identifier
         * 
         * @returns {Promise} Promise -> resolve: ({uid: number}) => void, reject: ({uid: number, status: number, errortxt: string}) => void
         * 
         * A Promise that is resolved, if the process is finished
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to renames a file or a directory -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x0106 -> DS_ERROR_FILE_NAME_INVALID -> filename or directory is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        rename(
            newname: string,
            oldname: string,
            uid?: number
        ): Promise<{ uid: number }>
        /**
         * Copies a file or directory
         * Note: this command can be canceled with cancelCommand(uid)
         * 
         * @param {string} dst destination file or directory (when a file is copied, the new file name must be specified)
         * @param {string} src source file or directory
         * @param {Function} [progress] a callback function - invoked, when copy progresses (returns an object with parameter 'uid' and 'progress' (in a resolution of 0,1%))
         *  {Function} ({uid: number, progress: number}): void
         * @param {Function} [begin] a callback function - invoked, when copy begins (returns an object with parameter 'uid')
         *  {Function} ({uid: number}): void
         * @param {Function} [end] a callback function - invoked, when copy ends (returns an object with parameter 'uid')
         *  {Function} ({uid: number}): void
         * @param {number} [uid=undefined] a unique identifier
         * 
         * @returns {Promise} Promise -> resolve: ({uid: number}) => void, reject: ({uid: number, status: number, errortxt: string}) => void
         * 
         * A Promise that is resolved, if the process is finished
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to copys a file or directory -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x0106 -> DS_ERROR_FILE_NAME_INVALID -> filename or directory is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        copy(
            dst: string,
            src: string,
            progress?: (progressCallbackObject: ProgressCallbackObject) => void,
            begin?: (progressCallbackObject: ProgressCallbackObject) => void,
            end?: (progressCallbackObject: ProgressCallbackObject) => void,
            uid?: number
        ): Promise<{ uid: number }>
        /**
         * Moves a file or directory
         * Note: this command can be canceled with cancelCommand(uid)
         * 
         * @param {string} dst destination file or directory (when a file is moved, the new file name must be specified)
         * @param {string} src source file or directory
         * @param {Function} [progress] a callback function - invoked, when move progresses (returns an object with parameter 'uid' and 'progress' (in a resolution of 0,1%))
         *  {Function} ({uid: number, progress: number}): void
         * @param {Function} [begin] a callback function - invoked, when move begins (returns an object with parameter 'uid')
         *  {Function} ({uid: number}): void
         * @param {Function} [end] a callback function - invoked, when move ends (returns an object with parameter 'uid')
         *  {Function} ({uid: number}): void
         * @param {number} [uid=undefined] a unique identifier
         * 
         * @returns {Promise} Promise -> resolve: ({uid: number}) => void, reject: ({uid: number, status: number, errortxt: string}) => void
         * 
         * A Promise that is resolved, if the process is finished
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to moves a file or directory -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x0106 -> DS_ERROR_FILE_NAME_INVALID -> filename or directory is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        move(
            dst: string,
            src: string,
            progress?: (progressCallbackObject: ProgressCallbackObject) => void,
            begin?: (progressCallbackObject: ProgressCallbackObject) => void,
            end?: (progressCallbackObject: ProgressCallbackObject) => void,
            uid?: number
        ): Promise<{ uid: number }>
        /**
         * Reads data from a file
         *
         * @param {number} handle handle of the file to read
         * @param {number} length number of bytes to read
         * @param {number} [uid=undefined] a unique identifier
         * @param {Function} [progress] a callback function - invoked, on progress (returns an object with parameter 'uid' and 'progress' (in a resolution of 0,1%))
         *  {Function} ({uid: number, progress: number}): void
         * @param {Function} [begin] a callback function - invoked, on begin (returns an object with parameter 'uid')
         *  {Function} ({uid: number}): void
         * @param {Function} [end] a callback function - invoked, on end (returns an object with parameter 'uid')
         *  {Function} ({uid: number}): void
         * 
         * @returns {Promise} Promise -> resolve: ({uid: number, length: number, data: Blob}) => void, reject: ({uid: number, status: number, errortxt: string}) => void
         *  
         * A Promise that is resolved with an Object containing the identifier as uid, the length of the read data as attribute length, and the data in a Blob object as attribute data
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to reads a file -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x000B -> DS_ERROR_INVALID_FILEHANDLE -> filehandle is invalid
         * * 0x010B -> DS_ERROR_FILE_READ_FAILED -> failed to read the given amount of bytes
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        readFile(
            handle: number,
            length: number,
            uid?: number,
            progress?: (progressCallbackObject: ProgressCallbackObject) => void,
            begin?: (progressCallbackObject: ProgressCallbackObject) => void,
            end?: (progressCallbackObject: ProgressCallbackObject) => void
        ): Promise<{ uid: number, length: number, data: Blob }>
        /**
         * Writes data to a file
         * 
         * @param {string} dpne drive, path, name and extension of the file, that should be write (e.g. 'c:\\temp\\test.txt')
         * @param {Blob} data data (as Blob) to write in a file 
         * @param {number} [uid=undefined] a unique identifier
         * @param {Function} [progress] a callback function - invoked, on progress (returns an object with parameter 'uid' and 'progress' (in a resolution of 0,1%))
         *  {Function} ({uid: number, progress: number}): void
         * @param {Function} [begin] a callback function - invoked, on begin (returns an object with parameter 'uid')
         *  {Function} ({uid: number}): void
         * @param {Function} [end] a callback function - invoked, on end (returns an object with parameter 'uid')
         *  {Function} ({uid: number}): void
         * 
         * @returns {Promise} Promise -> resolve: ({uid: number}) => void, reject: ({uid: number, status: number, errortxt: string}) => void
         * 
         * A Promise that is resolved with an Object containing the identifier as uid
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to writes a file -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x0106 -> DS_ERROR_FILE_NAME_INVALID -> filename or directory is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        writeFile(
            dpne: string,
            data: Blob,
            uid?: number,
            progress?: (progressCallbackObject: ProgressCallbackObject) => void,
            begin?: (progressCallbackObject: ProgressCallbackObject) => void,
            end?: (progressCallbackObject: ProgressCallbackObject) => void
        ): Promise<{ uid: number }>
        /**
         * Opens a file
         * 
         * @param {string} dpne drive, path, name and extension of the file, to open (e.g. 'c:\\temp\\test.txt')
         * @param {string} mode mode to open the file (Possible values: 'r', 'r+', 'rb', 'rb+', 'w', 'w+', 'wb', 'wb+', 'a', 'a+', 'ab', 'ab+')
         * @param {number} [uid=undefined] a unique identifier
         * 
         * @returns {Promise} Promise -> resolve: ({uid: number, handle: number, filename: string}) => void, reject: ({uid: number, status: number, errortxt: string}) => void 
         * 
         * A Promise that is resolved with an Object containing the identifier as uid, the handle of the open file as handle and the filename as filename
         * 
         * Meaning of values for 'mode':
         * * 'r'  : opens a text file in reading mode.
         * * 'w'  : opens or creates a text file in writing mode.
         * * 'a'  : opens a text file in append mode.
         * * 'r+' : opens a text file in both reading and writing mode. The file must exist.
         * * 'w+' : opens a text file in both reading and writing mode. If the file exists, it's truncated first before overwriting. Any old data will be lost. If the file doesn't exist, a new file will be created.
         * * 'a+' : opens a text file in both reading and appending mode. New data is appended at the end of the file and does not overwrite the existing content.     
         * * 'rb' : opens a binary file in reading mode.
         * * 'wb' : opens or creates a binary file in writing mode.
         * * 'ab' : opens a binary file in append mode.
         * * 'rb+': opens a binary file in both reading and writing mode, and the original content is overwritten if the file exists.
         * * 'wb+': opens a binary file in both reading and writing mode and works similar to the w+ mode for binary files. The file content is deleted first and then new content is added.
         * * 'ab+': opens a binary file in both reading and appending mode and appends data at the end of the file without overwriting the existing content.
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to open a file -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x0106 -> DS_ERROR_FILE_NAME_INVALID -> filename or directory is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        open(
            dpne: string,
            mode: string,
            uid?: number
        ): Promise<{ uid: number, handle: number, filename: string }>
        /**
         * Closes a file
         * 
         * @param {number} handle handle of the file to be closed
         * @param {number} [uid=undefined] a unique identifier
         * 
         * @returns {Promise} Promise -> resolve: ({uid: number}) => void, reject: ({uid: number, status: number, errortxt: string}) => void
         * 
         * A Promise that is resolved with an Object containing the identifier as uid
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to close a file -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x000B -> DS_ERROR_INVALID_FILEHANDLE -> filehandle is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        close(handle: number, uid?: number): Promise<{ uid: number }>
        /**
         * Sets the position of the files read/write pointer to offset
         * 
         * @param {number} handle handle of the file
         * @param {number} start 0 = absolute file positioning, 1 = seek relative to the current position, 2 = seek relative to the file's end
         * @param {number} offset position of the read/write pointer within the file
         * @param {number} [uid=undefined] a unique identifier
         *
         * @returns {Promise} Promise -> resolve: ({uid: number}) => void, reject: ({uid: number, status: number, errortxt: string}) => void 
         * 
         * A Promise that is resolved with an Object containing the identifier as uid
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to set the position of the files read/write pointer -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x000B -> DS_ERROR_INVALID_FILEHANDLE -> filehandle is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        seek(
            handle: number,
            start: number,
            offset: number,
            uid?: number
        ): Promise<{ uid: number }>
        /**
         * Returns the current position of the files read/write pointer within the file
         * 
         * @param {number} handle handle of the file
         * @param {number} [uid=undefined] a unique identifier
         * 
         * @returns {Promise} Promise -> resolve: ({uid: number, offset: number}) => void, reject: ({uid: number, status: number, errortxt: string}) => void 
         * 
         * A Promise that is resolved with an Object containing the identifier as uid and the current position of the files read/write pointer as offset
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to get the current position of the files read/write pointer -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x000B -> DS_ERROR_INVALID_FILEHANDLE -> filehandle is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        tell(
            handle: number,
            uid?: number
        ): Promise<{ uid: number, offset: number }>
        /**
         * Returns data from a file
         * 
         * @param {number} handle handle of the file
         * @param {number} maxSize maximum size of returned data
         * @param {number} [uid=undefined] a unique identifier
         * 
         * @returns {Promise} Promise -> resolve: ({uid: number, length: number, data: ArrayBuffer}) => void, reject: ({uid: number, status: number, errortxt: string}) => void 
         * 
         * A Promise that is resolved with an Object containing the identifier as uid, the length of the read data as length and the returned data as data
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to reads data from a file -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x000B -> DS_ERROR_INVALID_FILEHANDLE -> filehandle is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        get(
            handle: number,
            maxSize: number,
            uid?: number
        ): Promise<{ uid: number, length: number, data: ArrayBuffer }>
        /**
         * Puts a text to a file
         * 
         * @param {number} handle handle of the file
         * @param {string} text a text to be inserted into the file
         * @param {number} [uid=undefined] a unique identifier
         *
         * @returns {Promise} Promise -> resolve: ({uid: number}) => void, reject: ({uid: number, status: number, errortxt: string}) => void 
         * 
         * A Promise that is resolved with an Object containing the identifier as uid
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to write data to a file -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x000B -> DS_ERROR_INVALID_FILEHANDLE -> filehandle is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        put(
            handle: number,
            text: string,
            uid?: number
        ): Promise<{ uid: number }>
        /**
         * Returns the length of a file
         * 
         * @param {number} handle handle of the file
         * @param {number} [uid=undefined] a unique identifier
         *
         * @returns {Promise} Promise -> resolve: ({uid: number, length: number }) => void, reject: ({uid: number, status: number, errortxt: string}) => void 
         * 
         * A Promise that is resolved with an Object containing the identifier as uid and the filelength as length
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to gets theh length of a file -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x000B -> DS_ERROR_INVALID_FILEHANDLE -> filehandle is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        length(
            handle: number,
            uid?: number
        ): Promise<{ uid: number, length: number }>
        /**
         * Returns infos of a file (fileattribut, filesize, access timestamp, modified timestamp and create timestamp)
         * 
         * @param {string} dpne drive, path, name and extension of the file, from which the information should be obtained (e.g. 'c:\\temp\\test.txt')
         * @param {number} [uid=undefined] a unique identifier
         *
         * @returns {Promise} Promise -> resolve: ({uid: number, attribute: number, size: number, AccessDate: number, AccessTime: number, ModifiedDate: number, ModifiedTime: number, CreatedDate: number, CreatedTime: number}), reject=({uid, status, errortxt})
         * 
         * A Promise that is resolved with an Object containing
         *  * uid .. the identifier
         *  * attribute .. the attribute of the file with attribute bit masks:
         *    - sigApi.SIG_CONST.ATTRIBUTE_READONLY (0x0001)
         *    - sigApi.SIG_CONST.ATTRIBUTE_HIDDEN (0x0002)
         *    - sigApi.SIG_CONST.ATTRIBUTE_SYSTEM (0x0004)
         *    - sigApi.SIG_CONST.ATTRIBUTE_DIRECTORY (0x0010)
         *    - sigApi.SIG_CONST.ATTRIBUTE_ARCHIVE (0x0020)
         *  * size .. the filelength
         *  * AccessDate, AccessTime .. the access timestamp
         *  * ModifiedDate, ModifiedTime .. the modified timestamp
         *  * CreatedDate, CreatedTime .. the create timestamp
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to get infos about a file -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x0106 -> DS_ERROR_FILE_NAME_INVALID -> filename or directory is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        info(
            dpne: string,
            uid?: number
        ): Promise<{ uid: number, attribute: number, size: number, AccessDate: number, AccessTime: number, ModifiedDate: number, ModifiedTime: number, CreatedDate: number, CreatedTime: number }>
        /**
         * Sets the attribute of a file
         * 
         * @param {number} attributeToSet sets the attribute of the file
         * 
         * supported attributes:
         *  * sigApi.SIG_CONST.ATTRIBUTE_READONLY (0x0001)
         * @param {number} attributeToReset resets the attribute of the file
         * 
         * supported attributes:
         *  * sigApi.SIG_CONST.ATTRIBUTE_READONLY (0x0001)
         * @param {string} dpne drive, path, name and extension of the file, that should be write (e.g. 'c:\\temp\\test.txt')
         * @param {number} [uid=undefined] a unique identifier
         * 
         * @returns {Promise} Promise -> resolve: ({uid: number }) => void, reject: ({uid: number, status: number, errortxt: string}) => void
         * 
         * A Promise that is resolved with an Object containing the identifier as uid
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to sets the attribute of a file -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x0106 -> DS_ERROR_FILE_NAME_INVALID -> filename or directory is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        setAttribute(
            attributeToSet: number,
            attributeToReset: number,
            dpne: string,
            uid?: number
        ): Promise<{ uid: number }>
        /**
         * Reads the content of a file
         * 
         * @param {string} dpne drive, path, name and extension of the file, that should be read (e.g. 'c:\\temp\\test.txt')
         * @param {number} [uid=undefined] a unique identifier
         * @param {Function} [progress] a callback function - invoked, on progress (returns an object with parameter 'uid' and 'progress' (in a resolution of 0,1%))
         *  {Function} ({uid: number, progress: number}): void
         * @param {Function} [begin] a callback function - invoked, on begin (returns an object with parameter 'uid')
         *  {Function} ({uid: number}): void
         * @param {Function} [end] a callback function - invoked, on end (returns an object with parameter 'uid')
         *  {Function} ({uid: number}): void
         * 
         * @returns {Promise} Promise -> resolve: ({uid: number, filelength: number, data: Blob}) => void, reject: ({uid: number, status: number, errortxt: string}) => void
         *  
         * A Promise that is resolved with an Object containing the identifier as uid, the lenght of the read file as attribute filelength and the data in for of a Blob Object as attribute data
         * 
         * The reject Function is called with an object that has the identifier as attribute uid, a statuscode as attribute status, and an errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to reads the content of a file -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         * * 0x0010 -> DS_ERROR_INVALID_USER_PARAM -> user parameter is out of range or unknown
         * * 0x0106 -> DS_ERROR_FILE_NAME_INVALID -> filename or directory is invalid
         * * 0x7xxx -> error from operating system (POSIX errno + 0x7000)
         */
        fileContent(
            dpne: string,
            uid?: number,
            progress?: (progressCallbackObject: ProgressCallbackObject) => void,
            begin?: (progressCallbackObject: ProgressCallbackObject) => void,
            end?: (progressCallbackObject: ProgressCallbackObject) => void
        ): Promise<{ uid: number, filelength: number, data: Blob }>
        /**
         * Cancels a command
         * 
         * @param {number} uid the identifier which was used in the invocation of the command
         * 
         * @returns {Promise} Promise -> resolve: ({uid: number}) => void, reject: ({uid: number, status: number, errortxt: string}) => void
         * 
         * A Promise that is resolved with an Object containing the identifier as uid
         * 
         * The reject Function is called with an object that has the identifier as attribute uid
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to cancel a command -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         */
        cancelCommand(uid?: number): Promise<{ uid: number }>
        /**
         * Returns an object containing the file attributes
         * * readonly `boolean`
         * * hidden `boolean`
         * * system `boolean`
         * * directory `boolean`
         * * archive `boolean`
         * @param {number} value 
         * 
         * @returns {object} file attributes
         */
        getFileAttributesAsArray(value: number): {
            readonly: boolean,
            hidden: boolean,
            system: boolean,
            directory: boolean,
            archive: boolean
        }
        /**
         * Function to check if parameter object is a instanceof File.
         * This function can be used without importing the type File to be used with the instanceof operator.
         * @param {*} object Any object to type check
         * @returns {boolean} Returns true if parameter object is instanceof File, else false
         */
        instanceofFile(object: any): boolean
        /**
         * Returns an object containing information about drives
         *
         * @param {string} driveLetters the letters of the drives whose drive information is to be queried (e.g 'CDF')
         * 
         * @returns {Promise} Promise -> resolve: ({driveInfos: {@link DriveInfos}[]}) => void, reject: ({status: number, errortxt: string}) => void
         * 
         * A Promise that is resolved with an object containing an array of {@link DriveInfos} objects.
         * 
         * The reject Function is called with an object that has the identifier statuscode as attribute status and errortext as attribute errortxt
         * 
         * Possible status for reject:
         * * 0x0001 -> ERROR_UNKNOWN -> Unknown error: see errortext for details
         * * 0x0012 -> ERROR_INSUFFICIENT_PRIVILEGES -> not enough privileges to cancel a command -> check the access level of the current user
         * * 0x0007 -> ERROR_COMMUNICATION -> no response from dataservice for this request -> check if the DS is running
         */
        getDriveInfos(
            driveLetters?: string
        ): Promise<{ driveInfos?: DriveInfos[] }>
        /**
         * Register a callback function to be called on directory events in a directory
         * Directory events are:
         *  * new file - sigApi.SIG_CONST.DIRECTORY_EVENT_UPDATE_MODE_NEW_FILE
         *  * new directory - sigApi.SIG_CONST.DIRECTORY_EVENT_UPDATE_MODE_NEW_DIR
         *  * file deleted - sigApi.SIG_CONST.DIRECTORY_EVENT_UPDATE_MODE_FILE_DELETED
         *  * directory deleted - sigApi.SIG_CONST.DIRECTORY_EVENT_UPDATE_MODE_DIR_DELETED
         *  * file renamed - sigApi.SIG_CONST.DIRECTORY_EVENT_UPDATE_MODE_FILE_RENAMED
         *  * directory renamed - sigApi.SIG_CONST.DIRECTORY_EVENT_UPDATE_MODE_DIR_RENAMED
         *  * file copied - sigApi.SIG_CONST.DIRECTORY_EVENT_UPDATE_MODE_FILE_COPIED
         *  * directory copied - sigApi.SIG_CONST.DIRECTORY_EVENT_UPDATE_MODE_DIR_COPIED
         *  * file moved - sigApi.SIG_CONST.DIRECTORY_EVENT_UPDATE_MODE_FILE_MOVED
         *  * directory moved - sigApi.SIG_CONST.DIRECTORY_EVENT_UPDATE_MODE_DIR_MOVED
         *  * file modified - sigApi.SIG_CONST.DIRECTORY_EVENT_UPDATE_MODE_FILE_MODIFIED
         *  * file attributes changed - sigApi.SIG_CONST.DIRECTORY_EVENT_UPDATE_MODE_FILE_ATTRIBUTES_CHANGED
         *  * dir attributes changed - sigApi.SIG_CONST.DIRECTORY_EVENT_UPDATE_MODE_DIR_ATTRIBUTES_CHANGED
         * 
         * @param {string} dirName Observed directory (must exist)
         * @param {Function} callback ({number} mode, {string} dirName, {string} fileName, {string|undefined} newDirName, {string|undefined} newFileName)
         *                            mode: sigApi.SIG_CONST.DIRECTORY_EVENT_UPDATE_MODE_*
         * @returns {Promise} resolve({ {number} status, {number} registrationUid })
         *                    reject({ {number} status, {string} errortxt })
         */
        registerDirectoryEvent(
            dirName: string,
            callback: (mode: number, dirName: string, fileName: string, newDirName?: string, newFileName?: string) => void
        ): Promise<{ status: number, registrationUid: number }>
        /**
         * Deregister a previously registered callback
         * 
         * @param {number} registrationUid obtained by registerDirectoryEvent
         * @returns {Promise} resolve({ {number} status })
         *                    reject({ {number} status, {string} errortxt })
         */
        deregisterDirectoryEvent(registrationUid: number): Promise<{ status: number }>
    }
}
