mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 01:52:19 +08:00
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:
@ -9,6 +9,8 @@ import {
|
||||
} from '@ionic/core/components';
|
||||
import React, { PropsWithChildren } from 'react';
|
||||
|
||||
// TODO(FW-2959): types
|
||||
|
||||
interface PartialPropertyValue {
|
||||
property: string;
|
||||
value: any;
|
||||
|
@ -21,6 +21,7 @@ export interface ActionSheetOptions extends Omit<ActionSheetOptionsCore, 'button
|
||||
}
|
||||
|
||||
const actionSheetController = {
|
||||
// TODO(FW-2959): type
|
||||
create: (options: ActionSheetOptions) => actionSheetControllerCore.create(options as any),
|
||||
dismiss: (data?: any, role?: string | undefined, id?: string | undefined) =>
|
||||
actionSheetControllerCore.dismiss(data, role, id),
|
||||
|
@ -15,7 +15,7 @@ type Props = LocalJSX.IonApp &
|
||||
|
||||
export const IonApp = /*@__PURE__*/ (() =>
|
||||
class extends React.Component<Props> {
|
||||
addOverlayCallback?: (id: string, overlay: any, containerElement: HTMLDivElement) => void;
|
||||
addOverlayCallback?: (id: string, overlay: ReactComponentOrElement, containerElement: HTMLDivElement) => void;
|
||||
removeOverlayCallback?: (id: string) => void;
|
||||
|
||||
constructor(props: Props) {
|
||||
|
@ -27,7 +27,7 @@ export const IonOverlayManager: React.FC<IonOverlayManagerProps> = ({
|
||||
}) => {
|
||||
type OverlaysList = {
|
||||
[key: string]: {
|
||||
component: any;
|
||||
component: any; // TODO(FW-2959): type
|
||||
containerElement: HTMLDivElement;
|
||||
};
|
||||
};
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ export interface IonRouterContextState {
|
||||
}
|
||||
|
||||
export const IonRouterContext = React.createContext<IonRouterContextState>({
|
||||
routeInfo: undefined as any,
|
||||
routeInfo: undefined as any, // TODO(FW-2959): type
|
||||
push: () => {
|
||||
throw new Error('An Ionic Router is required for IonRouterContext');
|
||||
},
|
||||
|
@ -10,6 +10,8 @@ import {
|
||||
} from './react-component-lib/utils';
|
||||
import { createForwardRef } from './utils';
|
||||
|
||||
// TODO(FW-2959): types
|
||||
|
||||
type InlineOverlayState = {
|
||||
isOpen: boolean;
|
||||
};
|
||||
|
@ -15,6 +15,8 @@ import {
|
||||
} from './react-component-lib/utils';
|
||||
import { createForwardRef } from './utils';
|
||||
|
||||
// TODO(FW-2959): types
|
||||
|
||||
interface IonicReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {
|
||||
forwardedRef?: React.ForwardedRef<ElementType>;
|
||||
href?: string;
|
||||
|
@ -35,6 +35,8 @@ interface IonTabBarState {
|
||||
tabs: { [key: string]: TabUrls };
|
||||
}
|
||||
|
||||
// TODO(FW-2959): types
|
||||
|
||||
class IonTabBarUnwrapped extends React.PureComponent<InternalProps, IonTabBarState> {
|
||||
context!: React.ContextType<typeof NavContext>;
|
||||
|
||||
|
@ -9,7 +9,7 @@ type Props = LocalJSX.IonTabButton &
|
||||
IonicReactProps & {
|
||||
routerOptions?: RouterOptions;
|
||||
ref?: React.Ref<HTMLIonTabButtonElement>;
|
||||
onClick?: (e: any) => void;
|
||||
onClick?: (e: Event) => void;
|
||||
};
|
||||
|
||||
export const IonTabButton = /*@__PURE__*/ (() =>
|
||||
|
@ -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) {
|
||||
|
@ -13,7 +13,7 @@ export type IonicReactExternalProps<PropType, ElementType> = PropType &
|
||||
IonicReactProps;
|
||||
|
||||
export const createForwardRef = <PropType, ElementType>(
|
||||
ReactComponent: any,
|
||||
ReactComponent: any, // TODO(FW-2959): type
|
||||
displayName: string
|
||||
) => {
|
||||
const forwardRef = (
|
||||
|
@ -3,6 +3,8 @@ import React from 'react';
|
||||
|
||||
import { RouteInfo } from '../models';
|
||||
|
||||
// TODO(FW-2959): types
|
||||
|
||||
export interface NavContextState {
|
||||
getIonRoute: () => any;
|
||||
getIonRedirect: () => any;
|
||||
|
@ -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 = (
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -8,6 +8,8 @@ import { generateId } from '../utils/generateId';
|
||||
|
||||
import { HookOverlayOptions } from './HookOverlayOptions';
|
||||
|
||||
// TODO(FW-2959): types
|
||||
|
||||
interface OverlayBase extends HTMLElement {
|
||||
present: () => Promise<void>;
|
||||
dismiss: (data?: any, role?: string | undefined) => Promise<boolean>;
|
||||
|
@ -2,6 +2,8 @@ import React from 'react';
|
||||
|
||||
import { IonLifeCycleContext } from '../contexts/IonLifeCycleContext';
|
||||
|
||||
// TODO(FW-2959): types
|
||||
|
||||
export const withIonLifeCycle = (WrappedComponent: React.ComponentType<any>) => {
|
||||
return class IonLifeCycle extends React.Component<any, any> {
|
||||
context!: React.ContextType<typeof IonLifeCycleContext>;
|
||||
|
@ -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;
|
||||
|
@ -11,7 +11,7 @@ interface OutletPageManagerProps {
|
||||
className?: string;
|
||||
forwardedRef?: React.ForwardedRef<HTMLIonRouterOutletElement>;
|
||||
routeInfo?: RouteInfo;
|
||||
StackManager: any;
|
||||
StackManager: any; // TODO(FW-2959): type
|
||||
}
|
||||
|
||||
export class OutletPageManager extends React.Component<OutletPageManagerProps> {
|
||||
|
@ -27,6 +27,7 @@ export interface RouteManagerContextState {
|
||||
unMountViewItem: (viewItem: ViewItem) => void;
|
||||
}
|
||||
|
||||
// TODO(FW-2959): types
|
||||
export const RouteManagerContext = /*@__PURE__*/ React.createContext<RouteManagerContextState>({
|
||||
addViewItem: () => undefined,
|
||||
canGoBack: () => undefined as any,
|
||||
|
Reference in New Issue
Block a user