diff --git a/angular/src/app-initialize.ts b/angular/src/app-initialize.ts index cb98eca94e..0838a6d9b4 100644 --- a/angular/src/app-initialize.ts +++ b/angular/src/app-initialize.ts @@ -6,6 +6,8 @@ import { Config } from './providers/config'; import { IonicWindow } from './types/interfaces'; import { raf } from './util/util'; +// TODO(FW-2827): types + export const appInitialize = (config: Config, doc: Document, zone: NgZone) => { return (): any => { const win: IonicWindow | undefined = doc.defaultView as any; diff --git a/angular/src/directives/control-value-accessors/boolean-value-accessor.ts b/angular/src/directives/control-value-accessors/boolean-value-accessor.ts index ac15f5b6b6..3e39238b4c 100644 --- a/angular/src/directives/control-value-accessors/boolean-value-accessor.ts +++ b/angular/src/directives/control-value-accessors/boolean-value-accessor.ts @@ -18,13 +18,13 @@ export class BooleanValueAccessorDirective extends ValueAccessor { super(injector, el); } - writeValue(value: any): void { + writeValue(value: boolean): void { this.el.nativeElement.checked = this.lastValue = value == null ? false : value; setIonicClasses(this.el); } @HostListener('ionChange', ['$event.target']) - _handleIonChange(el: any): void { + _handleIonChange(el: HTMLIonCheckboxElement | HTMLIonToggleElement): void { this.handleChangeEvent(el, el.checked); } } diff --git a/angular/src/directives/control-value-accessors/radio-value-accessor.ts b/angular/src/directives/control-value-accessors/radio-value-accessor.ts index 192f10b58c..71e1c2e8da 100644 --- a/angular/src/directives/control-value-accessors/radio-value-accessor.ts +++ b/angular/src/directives/control-value-accessors/radio-value-accessor.ts @@ -19,6 +19,7 @@ export class RadioValueAccessorDirective extends ValueAccessor { super(injector, el); } + // TODO(FW-2827): type (HTMLIonRadioElement and HTMLElement are both missing `checked`) @HostListener('ionSelect', ['$event.target']) _handleIonSelect(el: any): void { this.handleChangeEvent(el, el.checked); diff --git a/angular/src/directives/control-value-accessors/select-value-accessor.ts b/angular/src/directives/control-value-accessors/select-value-accessor.ts index 36c36f218a..9f5d1ab7df 100644 --- a/angular/src/directives/control-value-accessors/select-value-accessor.ts +++ b/angular/src/directives/control-value-accessors/select-value-accessor.ts @@ -20,7 +20,14 @@ export class SelectValueAccessorDirective extends ValueAccessor { } @HostListener('ionChange', ['$event.target']) - _handleChangeEvent(el: any): void { + _handleChangeEvent( + el: + | HTMLIonRangeElement + | HTMLIonSelectElement + | HTMLIonRadioGroupElement + | HTMLIonSegmentElement + | HTMLIonDatetimeElement + ): void { this.handleChangeEvent(el, el.value); } } diff --git a/angular/src/directives/control-value-accessors/text-value-accessor.ts b/angular/src/directives/control-value-accessors/text-value-accessor.ts index b59d475fcc..96ba5233a6 100644 --- a/angular/src/directives/control-value-accessors/text-value-accessor.ts +++ b/angular/src/directives/control-value-accessors/text-value-accessor.ts @@ -20,7 +20,7 @@ export class TextValueAccessorDirective extends ValueAccessor { } @HostListener('ionChange', ['$event.target']) - _handleInputEvent(el: any): void { + _handleInputEvent(el: HTMLIonInputElement | HTMLIonTextareaElement | HTMLIonSearchbarElement): void { this.handleChangeEvent(el, el.value); } } diff --git a/angular/src/directives/control-value-accessors/value-accessor.ts b/angular/src/directives/control-value-accessors/value-accessor.ts index 3665b3d46c..709f0343cc 100644 --- a/angular/src/directives/control-value-accessors/value-accessor.ts +++ b/angular/src/directives/control-value-accessors/value-accessor.ts @@ -4,6 +4,8 @@ import { Subscription } from 'rxjs'; import { raf } from '../../util/util'; +// TODO(FW-2827): types + @Directive() export class ValueAccessor implements ControlValueAccessor, AfterViewInit, OnDestroy { private onChange: (value: any) => void = () => { diff --git a/angular/src/directives/navigation/ion-router-outlet.ts b/angular/src/directives/navigation/ion-router-outlet.ts index 3511563dd2..cf2c59b885 100644 --- a/angular/src/directives/navigation/ion-router-outlet.ts +++ b/angular/src/directives/navigation/ion-router-outlet.ts @@ -30,6 +30,8 @@ import { isComponentFactoryResolver } from '../../util/util'; import { StackController } from './stack-controller'; import { RouteView, getUrl } from './stack-utils'; +// TODO(FW-2827): types + @Directive({ selector: 'ion-router-outlet', exportAs: 'outlet', diff --git a/angular/src/directives/navigation/stack-controller.ts b/angular/src/directives/navigation/stack-controller.ts index a1e326ca4a..70585027eb 100644 --- a/angular/src/directives/navigation/stack-controller.ts +++ b/angular/src/directives/navigation/stack-controller.ts @@ -17,6 +17,8 @@ import { toSegments, } from './stack-utils'; +// TODO(FW-2827): types + export class StackController { private views: RouteView[] = []; private runningTask?: Promise; diff --git a/angular/src/directives/navigation/stack-utils.ts b/angular/src/directives/navigation/stack-utils.ts index 4f8c5b054f..ae33e03ce7 100644 --- a/angular/src/directives/navigation/stack-utils.ts +++ b/angular/src/directives/navigation/stack-utils.ts @@ -86,6 +86,7 @@ export interface StackEvent { tabSwitch: boolean; } +// TODO(FW-2827): types export interface RouteView { id: number; url: string; diff --git a/angular/src/directives/overlays/modal.ts b/angular/src/directives/overlays/modal.ts index 960b5d2242..8b47d73815 100644 --- a/angular/src/directives/overlays/modal.ts +++ b/angular/src/directives/overlays/modal.ts @@ -108,6 +108,7 @@ export declare interface IonModal extends Components.IonModal { ], }) export class IonModal { + // TODO(FW-2827): type @ContentChild(TemplateRef, { static: false }) template: TemplateRef; isCmpOpen: boolean = false; diff --git a/angular/src/directives/overlays/popover.ts b/angular/src/directives/overlays/popover.ts index 5cee75eecf..a1c1b37239 100644 --- a/angular/src/directives/overlays/popover.ts +++ b/angular/src/directives/overlays/popover.ts @@ -99,6 +99,7 @@ export declare interface IonPopover extends Components.IonPopover { ], }) export class IonPopover { + // TODO(FW-2827): type @ContentChild(TemplateRef, { static: false }) template: TemplateRef; isCmpOpen: boolean = false; diff --git a/angular/src/providers/angular-delegate.ts b/angular/src/providers/angular-delegate.ts index 274d3b2257..7e5dca413d 100644 --- a/angular/src/providers/angular-delegate.ts +++ b/angular/src/providers/angular-delegate.ts @@ -21,6 +21,8 @@ import { EnvironmentInjector } from '../di/r3_injector'; import { NavParams } from '../directives/navigation/nav-params'; import { isComponentFactoryResolver } from '../util/util'; +// TODO(FW-2827): types + @Injectable() export class AngularDelegate { constructor(private zone: NgZone, private appRef: ApplicationRef) {} diff --git a/angular/src/providers/platform.ts b/angular/src/providers/platform.ts index 95a33a7a21..42a9fff095 100644 --- a/angular/src/providers/platform.ts +++ b/angular/src/providers/platform.ts @@ -3,6 +3,8 @@ import { NgZone, Inject, Injectable } from '@angular/core'; import { BackButtonEventDetail, KeyboardEventDetail, Platforms, getPlatforms, isPlatform } from '@ionic/core'; import { Subscription, Subject } from 'rxjs'; +// TODO(FW-2827): types + export interface BackButtonEmitter extends Subject { subscribeWithPriority( priority: number, diff --git a/angular/src/schematics/utils/config.ts b/angular/src/schematics/utils/config.ts index 5215ebdb9e..3e1c7f9d93 100644 --- a/angular/src/schematics/utils/config.ts +++ b/angular/src/schematics/utils/config.ts @@ -4,6 +4,8 @@ import { parse } from 'jsonc-parser'; const CONFIG_PATH = 'angular.json'; +// TODO(FW-2827): types + export function readConfig(host: Tree): any { const sourceText = host.read(CONFIG_PATH)?.toString('utf-8'); return JSON.parse(sourceText); diff --git a/angular/src/types/interfaces.ts b/angular/src/types/interfaces.ts index 9b1b1cf0ba..b86fa899f3 100644 --- a/angular/src/types/interfaces.ts +++ b/angular/src/types/interfaces.ts @@ -1,5 +1,5 @@ export interface IonicGlobal { - config?: any; + config?: any; // TODO(FW-2827): type asyncQueue?: boolean; } diff --git a/angular/src/util/overlay.ts b/angular/src/util/overlay.ts index 992e009c4e..1141eeb0da 100644 --- a/angular/src/util/overlay.ts +++ b/angular/src/util/overlay.ts @@ -1,3 +1,5 @@ +// TODO(FW-2827): types + interface ControllerShape { create(options: Opts): Promise; dismiss(data?: any, role?: string, id?: string): Promise; diff --git a/core/src/components/alert/alert-interface.ts b/core/src/components/alert/alert-interface.ts index 7dfe782bb3..25ffd5e391 100644 --- a/core/src/components/alert/alert-interface.ts +++ b/core/src/components/alert/alert-interface.ts @@ -30,7 +30,7 @@ export interface AlertInput { type?: TextFieldTypes | 'checkbox' | 'radio' | 'textarea'; name?: string; placeholder?: string; - value?: any; + value?: any; // TODO(FW-2832): type label?: string; checked?: boolean; disabled?: boolean; @@ -60,5 +60,6 @@ export interface AlertButton { role?: 'cancel' | 'destructive' | string; cssClass?: string | string[]; id?: string; + // TODO(FW-2832): type handler?: (value: any) => AlertButtonOverlayHandler | Promise; } diff --git a/core/src/components/alert/alert.tsx b/core/src/components/alert/alert.tsx index 9f1cbc4d6c..8e7284fefe 100644 --- a/core/src/components/alert/alert.tsx +++ b/core/src/components/alert/alert.tsx @@ -25,6 +25,8 @@ import { iosLeaveAnimation } from './animations/ios.leave'; import { mdEnterAnimation } from './animations/md.enter'; import { mdLeaveAnimation } from './animations/md.leave'; +// TODO(FW-2832): types + /** * @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use. */ diff --git a/core/src/components/app/app.tsx b/core/src/components/app/app.tsx index c49083c4f5..9c3ba928f3 100644 --- a/core/src/components/app/app.tsx +++ b/core/src/components/app/app.tsx @@ -10,7 +10,7 @@ import { isPlatform } from '../../utils/platform'; styleUrl: 'app.scss', }) export class App implements ComponentInterface { - private focusVisible?: any; + private focusVisible?: any; // TODO(FW-2832): type @Element() el!: HTMLElement; diff --git a/core/src/components/checkbox/checkbox.tsx b/core/src/components/checkbox/checkbox.tsx index 5d8e482b78..73706fa228 100644 --- a/core/src/components/checkbox/checkbox.tsx +++ b/core/src/components/checkbox/checkbox.tsx @@ -114,7 +114,7 @@ export class Checkbox implements ComponentInterface { } } - private onClick = (ev: any) => { + private onClick = (ev: Event) => { ev.preventDefault(); this.setFocus(); diff --git a/core/src/components/content/content.tsx b/core/src/components/content/content.tsx index 1d85446df3..99f50d5c89 100644 --- a/core/src/components/content/content.tsx +++ b/core/src/components/content/content.tsx @@ -21,7 +21,7 @@ import { createColorClasses, hostContext } from '../../utils/theme'; shadow: true, }) export class Content implements ComponentInterface { - private watchDog: any; + private watchDog: ReturnType | null = null; private isScrolling = false; private lastScroll = 0; private queued = false; @@ -311,7 +311,7 @@ export class Content implements ComponentInterface { } private onScrollEnd() { - clearInterval(this.watchDog); + if (this.watchDog) clearInterval(this.watchDog); this.watchDog = null; if (this.isScrolling) { this.isScrolling = false; diff --git a/core/src/components/datetime/datetime.tsx b/core/src/components/datetime/datetime.tsx index 739e727abe..bb42c8532b 100644 --- a/core/src/components/datetime/datetime.tsx +++ b/core/src/components/datetime/datetime.tsx @@ -95,6 +95,7 @@ export class Datetime implements ComponentInterface { private destroyCalendarListener?: () => void; private destroyKeyboardMO?: () => void; + // TODO(FW-2832): types (DatetimeParts causes some errors that need untangling) private minParts?: any; private maxParts?: any; private todayParts!: DatetimeParts; diff --git a/core/src/components/footer/footer.tsx b/core/src/components/footer/footer.tsx index d783dbd0fc..fcdb283c1b 100644 --- a/core/src/components/footer/footer.tsx +++ b/core/src/components/footer/footer.tsx @@ -20,7 +20,7 @@ import { handleFooterFade } from './footer.utils'; }) export class Footer implements ComponentInterface { private scrollEl?: HTMLElement; - private contentScrollCallback: any; + private contentScrollCallback?: () => void; private keyboardCtrl: KeyboardController | null = null; @State() private keyboardVisible = false; diff --git a/core/src/components/header/header.tsx b/core/src/components/header/header.tsx index 9ebc2f9579..35b476d8fb 100644 --- a/core/src/components/header/header.tsx +++ b/core/src/components/header/header.tsx @@ -29,8 +29,8 @@ import { }) export class Header implements ComponentInterface { private scrollEl?: HTMLElement; - private contentScrollCallback?: any; - private intersectionObserver?: any; + private contentScrollCallback?: () => void; + private intersectionObserver?: IntersectionObserver; private collapsibleMainHeader?: HTMLElement; private inheritedAttributes: Attributes = {}; @@ -153,9 +153,9 @@ export class Header implements ComponentInterface { this.scrollEl = await getScrollElement(contentEl); const headers = pageEl.querySelectorAll('ion-header'); - this.collapsibleMainHeader = Array.from(headers).find((header: any) => header.collapse !== 'condense') as - | HTMLElement - | undefined; + this.collapsibleMainHeader = Array.from(headers).find( + (header: HTMLIonHeaderElement) => header.collapse !== 'condense' + ) as HTMLElement | undefined; if (!this.collapsibleMainHeader) { return; @@ -177,7 +177,7 @@ export class Header implements ComponentInterface { * as well as progressively showing/hiding the main header * border as the top-most toolbar collapses or expands. */ - const toolbarIntersection = (ev: any) => { + const toolbarIntersection = (ev: IntersectionObserverEntry[]) => { handleToolbarIntersection(ev, mainHeaderIndex, scrollHeaderIndex, this.scrollEl!); }; diff --git a/core/src/components/header/header.utils.ts b/core/src/components/header/header.utils.ts index 84e882b161..77c3807cfe 100644 --- a/core/src/components/header/header.utils.ts +++ b/core/src/components/header/header.utils.ts @@ -40,7 +40,7 @@ export const createHeaderIndex = (headerEl: HTMLElement | undefined): HeaderInde return { el: headerEl, - toolbars: Array.from(toolbars).map((toolbar: any) => { + toolbars: Array.from(toolbars).map((toolbar: HTMLIonToolbarElement) => { const ionTitleEl = toolbar.querySelector('ion-title'); return { el: toolbar, @@ -86,7 +86,11 @@ export const setToolbarBackgroundOpacity = (headerEl: HTMLIonHeaderElement, opac } }; -const handleToolbarBorderIntersection = (ev: any, mainHeaderIndex: HeaderIndex, scrollTop: number) => { +const handleToolbarBorderIntersection = ( + ev: IntersectionObserverEntry[], + mainHeaderIndex: HeaderIndex, + scrollTop: number +) => { if (!ev[0].isIntersecting) { return; } @@ -113,7 +117,7 @@ const handleToolbarBorderIntersection = (ev: any, mainHeaderIndex: HeaderIndex, * hide the primary toolbar content and show the scrollable toolbar content */ export const handleToolbarIntersection = ( - ev: any, + ev: any, // TODO(FW-2832): type (IntersectionObserverEntry[] triggers errors which should be sorted) mainHeaderIndex: HeaderIndex, scrollHeaderIndex: HeaderIndex, scrollEl: HTMLElement diff --git a/core/src/components/item-options/item-options.tsx b/core/src/components/item-options/item-options.tsx index 0d113714aa..2e40faf162 100644 --- a/core/src/components/item-options/item-options.tsx +++ b/core/src/components/item-options/item-options.tsx @@ -24,7 +24,7 @@ export class ItemOptions implements ComponentInterface { /** * Emitted when the item has been fully swiped. */ - @Event() ionSwipe!: EventEmitter; + @Event() ionSwipe!: EventEmitter; // TODO(FW-2832): type /** @internal */ @Method() diff --git a/core/src/components/item-sliding/item-sliding.tsx b/core/src/components/item-sliding/item-sliding.tsx index eb11d1136f..1c2a7c7548 100644 --- a/core/src/components/item-sliding/item-sliding.tsx +++ b/core/src/components/item-sliding/item-sliding.tsx @@ -39,7 +39,7 @@ export class ItemSliding implements ComponentInterface { private optsWidthRightSide = 0; private optsWidthLeftSide = 0; private sides = ItemSide.None; - private tmr: number | undefined; + private tmr?: ReturnType; private leftOptions?: HTMLIonItemOptionsElement; private rightOptions?: HTMLIonItemOptionsElement; private optsDirty = true; @@ -418,7 +418,7 @@ export class ItemSliding implements ComponentInterface { if (this.gesture) { this.gesture.enable(!this.disabled); } - }, 600) as any; + }, 600); openSlidingItem = undefined; style.transform = ''; diff --git a/core/src/components/item/item.tsx b/core/src/components/item/item.tsx index f25ac50790..e798aca310 100644 --- a/core/src/components/item/item.tsx +++ b/core/src/components/item/item.tsx @@ -177,7 +177,7 @@ export class Item implements ComponentInterface, AnchorInterface, ButtonInterfac const tagName = (ev.target as HTMLElement).tagName; const updatedStyles = ev.detail; - const newStyles = {} as any; + const newStyles = {} as CssClassMap; const childStyles = this.itemStyles.get(tagName) || {}; let hasStyleChange = false; @@ -364,7 +364,7 @@ export class Item implements ComponentInterface, AnchorInterface, ButtonInterfac routerDirection, inheritedAriaAttributes, } = this; - const childStyles = {} as any; + const childStyles = {} as StyleEventDetail; const mode = getIonMode(this); const clickable = this.isClickable(); const canActivate = this.canActivate(); diff --git a/core/src/components/loading/loading.tsx b/core/src/components/loading/loading.tsx index 21ce53a377..413360e08d 100644 --- a/core/src/components/loading/loading.tsx +++ b/core/src/components/loading/loading.tsx @@ -20,6 +20,8 @@ import { iosLeaveAnimation } from './animations/ios.leave'; import { mdEnterAnimation } from './animations/md.enter'; import { mdLeaveAnimation } from './animations/md.leave'; +// TODO(FW-2832): types + /** * @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use. */ @@ -32,7 +34,7 @@ import { mdLeaveAnimation } from './animations/md.leave'; scoped: true, }) export class Loading implements ComponentInterface, OverlayInterface { - private durationTimeout: any; + private durationTimeout?: ReturnType; presented = false; lastFocus?: HTMLElement; diff --git a/core/src/components/menu/menu.tsx b/core/src/components/menu/menu.tsx index a24934d0cc..178491bef9 100644 --- a/core/src/components/menu/menu.tsx +++ b/core/src/components/menu/menu.tsx @@ -31,7 +31,7 @@ const focusableQueryString = shadow: true, }) export class Menu implements ComponentInterface, MenuI { - private animation?: any; + private animation?: any; // TODO(FW-2832): type private lastOnEnd = 0; private gesture?: Gesture; private blocker = GESTURE_CONTROLLER.createBlocker({ disableScroll: true }); @@ -257,6 +257,7 @@ export class Menu implements ComponentInterface, MenuI { @Listen('click', { capture: true }) onBackdropClick(ev: any) { + // TODO(FW-2832): type (CustomEvent triggers errors which should be sorted) if (this._isOpen && this.lastOnEnd < ev.timeStamp - 100) { const shouldClose = ev.composedPath ? !ev.composedPath().includes(this.menuInnerEl) : false; diff --git a/core/src/components/modal/modal.tsx b/core/src/components/modal/modal.tsx index 6269637ab2..f494eb5946 100644 --- a/core/src/components/modal/modal.tsx +++ b/core/src/components/modal/modal.tsx @@ -44,6 +44,8 @@ import { createSheetGesture } from './gestures/sheet'; import { createSwipeToCloseGesture } from './gestures/swipe-to-close'; import { setCardStatusBarDark, setCardStatusBarDefault } from './utils'; +// TODO(FW-2832): types + /** * @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use. * diff --git a/core/src/components/nav/nav-interface.ts b/core/src/components/nav/nav-interface.ts index 627901b291..625aa453df 100644 --- a/core/src/components/nav/nav-interface.ts +++ b/core/src/components/nav/nav-interface.ts @@ -9,6 +9,8 @@ import type { import { ViewController } from './view-controller'; +// TODO(FW-2832): types + export type NavDirection = 'back' | 'forward'; export type NavComponent = ComponentRef | ViewController; diff --git a/core/src/components/nav/view-controller.ts b/core/src/components/nav/view-controller.ts index 04d467c832..b20c27edac 100644 --- a/core/src/components/nav/view-controller.ts +++ b/core/src/components/nav/view-controller.ts @@ -6,6 +6,8 @@ export const VIEW_STATE_NEW = 1; export const VIEW_STATE_ATTACHED = 2; export const VIEW_STATE_DESTROYED = 3; +// TODO(FW-2832): types + export class ViewController { state = VIEW_STATE_NEW; nav?: any; diff --git a/core/src/components/picker-column-internal/picker-column-internal.tsx b/core/src/components/picker-column-internal/picker-column-internal.tsx index 53996b4eeb..dd62261751 100644 --- a/core/src/components/picker-column-internal/picker-column-internal.tsx +++ b/core/src/components/picker-column-internal/picker-column-internal.tsx @@ -111,6 +111,7 @@ export class PickerColumnInternal implements ComponentInterface { const parentEl = this.el.closest('ion-picker-internal') as HTMLIonPickerInternalElement | null; if (parentEl !== null) { + // TODO(FW-2832): type parentEl.addEventListener('ionInputModeChange', (ev: any) => this.inputModeChange(ev)); } } @@ -231,7 +232,7 @@ export class PickerColumnInternal implements ComponentInterface { private initializeScrollListener = () => { const { el } = this; - let timeout: any; + let timeout: ReturnType | undefined; let activeEl: HTMLElement | null = this.activeItem; const scrollCallback = () => { diff --git a/core/src/components/picker-column/picker-column.tsx b/core/src/components/picker-column/picker-column.tsx index 3d86df7dcd..5c20f7c1a8 100644 --- a/core/src/components/picker-column/picker-column.tsx +++ b/core/src/components/picker-column/picker-column.tsx @@ -28,8 +28,8 @@ export class PickerColumnCmp implements ComponentInterface { private y = 0; private optsEl?: HTMLElement; private gesture?: Gesture; - private rafId: any; - private tmrId: any; + private rafId?: ReturnType; + private tmrId?: ReturnType; private noAnimate = true; @Element() el!: HTMLElement; @@ -90,8 +90,8 @@ export class PickerColumnCmp implements ComponentInterface { } disconnectedCallback() { - cancelAnimationFrame(this.rafId); - clearTimeout(this.tmrId); + if (this.rafId !== undefined) cancelAnimationFrame(this.rafId); + if (this.tmrId) clearTimeout(this.tmrId); if (this.gesture) { this.gesture.destroy(); this.gesture = undefined; @@ -110,7 +110,7 @@ export class PickerColumnCmp implements ComponentInterface { this.velocity = 0; // set what y position we're at - cancelAnimationFrame(this.rafId); + if (this.rafId !== undefined) cancelAnimationFrame(this.rafId); this.update(y, duration, true); this.emitColChange(); @@ -251,7 +251,7 @@ export class PickerColumnCmp implements ComponentInterface { hapticSelectionStart(); // reset everything - cancelAnimationFrame(this.rafId); + if (this.rafId !== undefined) cancelAnimationFrame(this.rafId); const options = this.col.options; let minY = options.length - 1; let maxY = 0; diff --git a/core/src/components/picker-internal/picker-internal.tsx b/core/src/components/picker-internal/picker-internal.tsx index 764cfde9c6..d789192f45 100644 --- a/core/src/components/picker-internal/picker-internal.tsx +++ b/core/src/components/picker-internal/picker-internal.tsx @@ -24,7 +24,7 @@ export class PickerInternal implements ComponentInterface { private highlightEl?: HTMLElement; private actionOnClick?: () => void; private destroyKeypressListener?: () => void; - private singleColumnSearchTimeout?: any; + private singleColumnSearchTimeout?: ReturnType; @Element() el!: HTMLIonPickerInternalElement; @@ -76,6 +76,7 @@ export class PickerInternal implements ComponentInterface { * that focused means we are still in input mode. */ private onFocusOut = (ev: any) => { + // TODO(FW-2832): type const { relatedTarget } = ev; if (!relatedTarget || (relatedTarget.tagName !== 'ION-PICKER-COLUMN-INTERNAL' && relatedTarget !== this.inputEl)) { @@ -89,6 +90,7 @@ export class PickerInternal implements ComponentInterface { * whether to enter/exit input mode. */ private onFocusIn = (ev: any) => { + // TODO(FW-2832): type const { target } = ev; /** diff --git a/core/src/components/picker/picker.tsx b/core/src/components/picker/picker.tsx index 1fd57c4e29..3e11fdd78c 100644 --- a/core/src/components/picker/picker.tsx +++ b/core/src/components/picker/picker.tsx @@ -17,6 +17,8 @@ import { getClassMap } from '../../utils/theme'; import { iosEnterAnimation } from './animations/ios.enter'; import { iosLeaveAnimation } from './animations/ios.leave'; +// TODO(FW-2832): types + /** * @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use. */ @@ -29,7 +31,7 @@ import { iosLeaveAnimation } from './animations/ios.leave'; scoped: true, }) export class Picker implements ComponentInterface, OverlayInterface { - private durationTimeout: any; + private durationTimeout?: ReturnType; lastFocus?: HTMLElement; @Element() el!: HTMLIonPickerElement; diff --git a/core/src/components/popover/animations/ios.enter.ts b/core/src/components/popover/animations/ios.enter.ts index b34b512a3e..e74fa4175b 100644 --- a/core/src/components/popover/animations/ios.enter.ts +++ b/core/src/components/popover/animations/ios.enter.ts @@ -14,6 +14,7 @@ const POPOVER_IOS_BODY_PADDING = 5; /** * iOS Popover Enter Animation */ +// TODO(FW-2832): types export const iosEnterAnimation = (baseEl: HTMLElement, opts?: any): Animation => { const { event: ev, size, trigger, reference, side, align } = opts; const doc = baseEl.ownerDocument as any; diff --git a/core/src/components/popover/animations/md.enter.ts b/core/src/components/popover/animations/md.enter.ts index 1fe3d732aa..27d9f9cf38 100644 --- a/core/src/components/popover/animations/md.enter.ts +++ b/core/src/components/popover/animations/md.enter.ts @@ -8,6 +8,7 @@ const POPOVER_MD_BODY_PADDING = 12; /** * Md Popover Enter Animation */ +// TODO(FW-2832): types export const mdEnterAnimation = (baseEl: HTMLElement, opts?: any): Animation => { const { event: ev, size, trigger, reference, side, align } = opts; const doc = baseEl.ownerDocument as any; diff --git a/core/src/components/popover/popover.tsx b/core/src/components/popover/popover.tsx index 9581399a19..9b3ff6a332 100644 --- a/core/src/components/popover/popover.tsx +++ b/core/src/components/popover/popover.tsx @@ -29,6 +29,8 @@ import { mdEnterAnimation } from './animations/md.enter'; import { mdLeaveAnimation } from './animations/md.leave'; import { configureDismissInteraction, configureKeyboardInteraction, configureTriggerInteraction } from './utils'; +// TODO(FW-2832): types + /** * @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use. * diff --git a/core/src/components/popover/utils.ts b/core/src/components/popover/utils.ts index 363db25c52..9c6af58640 100644 --- a/core/src/components/popover/utils.ts +++ b/core/src/components/popover/utils.ts @@ -3,7 +3,7 @@ import { getElementRoot, raf } from '../../utils/helpers'; interface InteractionCallback { eventName: string; - callback: (ev: any) => void; + callback: (ev: any) => void; // TODO(FW-2832): type } export interface ReferenceCoordinates { @@ -169,7 +169,7 @@ export const configureTriggerInteraction = ( */ switch (triggerAction) { case 'hover': - let hoverTimeout: any; + let hoverTimeout: ReturnType | undefined; triggerCallbacks = [ { diff --git a/core/src/components/radio-group/radio-group.tsx b/core/src/components/radio-group/radio-group.tsx index 8dbdcaba87..109cb9b208 100644 --- a/core/src/components/radio-group/radio-group.tsx +++ b/core/src/components/radio-group/radio-group.tsx @@ -105,6 +105,7 @@ export class RadioGroup implements ComponentInterface { @Listen('keydown', { target: 'document' }) onKeydown(ev: any) { + // TODO(FW-2832): type const inSelectPopover = !!this.el.closest('ion-select-popover'); if (ev.target && !this.el.contains(ev.target)) { diff --git a/core/src/components/radio/radio.tsx b/core/src/components/radio/radio.tsx index 9a0a3d97e5..373c5f03a0 100644 --- a/core/src/components/radio/radio.tsx +++ b/core/src/components/radio/radio.tsx @@ -79,6 +79,7 @@ export class Radio implements ComponentInterface { /** @internal */ @Method() async setFocus(ev: any) { + // TODO(FW-2832): type (using Event triggers a build error due to conflict with Stencil Event import) ev.stopPropagation(); ev.preventDefault(); diff --git a/core/src/components/range/range.tsx b/core/src/components/range/range.tsx index f03c501435..3ddbbedd93 100644 --- a/core/src/components/range/range.tsx +++ b/core/src/components/range/range.tsx @@ -22,6 +22,8 @@ import { createColorClasses, hostContext } from '../../utils/theme'; import type { PinFormatter } from './range-interface'; +// TODO(FW-2832): types + /** * @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use. * diff --git a/core/src/components/refresher/refresher.tsx b/core/src/components/refresher/refresher.tsx index a45810b248..1c18c8d55d 100644 --- a/core/src/components/refresher/refresher.tsx +++ b/core/src/components/refresher/refresher.tsx @@ -37,7 +37,7 @@ export class Refresher implements ComponentInterface { private progress = 0; private scrollEl?: HTMLElement; private backgroundContentEl?: HTMLElement; - private scrollListenerCallback?: any; + private scrollListenerCallback?: () => void; private gesture?: Gesture; private pointerDown = false; diff --git a/core/src/components/refresher/refresher.utils.ts b/core/src/components/refresher/refresher.utils.ts index f52f1a7cea..38a44abb6d 100644 --- a/core/src/components/refresher/refresher.utils.ts +++ b/core/src/components/refresher/refresher.utils.ts @@ -26,6 +26,7 @@ export const createPullingAnimation = ( }; const createBaseAnimation = (pullingRefresherIcon: HTMLElement) => { + // TODO(FW-2832): add types/re-evaluate asserting so many things const spinner = pullingRefresherIcon.querySelector('ion-spinner') as HTMLElement; const circle = spinner!.shadowRoot!.querySelector('circle') as any; const spinnerArrowContainer = pullingRefresherIcon.querySelector('.spinner-arrow-container') as HTMLElement; diff --git a/core/src/components/reorder-group/reorder-group.tsx b/core/src/components/reorder-group/reorder-group.tsx index 8855ee6854..5d898cfbfd 100644 --- a/core/src/components/reorder-group/reorder-group.tsx +++ b/core/src/components/reorder-group/reorder-group.tsx @@ -7,6 +7,8 @@ import { findClosestIonContent, getScrollElement } from '../../utils/content'; import { raf } from '../../utils/helpers'; import { hapticSelectionChanged, hapticSelectionEnd, hapticSelectionStart } from '../../utils/native/haptic'; +// TODO(FW-2832): types + const enum ReorderGroupState { Idle = 0, Active = 1, diff --git a/core/src/components/route/route.tsx b/core/src/components/route/route.tsx index 01a513e348..f9ecf90153 100644 --- a/core/src/components/route/route.tsx +++ b/core/src/components/route/route.tsx @@ -3,6 +3,8 @@ import { Component, Event, Prop, Watch } from '@stencil/core'; import type { NavigationHookCallback } from './route-interface'; +// TODO(FW-2832): types + @Component({ tag: 'ion-route', }) diff --git a/core/src/components/router-outlet/route-outlet.tsx b/core/src/components/router-outlet/route-outlet.tsx index c1ba068bed..904244fa3d 100644 --- a/core/src/components/router-outlet/route-outlet.tsx +++ b/core/src/components/router-outlet/route-outlet.tsx @@ -29,6 +29,7 @@ import { transition } from '../../utils/transition'; }) export class RouterOutlet implements ComponentInterface, NavOutlet { private activeEl: HTMLElement | undefined; + // TODO(FW-2832): types private activeComponent: any; private activeParams: any; private waitPromise?: Promise; diff --git a/core/src/components/segment/segment.tsx b/core/src/components/segment/segment.tsx index 4a83c2fa33..d1d8cabae5 100644 --- a/core/src/components/segment/segment.tsx +++ b/core/src/components/segment/segment.tsx @@ -26,7 +26,7 @@ export class Segment implements ComponentInterface { private checked?: HTMLIonSegmentButtonElement; // Value to be emitted when gesture ends - private valueAfterGesture?: any; + private valueAfterGesture?: string; @Element() el!: HTMLIonSegmentElement; diff --git a/core/src/components/select-popover/select-popover.tsx b/core/src/components/select-popover/select-popover.tsx index 9a2c7cb62f..f9a0ca811a 100644 --- a/core/src/components/select-popover/select-popover.tsx +++ b/core/src/components/select-popover/select-popover.tsx @@ -6,6 +6,8 @@ import type { SelectPopoverOption } from '../../interface'; import { safeCall } from '../../utils/overlays'; import { getClassMap } from '../../utils/theme'; +// TODO(FW-2832): types + /** * @internal */ diff --git a/core/src/components/select/select.tsx b/core/src/components/select/select.tsx index c303a6569a..761cae7e20 100644 --- a/core/src/components/select/select.tsx +++ b/core/src/components/select/select.tsx @@ -22,6 +22,8 @@ import { watchForOptions } from '../../utils/watch-options'; import type { SelectCompareFn } from './select-interface'; +// TODO(FW-2832): types + /** * @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use. * diff --git a/core/src/components/spinner/spinner-interface.ts b/core/src/components/spinner/spinner-interface.ts index b5aa336cf7..3b1aee845e 100644 --- a/core/src/components/spinner/spinner-interface.ts +++ b/core/src/components/spinner/spinner-interface.ts @@ -18,7 +18,7 @@ export interface SpinnerData { y2?: number; cx?: number; cy?: number; - style: any; + style: any; // TODO(FW-2832): type viewBox?: string; transform?: string; } diff --git a/core/src/components/spinner/spinner.tsx b/core/src/components/spinner/spinner.tsx index 616a732816..90548e6b08 100644 --- a/core/src/components/spinner/spinner.tsx +++ b/core/src/components/spinner/spinner.tsx @@ -52,7 +52,7 @@ export class Spinner implements ComponentInterface { const spinnerName = self.getName(); const spinner = SPINNERS[spinnerName] ?? SPINNERS['lines']; const duration = typeof self.duration === 'number' && self.duration > 10 ? self.duration : spinner.dur; - const svgs: any[] = []; + const svgs: any[] = []; // TODO(FW-2832): type if (spinner.circles !== undefined) { for (let i = 0; i < spinner.circles; i++) { diff --git a/core/src/components/split-pane/split-pane.tsx b/core/src/components/split-pane/split-pane.tsx index 38cbe65a70..eebcfbfbba 100644 --- a/core/src/components/split-pane/split-pane.tsx +++ b/core/src/components/split-pane/split-pane.tsx @@ -3,6 +3,8 @@ import { Build, Component, Element, Event, Host, Prop, State, Watch, h } from '@ import { getIonMode } from '../../global/ionic-global'; +// TODO(FW-2832): types + const SPLIT_PANE_MAIN = 'split-pane-main'; const SPLIT_PANE_SIDE = 'split-pane-side'; const QUERY: { [key: string]: string } = { diff --git a/core/src/components/toast/toast.tsx b/core/src/components/toast/toast.tsx index 6f562d1994..cc941008e7 100644 --- a/core/src/components/toast/toast.tsx +++ b/core/src/components/toast/toast.tsx @@ -22,6 +22,8 @@ import { mdEnterAnimation } from './animations/md.enter'; import { mdLeaveAnimation } from './animations/md.leave'; import type { ToastAttributes, ToastPosition } from './toast-interface'; +// TODO(FW-2832): types + /** * @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use. * @@ -40,7 +42,7 @@ import type { ToastAttributes, ToastPosition } from './toast-interface'; shadow: true, }) export class Toast implements ComponentInterface, OverlayInterface { - private durationTimeout: any; + private durationTimeout?: ReturnType; presented = false; diff --git a/core/src/components/toolbar/toolbar.tsx b/core/src/components/toolbar/toolbar.tsx index ecb0708c23..4e5e3f3d06 100644 --- a/core/src/components/toolbar/toolbar.tsx +++ b/core/src/components/toolbar/toolbar.tsx @@ -60,7 +60,7 @@ export class Toolbar implements ComponentInterface { const tagName = (ev.target as HTMLElement).tagName; const updatedStyles = ev.detail; - const newStyles = {} as any; + const newStyles = {} as CssClassMap; const childStyles = this.childrenStyles.get(tagName) || {}; let hasStyleChange = false; diff --git a/core/src/components/virtual-scroll/virtual-scroll-interface.ts b/core/src/components/virtual-scroll/virtual-scroll-interface.ts index 30b812cac4..71df559cd9 100644 --- a/core/src/components/virtual-scroll/virtual-scroll-interface.ts +++ b/core/src/components/virtual-scroll/virtual-scroll-interface.ts @@ -1,3 +1,5 @@ +// TODO(FW-2832): types + export interface Cell { i: number; index: number; diff --git a/core/src/components/virtual-scroll/virtual-scroll.tsx b/core/src/components/virtual-scroll/virtual-scroll.tsx index 75e0065a45..4079963c0d 100644 --- a/core/src/components/virtual-scroll/virtual-scroll.tsx +++ b/core/src/components/virtual-scroll/virtual-scroll.tsx @@ -42,6 +42,8 @@ import { updateVDom, } from './virtual-scroll-utils'; +// TODO(FW-2832): types + @Component({ tag: 'ion-virtual-scroll', styleUrl: 'virtual-scroll.scss', diff --git a/core/src/global/config.ts b/core/src/global/config.ts index 3ad08285c0..e79de89865 100644 --- a/core/src/global/config.ts +++ b/core/src/global/config.ts @@ -1,5 +1,7 @@ import type { IonicConfig } from '../interface'; +// TODO(FW-2832): types + export class Config { private m = new Map(); diff --git a/core/src/global/ionic-global.ts b/core/src/global/ionic-global.ts index 6ef4344b68..13a269088b 100644 --- a/core/src/global/ionic-global.ts +++ b/core/src/global/ionic-global.ts @@ -5,6 +5,8 @@ import { isPlatform, setupPlatforms } from '../utils/platform'; import { config, configFromSession, configFromURL, saveConfig } from './config'; +// TODO(FW-2832): types + declare const Context: any; let defaultMode: Mode; diff --git a/core/src/utils/animation/animation-interface.ts b/core/src/utils/animation/animation-interface.ts index 8a8ee71142..7a65f52157 100644 --- a/core/src/utils/animation/animation-interface.ts +++ b/core/src/utils/animation/animation-interface.ts @@ -1,3 +1,5 @@ +// TODO(FW-2832): types + export interface Animation { parentAnimation: Animation | undefined; elements: HTMLElement[]; diff --git a/core/src/utils/animation/animation-utils.ts b/core/src/utils/animation/animation-utils.ts index 7115f6f26f..0e8a6fde6f 100644 --- a/core/src/utils/animation/animation-utils.ts +++ b/core/src/utils/animation/animation-utils.ts @@ -38,8 +38,8 @@ const convertCamelCaseToHypen = (str: string) => { export const getAnimationPrefix = (el: HTMLElement): string => { if (animationPrefix === undefined) { - const supportsUnprefixed = (el.style as any).animationName !== undefined; - const supportsWebkitPrefix = (el.style as any).webkitAnimationName !== undefined; + const supportsUnprefixed = el.style.animationName !== undefined; + const supportsWebkitPrefix = el.style.webkitAnimationName !== undefined; animationPrefix = !supportsUnprefixed && supportsWebkitPrefix ? '-webkit-' : ''; } return animationPrefix; @@ -57,7 +57,7 @@ export const removeStyleProperty = (element: HTMLElement, propertyName: string) export const animationEnd = (el: HTMLElement | null, callback: (ev?: TransitionEvent) => void) => { let unRegTrans: (() => void) | undefined; - const opts: any = { passive: true }; + const opts: AddEventListenerOptions = { passive: true }; const unregister = () => { if (unRegTrans) { @@ -85,6 +85,7 @@ export const animationEnd = (el: HTMLElement | null, callback: (ev?: TransitionE return unregister; }; +// TODO(FW-2832): type export const generateKeyframeRules = (keyframes: any[] = []) => { return keyframes .map((keyframe) => { @@ -115,6 +116,7 @@ export const generateKeyframeName = (keyframeRules: string) => { export const getStyleContainer = (element: HTMLElement) => { // getRootNode is not always available in SSR environments. + // TODO(FW-2832): types const rootNode = element.getRootNode !== undefined ? (element.getRootNode() as any) : element; return rootNode.head || rootNode; }; diff --git a/core/src/utils/animation/animation.ts b/core/src/utils/animation/animation.ts index 6516c76831..53681440f9 100644 --- a/core/src/utils/animation/animation.ts +++ b/core/src/utils/animation/animation.ts @@ -23,6 +23,8 @@ import { setStyleProperty, } from './animation-utils'; +// TODO(FW-2832): types + interface AnimationOnFinishCallback { c: AnimationLifecycle; o?: AnimationCallbackOptions; diff --git a/core/src/utils/config.ts b/core/src/utils/config.ts index c84cfbdde2..3069923b6b 100644 --- a/core/src/utils/config.ts +++ b/core/src/utils/config.ts @@ -201,6 +201,7 @@ export interface IonicConfig { hideCaretOnScroll?: boolean; // INTERNAL configs + // TODO(FW-2832): types persistConfig?: boolean; _forceStatusbarPadding?: boolean; _testing?: boolean; diff --git a/core/src/utils/content/index.ts b/core/src/utils/content/index.ts index 2b974b85e5..da19ee1d0e 100644 --- a/core/src/utils/content/index.ts +++ b/core/src/utils/content/index.ts @@ -62,6 +62,7 @@ export const findClosestIonContent = (el: Element) => { * Scrolls to the top of the element. If an `ion-content` is found, it will scroll * using the public API `scrollToTop` with a duration. */ +// TODO(FW-2832): type export const scrollToTop = (el: HTMLElement, durationMs: number): Promise => { if (isIonContent(el)) { const content = el as HTMLIonContentElement; diff --git a/core/src/utils/focus-visible.ts b/core/src/utils/focus-visible.ts index d7a98bd5c4..7e48c4bbb2 100644 --- a/core/src/utils/focus-visible.ts +++ b/core/src/utils/focus-visible.ts @@ -32,8 +32,8 @@ export const startFocusVisible = (rootEl?: HTMLElement) => { setFocus([]); }; - const onKeydown = (ev: any) => { - keyboardMode = FOCUS_KEYS.includes(ev.key); + const onKeydown = (ev: Event) => { + keyboardMode = FOCUS_KEYS.includes((ev as KeyboardEvent).key); if (!keyboardMode) { setFocus([]); } @@ -41,6 +41,7 @@ export const startFocusVisible = (rootEl?: HTMLElement) => { const onFocusin = (ev: Event) => { if (keyboardMode && ev.composedPath !== undefined) { const toFocus = ev.composedPath().filter((el: any) => { + // TODO(FW-2832): type if (el.classList) { return el.classList.contains(ION_FOCUSABLE); } diff --git a/core/src/utils/framework-delegate.ts b/core/src/utils/framework-delegate.ts index af4f24a2be..d099d5ecbb 100644 --- a/core/src/utils/framework-delegate.ts +++ b/core/src/utils/framework-delegate.ts @@ -2,6 +2,8 @@ import type { ComponentRef, FrameworkDelegate } from '../interface'; import { componentOnReady } from './helpers'; +// TODO(FW-2832): types + export const attachComponent = async ( delegate: FrameworkDelegate | undefined, container: Element, diff --git a/core/src/utils/gesture/index.ts b/core/src/utils/gesture/index.ts index 9a12c90a0a..79e5ee323d 100644 --- a/core/src/utils/gesture/index.ts +++ b/core/src/utils/gesture/index.ts @@ -2,6 +2,8 @@ import { GESTURE_CONTROLLER } from './gesture-controller'; import { createPointerEvents } from './pointer-events'; import { createPanRecognizer } from './recognizers'; +// TODO(FW-2832): types + export const createGesture = (config: GestureConfig): Gesture => { let hasCapturedPan = false; let hasStartedPan = false; diff --git a/core/src/utils/gesture/listener.ts b/core/src/utils/gesture/listener.ts index 160402345e..357076dadf 100644 --- a/core/src/utils/gesture/listener.ts +++ b/core/src/utils/gesture/listener.ts @@ -1,5 +1,5 @@ export const addEventListener = ( - el: any, + el: any, // TODO(FW-2832): type eventName: string, callback: EventListenerOrEventListenerObject, opts: { diff --git a/core/src/utils/gesture/pointer-events.ts b/core/src/utils/gesture/pointer-events.ts index c009f142da..9035477acc 100644 --- a/core/src/utils/gesture/pointer-events.ts +++ b/core/src/utils/gesture/pointer-events.ts @@ -2,6 +2,7 @@ import { addEventListener } from './listener'; const MOUSE_WAIT = 2000; +// TODO(FW-2832): types export const createPointerEvents = ( el: Node, pointerDown: any, diff --git a/core/src/utils/hardware-back-button.ts b/core/src/utils/hardware-back-button.ts index b32a3075ea..7445dbedbd 100644 --- a/core/src/utils/hardware-back-button.ts +++ b/core/src/utils/hardware-back-button.ts @@ -1,5 +1,6 @@ import type { BackButtonEvent } from '../interface'; +// TODO(FW-2832): type type Handler = (processNextHandler: () => void) => Promise | void | null; interface HandlerRegister { diff --git a/core/src/utils/helpers.ts b/core/src/utils/helpers.ts index b29e7b92f9..5b9c59c7b0 100644 --- a/core/src/utils/helpers.ts +++ b/core/src/utils/helpers.ts @@ -2,6 +2,8 @@ import type { EventEmitter } from '@stencil/core'; import type { Side } from '../interface'; +// TODO(FW-2832): types + declare const __zone_symbol__requestAnimationFrame: any; declare const requestAnimationFrame: any; diff --git a/core/src/utils/input-shims/hacks/common.ts b/core/src/utils/input-shims/hacks/common.ts index 8da035ff98..747fe710b9 100644 --- a/core/src/utils/input-shims/hacks/common.ts +++ b/core/src/utils/input-shims/hacks/common.ts @@ -18,6 +18,7 @@ export const relocateInput = ( } }; +// TODO(FW-2832): type export const isFocused = (input: HTMLInputElement | HTMLTextAreaElement): boolean => { return input === (input as any).getRootNode().activeElement; }; diff --git a/core/src/utils/input-shims/hacks/input-blurring.ts b/core/src/utils/input-shims/hacks/input-blurring.ts index 64a04ff3bd..0f2fe60bc7 100644 --- a/core/src/utils/input-shims/hacks/input-blurring.ts +++ b/core/src/utils/input-shims/hacks/input-blurring.ts @@ -15,7 +15,7 @@ export const enableInputBlurring = () => { focused = true; }; - const onTouchend = (ev: any) => { + const onTouchend = (ev: TouchEvent) => { // if app did scroll return early if (didScroll) { didScroll = false; diff --git a/core/src/utils/input-shims/hacks/scroll-assist.ts b/core/src/utils/input-shims/hacks/scroll-assist.ts index a163cf75a8..67cbfe303c 100644 --- a/core/src/utils/input-shims/hacks/scroll-assist.ts +++ b/core/src/utils/input-shims/hacks/scroll-assist.ts @@ -12,7 +12,7 @@ export const enableScrollAssist = ( keyboardHeight: number, disableClonedInput = false ) => { - let coord: any; + let coord: { x: number; y: number } | undefined; const touchStart = (ev: Event) => { coord = pointerCoord(ev); }; @@ -75,7 +75,7 @@ const jsSetFocus = async ( raf(() => componentEl.click()); if (typeof window !== 'undefined') { - let scrollContentTimeout: any; + let scrollContentTimeout: ReturnType; const scrollContent = async () => { // clean up listeners and timeouts if (scrollContentTimeout !== undefined) { diff --git a/core/src/utils/input-shims/hacks/scroll-data.ts b/core/src/utils/input-shims/hacks/scroll-data.ts index d8219dcf01..08d973a477 100644 --- a/core/src/utils/input-shims/hacks/scroll-data.ts +++ b/core/src/utils/input-shims/hacks/scroll-data.ts @@ -13,7 +13,7 @@ export const getScrollData = (componentEl: HTMLElement, contentEl: HTMLElement, itemEl.getBoundingClientRect(), contentEl.getBoundingClientRect(), keyboardHeight, - (componentEl as any).ownerDocument.defaultView.innerHeight + (componentEl as any).ownerDocument.defaultView.innerHeight // TODO(FW-2832): type ); }; diff --git a/core/src/utils/input-shims/hacks/scroll-padding.ts b/core/src/utils/input-shims/hacks/scroll-padding.ts index d729c492d7..755120b020 100644 --- a/core/src/utils/input-shims/hacks/scroll-padding.ts +++ b/core/src/utils/input-shims/hacks/scroll-padding.ts @@ -5,6 +5,7 @@ const PADDING_TIMER_KEY = '$ionPaddingTimer'; export const enableScrollPadding = (keyboardHeight: number) => { const doc = document; + // TODO(FW-2832): types const onFocusin = (ev: any) => { setScrollPadding(ev.target, keyboardHeight); }; diff --git a/core/src/utils/input-shims/input-shims.ts b/core/src/utils/input-shims/input-shims.ts index e8c44a7786..2c94f5014b 100644 --- a/core/src/utils/input-shims/input-shims.ts +++ b/core/src/utils/input-shims/input-shims.ts @@ -101,6 +101,8 @@ export const startInputShims = (config: Config, platform: 'ios' | 'android') => registerInput(input); } + // TODO(FW-2832): types + doc.addEventListener('ionInputDidLoad', ((ev: InputEvent) => { registerInput(ev.detail); }) as any); diff --git a/core/src/utils/keyboard/keyboard.ts b/core/src/utils/keyboard/keyboard.ts index d21957bc48..730e221294 100644 --- a/core/src/utils/keyboard/keyboard.ts +++ b/core/src/utils/keyboard/keyboard.ts @@ -2,6 +2,8 @@ export const KEYBOARD_DID_OPEN = 'ionKeyboardDidShow'; export const KEYBOARD_DID_CLOSE = 'ionKeyboardDidHide'; const KEYBOARD_THRESHOLD = 150; +// TODO(FW-2832): types + let previousVisualViewport: any = {}; let currentVisualViewport: any = {}; diff --git a/core/src/utils/menu-controller/index.ts b/core/src/utils/menu-controller/index.ts index a1ee0617b7..fe9e517150 100644 --- a/core/src/utils/menu-controller/index.ts +++ b/core/src/utils/menu-controller/index.ts @@ -166,7 +166,7 @@ const createMenuController = () => { }; const _createAnimation = (type: string, menuCmp: MenuI) => { - const animationBuilder = menuAnimations.get(type) as any; + const animationBuilder = menuAnimations.get(type) as any; // TODO(FW-2832): type if (!animationBuilder) { throw new Error('animation not registered'); } @@ -209,6 +209,7 @@ const createMenuController = () => { if (typeof document !== 'undefined') { document.addEventListener('ionBackButton', (ev: any) => { + // TODO(FW-2832): type const openMenu = _getOpenSync(); if (openMenu) { (ev as BackButtonEvent).detail.register(MENU_BACK_BUTTON_PRIORITY, () => { diff --git a/core/src/utils/platform.ts b/core/src/utils/platform.ts index ddfac8a3fa..622b81cac1 100644 --- a/core/src/utils/platform.ts +++ b/core/src/utils/platform.ts @@ -2,6 +2,8 @@ import { config } from '../global/config'; export type Platforms = keyof typeof PLATFORMS_MAP; +// TODO(FW-2832): types + interface IsPlatformSignature { (plt: Platforms): boolean; (win: Window, plt: Platforms): boolean; diff --git a/core/src/utils/sanitization/index.ts b/core/src/utils/sanitization/index.ts index ee29549213..b60a48cad1 100644 --- a/core/src/utils/sanitization/index.ts +++ b/core/src/utils/sanitization/index.ts @@ -82,6 +82,7 @@ export const sanitizeDOMString = (untrustedString: IonicSafeString | string | un * and then recursively dig down into any child elements to * clean those up as well */ +// TODO(FW-2832): type (using Element triggers other type errors as well) const sanitizeElement = (element: any) => { // IE uses childNodes, so ignore nodes that are not elements if (element.nodeType && element.nodeType !== 1) { @@ -123,6 +124,7 @@ const sanitizeElement = (element: any) => { * IE doesn't always support .children * so we revert to .childNodes instead */ +// TODO(FW-2832): type const getElementChildren = (el: any) => { return el.children != null ? el.children : el.childNodes; }; diff --git a/core/src/utils/tap-click/index.ts b/core/src/utils/tap-click/index.ts index 70919b0ef4..9bef0d4726 100644 --- a/core/src/utils/tap-click/index.ts +++ b/core/src/utils/tap-click/index.ts @@ -7,7 +7,7 @@ export const startTapClick = (config: Config) => { let activatableEle: HTMLElement | undefined; let activeRipple: Promise<() => void> | undefined; - let activeDefer: any; + let activeDefer: ReturnType | undefined; const useRippleEffect = config.getBoolean('animated', true) && config.getBoolean('rippleEffect', true); const clearDefers = new WeakMap(); @@ -43,7 +43,7 @@ export const startTapClick = (config: Config) => { }; const cancelActive = () => { - clearTimeout(activeDefer); + if (activeDefer) clearTimeout(activeDefer); activeDefer = undefined; if (activatableEle) { removeActivated(false); @@ -67,7 +67,7 @@ export const startTapClick = (config: Config) => { if (el && el === activatableEle) { return; } - clearTimeout(activeDefer); + if (activeDefer) clearTimeout(activeDefer); activeDefer = undefined; const { x, y } = pointerCoord(ev); @@ -163,6 +163,7 @@ export const startTapClick = (config: Config) => { doc.addEventListener('mouseup', onMouseUp, true); }; +// TODO(FW-2832): type const getActivatableTarget = (ev: UIEvent): any => { if (ev.composedPath !== undefined) { /** diff --git a/core/src/utils/transition/index.ts b/core/src/utils/transition/index.ts index 2f9cb9c402..fad106a5df 100644 --- a/core/src/utils/transition/index.ts +++ b/core/src/utils/transition/index.ts @@ -12,6 +12,8 @@ import { componentOnReady, raf } from '../helpers'; const iosTransitionAnimation = () => import('./ios.transition'); const mdTransitionAnimation = () => import('./md.transition'); +// TODO(FW-2832): types + export const transition = (opts: TransitionOptions): Promise => { return new Promise((resolve, reject) => { writeTask(() => { diff --git a/core/src/utils/transition/ios.transition.ts b/core/src/utils/transition/ios.transition.ts index 600490f822..3145564e21 100644 --- a/core/src/utils/transition/ios.transition.ts +++ b/core/src/utils/transition/ios.transition.ts @@ -5,6 +5,8 @@ import { getIonPageElement } from '../transition'; const DURATION = 540; +// TODO(FW-2832): types + const getClonedElement = (tagName: string): any => { return document.querySelector(`${tagName}.ion-cloned-element`) as any; }; diff --git a/core/src/utils/watch-options.ts b/core/src/utils/watch-options.ts index dca0a64f07..803aa90c4b 100644 --- a/core/src/utils/watch-options.ts +++ b/core/src/utils/watch-options.ts @@ -1,3 +1,5 @@ +// TODO(FW-2832): types + export const watchForOptions = ( containerEl: HTMLElement, tagName: string, diff --git a/packages/react-router/src/ReactRouter/StackManager.tsx b/packages/react-router/src/ReactRouter/StackManager.tsx index c21e6e6d51..57bff0a2b3 100644 --- a/packages/react-router/src/ReactRouter/StackManager.tsx +++ b/packages/react-router/src/ReactRouter/StackManager.tsx @@ -12,6 +12,8 @@ import { matchPath } from 'react-router-dom'; import { clonePageElement } from './clonePageElement'; +// TODO(FW-2959): types + interface StackManagerProps { routeInfo: RouteInfo; } diff --git a/packages/react/src/components/CreateAnimation.tsx b/packages/react/src/components/CreateAnimation.tsx index 382707259c..a16addda2a 100644 --- a/packages/react/src/components/CreateAnimation.tsx +++ b/packages/react/src/components/CreateAnimation.tsx @@ -9,6 +9,8 @@ import { } from '@ionic/core/components'; import React, { PropsWithChildren } from 'react'; +// TODO(FW-2959): types + interface PartialPropertyValue { property: string; value: any; diff --git a/packages/react/src/components/IonActionSheet.tsx b/packages/react/src/components/IonActionSheet.tsx index 0446a8e42f..a10abf7223 100644 --- a/packages/react/src/components/IonActionSheet.tsx +++ b/packages/react/src/components/IonActionSheet.tsx @@ -21,6 +21,7 @@ export interface ActionSheetOptions extends Omit actionSheetControllerCore.create(options as any), dismiss: (data?: any, role?: string | undefined, id?: string | undefined) => actionSheetControllerCore.dismiss(data, role, id), diff --git a/packages/react/src/components/IonApp.tsx b/packages/react/src/components/IonApp.tsx index 4b93da1eda..a557a67e50 100644 --- a/packages/react/src/components/IonApp.tsx +++ b/packages/react/src/components/IonApp.tsx @@ -15,7 +15,7 @@ type Props = LocalJSX.IonApp & export const IonApp = /*@__PURE__*/ (() => class extends React.Component { - addOverlayCallback?: (id: string, overlay: any, containerElement: HTMLDivElement) => void; + addOverlayCallback?: (id: string, overlay: ReactComponentOrElement, containerElement: HTMLDivElement) => void; removeOverlayCallback?: (id: string) => void; constructor(props: Props) { diff --git a/packages/react/src/components/IonOverlayManager.tsx b/packages/react/src/components/IonOverlayManager.tsx index 61b9513d47..c638af5dcc 100644 --- a/packages/react/src/components/IonOverlayManager.tsx +++ b/packages/react/src/components/IonOverlayManager.tsx @@ -27,7 +27,7 @@ export const IonOverlayManager: React.FC = ({ }) => { type OverlaysList = { [key: string]: { - component: any; + component: any; // TODO(FW-2959): type containerElement: HTMLDivElement; }; }; diff --git a/packages/react/src/components/IonRoute.tsx b/packages/react/src/components/IonRoute.tsx index bccda20bb1..e3675c1dcc 100644 --- a/packages/react/src/components/IonRoute.tsx +++ b/packages/react/src/components/IonRoute.tsx @@ -6,7 +6,7 @@ export interface IonRouteProps { path?: string; exact?: boolean; show?: boolean; - render: (props?: any) => JSX.Element; + render: (props?: any) => JSX.Element; // TODO(FW-2959): type disableIonPageManagement?: boolean; } diff --git a/packages/react/src/components/IonRouterContext.tsx b/packages/react/src/components/IonRouterContext.tsx index d87da64668..f2cda4ae2a 100644 --- a/packages/react/src/components/IonRouterContext.tsx +++ b/packages/react/src/components/IonRouterContext.tsx @@ -19,7 +19,7 @@ export interface IonRouterContextState { } export const IonRouterContext = React.createContext({ - routeInfo: undefined as any, + routeInfo: undefined as any, // TODO(FW-2959): type push: () => { throw new Error('An Ionic Router is required for IonRouterContext'); }, diff --git a/packages/react/src/components/createInlineOverlayComponent.tsx b/packages/react/src/components/createInlineOverlayComponent.tsx index 41d04a0d90..9a3c664f72 100644 --- a/packages/react/src/components/createInlineOverlayComponent.tsx +++ b/packages/react/src/components/createInlineOverlayComponent.tsx @@ -10,6 +10,8 @@ import { } from './react-component-lib/utils'; import { createForwardRef } from './utils'; +// TODO(FW-2959): types + type InlineOverlayState = { isOpen: boolean; }; diff --git a/packages/react/src/components/createRoutingComponent.tsx b/packages/react/src/components/createRoutingComponent.tsx index 468be3a9ed..134645056d 100644 --- a/packages/react/src/components/createRoutingComponent.tsx +++ b/packages/react/src/components/createRoutingComponent.tsx @@ -15,6 +15,8 @@ import { } from './react-component-lib/utils'; import { createForwardRef } from './utils'; +// TODO(FW-2959): types + interface IonicReactInternalProps extends React.HTMLAttributes { forwardedRef?: React.ForwardedRef; href?: string; diff --git a/packages/react/src/components/navigation/IonTabBar.tsx b/packages/react/src/components/navigation/IonTabBar.tsx index 1a88f8e4b7..293cb05300 100644 --- a/packages/react/src/components/navigation/IonTabBar.tsx +++ b/packages/react/src/components/navigation/IonTabBar.tsx @@ -35,6 +35,8 @@ interface IonTabBarState { tabs: { [key: string]: TabUrls }; } +// TODO(FW-2959): types + class IonTabBarUnwrapped extends React.PureComponent { context!: React.ContextType; diff --git a/packages/react/src/components/navigation/IonTabButton.tsx b/packages/react/src/components/navigation/IonTabButton.tsx index 102e638338..dd76e29e61 100644 --- a/packages/react/src/components/navigation/IonTabButton.tsx +++ b/packages/react/src/components/navigation/IonTabButton.tsx @@ -9,7 +9,7 @@ type Props = LocalJSX.IonTabButton & IonicReactProps & { routerOptions?: RouterOptions; ref?: React.Ref; - onClick?: (e: any) => void; + onClick?: (e: Event) => void; }; export const IonTabButton = /*@__PURE__*/ (() => diff --git a/packages/react/src/components/navigation/IonTabs.tsx b/packages/react/src/components/navigation/IonTabs.tsx index 1cf4241eec..9957e39e55 100644 --- a/packages/react/src/components/navigation/IonTabs.tsx +++ b/packages/react/src/components/navigation/IonTabs.tsx @@ -15,6 +15,8 @@ class IonTabsElement extends HTMLElementSSR { } } +// TODO(FW-2959): types + if (typeof (window as any) !== 'undefined' && window.customElements) { const element = window.customElements.get('ion-tabs'); if (!element) { diff --git a/packages/react/src/components/utils/index.tsx b/packages/react/src/components/utils/index.tsx index af3f52e8de..6e2151bb16 100644 --- a/packages/react/src/components/utils/index.tsx +++ b/packages/react/src/components/utils/index.tsx @@ -13,7 +13,7 @@ export type IonicReactExternalProps = PropType & IonicReactProps; export const createForwardRef = ( - ReactComponent: any, + ReactComponent: any, // TODO(FW-2959): type displayName: string ) => { const forwardRef = ( diff --git a/packages/react/src/contexts/NavContext.ts b/packages/react/src/contexts/NavContext.ts index c9cb4288f0..f20d82cfaa 100644 --- a/packages/react/src/contexts/NavContext.ts +++ b/packages/react/src/contexts/NavContext.ts @@ -3,6 +3,8 @@ import React from 'react'; import { RouteInfo } from '../models'; +// TODO(FW-2959): types + export interface NavContextState { getIonRoute: () => any; getIonRedirect: () => any; diff --git a/packages/react/src/framework-delegate.tsx b/packages/react/src/framework-delegate.tsx index 4143fa2abb..13705b54a9 100644 --- a/packages/react/src/framework-delegate.tsx +++ b/packages/react/src/framework-delegate.tsx @@ -1,6 +1,8 @@ import { FrameworkDelegate } from '@ionic/core/components'; import { createPortal } from 'react-dom'; +// TODO(FW-2959): types + type ReactComponent = (props?: any) => JSX.Element; export const ReactDelegate = ( diff --git a/packages/react/src/hooks/useIonModal.ts b/packages/react/src/hooks/useIonModal.ts index 50a7deec3d..6b56e7836b 100644 --- a/packages/react/src/hooks/useIonModal.ts +++ b/packages/react/src/hooks/useIonModal.ts @@ -7,6 +7,8 @@ import { ReactComponentOrElement } from '../models/ReactComponentOrElement'; import { HookOverlayOptions } from './HookOverlayOptions'; import { useOverlay } from './useOverlay'; +// TODO(FW-2959): types + /** * A hook for presenting/dismissing an IonModal component * @param component The component that the modal will show. Can be a React Component, a functional component, or a JSX Element diff --git a/packages/react/src/hooks/useIonPopover.ts b/packages/react/src/hooks/useIonPopover.ts index cd4e9d37c5..e2c354df64 100644 --- a/packages/react/src/hooks/useIonPopover.ts +++ b/packages/react/src/hooks/useIonPopover.ts @@ -7,6 +7,8 @@ import { ReactComponentOrElement } from '../models/ReactComponentOrElement'; import { HookOverlayOptions } from './HookOverlayOptions'; import { useOverlay } from './useOverlay'; +// TODO(FW-2959): types + /** * A hook for presenting/dismissing an IonPicker component * @param component The component that the popover will show. Can be a React Component, a functional component, or a JSX Element diff --git a/packages/react/src/hooks/useOverlay.ts b/packages/react/src/hooks/useOverlay.ts index cfb771727c..7bcbfae1db 100644 --- a/packages/react/src/hooks/useOverlay.ts +++ b/packages/react/src/hooks/useOverlay.ts @@ -8,6 +8,8 @@ import { generateId } from '../utils/generateId'; import { HookOverlayOptions } from './HookOverlayOptions'; +// TODO(FW-2959): types + interface OverlayBase extends HTMLElement { present: () => Promise; dismiss: (data?: any, role?: string | undefined) => Promise; diff --git a/packages/react/src/lifecycle/IonLifeCycleHOC.tsx b/packages/react/src/lifecycle/IonLifeCycleHOC.tsx index b22b452677..234944f2d5 100644 --- a/packages/react/src/lifecycle/IonLifeCycleHOC.tsx +++ b/packages/react/src/lifecycle/IonLifeCycleHOC.tsx @@ -2,6 +2,8 @@ import React from 'react'; import { IonLifeCycleContext } from '../contexts/IonLifeCycleContext'; +// TODO(FW-2959): types + export const withIonLifeCycle = (WrappedComponent: React.ComponentType) => { return class IonLifeCycle extends React.Component { context!: React.ContextType; diff --git a/packages/react/src/routing/NavManager.tsx b/packages/react/src/routing/NavManager.tsx index 5dda4305ba..3d44a72a9c 100644 --- a/packages/react/src/routing/NavManager.tsx +++ b/packages/react/src/routing/NavManager.tsx @@ -11,6 +11,8 @@ import { RouterOptions } from '../models/RouterOptions'; import { LocationHistory } from './LocationHistory'; import PageManager from './PageManager'; +// TODO(FW-2959): types + interface NavManagerProps { routeInfo: RouteInfo; onNativeBack: () => void; diff --git a/packages/react/src/routing/OutletPageManager.tsx b/packages/react/src/routing/OutletPageManager.tsx index 45025bc229..59c9f6bed3 100644 --- a/packages/react/src/routing/OutletPageManager.tsx +++ b/packages/react/src/routing/OutletPageManager.tsx @@ -11,7 +11,7 @@ interface OutletPageManagerProps { className?: string; forwardedRef?: React.ForwardedRef; routeInfo?: RouteInfo; - StackManager: any; + StackManager: any; // TODO(FW-2959): type } export class OutletPageManager extends React.Component { diff --git a/packages/react/src/routing/RouteManagerContext.ts b/packages/react/src/routing/RouteManagerContext.ts index a37eb22bb2..cc7d61cd10 100644 --- a/packages/react/src/routing/RouteManagerContext.ts +++ b/packages/react/src/routing/RouteManagerContext.ts @@ -27,6 +27,7 @@ export interface RouteManagerContextState { unMountViewItem: (viewItem: ViewItem) => void; } +// TODO(FW-2959): types export const RouteManagerContext = /*@__PURE__*/ React.createContext({ addViewItem: () => undefined, canGoBack: () => undefined as any, diff --git a/packages/vue-router/src/router.ts b/packages/vue-router/src/router.ts index eabdb0adcb..6cf3cd7997 100644 --- a/packages/vue-router/src/router.ts +++ b/packages/vue-router/src/router.ts @@ -18,6 +18,8 @@ import { } from './types'; import { AnimationBuilder } from '@ionic/vue'; +// TODO(FW-2969): types + export const createIonRouter = (opts: IonicVueRouterOptions, router: Router) => { let currentNavigationInfo: NavigationInformation = { direction: undefined, action: undefined, delta: undefined }; diff --git a/packages/vue-router/src/types.ts b/packages/vue-router/src/types.ts index ef535b5d82..46ca3b9d03 100644 --- a/packages/vue-router/src/types.ts +++ b/packages/vue-router/src/types.ts @@ -2,6 +2,8 @@ import { AnimationBuilder } from '@ionic/vue'; import { RouteLocationMatched, RouterOptions } from 'vue-router'; import { Ref } from 'vue'; +// TODO(FW-2969): types + export interface VueComponentData { /** * The cached result of the props diff --git a/packages/vue-router/src/viewStacks.ts b/packages/vue-router/src/viewStacks.ts index 3686024a0f..62f509b921 100644 --- a/packages/vue-router/src/viewStacks.ts +++ b/packages/vue-router/src/viewStacks.ts @@ -113,6 +113,7 @@ export const createViewStacks = (router: Router) => { return undefined; } + // TODO(FW-2969): type const createViewItem = (outletId: number, vueComponent: any, matchedRoute: RouteLocationMatched, routeInfo: RouteInfo, ionPage?: HTMLElement): ViewItem => { return { id: generateId('viewItem'), diff --git a/packages/vue/src/components/IonBackButton.ts b/packages/vue/src/components/IonBackButton.ts index 7d4468a2b4..c85a7f8dce 100644 --- a/packages/vue/src/components/IonBackButton.ts +++ b/packages/vue/src/components/IonBackButton.ts @@ -4,6 +4,7 @@ import { defineCustomElement } from '@ionic/core/components/ion-back-button.js'; export const IonBackButton = /*@__PURE__*/ defineComponent((_, { attrs, slots }) => { defineCustomElement(); + // TODO(FW-2969): type const ionRouter: any = inject('navManager'); const onClick = () => { diff --git a/packages/vue/src/components/IonRouterOutlet.ts b/packages/vue/src/components/IonRouterOutlet.ts index 981daadf12..6ad137b995 100644 --- a/packages/vue/src/components/IonRouterOutlet.ts +++ b/packages/vue/src/components/IonRouterOutlet.ts @@ -16,6 +16,8 @@ import { defineCustomElement } from '@ionic/core/components/ion-router-outlet.js import { matchedRouteKey, routeLocationKey, useRoute } from 'vue-router'; import { fireLifecycle, generateId, getConfig } from '../utils'; +// TODO(FW-2969): types + const isViewVisible = (enteringEl: HTMLElement) => { return !enteringEl.classList.contains('ion-page-hidden') && !enteringEl.classList.contains('ion-page-invisible'); } diff --git a/packages/vue/src/components/IonTabBar.ts b/packages/vue/src/components/IonTabBar.ts index e61bd8629a..4fcad6d50e 100644 --- a/packages/vue/src/components/IonTabBar.ts +++ b/packages/vue/src/components/IonTabBar.ts @@ -1,6 +1,8 @@ import { h, defineComponent, getCurrentInstance, inject, VNode } from 'vue'; import { defineCustomElement } from '@ionic/core/components/ion-tab-bar.js'; +// TODO(FW-2969): types + interface TabState { activeTab?: string; tabs: { [k: string]: Tab }; diff --git a/packages/vue/src/components/IonTabButton.ts b/packages/vue/src/components/IonTabButton.ts index dc522e9e5c..38f7a7bb9d 100644 --- a/packages/vue/src/components/IonTabButton.ts +++ b/packages/vue/src/components/IonTabButton.ts @@ -17,6 +17,7 @@ export const IonTabButton = /*@__PURE__*/ defineComponent({ setup(props, { slots }) { defineCustomElement(); + // TODO(FW-2969): type const ionRouter: any = inject('navManager'); const onClick = (ev: Event) => { if (ev.cancelable) { diff --git a/packages/vue/src/components/IonTabs.ts b/packages/vue/src/components/IonTabs.ts index 32221c3be9..bbb197085b 100644 --- a/packages/vue/src/components/IonTabs.ts +++ b/packages/vue/src/components/IonTabs.ts @@ -3,6 +3,8 @@ import { h, defineComponent, VNode } from 'vue'; const WILL_CHANGE = 'ionTabsWillChange'; const DID_CHANGE = 'ionTabsDidChange'; +// TODO(FW-2969): types + export const IonTabs = /*@__PURE__*/ defineComponent({ name: 'IonTabs', emits: [WILL_CHANGE, DID_CHANGE], diff --git a/packages/vue/src/controllers.ts b/packages/vue/src/controllers.ts index 2f164024d4..dcf30ba3bf 100644 --- a/packages/vue/src/controllers.ts +++ b/packages/vue/src/controllers.ts @@ -18,6 +18,8 @@ import { defineCustomElement as defineIonToastCustomElement } from '@ionic/core/ import { defineCustomElement as defineIonModalCustomElement } from '@ionic/core/components/ion-modal.js' import { defineCustomElement as defineIonPopoverCustomElement } from '@ionic/core/components/ion-popover.js' +// TODO(FW-2969): types + /** * Wrap the controllers export from @ionic/core * register the underlying Web Component and diff --git a/packages/vue/src/framework-delegate.ts b/packages/vue/src/framework-delegate.ts index 0be2956cbe..3c44d39e7b 100644 --- a/packages/vue/src/framework-delegate.ts +++ b/packages/vue/src/framework-delegate.ts @@ -5,6 +5,7 @@ import { addTeleportedUserComponent, removeTeleportedUserComponent } from './com export const VueDelegate = (addFn = addTeleportedUserComponent, removeFn = removeTeleportedUserComponent): FrameworkDelegate => { let Component: VNode | undefined; + // TODO(FW-2969): types const attachViewToDom = (parentElement: HTMLElement, component: any, componentProps: any = {}, classes?: string[]) => { /** * Ionic Framework passes in modal and popover element diff --git a/packages/vue/src/ionic-vue.ts b/packages/vue/src/ionic-vue.ts index e97974db8a..e4fe399609 100644 --- a/packages/vue/src/ionic-vue.ts +++ b/packages/vue/src/ionic-vue.ts @@ -1,6 +1,8 @@ import { App, Plugin } from 'vue'; import { IonicConfig, initialize } from '@ionic/core/components'; +// TODO(FW-2969): types + /** * We need to make sure that the web component fires an event * that will not conflict with the user's @ionChange binding, diff --git a/packages/vue/src/utils.ts b/packages/vue/src/utils.ts index 7d0f098036..678848f4a3 100644 --- a/packages/vue/src/utils.ts +++ b/packages/vue/src/utils.ts @@ -3,6 +3,8 @@ import { Config as CoreConfig, LIFECYCLE_DID_ENTER, LIFECYCLE_DID_LEAVE, LIFECYC type LIFECYCLE_EVENTS = typeof LIFECYCLE_WILL_ENTER | typeof LIFECYCLE_DID_ENTER | typeof LIFECYCLE_WILL_LEAVE | typeof LIFECYCLE_DID_LEAVE; +// TODO(FW-2969): types + export enum LifecycleHooks { WillEnter = 'onIonViewWillEnter', DidEnter = 'onIonViewDidEnter', diff --git a/packages/vue/src/vue-component-lib/overlays.ts b/packages/vue/src/vue-component-lib/overlays.ts index b886c1d493..e962daf693 100644 --- a/packages/vue/src/vue-component-lib/overlays.ts +++ b/packages/vue/src/vue-component-lib/overlays.ts @@ -1,5 +1,7 @@ import { defineComponent, h, ref, VNode, onMounted } from 'vue'; +// TODO(FW-2969): types + export interface OverlayProps { isOpen?: boolean; }