/// <reference path="./sigApi.ApiBase.d.ts" />
/// <reference path="./sigApi.Event.d.ts" />

declare namespace SigApi {
    interface ApiEvents extends ApiBase {
        /**
         * Gets an userdefined internal event 
         * 
         * @param {string} eventName The name of the event
         * 
         * @returns {Event|null} The Event to the name
         */
        getUserDefinedInternalEvent(eventName: string): Event | null
        /**
         * Gets an userdefined external event 
         * 
         * @param {string} eventName The name of the event
         * 
         * @returns {Event|null} The Event to the name
         */
        getUserDefinedExternalEvent(eventName: string): Event | null
        /**
         * Gets an internal event 
         * 
         * @param {string} eventName The name of the event
         * 
         * @returns {Event|null} The Event to the name
         */
        getInternalEvent(eventName: string): Event | null
        /**
         * Gets an external event 
         * 
         * @param {string} eventName The name of the event
         * 
         * @returns {Event|null} The Event to the name
         */
        getExternalEvent(eventName: string): Event | null
        /**
         * Adds a user defined internal event.
         * 
         * The maId must not be between SYSTEM_DOWN and SYSTEM_UP, otherwise the error SIG_CONST.ERROR_MAID_OUT_OF_RANGE will be returned.
         * If an event with the same maId and miId is already defined for a different event name, SIG_CONST.ERROR_MAID_MIID_ALREADY_IN_USE will be returned.
         * If the event name is also the same, the event is valide and SIG_CONST.ERROR_NONE is returned.* 
         * 
         * WARNING: The event system is not intended to manage an infinite number of events.
         * Therefore, it should be checked exactly whether it is necessary to register your own event or whether it is sufficient to send 
         * a generic event with your own user data.
         *
         * @param {string} eventName The name of the event
         * @param {number} maId The maId of the Event (must not be between SYSTEM_DOWN and SYSTEM_UP)
         * @param {number} miId The miId of the Event
         * @param {string} desc The description of the event
         * @param {number} accNo The accessnumber of the event
         * 
         * @returns {number} one of the following errorcodes:
         * * SIG_CONST.ERROR_NONE -> the event was successfully added
         * * SIG_CONST.ERROR_MAID_OUT_OF_RANGE -> the maId is out of range (must not be between SYSTEM_DOWN and SYSTEM_UP)
         * * SIG_CONST.ERROR_MAID_MIID_ALREADY_IN_USE -> An event is already defined with the given maId and miId but with a different name
         */
        addUserDefinedInternalEvent(
            eventName: string,
            maId: number,
            miId: number,
            desc: string,
            accNo: number
        ): number
        /**
         * Adds a user defined external event.
         * 
         * The maId must not be between SYSTEM_DOWN and SYSTEM_UP, otherwise the error SIG_CONST.ERROR_MAID_OUT_OF_RANGE will be returned.
         * If an event with the same maId and miId is already defined for a different event name, SIG_CONST.ERROR_MAID_MIID_ALREADY_IN_USE will be returned.
         * If the event name is also the same, the event is valide and SIG_CONST.ERROR_NONE is returned.
         * 
         * WARNING: The event system is not intended to manage an infinite number of events.
         * Therefore, it should be checked exactly whether it is necessary to register your own event or whether it is sufficient to send 
         * a generic event with your own user data.
         *
         * @param {string} eventName The name of the event
         * @param {number} maId The maId of the Event (must not be between SYSTEM_DOWN and SYSTEM_UP)
         * @param {number} miId The miId of the Event
         * @param {string} desc The description of the event
         * @param {number} accNo The accessnumber of the event
         * 
         * @returns {number} one of the following errorcodes:
         * * SIG_CONST.ERROR_NONE -> the event was successfully added
         * * SIG_CONST.ERROR_MAID_OUT_OF_RANGE -> the maId is out of range (must not be between SYSTEM_DOWN and SYSTEM_UP)
         * * SIG_CONST.ERROR_MAID_MIID_ALREADY_IN_USE -> An event is already defined with the given maId and miId but with a different name
         */
        addUserDefinedExternalEvent(
            eventName: string,
            maId: number,
            miId: number,
            desc: string,
            accNo: number
        ): number
    }
}
