@companion-module/base
    Preparing search index...

    Interface CompanionActionDefinitionBase<TOptions>

    The base definition of an action, further augmented by:

    • WithSubscribeHooks or WithoutSubscribeHooks definitions, and
    • CallbackWithResult or CallbackWithoutResult definitions
    interface CompanionActionDefinitionBase<TOptions extends CompanionOptionValues> {
        description?: string;
        learn?: (
            action: CompanionActionEvent<TOptions>,
            context: CompanionLearnCallbackContext,
        ) => Partial<TOptions> | Promise<Partial<TOptions> | undefined> | undefined;
        learnTimeout?: number;
        name: string;
        options: SomeCompanionActionInputField<Extract<keyof TOptions, string>>[];
        sortName?: string;
    }

    Type Parameters

    Index

    Properties

    description?: string

    Additional description of the action

    learn?: (
        action: CompanionActionEvent<TOptions>,
        context: CompanionLearnCallbackContext,
    ) => Partial<TOptions> | Promise<Partial<TOptions> | undefined> | undefined

    The user requested to 'learn' the values for this action. Note: As of 2.0, you should only return the values that have been learned, so that expressions in any id fields will be preserved

    learnTimeout?: number

    Timeout for the 'learn' function (in milliseconds) Companion sets a default value of 5s, to ensure that the learn does not get stuck never completing You can change this if this number does not work for you, but you should keep it to a sensible value

    name: string

    Name to show in the actions list

    options: SomeCompanionActionInputField<Extract<keyof TOptions, string>>[]

    The input fields for the action

    sortName?: string

    Alternate value to use when sorting the list of actions By default, the actions are ordered by the name field, but you can override this without altering the visible name by setting this value