chore(many): replace any types and add tech debt tickets (#26293)

Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
This commit is contained in:
Amanda Johnston
2023-01-06 09:34:55 -06:00
committed by GitHub
parent 27527025e4
commit c2e1ad385d
122 changed files with 229 additions and 65 deletions

View File

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

View File

@ -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);
}
}

View File

@ -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);

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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 = () => {

View File

@ -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',

View File

@ -17,6 +17,8 @@ import {
toSegments,
} from './stack-utils';
// TODO(FW-2827): types
export class StackController {
private views: RouteView[] = [];
private runningTask?: Promise<any>;

View File

@ -86,6 +86,7 @@ export interface StackEvent {
tabSwitch: boolean;
}
// TODO(FW-2827): types
export interface RouteView {
id: number;
url: string;

View File

@ -108,6 +108,7 @@ export declare interface IonModal extends Components.IonModal {
],
})
export class IonModal {
// TODO(FW-2827): type
@ContentChild(TemplateRef, { static: false }) template: TemplateRef<any>;
isCmpOpen: boolean = false;

View File

@ -99,6 +99,7 @@ export declare interface IonPopover extends Components.IonPopover {
],
})
export class IonPopover {
// TODO(FW-2827): type
@ContentChild(TemplateRef, { static: false }) template: TemplateRef<any>;
isCmpOpen: boolean = false;

View File

@ -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) {}

View File

@ -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<BackButtonEventDetail> {
subscribeWithPriority(
priority: number,

View File

@ -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);

View File

@ -1,5 +1,5 @@
export interface IonicGlobal {
config?: any;
config?: any; // TODO(FW-2827): type
asyncQueue?: boolean;
}

View File

@ -1,3 +1,5 @@
// TODO(FW-2827): types
interface ControllerShape<Opts, HTMLElm> {
create(options: Opts): Promise<HTMLElm>;
dismiss(data?: any, role?: string, id?: string): Promise<boolean>;