Skip to content

API Reference / @gtkx/testing / getSuggestedQuery

Variable: getSuggestedQuery ​

const getSuggestedQuery: (widget, variant?, method?) => Suggestion | undefined

Defined in: packages/testing/dist/suggestions.d.ts:28

Computes the recommended query for reaching the given widget, preferring role, then label text, placeholder text, text, display value, and name.

Parameters ​

widget ​

Gtk.Widget

Widget to build a suggestion for.

variant? ​

Variant

Query variant the suggestion should use.

method? ​

Method

Restrict the suggestion to a specific query family instead of choosing by priority.

Returns ​

Suggestion | undefined

The best available suggestion, or undefined when no query applies.