Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SearchBar] Export common search_bar/query types #6218

Closed
PhaedrusTheGreek opened this issue Sep 7, 2022 · 3 comments
Closed

[SearchBar] Export common search_bar/query types #6218

PhaedrusTheGreek opened this issue Sep 7, 2022 · 3 comments

Comments

@PhaedrusTheGreek
Copy link
Contributor

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';
@cee-chen
Copy link
Member

cee-chen commented 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
Copy link
Contributor

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
Copy link
Contributor

We won't be addressing this at this time.

@daveyholler daveyholler closed this as not planned Won't fix, can't repro, duplicate, stale Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants