foo-webview-sdk
    Preparing search index...

    Type Alias MenuPopupItem

    A single item in a self-drawn (WebView-rendered) popup menu.

    This is the input shape accepted by menu.show / menu.popup, distinct from the read-only MenuItem tree returned by menu.getMainMenu / menu.getContextMenu.

    type MenuPopupItem = {
        checked?: boolean;
        cover?: string;
        enabled?: boolean;
        iconSvg?: { content: string; viewBox: string };
        id?: string;
        label?: string;
        max?: number;
        min?: number;
        orientation?: "horizontal" | "vertical";
        segments?: {
            enabled?: boolean;
            iconSvg?: { content: string; viewBox: string };
            label?: string;
        }[];
        submenu?: MenuPopupItem[];
        subtitle?: string;
        title?: string;
        type?: | "normal"
        | "separator"
        | "nowplaying"
        | "rating"
        | "slider"
        | "segmented";
        value?: number;
    }
    Index
    checked?: boolean

    Renders a check mark to the left of the label.

    cover?: string

    type: 'nowplaying' album art, drawn at 40x40 CSS px by the default stylesheet. Accepts three forms: a full data URL (data:image/jpeg;base64,...), an http(s):// URL (used directly), or raw base64 (decoded as JPEG).

    enabled?: boolean

    Disabled rows are greyed out and cannot be chosen. Defaults to true.

    iconSvg?: { content: string; viewBox: string }

    Inline monochrome SVG icon, drawn before the label. content is the SVG inner markup (e.g. "<path d=\"...\"/>"). The overlay runtime parses it with DOMParser and clones only an allowlisted set of shape elements / attributes into the live document; raw innerHTML injection is not used. An illegal or oversized (>32 KiB) icon is dropped silently and the row continues without an icon.

    id?: string

    Stable id echoed back through menu:select when the row is chosen.

    label?: string

    Visible row text; omitted for separators.

    max?: number

    type: 'slider' range maximum (default 100).

    min?: number

    type: 'slider' range minimum (default 0).

    orientation?: "horizontal" | "vertical"

    type: 'slider' axis only ('horizontal' | 'vertical'). Default when omitted: 'horizontal'. Only the exact value 'vertical' is vertical; unknown strings fall back to horizontal, and non-slider types ignore the field. Vertical semantics: min at bottom, max at top; ArrowUp / ArrowRight increase, ArrowDown / ArrowLeft decrease, Home=min, End=max. A constant slider (min === max after normalization) displays its value and never emits a value change.

    segments?: {
        enabled?: boolean;
        iconSvg?: { content: string; viewBox: string };
        label?: string;
    }[]

    type: 'segmented' segments — an inline single-select control (one row of mutually exclusive options). The selected segment is value, a zero-based index. Each segment shows its iconSvg when present, otherwise its label; a segment with enabled: false is greyed out and cannot be picked. Picking one reports { menuId, itemId, value } through menu:valueChanged and keeps the menu open (Left/Right also move the selection). Segment icons go through the same allowlist sanitizer as item icons, so an illegal icon is dropped per segment.

    submenu?: MenuPopupItem[]

    Nested child items; presence renders a flyout arrow.

    subtitle?: string

    type: 'nowplaying' secondary line (artist / album).

    title?: string

    type: 'nowplaying' primary line (track title). Falls back to label.

    type?: "normal" | "separator" | "nowplaying" | "rating" | "slider" | "segmented"

    Row kind. 'separator' renders a divider; any other value is a normal row.

    The rich kinds ('nowplaying' / 'rating' / 'slider' / 'segmented') draw an inline control instead of a plain label row. A rating, slider, or segmented change reports through menu:valueChanged and keeps the menu open; a now-playing card is an ordinary selection that reports through menu:select and closes the menu.

    value?: number

    Current value of a rich value control. type: 'rating' → integer stars 0..5; type: 'slider' → integer within [min, max]; type: 'segmented' → zero-based index of the selected segment. Changes are reported through menu:valueChanged as { menuId, itemId, value } without closing the menu, so the page owns what a value means.