/// <reference path="./sigApi.ViewModel.d.ts" />

declare namespace SigApi {
    interface Window extends ViewModel {
        /**
         * Opens a Window and overloads it, if the parameter a given therefore
         * 
         * @param {number|string} [ovId=null] the index or name of the datapoint with which the overload should be performed  
         * @param {number} [selGr=null]  the selection group for the overload
         * @param {number|string} [targetId=null] the id or the name of the target datapoint for the overload
         * 
         * @returns {Promise} Promise -> resolve: () => void, reject: (string) => void}
         * 
         * A promise which is resolved if the window was opened.
         * 
         * If it gets rejected, the cause is given as string
         */
        open(
            ovId?: number | string,
            selGr?: number,
            targetId?: number | string
        ): Promise<void>
        /**
         * Closes the window
         * 
         * @returns {Promise} Promise -> resolve: () => void, reject: (string) => void}
         * 
         * A promise which is resolved if the window was closed
         * 
         * If it gets rejected, the cause is given as string
         */
        close(): Promise<void>
        /**
         * Resets the size and the position if a window to its defaults
         * For this to work, the window must be closed
         */
        restoreDefaults(): void
        /**
         * Checks if a window is open
         * 
         * @returns {boolean} true if the window is currently open of false otherwise
         */
        isOpen(): boolean
        /**
         * The window index of the window
         * 
         * @returns {number} The index of the window
         */
        getWindowIndex(): number
        /**
         * The name of the window
         * 
         * @returns {string} The name of the window
         */
        getName(): string
    }
}
