Skip to content

Commit

Permalink
Use partial instead
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula committed Mar 3, 2025
1 parent 6427fa0 commit ca7444c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ interface Props {
navigation: NavigationPublicPluginStart;
}

type ControlGroupAPI = DefaultControlApi & {
clearSelections?: () => void;
};

const DEST_COUNTRY_CONTROL_ID = 'DEST_COUNTRY_CONTROL_ID';

export const SearchExample = ({ data, dataView, navigation }: Props) => {
Expand Down Expand Up @@ -184,7 +180,7 @@ export const SearchExample = ({ data, dataView, navigation }: Props) => {
onClick={() => {
if (controlGroupAPI) {
Object.values(controlGroupAPI.children$.getValue()).forEach((controlApi) => {
(controlApi as ControlGroupAPI)?.clearSelections?.();
(controlApi as DefaultControlApi)?.clearSelections?.();
});
}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {

import { DefaultDataControlState } from '../../../common';
import { ControlGroupApi } from '../../control_group/types';
import { CanClearSelections } from '../../types';
import { ControlFactory, DefaultControlApi } from '../types';
import { PublishesAsyncFilters } from './publishes_async_filters';

Expand All @@ -31,7 +30,6 @@ export interface PublishesField {

export type DataControlApi = DefaultControlApi &
Omit<PublishesTitle, 'hideTitle$'> & // control titles cannot be hidden
CanClearSelections &
HasEditCapabilities &
PublishesDataViews &
PublishesField &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import type { PublishesTitle, PublishesTimeslice } from '@kbn/presentation-publishing';
import type { DefaultControlState } from '../../../common';
import { CanClearSelections } from '../../types';
import type { DefaultControlApi } from '../types';

export type Timeslice = [number, number];
Expand All @@ -22,6 +21,5 @@ export interface TimesliderControlState extends DefaultControlState {
}

export type TimesliderControlApi = DefaultControlApi &
CanClearSelections &
Pick<PublishesTitle, 'defaultTitle$'> &
PublishesTimeslice;
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export type DefaultControlApi = PublishesDataLoading &
PublishesBlockingError &
PublishesUnsavedChanges &
Partial<PublishesTitle & PublishesDisabledActionIds & HasCustomPrepend> &
Partial<CanClearSelections> &
HasType &
HasUniqueId &
HasSerializableState<DefaultControlState> &
Expand Down

0 comments on commit ca7444c

Please sign in to comment.