Skip to content

[SearchBar] Export common search_bar/query types #6218

Closed as not planned
Closed as not planned

Description

@PhaedrusTheGreek

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';

Activity

  1. cee-chen commented on Sep 28, 2022

    @cee-chen
    Contributor

    @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 🤷

  2. chandlerprall commented on Sep 30, 2022

    @chandlerprall
    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.

  3. daveyholler commented on Dec 5, 2022

    @daveyholler
    Contributor

    We won't be addressing this at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions