Defines an item that is a Svelte component.

interface Svelte {
    condition?: boolean | () => boolean;
    onPress?: (
        data?: {
            event?: PointerEvent | KeyboardEvent;
            focusSource?: A11yFocusSource;
            item?: TJSMenuData.Item.Svelte;
        },
    ) => OnPressResult
    | Promise<OnPressResult>;
    svelte: Embed;
}
Hierarchy

Properties

condition?: boolean | () => boolean

If a boolean and false or a function that invoked returns a falsy value this item is not added.

onPress?: (
    data?: {
        event?: PointerEvent | KeyboardEvent;
        focusSource?: A11yFocusSource;
        item?: TJSMenuData.Item.Svelte;
    },
) => OnPressResult
| Promise<OnPressResult>

A callback function to invoke; The data object contains the originating event, menu item data, and an A11yFocusSource object to potentially handle later in a continuation of user interaction.

To defer immediate application of the A11yFocusSource return true indicating a focus continuation.

svelte: Embed

An embedded Svelte configuration object.