foo-webview-sdk
    Preparing search index...

    Variable discoveryConst

    discovery: {
        executeContextMenuByPath: (
            opts: DiscoveryExecuteContextMenuByPathParams,
        ) => Promise<DiscoveryExecuteContextMenuByPathResponse>;
        executeContextMenuCommand: (
            opts: DiscoveryExecuteContextMenuCommandParams,
        ) => Promise<DiscoveryExecuteContextMenuCommandResponse>;
        executeMainMenuCommand: (
            guid: string,
            subGuid?: string,
        ) => Promise<DiscoveryExecuteMainMenuCommandResponse>;
        getAllServices: () => Promise<DiscoveryGetAllServicesResponse>;
        getComponents: () => Promise<DiscoveryGetComponentsResponse>;
        getContextMenuCommands: (
            opts?: DiscoveryGetContextMenuCommandsParams,
        ) => Promise<DiscoveryGetContextMenuCommandsResponse>;
        getContextMenuTree: () => Promise<DiscoveryGetContextMenuTreeResponse>;
        getDspEntries: () => Promise<DiscoveryGetDspEntriesResponse>;
        getInputFormats: () => Promise<DiscoveryGetInputFormatsResponse>;
        getMainMenuCommands: (
            opts?: DiscoveryGetMainMenuCommandsParams,
        ) => Promise<DiscoveryGetMainMenuCommandsResponse>;
        getMainMenuGroups: () => Promise<DiscoveryGetMainMenuGroupsResponse>;
        getOutputDevices: () => Promise<DiscoveryGetOutputDevicesResponse>;
        getPreferencePages: () => Promise<DiscoveryGetPreferencePagesResponse>;
        getUIElements: () => Promise<DiscoveryGetUIElementsResponse>;
        searchCommands: (
            query: string,
            opts?: Omit<DiscoverySearchCommandsParams, "query">,
        ) => Promise<DiscoverySearchCommandsResponse>;
    } = ...

    discovery — service / menu / component discovery namespace.

    Type Declaration

    • executeContextMenuByPath: (
          opts: DiscoveryExecuteContextMenuByPathParams,
      ) => Promise<DiscoveryExecuteContextMenuByPathResponse>

      Executes a context-menu command addressed by its display path, e.g. 'Playback Statistics/Rating/5'.

      Each path segment must match a menu label exactly once, after normalization (mnemonic &, a trailing ellipsis, accelerator text and ASCII case are ignored). Matching is never a substring test, so 'Rating/1' cannot resolve to 'Rating/10'.

      A path that matches several commands is refused instead of guessed — duplicated labels are common in real hosts. That failure carries match: 'ambiguous' and a candidates list of full names; use it to refine the path, or address the command by GUID via executeContextMenuCommand, which is the only stable identifier. target picks the tracks as for that method; it cannot be combined with trackPath.

    • executeContextMenuCommand: (
          opts: DiscoveryExecuteContextMenuCommandParams,
      ) => Promise<DiscoveryExecuteContextMenuCommandResponse>

      Executes a context-menu command by GUID against the tracks target names. The default, 'auto', is the playing track, or the active playlist selection when nothing is playing; 'selection' matches what foobar2000's own context-menu shortcuts act on.

      A FORCE_OFF command is refused rather than dispatched: the SDK treats that state as "keyboard-shortcut list only", so the host never draws it and running it would perform something the user could not have clicked. The refusal fails with NOT_SUPPORTED and carries hidden: true. Pass { force: true } to dispatch anyway. DEFAULT_OFF commands (hidden unless Shift is held) are still invocable and are never refused. When the target holds no track the call fails with NO_ACTIVE_ITEM.

    • executeMainMenuCommand: (
          guid: string,
          subGuid?: string,
      ) => Promise<DiscoveryExecuteMainMenuCommandResponse>

      Execute a main-menu command. For a command expanded from a dynamic submenu, pass the entry's subGuid as well. Dynamic containers and incomplete addresses are refused; the current leaf must have a unique owner and be enabled. A missing GUID fails with NOT_FOUND.

    • getAllServices: () => Promise<DiscoveryGetAllServicesResponse>

      Count the discoverable service families in the running process.

    • getComponents: () => Promise<DiscoveryGetComponentsResponse>

      List the installed components.

    • getContextMenuCommands: (
          opts?: DiscoveryGetContextMenuCommandsParams,
      ) => Promise<DiscoveryGetContextMenuCommandsResponse>

      Lists context-menu commands with their state.

      enabled / checked are only observable when a track is selected or playing, because the SDK evaluates display data against a track set. Check the response's stateKnown before trusting them: when it is false, only hidden is meaningful. FORCE_OFF entries are shortcut-list-only per the SDK and are omitted unless includeHidden is set.

    • getContextMenuTree: () => Promise<DiscoveryGetContextMenuTreeResponse>

      Dumps the full context-menu tree for the current selection (or the playing track), as the host would build it.

      The walk is bounded in depth and in children per node, and any clipping is reported rather than silent: check truncated on the response for the whole tree, or on an individual node for its subtree. A popup node carries both childCount (the host's real count) and childrenReturned (what this response contains) so the two can be reconciled without counting.

    • getDspEntries: () => Promise<DiscoveryGetDspEntriesResponse>

      List the registered DSP entries.

    • getInputFormats: () => Promise<DiscoveryGetInputFormatsResponse>

      List the playable input file types, each with a display name and a filename mask.

    • getMainMenuCommands: (
          opts?: DiscoveryGetMainMenuCommandsParams,
      ) => Promise<DiscoveryGetMainMenuCommandsResponse>

      List main-menu commands. Components that build their submenu at runtime (mainmenu_commands_v2, e.g. ESLyric) are expanded by default, so the result includes their child commands in addition to the parent slot. Pass { expandDynamic: false } for the raw static registry only.

      Entries the host would not show — a command whose get_display() returns false, or one carrying flag_defaulthidden — are omitted by default, because they are not reachable from the real menu. Pass { includeHidden: true } to get the unfiltered superset.

    • getMainMenuGroups: () => Promise<DiscoveryGetMainMenuGroupsResponse>

      List the groups main-menu commands are filed under.

    • getOutputDevices: () => Promise<DiscoveryGetOutputDevicesResponse>

      List the registered output backends by GUID.

    • getPreferencePages: () => Promise<DiscoveryGetPreferencePagesResponse>

      List the pages of the Preferences dialog.

    • getUIElements: () => Promise<DiscoveryGetUIElementsResponse>

      List the registered UI elements.

    • searchCommands: (
          query: string,
          opts?: Omit<DiscoverySearchCommandsParams, "query">,
      ) => Promise<DiscoverySearchCommandsResponse>

      Case-insensitive substring search over command names, descriptions and menu paths, across both menu families.

      Each hit carries type ('mainmenu' / 'contextmenu') plus the same state fields the enumeration endpoints return, so a caller can tell whether a hit is invocable without a second round trip. Pass { scope: 'mainmenu' } or { scope: 'contextmenu' } to search one family only.

      Entries the host would not show are excluded, matching the enumeration endpoints; pass { includeHidden: true } for the unfiltered superset. Dynamic submenus are expanded by default — pass { expandDynamic: false } for the static registry only.

      Context-menu state is only observable with a track selected or playing. When the context family was searched without one, the response's stateKnown is false and its hits' enabled / checked must not be filtered on.