Tidy 5e Sheets API
    Preparing search index...

    Type Alias ItemToggleConfig

    A custom toggle switch.

    type ItemToggleConfig = {
        active?: (item: Item5e) => boolean;
        editable?: (item: Item5e) => boolean;
        field?: string;
        icon?: string;
        id: string;
        itemTypes?: string[];
        label: string;
        onChange?: (item: Item5e) => Promise<any>;
        visible?: (item: Item5e) => boolean;
    }
    Index
    active?: (item: Item5e) => boolean

    Optional callback that denotes whether the toggle switch is currently toggle on. Use this in combination with onChange. Otherwise, this is handled automatically with the field property.

    Type Declaration

      • (item: Item5e): boolean
      • Parameters

        • item: Item5e

        Returns boolean

        true for toggled on, false for toggled off

    editable?: (item: Item5e) => boolean

    A callback to determine if the toggle is editable by the current user.

    Type Declaration

      • (item: Item5e): boolean
      • Parameters

        • item: Item5e

        Returns boolean

        true for editable, false for read-only

    field?: string

    Optional property path for where to save the data. Typically, this is a flag path, like flags.my-example.is-cursed.

    icon?: string

    The FontAwesome icon to show for this toggle.

    id: string

    A unique ID for this toggle.

    itemTypes?: string[]

    The item types which should show this toggle. Excluding this property indicates item types.

    label: string

    The label text to show for this toggle. Supports localization keys.

    onChange?: (item: Item5e) => Promise<any>

    Optional callback to allow handling a change to the toggle value. If a property path is not available, or saving changes requires more work, use this callback.

    visible?: (item: Item5e) => boolean

    A callback to determine whether the toggle should be visible, based on the item document.

    Type Declaration

      • (item: Item5e): boolean
      • Parameters

        • item: Item5e

        Returns boolean

        true for editable, false for read-only