Skip to content

[EuiSelectable] Simplify/refactor EuiSelectableOption interface #5616

@thompsongl

Description

@thompsongl

Currently, the EuiSelectableOption interface (when inferred during d.ts generation; in eui.d.ts) contains hundreds of lines copied from DOM element definitions: every attribute and event handler allowed by both <div> and <li> (see below).

The likely culprit is the Exclude bit with <div>:

type _EuiSelectableGroupLabelOption = Omit<
EuiSelectableOptionBase,
'isGroupLabel'
> &
Exclude<HTMLAttributes<HTMLDivElement>, 'id'> & {
isGroupLabel: true;
};

And again with <li>:

type _EuiSelectableLIOption = EuiSelectableOptionBase &
Exclude<HTMLAttributes<HTMLLIElement>, 'id'>;

Omit may not result in such output, but that's just a guess.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions