/// <reference path="./sigApi.AddCBforWriteDPCallbackObject.d.ts" />
/// <reference path="./sigApi.Alarm.d.ts" />
/// <reference path="./sigApi.AlarmConfig.d.ts" />
/// <reference path="./sigApi.AlarmFilter.d.ts" />
/// <reference path="./sigApi.AlarmInfo.d.ts" />
/// <reference path="./sigApi.AlarmInfoParameter.d.ts" />
/// <reference path="./sigApi.AlarmSort.d.ts" />
/// <reference path="./sigApi.ApiAccessSequence.d.ts" />
/// <reference path="./sigApi.ApiAlarm.d.ts" />
/// <reference path="./sigApi.ApiAlarmConfig.d.ts" />
/// <reference path="./sigApi.ApiAlarmInfo.d.ts" />
/// <reference path="./sigApi.ApiAppRouter.d.ts" />
/// <reference path="./sigApi.ApiBase.d.ts" />
/// <reference path="./sigApi.ApiBrowser.d.ts" />
/// <reference path="./sigApi.ApiCheckbitManager.d.ts" />
/// <reference path="./sigApi.ApiClientIdentification.d.ts" />
/// <reference path="./sigApi.ApiColorManager.d.ts" />
/// <reference path="./sigApi.ApiDatapointManager.d.ts" />
/// <reference path="./sigApi.ApiDebug.d.ts" />
/// <reference path="./sigApi.ApiDefaultStyleManager.d.ts" />
/// <reference path="./sigApi.ApiDesigner.d.ts" />
/// <reference path="./sigApi.ApiDragAndDrop.d.ts" />
/// <reference path="./sigApi.ApiEventJournal.d.ts" />
/// <reference path="./sigApi.ApiEventMediator.d.ts" />
/// <reference path="./sigApi.ApiEvents.d.ts" />
/// <reference path="./sigApi.ApiFileManager.d.ts" />
/// <reference path="./sigApi.ApiFontManager.d.ts" />
/// <reference path="./sigApi.ApiFunctionBlockManager.d.ts" />
/// <reference path="./sigApi.ApiJsonLoader.d.ts" />
/// <reference path="./sigApi.ApiKeyboardManager.d.ts" />
/// <reference path="./sigApi.ApiMenuManager.d.ts" />
/// <reference path="./sigApi.ApiProjectConfig.d.ts" />
/// <reference path="./sigApi.ApiProjectInfo.d.ts" />
/// <reference path="./sigApi.ApiProperties.d.ts" />
/// <reference path="./sigApi.ApiRecipeManager.d.ts" />
/// <reference path="./sigApi.ApiResourceManager.d.ts" />
/// <reference path="./sigApi.ApiSessionVariableManager.d.ts" />
/// <reference path="./sigApi.ApiSigConst.d.ts" />
/// <reference path="./sigApi.ApiSigUtils.d.ts" />
/// <reference path="./sigApi.ApiState.d.ts" />
/// <reference path="./sigApi.ApiStationManager.d.ts" />
/// <reference path="./sigApi.ApiTextManager.d.ts" />
/// <reference path="./sigApi.ApiUnitManager.d.ts" />
/// <reference path="./sigApi.ApiUserManager.d.ts" />
/// <reference path="./sigApi.ApiViewModel.d.ts" />
/// <reference path="./sigApi.ApiViewSelection.d.ts" />
/// <reference path="./sigApi.ApiWebsocketState.d.ts" />
/// <reference path="./sigApi.ApiWindowManager.d.ts" />
/// <reference path="./sigApi.BrowserInfo.d.ts" />
/// <reference path="./sigApi.Checkbit.d.ts" />
/// <reference path="./sigApi.CodemoduleFactory.d.ts" />
/// <reference path="./sigApi.Color.d.ts" />
/// <reference path="./sigApi.CompositeControl.d.ts" />
/// <reference path="./sigApi.Datapoint.d.ts" />
/// <reference path="./sigApi.DriveInfos.d.ts" />
/// <reference path="./sigApi.Event.d.ts" />
/// <reference path="./sigApi.EventJournalEntry.d.ts" />
/// <reference path="./sigApi.EventJournalFilter.d.ts" />
/// <reference path="./sigApi.EventJournalSort.d.ts" />
/// <reference path="./sigApi.Factory2D.d.ts" />
/// <reference path="./sigApi.File.d.ts" />
/// <reference path="./sigApi.Font.d.ts" />
/// <reference path="./sigApi.Formula.d.ts" />
/// <reference path="./sigApi.Language.d.ts" />
/// <reference path="./sigApi.Logger.d.ts" />
/// <reference path="./sigApi.LogLevel.d.ts" />
/// <reference path="./sigApi.Menu.d.ts" />
/// <reference path="./sigApi.MenuBlueprint.d.ts" />
/// <reference path="./sigApi.MenuControl.d.ts" />
/// <reference path="./sigApi.MenuItem.d.ts" />
/// <reference path="./sigApi.MenuItemBlueprint.d.ts" />
/// <reference path="./sigApi.PermissionObj.d.ts" />
/// <reference path="./sigApi.PermissionRejectObj.d.ts" />
/// <reference path="./sigApi.PermissionResolveObj.d.ts" />
/// <reference path="./sigApi.ProgressCallbackObject.d.ts" />
/// <reference path="./sigApi.ProjectInfo.d.ts" />
/// <reference path="./sigApi.Property.d.ts" />
/// <reference path="./sigApi.PropertyAccessNumber.d.ts" />
/// <reference path="./sigApi.PropertyCheckbit.d.ts" />
/// <reference path="./sigApi.PropertyColor.d.ts" />
/// <reference path="./sigApi.PropertyCompositeControl.d.ts" />
/// <reference path="./sigApi.PropertyConstant.d.ts" />
/// <reference path="./sigApi.PropertyDatapoint.d.ts" />
/// <reference path="./sigApi.PropertyEvent.d.ts" />
/// <reference path="./sigApi.PropertyFont.d.ts" />
/// <reference path="./sigApi.PropertyFormat.d.ts" />
/// <reference path="./sigApi.PropertyFunctionBlock.d.ts" />
/// <reference path="./sigApi.PropertyMenu.d.ts" />
/// <reference path="./sigApi.PropertyObject.d.ts" />
/// <reference path="./sigApi.PropertyPropertySwitch.d.ts" />
/// <reference path="./sigApi.PropertyResource.d.ts" />
/// <reference path="./sigApi.PropertyScheme.d.ts" />
/// <reference path="./sigApi.PropertyText.d.ts" />
/// <reference path="./sigApi.PropertyUnit.d.ts" />
/// <reference path="./sigApi.PropertyWithDataPoints.d.ts" />
/// <reference path="./sigApi.PropertyWithUnit.d.ts" />
/// <reference path="./sigApi.Role.d.ts" />
/// <reference path="./sigApi.RoleObj.d.ts" />
/// <reference path="./sigApi.Route.d.ts" />
/// <reference path="./sigApi.Scheme.d.ts" />
/// <reference path="./sigApi.SchemeBranch.d.ts" />
/// <reference path="./sigApi.SchemeBranchData.d.ts" />
/// <reference path="./sigApi.SchemeIdentifier.d.ts" />
/// <reference path="./sigApi.SessionVariableImage.d.ts" />
/// <reference path="./sigApi.SessionVariableResult.d.ts" />
/// <reference path="./sigApi.SigLocalClient.d.ts" />
/// <reference path="./sigApi.SigState.d.ts" />
/// <reference path="./sigApi.StatePropertyDetailInfo.d.ts" />
/// <reference path="./sigApi.Station.d.ts" />
/// <reference path="./sigApi.StyleClass.d.ts" />
/// <reference path="./sigApi.StyleClassList.d.ts" />
/// <reference path="./sigApi.Unit.d.ts" />
/// <reference path="./sigApi.User.d.ts" />
/// <reference path="./sigApi.UserObj.d.ts" />
/// <reference path="./sigApi.View.d.ts" />
/// <reference path="./sigApi.ViewModel.d.ts" />
/// <reference path="./sigApi.ViewModelBlueprint.d.ts" />
/// <reference path="./sigApi.ViewModelCodeModule.d.ts" />
/// <reference path="./sigApi.Window.d.ts" />

// runtime version 1.3.15
declare namespace SigApi {
    interface SigApi {
        accessSequence: ApiAccessSequence
        alarm: ApiAlarm
        alarmConfig: ApiAlarmConfig
        alarmInfo: ApiAlarmInfo
        appRouter: ApiAppRouter
        browser: ApiBrowser
        checkbitManager: ApiCheckbitManager
        clientIdentification: ApiClientIdentification
        colorManager: ApiColorManager
        datapointManager: ApiDatapointManager
        debug: ApiDebug
        defaultStyleManager: ApiDefaultStyleManager
        designer: ApiDesigner
        dragAndDrop: ApiDragAndDrop
        eventJournal: ApiEventJournal
        eventMediator: ApiEventMediator
        events: ApiEvents
        fileManager: ApiFileManager
        fontManager: ApiFontManager
        functionBlockManager: ApiFunctionBlockManager
        jsonLoader: ApiJsonLoader
        keyboard: ApiKeyboardManager
        menuManager: ApiMenuManager
        projectConfigManager: ApiProjectConfig
        projectInfoManager: ApiProjectInfo
        properties: ApiProperties
        recipeManager: ApiRecipeManager
        resourceManager: ApiResourceManager
        sessionVariableManager: ApiSessionVariableManager
        SIG_CONST: ApiSigConst
        sigUtils: ApiSigUtils
        state: ApiState
        stationManager: ApiStationManager
        textManager: ApiTextManager
        unitManager: ApiUnitManager
        userManager: ApiUserManager
        vm: ApiViewModel
        viewSelection: ApiViewSelection
        websocketState: ApiWebsocketState
        windowManager: ApiWindowManager
    }
}

interface Window {
    sigApi: SigApi.SigApi
    log: SigApi.Logger
    renderProfiling: boolean
    /**
     * A Promise that resolves when js event 'SigApiReady' is fired
     * @type {Promise}
     * @global
     */
    sigApiReadyPromise: Promise<void>
    /**
     * A Map with key: {string} sigApi.SIG_CONST.EVENT_READY_PROMISE_*, value: {Promise}
     * 
     * supported keys:
     *  * sigApi.SIG_CONST.EVENT_READY_PROMISE_API_READY
     *  * sigApi.SIG_CONST.EVENT_READY_PROMISE_WS_READY
     *  * sigApi.SIG_CONST.EVENT_READY_PROMISE_ACCESS_SEQUENCE_READY
     *  * sigApi.SIG_CONST.EVENT_READY_PROMISE_STATIONS_READY
     *  * sigApi.SIG_CONST.EVENT_READY_PROMISE_LASALIDS_READY
     * 
     * @type {Map}
     * @global
     */
    eventReadyPromises: Map<string, Promise<void>>
    codemoduleFactory: SigApi.CodemoduleFactory
    /**
     * @param {number} name 
     * @param {Function} createFct 
     */
    registerDashboardModule(name: string, createFct: Function): void
    /**
     * @param {number} name 
     * @param {Function} createFct 
     */
    registerCompositeControlModule(name: string, createFct: Function): void
    /**
     * @param {number} name 
     * @param {Function} createFct 
     */
    registerGlobalModule(name: string, createFct: Function): void
    /**
     * @param {number} name 
     * @param {Function} createFct 
     */
    registerWindowModule(name: string, createFct: Function): void
    /**
     * @param {number} name 
     * @param {Function} createFct 
     */
    registerKeyboardModule(name: string, createFct: Function): void
    /**
     * Registers a callback function to overrule result of view selection process
     * 
     * Only one callback can be registered at a time. Successive calls replace the previous callback function
     * 
     * NOTE: can not be part of window.sigApi because sigApi is not ready, when registerViewSelectionCallback needs to be called
     * 
     * @param {Function} callback callback({number} viewIndex, {View[]} views) -> {undefined|number|string|Promise -> resolve({undefined|number|string})} viewIndex/viewName
     * 
     * callback returning undefined -> use default view
     * @returns {boolean}
     * @global
     */
    registerViewSelectionCallback(
        callback: (
            api: SigApi.SigApi,
            viewIndex: number,
            views: SigApi.View[]
        ) => undefined | number | string | Promise<undefined | number | string>
    ): boolean
    /**
     * Unregisters the previously registered callback function
     * 
     * NOTE: can not be part of window.sigApi because sigApi is not ready, when registerViewSelectionCallback needs to be called
     * 
     * @returns {boolean}
     * @global
     */
    unregisterViewSelectionCallback(): boolean
}
