You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SearchBar] Export common search_bar/query types #6218
It is possible to supply a custom options.fieldValuesToQuery to Query.toESQuery, however much of the types required to work with that function are not exported from @elastic/eui:
Specifically,
import {
AST,
OperatorType,
Value,
} from '@elastic/eui/src/components/search_bar/query/ast';
import { QueryContainer } from '@elastic/eui/src/components/search_bar/query/ast_to_es_query_dsl';
import { printIso8601 } from '@elastic/eui/src/components/search_bar/query/date_format';
import {
dateValue,
DateValue,
isDateValue,
} from '@elastic/eui/src/components/search_bar/query/date_value';
import { isDateLike } from '@elastic/eui/src/services/predicate';
To be perfectly honest, my first instinct is to say no. My worry is that their names are incredibly generic vs EUI specific, and might end up causing annoying namespace conflicts (see: RTL shenanigans). Additionally, the listed types are still obtainable by diving into the specific component / files, so it's not like they're not available for complex use cases - whereas the majority of consumers will not need them at the top level 🤷
I agree with the concerns about exporting the existing types/interfaces as they are. That whole query/ast class could do with a documentation & types pass, which would better inform what could be exported to support implementations.
Activity
cee-chen commentedon Sep 28, 2022
@thompsongl @chandlerprall Can you weigh in on whether we'd consider exporting the types @PhaedrusTheGreek listed in the above example at the top level of
@elastic/eui?To be perfectly honest, my first instinct is to say no. My worry is that their names are incredibly generic vs EUI specific, and might end up causing annoying namespace conflicts (see: RTL shenanigans). Additionally, the listed types are still obtainable by diving into the specific component / files, so it's not like they're not available for complex use cases - whereas the majority of consumers will not need them at the top level 🤷
chandlerprall commentedon Sep 30, 2022
I agree with the concerns about exporting the existing types/interfaces as they are. That whole query/ast class could do with a documentation & types pass, which would better inform what could be exported to support implementations.
daveyholler commentedon Dec 5, 2022
We won't be addressing this at this time.