diff --git a/packages/internet-header/src/components/post-language-switch/post-language-switch.tsx b/packages/internet-header/src/components/post-language-switch/post-language-switch.tsx index 463497bdcf..f0fb6af64d 100644 --- a/packages/internet-header/src/components/post-language-switch/post-language-switch.tsx +++ b/packages/internet-header/src/components/post-language-switch/post-language-switch.tsx @@ -12,12 +12,7 @@ import { import { SvgSprite } from '../../utils/svg-sprite.component'; import { SvgIcon } from '../../utils/svg-icon.component'; import { state } from '../../data/store'; -import { - DropdownElement, - DropdownEvent, - HasDropdown, - NavLangEntity, -} from '../../models/header.model'; +import { DropdownEvent, HasDropdown, NavLangEntity } from '../../models/header.model'; import { elementHasTransition, userPrefersReducedMotion } from '../../services/ui.service'; import { translate } from '../../services/language.service'; import { PostLanguageSwitchList } from './components/post-language-switch-list'; @@ -35,7 +30,7 @@ export class PostLanguageSwitch implements HasDropdown { */ @Prop() mode: 'dropdown' | 'list'; @State() langSwitchOpen = false; - @Element() host: DropdownElement; + @Element() host: HTMLPostLanguageSwitchElement; /** * Fires when the dropdown has been toggled. */ diff --git a/packages/internet-header/src/components/post-main-navigation/post-main-navigation.tsx b/packages/internet-header/src/components/post-main-navigation/post-main-navigation.tsx index ba95be874f..542581c133 100644 --- a/packages/internet-header/src/components/post-main-navigation/post-main-navigation.tsx +++ b/packages/internet-header/src/components/post-main-navigation/post-main-navigation.tsx @@ -1,13 +1,7 @@ import { Component, Element, Event, EventEmitter, h, Host, Method, State } from '@stencil/core'; import { throttle } from 'throttle-debounce'; import { state } from '../../data/store'; -import { - DropdownElement, - DropdownEvent, - HasDropdown, - IsFocusable, - NavMainEntity, -} from '../../models/header.model'; +import { DropdownEvent, HasDropdown, IsFocusable, NavMainEntity } from '../../models/header.model'; import { userPrefersReducedMotion } from '../../services/ui.service'; import { translate } from '../../services/language.service'; import { SvgSprite } from '../../utils/svg-sprite.component'; @@ -30,7 +24,7 @@ export class PostMainNavigation implements HasDropdown, IsFocusable { * Fires when the flyout has been toggled. */ @Event() flyoutToggled: EventEmitter; - @Element() host: DropdownElement; + @Element() host: HTMLPostMainNavigationElement; private throttledResize: throttle<() => void>; private resizeTimer: number | null = null; private mouseLeaveTimer: number | null = null; diff --git a/packages/internet-header/src/components/post-search/post-search.tsx b/packages/internet-header/src/components/post-search/post-search.tsx index c77c8956b9..c1f2750158 100644 --- a/packages/internet-header/src/components/post-search/post-search.tsx +++ b/packages/internet-header/src/components/post-search/post-search.tsx @@ -6,7 +6,6 @@ import { CoveoCompletion } from '../../models/coveo.model'; import { GeocodeLocation } from '../../models/geocode.model'; import { TagManagerDataLayer } from '../../models/general.model'; import { - DropdownElement, DropdownEvent, HasDropdown, ISearchRecommendation, @@ -42,7 +41,7 @@ export class PostSearch implements HasDropdown, IsFocusable { * Fires when the dropdown has been toggled. */ @Event() dropdownToggled: EventEmitter; - @Element() host: DropdownElement; + @Element() host: HTMLPostSearchElement; private searchBox?: HTMLInputElement; private searchFlyout: HTMLElement | undefined; private throttledResize: throttle<() => void>; diff --git a/packages/internet-header/src/models/header.model.ts b/packages/internet-header/src/models/header.model.ts index 673ec98d4c..a31dde1a44 100644 --- a/packages/internet-header/src/models/header.model.ts +++ b/packages/internet-header/src/models/header.model.ts @@ -158,12 +158,15 @@ export interface IsFocusable { export type FocusableElement = HTMLElement & IsFocusable; -export interface HasDropdown { +export interface IDropdownElement { toggleDropdown: (force?: boolean) => Promise; +} + +export interface HasDropdown extends IDropdownElement { dropdownToggled: EventEmitter; } -export type DropdownElement = HTMLElement & HasDropdown; +export type DropdownElement = HTMLElement & IDropdownElement; export type DropdownEvent = { open: boolean; element: DropdownElement };