mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(all): use ts strict mode
This commit is contained in:
@@ -24,13 +24,9 @@ export class DomFrameworkDelegate implements FrameworkDelegate {
|
||||
});
|
||||
}
|
||||
|
||||
removeViewFromDom(parentElement: HTMLElement, childElement: HTMLElement): Promise<FrameworkMountingData> {
|
||||
removeViewFromDom(parentElement: HTMLElement, childElement: HTMLElement): Promise<void> {
|
||||
parentElement.removeChild(childElement);
|
||||
return Promise.resolve({
|
||||
element: null,
|
||||
data: null,
|
||||
component: null
|
||||
});
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
shouldDeferToRouter(_elementOrComponentToMount: any): Promise<boolean> {
|
||||
|
||||
@@ -253,7 +253,7 @@ export const NON_TEXT_INPUT_REGEX = /^(radio|checkbox|range|file|submit|reset|co
|
||||
|
||||
export function hasFocusedTextInput() {
|
||||
const activeElement = getActiveElement();
|
||||
if (isTextInput(activeElement)) {
|
||||
if (isTextInput(activeElement) && activeElement.parentElement) {
|
||||
return activeElement.parentElement.querySelector(':focus') === activeElement;
|
||||
}
|
||||
return false;
|
||||
@@ -271,7 +271,7 @@ export function reorderArray(array: any[], indexes: {from: number, to: number}):
|
||||
|
||||
export function playAnimationAsync(animation: Animation): Promise<Animation> {
|
||||
return new Promise((resolve) => {
|
||||
animation.onFinish((ani: Animation) => {
|
||||
animation.onFinish((ani) => {
|
||||
resolve(ani);
|
||||
});
|
||||
animation.play();
|
||||
@@ -299,7 +299,7 @@ export function debounce(func: Function, wait = 0) {
|
||||
};
|
||||
}
|
||||
|
||||
export function getNavAsChildIfExists(element: HTMLElement): HTMLIonNavElement {
|
||||
export function getNavAsChildIfExists(element: HTMLElement): HTMLIonNavElement|null {
|
||||
for (let i = 0; i < element.children.length; i++) {
|
||||
if (element.children[i].tagName.toLowerCase() === 'ion-nav') {
|
||||
return element.children[i] as HTMLIonNavElement;
|
||||
|
||||
@@ -51,7 +51,7 @@ export function getButtonClassMap(buttonType: string, mode: string): CssClassMap
|
||||
}
|
||||
|
||||
|
||||
export function getClassMap(classes: string): CssClassMap {
|
||||
export function getClassMap(classes: string | undefined): CssClassMap {
|
||||
const map: CssClassMap = {};
|
||||
if (classes) {
|
||||
classes
|
||||
|
||||
Reference in New Issue
Block a user