/// <reference path="./sigApi.MenuItemBlueprint.d.ts" />
/// <reference path="./sigApi.PropertyObject.d.ts" />

declare namespace SigApi {
    interface MenuItem {
        /**
         * @returns {string}
         */
        getName(): string
        /**
         * @returns {number}
         */
        getIndex(): number
        /**
         * @returns {MenuItemBlueprint}
         */
        getBlueprint(): MenuItemBlueprint
        /**
         * @param {string} propertyName
         * @returns {boolean} 
         */
        hasProperty(propertyName: string): boolean
        /**
         * @param {string} propertyName
         * @returns {Promise<*>} resolve(value{*})
         * 
         * reject(error{string})
         */
        getPropertyValue(propertyName: string): Promise<any>
        /**
         * @returns {string} functionblockName
         */
        getFunctionblockName(): string
        /**
         * @returns {number} menuId of the subMenu
         */
        getSubMenuId(): number
        /**
         * @returns {Promise<boolean>} resolve(isEnabled{boolean})
         * 
         * reject(error{string})
         */
        isEnabled(): Promise<boolean>
        /**
         * Returns the description Object of the Property
         * @param {string} propertyName 
         * @returns {PropertyObject} Returns the descriptionObject of an property
         */
        getPropertyObject(propertyName: string): PropertyObject
        /**
         * @param {string} propertyName 
         * @param {Function} callback 
         * @returns {null|number} observerId (null on error)
         */
        addObserver(
            propertyName: string,
            callback: (value: any) => void
        ): number | null
        /**
         * @param {number} observerId 
         */
        removeObserver(observerId: number): void
    }
}
