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

    Interface CompanionBooleanFeedbackDefinition<TOptions>

    The definition of a boolean feedback

    interface CompanionBooleanFeedbackDefinition<
        TOptions extends CompanionOptionValues = CompanionOptionValues,
    > {
        callback: (
            feedback: CompanionFeedbackBooleanEvent<TOptions>,
            context: CompanionCommonCallbackContext,
        ) => boolean | Promise<boolean>;
        defaultStyle: Partial<CompanionFeedbackButtonStyleResult>;
        description?: string;
        learn?: (
            feedback: CompanionFeedbackInfo<TOptions>,
            context: CompanionCommonCallbackContext,
        ) => Partial<TOptions> | Promise<Partial<TOptions> | undefined> | undefined;
        learnTimeout?: number;
        name: string;
        options: SomeCompanionFeedbackInputField<Extract<keyof TOptions, string>>[];
        showInvert?: boolean;
        sortName?: string;
        type: "boolean";
        unsubscribe?: (
            feedback: CompanionFeedbackInfo<TOptions>,
            context: CompanionCommonCallbackContext,
        ) => void | Promise<void>;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    callback: (
        feedback: CompanionFeedbackBooleanEvent<TOptions>,
        context: CompanionCommonCallbackContext,
    ) => boolean | Promise<boolean>

    Called to get the feedback value

    defaultStyle: Partial<CompanionFeedbackButtonStyleResult>

    The default style properties for this feedback

    description?: string

    Additional description of the feedback

    learn?: (
        feedback: CompanionFeedbackInfo<TOptions>,
        context: CompanionCommonCallbackContext,
    ) => Partial<TOptions> | Promise<Partial<TOptions> | undefined> | undefined

    The user requested to 'learn' the values for this feedback. 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 feedbacks list

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

    The input fields for the feedback

    showInvert?: boolean

    If undefined or true, Companion will add an 'Inverted' checkbox for your feedback, and handle the logic for you. By setting this to false, you can disable this for your feedback. You should do this if it does not make sense for your feedback.

    sortName?: string

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

    type: "boolean"

    The type of the feedback

    unsubscribe?: (
        feedback: CompanionFeedbackInfo<TOptions>,
        context: CompanionCommonCallbackContext,
    ) => void | Promise<void>

    Called to report a feedback has been removed or disabled. Useful to cleanup subscriptions setup in the callback