From 2f8a027e2f390b74b0bdfbe73ef0d3d0016dbd2f Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Mon, 5 Feb 2018 18:34:37 +0100 Subject: [PATCH] refactor(all): use ts strict mode --- packages/core/src/components.d.ts.orig | 3336 +++++++++++++++++ .../action-sheet-controller.tsx | 3 + .../components/action-sheet/action-sheet.tsx | 29 +- .../alert-controller/alert-controller.tsx | 3 + packages/core/src/components/alert/alert.tsx | 88 +- .../animation-interface.tsx | 2 +- .../animation-controller/animator.tsx | 101 +- .../animation-controller/constants.ts | 49 +- .../core/src/components/button/button.tsx | 2 +- .../core/src/components/content/content.tsx | 2 +- .../gesture-controller/gesture-controller.ts | 3 +- .../infinite-scroll/infinite-scroll.tsx | 4 +- .../modal-controller/modal-controller.tsx | 3 + .../picker-controller/picker-controller.tsx | 3 + .../popover-controller/popover-controller.tsx | 3 + .../src/components/range-knob/range-knob.tsx | 1 + .../src/components/refresher/refresher.tsx | 34 +- .../reorder-group/reorder-group.tsx | 14 +- .../router-controller/router-controller.tsx | 2 +- .../router-controller/router-utils.ts | 16 +- .../core/src/components/select/select.tsx | 9 +- .../core/src/components/tabbar/tabbar.tsx | 128 +- packages/core/src/components/tabs/tabs.tsx | 15 +- .../src/components/tap-click/tap-click.tsx | 8 +- .../toast-controller/toast-controller.tsx | 3 + packages/core/src/components/toast/toast.tsx | 2 +- .../components/virtual-scroll/test/basic.html | 11 + .../virtual-scroll/virtual-scroll.tsx | 22 +- packages/core/src/global/config-controller.ts | 4 +- packages/core/src/global/dom-controller.ts | 2 +- packages/core/src/global/platform-utils.ts | 3 +- packages/core/src/index.d.ts | 2 +- .../core/src/utils/dom-framework-delegate.ts | 8 +- packages/core/src/utils/helpers.ts | 6 +- packages/core/src/utils/theme.ts | 2 +- 35 files changed, 3630 insertions(+), 293 deletions(-) create mode 100644 packages/core/src/components.d.ts.orig diff --git a/packages/core/src/components.d.ts.orig b/packages/core/src/components.d.ts.orig new file mode 100644 index 0000000000..cd1a3c9e7c --- /dev/null +++ b/packages/core/src/components.d.ts.orig @@ -0,0 +1,3336 @@ +/** + * This is an autogenerated file created by the Stencil build process. + * It contains typing information for all components that exist in this project + * and imports for stencil collections that might be configured in your stencil.config.js file + */ + +import 'ionicons'; + +import { + ActionSheetButton, +} from './components/action-sheet/action-sheet'; +import { + AnimationBuilder, + FrameworkDelegate, + PickerColumn, + PickerOptions, +} from './index'; +import { + AlertButton, + AlertInput, +} from './components/alert/alert'; +import { + ElementRef, + Side, +} from './utils/helpers'; +import { + GestureCallback, + GestureDetail, +} from './components/gesture/gesture'; +import { + PickerButton, + PickerColumn as PickerColumn2, +} from './components/picker/picker'; +import { + Event, +} from '@stencil/core'; +import { + ScrollCallback, +} from './components/scroll/scroll'; +import { + SelectPopoverOption, +} from './components/select-popover/select-popover'; +import { + DomRenderFn, + HeaderFn, + ItemHeightFn, + ItemRenderFn, + NodeHeightFn, +} from './components/virtual-scroll/virtual-scroll-utils'; + +import { + ActionSheetController as IonActionSheetController +} from './components/action-sheet-controller/action-sheet-controller'; + +declare global { + interface HTMLStencilElement extends HTMLElement { + componentOnReady(): Promise; + componentOnReady(done: (el?: this) => void): void; + } +} + +declare global { + interface HTMLIonActionSheetControllerElement extends IonActionSheetController, HTMLStencilElement { + } + var HTMLIonActionSheetControllerElement: { + prototype: HTMLIonActionSheetControllerElement; + new (): HTMLIonActionSheetControllerElement; + }; + interface HTMLElementTagNameMap { + "ion-action-sheet-controller": HTMLIonActionSheetControllerElement; + } + interface ElementTagNameMap { + "ion-action-sheet-controller": HTMLIonActionSheetControllerElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-action-sheet-controller": JSXElements.IonActionSheetControllerAttributes; + } + } + namespace JSXElements { + export interface IonActionSheetControllerAttributes extends HTMLAttributes { + + } + } +} + + +import { + ActionSheet as IonActionSheet +} from './components/action-sheet/action-sheet'; + +declare global { + interface HTMLIonActionSheetElement extends IonActionSheet, HTMLElement { + } + var HTMLIonActionSheetElement: { + prototype: HTMLIonActionSheetElement; + new (): HTMLIonActionSheetElement; + }; + interface HTMLElementTagNameMap { + "ion-action-sheet": HTMLIonActionSheetElement; + } + interface ElementTagNameMap { + "ion-action-sheet": HTMLIonActionSheetElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-action-sheet": JSXElements.IonActionSheetAttributes; + } + } + namespace JSXElements { + export interface IonActionSheetAttributes extends HTMLAttributes { + buttons?: ActionSheetButton[]; + cssClass?: string; + enableBackdropDismiss?: boolean; + enterAnimation?: AnimationBuilder; + leaveAnimation?: AnimationBuilder; + subTitle?: string; + title?: string; + translucent?: boolean; + willAnimate?: boolean; + } + } +} + + +import { + AlertController as IonAlertController +} from './components/alert-controller/alert-controller'; + +declare global { + interface HTMLIonAlertControllerElement extends IonAlertController, HTMLElement { + } + var HTMLIonAlertControllerElement: { + prototype: HTMLIonAlertControllerElement; + new (): HTMLIonAlertControllerElement; + }; + interface HTMLElementTagNameMap { + "ion-alert-controller": HTMLIonAlertControllerElement; + } + interface ElementTagNameMap { + "ion-alert-controller": HTMLIonAlertControllerElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-alert-controller": JSXElements.IonAlertControllerAttributes; + } + } + namespace JSXElements { + export interface IonAlertControllerAttributes extends HTMLAttributes { + + } + } +} + + +import { + Alert as IonAlert +} from './components/alert/alert'; + +declare global { + interface HTMLIonAlertElement extends IonAlert, HTMLElement { + } + var HTMLIonAlertElement: { + prototype: HTMLIonAlertElement; + new (): HTMLIonAlertElement; + }; + interface HTMLElementTagNameMap { + "ion-alert": HTMLIonAlertElement; + } + interface ElementTagNameMap { + "ion-alert": HTMLIonAlertElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-alert": JSXElements.IonAlertAttributes; + } + } + namespace JSXElements { + export interface IonAlertAttributes extends HTMLAttributes { + buttons?: AlertButton[]; + cssClass?: string; + enableBackdropDismiss?: boolean; + enterAnimation?: AnimationBuilder; + inputs?: AlertInput[]; + leaveAnimation?: AnimationBuilder; + message?: string; + subTitle?: string; + title?: string; + translucent?: boolean; + willAnimate?: boolean; + } + } +} + + +import { + AnimationControllerImpl as IonAnimationController +} from './components/animation-controller/animation-controller'; + +declare global { + interface HTMLIonAnimationControllerElement extends IonAnimationController, HTMLElement { + } + var HTMLIonAnimationControllerElement: { + prototype: HTMLIonAnimationControllerElement; + new (): HTMLIonAnimationControllerElement; + }; + interface HTMLElementTagNameMap { + "ion-animation-controller": HTMLIonAnimationControllerElement; + } + interface ElementTagNameMap { + "ion-animation-controller": HTMLIonAnimationControllerElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-animation-controller": JSXElements.IonAnimationControllerAttributes; + } + } + namespace JSXElements { + export interface IonAnimationControllerAttributes extends HTMLAttributes { + + } + } +} + + +import { + App as IonApp +} from './components/app/app'; + +declare global { + interface HTMLIonAppElement extends IonApp, HTMLElement { + } + var HTMLIonAppElement: { + prototype: HTMLIonAppElement; + new (): HTMLIonAppElement; + }; + interface HTMLElementTagNameMap { + "ion-app": HTMLIonAppElement; + } + interface ElementTagNameMap { + "ion-app": HTMLIonAppElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-app": JSXElements.IonAppAttributes; + } + } + namespace JSXElements { + export interface IonAppAttributes extends HTMLAttributes { + + } + } +} + + +import { + Avatar as IonAvatar +} from './components/avatar/avatar'; + +declare global { + interface HTMLIonAvatarElement extends IonAvatar, HTMLElement { + } + var HTMLIonAvatarElement: { + prototype: HTMLIonAvatarElement; + new (): HTMLIonAvatarElement; + }; + interface HTMLElementTagNameMap { + "ion-avatar": HTMLIonAvatarElement; + } + interface ElementTagNameMap { + "ion-avatar": HTMLIonAvatarElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-avatar": JSXElements.IonAvatarAttributes; + } + } + namespace JSXElements { + export interface IonAvatarAttributes extends HTMLAttributes { + + } + } +} + + +import { + Backdrop as IonBackdrop +} from './components/backdrop/backdrop'; + +declare global { + interface HTMLIonBackdropElement extends IonBackdrop, HTMLElement { + } + var HTMLIonBackdropElement: { + prototype: HTMLIonBackdropElement; + new (): HTMLIonBackdropElement; + }; + interface HTMLElementTagNameMap { + "ion-backdrop": HTMLIonBackdropElement; + } + interface ElementTagNameMap { + "ion-backdrop": HTMLIonBackdropElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-backdrop": JSXElements.IonBackdropAttributes; + } + } + namespace JSXElements { + export interface IonBackdropAttributes extends HTMLAttributes { +<<<<<<< HEAD + mode?: 'ios' | 'md'; +======= + +>>>>>>> refactor(all): use ts strict mode + } + } +} + + +import { + Badge as IonBadge +} from './components/badge/badge'; + +declare global { + interface HTMLIonBadgeElement extends IonBadge, HTMLElement { + } + var HTMLIonBadgeElement: { + prototype: HTMLIonBadgeElement; + new (): HTMLIonBadgeElement; + }; + interface HTMLElementTagNameMap { + "ion-badge": HTMLIonBadgeElement; + } + interface ElementTagNameMap { + "ion-badge": HTMLIonBadgeElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-badge": JSXElements.IonBadgeAttributes; + } + } + namespace JSXElements { + export interface IonBadgeAttributes extends HTMLAttributes { + color?: string; + mode?: 'ios' | 'md'; + } + } +} + + +import { + Button as IonButton +} from './components/button/button'; + +declare global { + interface HTMLIonButtonElement extends IonButton, HTMLElement { + } + var HTMLIonButtonElement: { + prototype: HTMLIonButtonElement; + new (): HTMLIonButtonElement; + }; + interface HTMLElementTagNameMap { + "ion-button": HTMLIonButtonElement; + } + interface ElementTagNameMap { + "ion-button": HTMLIonButtonElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-button": JSXElements.IonButtonAttributes; + } + } + namespace JSXElements { + export interface IonButtonAttributes extends HTMLAttributes { + buttonType?: string; + color?: string; + disabled?: boolean; + expand?: 'full' | 'block'; + fill?: 'clear' | 'outline' | 'solid' | 'default'; + href?: string; + mode?: 'ios' | 'md'; + round?: boolean; + size?: 'small' | 'default' | 'large'; + strong?: boolean; + } + } +} + + +import { + Buttons as IonButtons +} from './components/buttons/buttons'; + +declare global { + interface HTMLIonButtonsElement extends IonButtons, HTMLElement { + } + var HTMLIonButtonsElement: { + prototype: HTMLIonButtonsElement; + new (): HTMLIonButtonsElement; + }; + interface HTMLElementTagNameMap { + "ion-buttons": HTMLIonButtonsElement; + } + interface ElementTagNameMap { + "ion-buttons": HTMLIonButtonsElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-buttons": JSXElements.IonButtonsAttributes; + } + } + namespace JSXElements { + export interface IonButtonsAttributes extends HTMLAttributes { + + } + } +} + + +import { + CardContent as IonCardContent +} from './components/card-content/card-content'; + +declare global { + interface HTMLIonCardContentElement extends IonCardContent, HTMLElement { + } + var HTMLIonCardContentElement: { + prototype: HTMLIonCardContentElement; + new (): HTMLIonCardContentElement; + }; + interface HTMLElementTagNameMap { + "ion-card-content": HTMLIonCardContentElement; + } + interface ElementTagNameMap { + "ion-card-content": HTMLIonCardContentElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-card-content": JSXElements.IonCardContentAttributes; + } + } + namespace JSXElements { + export interface IonCardContentAttributes extends HTMLAttributes { + color?: string; + mode?: 'ios' | 'md'; + } + } +} + + +import { + CardHeader as IonCardHeader +} from './components/card-header/card-header'; + +declare global { + interface HTMLIonCardHeaderElement extends IonCardHeader, HTMLElement { + } + var HTMLIonCardHeaderElement: { + prototype: HTMLIonCardHeaderElement; + new (): HTMLIonCardHeaderElement; + }; + interface HTMLElementTagNameMap { + "ion-card-header": HTMLIonCardHeaderElement; + } + interface ElementTagNameMap { + "ion-card-header": HTMLIonCardHeaderElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-card-header": JSXElements.IonCardHeaderAttributes; + } + } + namespace JSXElements { + export interface IonCardHeaderAttributes extends HTMLAttributes { + color?: string; + mode?: 'ios' | 'md'; + translucent?: boolean; + } + } +} + + +import { + CardSubtitle as IonCardSubtitle +} from './components/card-subtitle/card-subtitle'; + +declare global { + interface HTMLIonCardSubtitleElement extends IonCardSubtitle, HTMLElement { + } + var HTMLIonCardSubtitleElement: { + prototype: HTMLIonCardSubtitleElement; + new (): HTMLIonCardSubtitleElement; + }; + interface HTMLElementTagNameMap { + "ion-card-subtitle": HTMLIonCardSubtitleElement; + } + interface ElementTagNameMap { + "ion-card-subtitle": HTMLIonCardSubtitleElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-card-subtitle": JSXElements.IonCardSubtitleAttributes; + } + } + namespace JSXElements { + export interface IonCardSubtitleAttributes extends HTMLAttributes { + color?: string; + mode?: 'ios' | 'md'; + } + } +} + + +import { + CardTitle as IonCardTitle +} from './components/card-title/card-title'; + +declare global { + interface HTMLIonCardTitleElement extends IonCardTitle, HTMLElement { + } + var HTMLIonCardTitleElement: { + prototype: HTMLIonCardTitleElement; + new (): HTMLIonCardTitleElement; + }; + interface HTMLElementTagNameMap { + "ion-card-title": HTMLIonCardTitleElement; + } + interface ElementTagNameMap { + "ion-card-title": HTMLIonCardTitleElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-card-title": JSXElements.IonCardTitleAttributes; + } + } + namespace JSXElements { + export interface IonCardTitleAttributes extends HTMLAttributes { + color?: string; + mode?: 'ios' | 'md'; + } + } +} + + +import { + Card as IonCard +} from './components/card/card'; + +declare global { + interface HTMLIonCardElement extends IonCard, HTMLElement { + } + var HTMLIonCardElement: { + prototype: HTMLIonCardElement; + new (): HTMLIonCardElement; + }; + interface HTMLElementTagNameMap { + "ion-card": HTMLIonCardElement; + } + interface ElementTagNameMap { + "ion-card": HTMLIonCardElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-card": JSXElements.IonCardAttributes; + } + } + namespace JSXElements { + export interface IonCardAttributes extends HTMLAttributes { + color?: string; + mode?: 'ios' | 'md'; + } + } +} + + +import { + Checkbox as IonCheckbox +} from './components/checkbox/checkbox'; + +declare global { + interface HTMLIonCheckboxElement extends IonCheckbox, HTMLElement { + } + var HTMLIonCheckboxElement: { + prototype: HTMLIonCheckboxElement; + new (): HTMLIonCheckboxElement; + }; + interface HTMLElementTagNameMap { + "ion-checkbox": HTMLIonCheckboxElement; + } + interface ElementTagNameMap { + "ion-checkbox": HTMLIonCheckboxElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-checkbox": JSXElements.IonCheckboxAttributes; + } + } + namespace JSXElements { + export interface IonCheckboxAttributes extends HTMLAttributes { + checked?: boolean; + color?: string; + disabled?: boolean; + mode?: 'ios' | 'md'; + name?: string; + value?: string; + } + } +} + + +import { + ChipButton as IonChipButton +} from './components/chip-button/chip-button'; + +declare global { + interface HTMLIonChipButtonElement extends IonChipButton, HTMLElement { + } + var HTMLIonChipButtonElement: { + prototype: HTMLIonChipButtonElement; + new (): HTMLIonChipButtonElement; + }; + interface HTMLElementTagNameMap { + "ion-chip-button": HTMLIonChipButtonElement; + } + interface ElementTagNameMap { + "ion-chip-button": HTMLIonChipButtonElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-chip-button": JSXElements.IonChipButtonAttributes; + } + } + namespace JSXElements { + export interface IonChipButtonAttributes extends HTMLAttributes { + color?: string; + disabled?: boolean; + fill?: string; + href?: string; + mode?: 'ios' | 'md'; + } + } +} + + +import { + Chip as IonChip +} from './components/chip/chip'; + +declare global { + interface HTMLIonChipElement extends IonChip, HTMLElement { + } + var HTMLIonChipElement: { + prototype: HTMLIonChipElement; + new (): HTMLIonChipElement; + }; + interface HTMLElementTagNameMap { + "ion-chip": HTMLIonChipElement; + } + interface ElementTagNameMap { + "ion-chip": HTMLIonChipElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-chip": JSXElements.IonChipAttributes; + } + } + namespace JSXElements { + export interface IonChipAttributes extends HTMLAttributes { + color?: string; + mode?: 'ios' | 'md'; + } + } +} + + +import { + Col as IonCol +} from './components/col/col'; + +declare global { + interface HTMLIonColElement extends IonCol, HTMLElement { + } + var HTMLIonColElement: { + prototype: HTMLIonColElement; + new (): HTMLIonColElement; + }; + interface HTMLElementTagNameMap { + "ion-col": HTMLIonColElement; + } + interface ElementTagNameMap { + "ion-col": HTMLIonColElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-col": JSXElements.IonColAttributes; + } + } + namespace JSXElements { + export interface IonColAttributes extends HTMLAttributes { + + } + } +} + + +import { + Content as IonContent +} from './components/content/content'; + +declare global { + interface HTMLIonContentElement extends IonContent, HTMLElement { + } + var HTMLIonContentElement: { + prototype: HTMLIonContentElement; + new (): HTMLIonContentElement; + }; + interface HTMLElementTagNameMap { + "ion-content": HTMLIonContentElement; + } + interface ElementTagNameMap { + "ion-content": HTMLIonContentElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-content": JSXElements.IonContentAttributes; + } + } + namespace JSXElements { + export interface IonContentAttributes extends HTMLAttributes { + fullscreen?: boolean; + ionScroll?: Function; + ionScrollEnd?: Function; + ionScrollStart?: Function; + } + } +} + + +import { + Datetime as IonDatetime +} from './components/datetime/datetime'; + +declare global { + interface HTMLIonDatetimeElement extends IonDatetime, HTMLElement { + } + var HTMLIonDatetimeElement: { + prototype: HTMLIonDatetimeElement; + new (): HTMLIonDatetimeElement; + }; + interface HTMLElementTagNameMap { + "ion-datetime": HTMLIonDatetimeElement; + } + interface ElementTagNameMap { + "ion-datetime": HTMLIonDatetimeElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-datetime": JSXElements.IonDatetimeAttributes; + } + } + namespace JSXElements { + export interface IonDatetimeAttributes extends HTMLAttributes { + cancelText?: string; + dayNames?: any; + dayShortNames?: any; + dayValues?: any; + disabled?: boolean; + displayFormat?: string; + doneText?: string; + hourValues?: any; + max?: string; + min?: string; + minuteValues?: any; + monthNames?: any; + monthShortNames?: any; + monthValues?: any; + pickerFormat?: string; + pickerOptions?: PickerOptions; + placeholder?: string; + value?: string; + yearValues?: any; + } + } +} + + +import { + Events as IonEvents +} from './components/events/events'; + +declare global { + interface HTMLIonEventsElement extends IonEvents, HTMLElement { + } + var HTMLIonEventsElement: { + prototype: HTMLIonEventsElement; + new (): HTMLIonEventsElement; + }; + interface HTMLElementTagNameMap { + "ion-events": HTMLIonEventsElement; + } + interface ElementTagNameMap { + "ion-events": HTMLIonEventsElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-events": JSXElements.IonEventsAttributes; + } + } + namespace JSXElements { + export interface IonEventsAttributes extends HTMLAttributes { + + } + } +} + + +import { + FabButton as IonFabButton +} from './components/fab-button/fab-button'; + +declare global { + interface HTMLIonFabButtonElement extends IonFabButton, HTMLElement { + } + var HTMLIonFabButtonElement: { + prototype: HTMLIonFabButtonElement; + new (): HTMLIonFabButtonElement; + }; + interface HTMLElementTagNameMap { + "ion-fab-button": HTMLIonFabButtonElement; + } + interface ElementTagNameMap { + "ion-fab-button": HTMLIonFabButtonElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-fab-button": JSXElements.IonFabButtonAttributes; + } + } + namespace JSXElements { + export interface IonFabButtonAttributes extends HTMLAttributes { + activated?: boolean; + color?: string; + disabled?: boolean; + href?: string; + mode?: 'ios' | 'md'; + show?: boolean; + toggleActive?: Function; + translucent?: boolean; + } + } +} + + +import { + FabList as IonFabList +} from './components/fab-list/fab-list'; + +declare global { + interface HTMLIonFabListElement extends IonFabList, HTMLElement { + } + var HTMLIonFabListElement: { + prototype: HTMLIonFabListElement; + new (): HTMLIonFabListElement; + }; + interface HTMLElementTagNameMap { + "ion-fab-list": HTMLIonFabListElement; + } + interface ElementTagNameMap { + "ion-fab-list": HTMLIonFabListElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-fab-list": JSXElements.IonFabListAttributes; + } + } + namespace JSXElements { + export interface IonFabListAttributes extends HTMLAttributes { + activated?: boolean; + } + } +} + + +import { + Fab as IonFab +} from './components/fab/fab'; + +declare global { + interface HTMLIonFabElement extends IonFab, HTMLElement { + } + var HTMLIonFabElement: { + prototype: HTMLIonFabElement; + new (): HTMLIonFabElement; + }; + interface HTMLElementTagNameMap { + "ion-fab": HTMLIonFabElement; + } + interface ElementTagNameMap { + "ion-fab": HTMLIonFabElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-fab": JSXElements.IonFabAttributes; + } + } + namespace JSXElements { + export interface IonFabAttributes extends HTMLAttributes { + + } + } +} + + +import { + Footer as IonFooter +} from './components/footer/footer'; + +declare global { + interface HTMLIonFooterElement extends IonFooter, HTMLElement { + } + var HTMLIonFooterElement: { + prototype: HTMLIonFooterElement; + new (): HTMLIonFooterElement; + }; + interface HTMLElementTagNameMap { + "ion-footer": HTMLIonFooterElement; + } + interface ElementTagNameMap { + "ion-footer": HTMLIonFooterElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-footer": JSXElements.IonFooterAttributes; + } + } + namespace JSXElements { + export interface IonFooterAttributes extends HTMLAttributes { + translucent?: boolean; + } + } +} + + +import { + Gesture as IonGesture +} from './components/gesture/gesture'; + +declare global { + interface HTMLIonGestureElement extends IonGesture, HTMLElement { + } + var HTMLIonGestureElement: { + prototype: HTMLIonGestureElement; + new (): HTMLIonGestureElement; + }; + interface HTMLElementTagNameMap { + "ion-gesture": HTMLIonGestureElement; + } + interface ElementTagNameMap { + "ion-gesture": HTMLIonGestureElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-gesture": JSXElements.IonGestureAttributes; + } + } + namespace JSXElements { + export interface IonGestureAttributes extends HTMLAttributes { + attachTo?: ElementRef; + autoBlockAll?: boolean; + block?: string; + canStart?: GestureCallback; + direction?: string; + disabled?: boolean; + disableScroll?: boolean; + gestureName?: string; + gesturePriority?: number; + maxAngle?: number; + notCaptured?: GestureCallback; + onEnd?: GestureCallback; + onMove?: GestureCallback; + onPress?: GestureCallback; + onStart?: GestureCallback; + onWillStart?: (_: GestureDetail) => Promise; + passive?: boolean; + threshold?: number; + type?: string; + } + } +} + + +import { + Grid as IonGrid +} from './components/grid/grid'; + +declare global { + interface HTMLIonGridElement extends IonGrid, HTMLElement { + } + var HTMLIonGridElement: { + prototype: HTMLIonGridElement; + new (): HTMLIonGridElement; + }; + interface HTMLElementTagNameMap { + "ion-grid": HTMLIonGridElement; + } + interface ElementTagNameMap { + "ion-grid": HTMLIonGridElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-grid": JSXElements.IonGridAttributes; + } + } + namespace JSXElements { + export interface IonGridAttributes extends HTMLAttributes { + + } + } +} + + +import { + Header as IonHeader +} from './components/header/header'; + +declare global { + interface HTMLIonHeaderElement extends IonHeader, HTMLElement { + } + var HTMLIonHeaderElement: { + prototype: HTMLIonHeaderElement; + new (): HTMLIonHeaderElement; + }; + interface HTMLElementTagNameMap { + "ion-header": HTMLIonHeaderElement; + } + interface ElementTagNameMap { + "ion-header": HTMLIonHeaderElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-header": JSXElements.IonHeaderAttributes; + } + } + namespace JSXElements { + export interface IonHeaderAttributes extends HTMLAttributes { + translucent?: boolean; + } + } +} + + +import { + InfiniteScrollContent as IonInfiniteScrollContent +} from './components/infinite-scroll-content/infinite-scroll-content'; + +declare global { + interface HTMLIonInfiniteScrollContentElement extends IonInfiniteScrollContent, HTMLElement { + } + var HTMLIonInfiniteScrollContentElement: { + prototype: HTMLIonInfiniteScrollContentElement; + new (): HTMLIonInfiniteScrollContentElement; + }; + interface HTMLElementTagNameMap { + "ion-infinite-scroll-content": HTMLIonInfiniteScrollContentElement; + } + interface ElementTagNameMap { + "ion-infinite-scroll-content": HTMLIonInfiniteScrollContentElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-infinite-scroll-content": JSXElements.IonInfiniteScrollContentAttributes; + } + } + namespace JSXElements { + export interface IonInfiniteScrollContentAttributes extends HTMLAttributes { + loadingSpinner?: string; + loadingText?: string; + } + } +} + + +import { + InfiniteScroll as IonInfiniteScroll +} from './components/infinite-scroll/infinite-scroll'; + +declare global { + interface HTMLIonInfiniteScrollElement extends IonInfiniteScroll, HTMLElement { + } + var HTMLIonInfiniteScrollElement: { + prototype: HTMLIonInfiniteScrollElement; + new (): HTMLIonInfiniteScrollElement; + }; + interface HTMLElementTagNameMap { + "ion-infinite-scroll": HTMLIonInfiniteScrollElement; + } + interface ElementTagNameMap { + "ion-infinite-scroll": HTMLIonInfiniteScrollElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-infinite-scroll": JSXElements.IonInfiniteScrollAttributes; + } + } + namespace JSXElements { + export interface IonInfiniteScrollAttributes extends HTMLAttributes { + disabled?: boolean; + position?: string; + threshold?: string; + } + } +} + + +import { + Input as IonInput +} from './components/input/input'; + +declare global { + interface HTMLIonInputElement extends IonInput, HTMLElement { + } + var HTMLIonInputElement: { + prototype: HTMLIonInputElement; + new (): HTMLIonInputElement; + }; + interface HTMLElementTagNameMap { + "ion-input": HTMLIonInputElement; + } + interface ElementTagNameMap { + "ion-input": HTMLIonInputElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-input": JSXElements.IonInputAttributes; + } + } + namespace JSXElements { + export interface IonInputAttributes extends HTMLAttributes { + accept?: string; + autocapitalize?: string; + autocomplete?: string; + autocorrect?: string; + autofocus?: boolean; + checked?: boolean; + clearInput?: boolean; + clearOnEdit?: boolean; + debounce?: number; + disabled?: boolean; + inputmode?: string; + max?: string; + maxlength?: number; + min?: string; + minlength?: number; + multiple?: boolean; + name?: string; + pattern?: string; + placeholder?: string; + readonly?: boolean; + required?: boolean; + results?: number; + size?: number; + spellcheck?: boolean; + step?: string; + type?: string; + value?: string; + } + } +} + + +import { + ItemDivider as IonItemDivider +} from './components/item-divider/item-divider'; + +declare global { + interface HTMLIonItemDividerElement extends IonItemDivider, HTMLElement { + } + var HTMLIonItemDividerElement: { + prototype: HTMLIonItemDividerElement; + new (): HTMLIonItemDividerElement; + }; + interface HTMLElementTagNameMap { + "ion-item-divider": HTMLIonItemDividerElement; + } + interface ElementTagNameMap { + "ion-item-divider": HTMLIonItemDividerElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-item-divider": JSXElements.IonItemDividerAttributes; + } + } + namespace JSXElements { + export interface IonItemDividerAttributes extends HTMLAttributes { + color?: string; + mode?: 'ios' | 'md'; + } + } +} + + +import { + ItemGroup as IonItemGroup +} from './components/item-group/item-group'; + +declare global { + interface HTMLIonItemGroupElement extends IonItemGroup, HTMLElement { + } + var HTMLIonItemGroupElement: { + prototype: HTMLIonItemGroupElement; + new (): HTMLIonItemGroupElement; + }; + interface HTMLElementTagNameMap { + "ion-item-group": HTMLIonItemGroupElement; + } + interface ElementTagNameMap { + "ion-item-group": HTMLIonItemGroupElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-item-group": JSXElements.IonItemGroupAttributes; + } + } + namespace JSXElements { + export interface IonItemGroupAttributes extends HTMLAttributes { + + } + } +} + + +import { + ItemOption as IonItemOption +} from './components/item-option/item-option'; + +declare global { + interface HTMLIonItemOptionElement extends IonItemOption, HTMLElement { + } + var HTMLIonItemOptionElement: { + prototype: HTMLIonItemOptionElement; + new (): HTMLIonItemOptionElement; + }; + interface HTMLElementTagNameMap { + "ion-item-option": HTMLIonItemOptionElement; + } + interface ElementTagNameMap { + "ion-item-option": HTMLIonItemOptionElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-item-option": JSXElements.IonItemOptionAttributes; + } + } + namespace JSXElements { + export interface IonItemOptionAttributes extends HTMLAttributes { + color?: string; + disabled?: boolean; + href?: string; + mode?: 'ios' | 'md'; + } + } +} + + +import { + ItemOptions as IonItemOptions +} from './components/item-options/item-options'; + +declare global { + interface HTMLIonItemOptionsElement extends IonItemOptions, HTMLElement { + } + var HTMLIonItemOptionsElement: { + prototype: HTMLIonItemOptionsElement; + new (): HTMLIonItemOptionsElement; + }; + interface HTMLElementTagNameMap { + "ion-item-options": HTMLIonItemOptionsElement; + } + interface ElementTagNameMap { + "ion-item-options": HTMLIonItemOptionsElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-item-options": JSXElements.IonItemOptionsAttributes; + } + } + namespace JSXElements { + export interface IonItemOptionsAttributes extends HTMLAttributes { + side?: Side; + } + } +} + + +import { + ItemSliding as IonItemSliding +} from './components/item-sliding/item-sliding'; + +declare global { + interface HTMLIonItemSlidingElement extends IonItemSliding, HTMLElement { + } + var HTMLIonItemSlidingElement: { + prototype: HTMLIonItemSlidingElement; + new (): HTMLIonItemSlidingElement; + }; + interface HTMLElementTagNameMap { + "ion-item-sliding": HTMLIonItemSlidingElement; + } + interface ElementTagNameMap { + "ion-item-sliding": HTMLIonItemSlidingElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-item-sliding": JSXElements.IonItemSlidingAttributes; + } + } + namespace JSXElements { + export interface IonItemSlidingAttributes extends HTMLAttributes { + + } + } +} + + +import { + Item as IonItem +} from './components/item/item'; + +declare global { + interface HTMLIonItemElement extends IonItem, HTMLElement { + } + var HTMLIonItemElement: { + prototype: HTMLIonItemElement; + new (): HTMLIonItemElement; + }; + interface HTMLElementTagNameMap { + "ion-item": HTMLIonItemElement; + } + interface ElementTagNameMap { + "ion-item": HTMLIonItemElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-item": JSXElements.IonItemAttributes; + } + } + namespace JSXElements { + export interface IonItemAttributes extends HTMLAttributes { + color?: string; + href?: string; + mode?: 'ios' | 'md'; + onclick?: (this: HTMLElement, ev: MouseEvent) => any; + tappable?: boolean; + } + } +} + + +import { + KeyboardController as IonKeyboardController +} from './components/keyboard-controller/keyboard-controller'; + +declare global { + interface HTMLIonKeyboardControllerElement extends IonKeyboardController, HTMLElement { + } + var HTMLIonKeyboardControllerElement: { + prototype: HTMLIonKeyboardControllerElement; + new (): HTMLIonKeyboardControllerElement; + }; + interface HTMLElementTagNameMap { + "ion-keyboard-controller": HTMLIonKeyboardControllerElement; + } + interface ElementTagNameMap { + "ion-keyboard-controller": HTMLIonKeyboardControllerElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-keyboard-controller": JSXElements.IonKeyboardControllerAttributes; + } + } + namespace JSXElements { + export interface IonKeyboardControllerAttributes extends HTMLAttributes { + + } + } +} + + +import { + Label as IonLabel +} from './components/label/label'; + +declare global { + interface HTMLIonLabelElement extends IonLabel, HTMLElement { + } + var HTMLIonLabelElement: { + prototype: HTMLIonLabelElement; + new (): HTMLIonLabelElement; + }; + interface HTMLElementTagNameMap { + "ion-label": HTMLIonLabelElement; + } + interface ElementTagNameMap { + "ion-label": HTMLIonLabelElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-label": JSXElements.IonLabelAttributes; + } + } + namespace JSXElements { + export interface IonLabelAttributes extends HTMLAttributes { + color?: string; + fixed?: boolean; + floating?: boolean; + mode?: 'ios' | 'md'; + stacked?: boolean; + } + } +} + + +import { + ListHeader as IonListHeader +} from './components/list-header/list-header'; + +declare global { + interface HTMLIonListHeaderElement extends IonListHeader, HTMLElement { + } + var HTMLIonListHeaderElement: { + prototype: HTMLIonListHeaderElement; + new (): HTMLIonListHeaderElement; + }; + interface HTMLElementTagNameMap { + "ion-list-header": HTMLIonListHeaderElement; + } + interface ElementTagNameMap { + "ion-list-header": HTMLIonListHeaderElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-list-header": JSXElements.IonListHeaderAttributes; + } + } + namespace JSXElements { + export interface IonListHeaderAttributes extends HTMLAttributes { + color?: string; + mode?: 'ios' | 'md'; + } + } +} + + +import { + List as IonList +} from './components/list/list'; + +declare global { + interface HTMLIonListElement extends IonList, HTMLElement { + } + var HTMLIonListElement: { + prototype: HTMLIonListElement; + new (): HTMLIonListElement; + }; + interface HTMLElementTagNameMap { + "ion-list": HTMLIonListElement; + } + interface ElementTagNameMap { + "ion-list": HTMLIonListElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-list": JSXElements.IonListAttributes; + } + } + namespace JSXElements { + export interface IonListAttributes extends HTMLAttributes { + + } + } +} + + +import { + LoadingController as IonLoadingController +} from './components/loading-controller/loading-controller'; + +declare global { + interface HTMLIonLoadingControllerElement extends IonLoadingController, HTMLStencilElement { + } + var HTMLIonLoadingControllerElement: { + prototype: HTMLIonLoadingControllerElement; + new (): HTMLIonLoadingControllerElement; + }; + interface HTMLElementTagNameMap { + "ion-loading-controller": HTMLIonLoadingControllerElement; + } + interface ElementTagNameMap { + "ion-loading-controller": HTMLIonLoadingControllerElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-loading-controller": JSXElements.IonLoadingControllerAttributes; + } + } + namespace JSXElements { + export interface IonLoadingControllerAttributes extends HTMLAttributes { + + } + } +} + + +import { + Loading as IonLoading +} from './components/loading/loading'; + +declare global { + interface HTMLIonLoadingElement extends IonLoading, HTMLStencilElement { + } + var HTMLIonLoadingElement: { + prototype: HTMLIonLoadingElement; + new (): HTMLIonLoadingElement; + }; + interface HTMLElementTagNameMap { + "ion-loading": HTMLIonLoadingElement; + } + interface ElementTagNameMap { + "ion-loading": HTMLIonLoadingElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-loading": JSXElements.IonLoadingAttributes; + } + } + namespace JSXElements { + export interface IonLoadingAttributes extends HTMLAttributes { + content?: string; + cssClass?: string; + dismissOnPageChange?: boolean; + duration?: number; + enterAnimation?: AnimationBuilder; + leaveAnimation?: AnimationBuilder; + showBackdrop?: boolean; + spinner?: string; + translucent?: boolean; + willAnimate?: boolean; + } + } +} + + +import { + MenuController as IonMenuController +} from './components/menu-controller/menu-controller'; + +declare global { + interface HTMLIonMenuControllerElement extends IonMenuController, HTMLElement { + } + var HTMLIonMenuControllerElement: { + prototype: HTMLIonMenuControllerElement; + new (): HTMLIonMenuControllerElement; + }; + interface HTMLElementTagNameMap { + "ion-menu-controller": HTMLIonMenuControllerElement; + } + interface ElementTagNameMap { + "ion-menu-controller": HTMLIonMenuControllerElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-menu-controller": JSXElements.IonMenuControllerAttributes; + } + } + namespace JSXElements { + export interface IonMenuControllerAttributes extends HTMLAttributes { + + } + } +} + + +import { + MenuToggle as IonMenuToggle +} from './components/menu-toggle/menu-toggle'; + +declare global { + interface HTMLIonMenuToggleElement extends IonMenuToggle, HTMLElement { + } + var HTMLIonMenuToggleElement: { + prototype: HTMLIonMenuToggleElement; + new (): HTMLIonMenuToggleElement; + }; + interface HTMLElementTagNameMap { + "ion-menu-toggle": HTMLIonMenuToggleElement; + } + interface ElementTagNameMap { + "ion-menu-toggle": HTMLIonMenuToggleElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-menu-toggle": JSXElements.IonMenuToggleAttributes; + } + } + namespace JSXElements { + export interface IonMenuToggleAttributes extends HTMLAttributes { + menu?: string; + } + } +} + + +import { + Menu as IonMenu +} from './components/menu/menu'; + +declare global { + interface HTMLIonMenuElement extends IonMenu, HTMLElement { + } + var HTMLIonMenuElement: { + prototype: HTMLIonMenuElement; + new (): HTMLIonMenuElement; + }; + interface HTMLElementTagNameMap { + "ion-menu": HTMLIonMenuElement; + } + interface ElementTagNameMap { + "ion-menu": HTMLIonMenuElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-menu": JSXElements.IonMenuAttributes; + } + } + namespace JSXElements { + export interface IonMenuAttributes extends HTMLAttributes { + content?: string; + disabled?: boolean; + maxEdgeStart?: number; + menuId?: string; + persistent?: boolean; + side?: Side; + swipeEnabled?: boolean; + type?: string; + } + } +} + + +import { + ModalController as IonModalController +} from './components/modal-controller/modal-controller'; + +declare global { + interface HTMLIonModalControllerElement extends IonModalController, HTMLElement { + } + var HTMLIonModalControllerElement: { + prototype: HTMLIonModalControllerElement; + new (): HTMLIonModalControllerElement; + }; + interface HTMLElementTagNameMap { + "ion-modal-controller": HTMLIonModalControllerElement; + } + interface ElementTagNameMap { + "ion-modal-controller": HTMLIonModalControllerElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-modal-controller": JSXElements.IonModalControllerAttributes; + } + } + namespace JSXElements { + export interface IonModalControllerAttributes extends HTMLAttributes { + + } + } +} + + +import { + Modal as IonModal +} from './components/modal/modal'; + +declare global { + interface HTMLIonModalElement extends IonModal, HTMLElement { + } + var HTMLIonModalElement: { + prototype: HTMLIonModalElement; + new (): HTMLIonModalElement; + }; + interface HTMLElementTagNameMap { + "ion-modal": HTMLIonModalElement; + } + interface ElementTagNameMap { + "ion-modal": HTMLIonModalElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-modal": JSXElements.IonModalAttributes; + } + } + namespace JSXElements { + export interface IonModalAttributes extends HTMLAttributes { + color?: string; + component?: any; + cssClass?: string; + data?: any; + delegate?: FrameworkDelegate; + enableBackdropDismiss?: boolean; + enterAnimation?: AnimationBuilder; + leaveAnimation?: AnimationBuilder; + modalId?: number; + mode?: 'ios' | 'md'; + showBackdrop?: boolean; + willAnimate?: boolean; + } + } +} + + +import { + Nav as IonNav +} from './components/nav/nav'; + +declare global { + interface HTMLIonNavElement extends IonNav, HTMLElement { + } + var HTMLIonNavElement: { + prototype: HTMLIonNavElement; + new (): HTMLIonNavElement; + }; + interface HTMLElementTagNameMap { + "ion-nav": HTMLIonNavElement; + } + interface ElementTagNameMap { + "ion-nav": HTMLIonNavElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-nav": JSXElements.IonNavAttributes; + } + } + namespace JSXElements { + export interface IonNavAttributes extends HTMLAttributes { + delegate?: FrameworkDelegate; + lazy?: boolean; + mode?: string; + root?: any; + useUrls?: boolean; + } + } +} + + +import { + Note as IonNote +} from './components/note/note'; + +declare global { + interface HTMLIonNoteElement extends IonNote, HTMLElement { + } + var HTMLIonNoteElement: { + prototype: HTMLIonNoteElement; + new (): HTMLIonNoteElement; + }; + interface HTMLElementTagNameMap { + "ion-note": HTMLIonNoteElement; + } + interface ElementTagNameMap { + "ion-note": HTMLIonNoteElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-note": JSXElements.IonNoteAttributes; + } + } + namespace JSXElements { + export interface IonNoteAttributes extends HTMLAttributes { + color?: string; + mode?: 'ios' | 'md'; + } + } +} + + +import { + Page as IonPage +} from './components/page/page'; + +declare global { + interface HTMLIonPageElement extends IonPage, HTMLElement { + } + var HTMLIonPageElement: { + prototype: HTMLIonPageElement; + new (): HTMLIonPageElement; + }; + interface HTMLElementTagNameMap { + "ion-page": HTMLIonPageElement; + } + interface ElementTagNameMap { + "ion-page": HTMLIonPageElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-page": JSXElements.IonPageAttributes; + } + } + namespace JSXElements { + export interface IonPageAttributes extends HTMLAttributes { + + } + } +} + + +import { + PickerColumnCmp as IonPickerColumn +} from './components/picker-column/picker-column'; + +declare global { + interface HTMLIonPickerColumnElement extends IonPickerColumn, HTMLElement { + } + var HTMLIonPickerColumnElement: { + prototype: HTMLIonPickerColumnElement; + new (): HTMLIonPickerColumnElement; + }; + interface HTMLElementTagNameMap { + "ion-picker-column": HTMLIonPickerColumnElement; + } + interface ElementTagNameMap { + "ion-picker-column": HTMLIonPickerColumnElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-picker-column": JSXElements.IonPickerColumnAttributes; + } + } + namespace JSXElements { + export interface IonPickerColumnAttributes extends HTMLAttributes { + col?: PickerColumn; + } + } +} + + +import { + PickerController as IonPickerController +} from './components/picker-controller/picker-controller'; + +declare global { + interface HTMLIonPickerControllerElement extends IonPickerController, HTMLElement { + } + var HTMLIonPickerControllerElement: { + prototype: HTMLIonPickerControllerElement; + new (): HTMLIonPickerControllerElement; + }; + interface HTMLElementTagNameMap { + "ion-picker-controller": HTMLIonPickerControllerElement; + } + interface ElementTagNameMap { + "ion-picker-controller": HTMLIonPickerControllerElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-picker-controller": JSXElements.IonPickerControllerAttributes; + } + } + namespace JSXElements { + export interface IonPickerControllerAttributes extends HTMLAttributes { + + } + } +} + + +import { + Picker as IonPicker +} from './components/picker/picker'; + +declare global { + interface HTMLIonPickerElement extends IonPicker, HTMLElement { + } + var HTMLIonPickerElement: { + prototype: HTMLIonPickerElement; + new (): HTMLIonPickerElement; + }; + interface HTMLElementTagNameMap { + "ion-picker": HTMLIonPickerElement; + } + interface ElementTagNameMap { + "ion-picker": HTMLIonPickerElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-picker": JSXElements.IonPickerAttributes; + } + } + namespace JSXElements { + export interface IonPickerAttributes extends HTMLAttributes { + buttons?: PickerButton[]; + columns?: PickerColumn[]; + content?: string; + cssClass?: string; + dismissOnPageChange?: boolean; + duration?: number; + enableBackdropDismiss?: boolean; + enterAnimation?: AnimationBuilder; + leaveAnimation?: AnimationBuilder; + pickerId?: number; + showBackdrop?: boolean; + willAnimate?: boolean; + } + } +} + + +import { + PopoverController as IonPopoverController +} from './components/popover-controller/popover-controller'; + +declare global { + interface HTMLIonPopoverControllerElement extends IonPopoverController, HTMLElement { + } + var HTMLIonPopoverControllerElement: { + prototype: HTMLIonPopoverControllerElement; + new (): HTMLIonPopoverControllerElement; + }; + interface HTMLElementTagNameMap { + "ion-popover-controller": HTMLIonPopoverControllerElement; + } + interface ElementTagNameMap { + "ion-popover-controller": HTMLIonPopoverControllerElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-popover-controller": JSXElements.IonPopoverControllerAttributes; + } + } + namespace JSXElements { + export interface IonPopoverControllerAttributes extends HTMLAttributes { + + } + } +} + + +import { + Popover as IonPopover +} from './components/popover/popover'; + +declare global { + interface HTMLIonPopoverElement extends IonPopover, HTMLElement { + } + var HTMLIonPopoverElement: { + prototype: HTMLIonPopoverElement; + new (): HTMLIonPopoverElement; + }; + interface HTMLElementTagNameMap { + "ion-popover": HTMLIonPopoverElement; + } + interface ElementTagNameMap { + "ion-popover": HTMLIonPopoverElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-popover": JSXElements.IonPopoverAttributes; + } + } + namespace JSXElements { + export interface IonPopoverAttributes extends HTMLAttributes { + color?: string; + component?: string; + cssClass?: string; + data?: any; + delegate?: FrameworkDelegate; + enableBackdropDismiss?: boolean; + enterAnimation?: AnimationBuilder; + ev?: Event; + leaveAnimation?: AnimationBuilder; + mode?: 'ios' | 'md'; + popoverId?: number; + showBackdrop?: boolean; + translucent?: boolean; + willAnimate?: boolean; + } + } +} + + +import { + RadioGroup as IonRadioGroup +} from './components/radio-group/radio-group'; + +declare global { + interface HTMLIonRadioGroupElement extends IonRadioGroup, HTMLElement { + } + var HTMLIonRadioGroupElement: { + prototype: HTMLIonRadioGroupElement; + new (): HTMLIonRadioGroupElement; + }; + interface HTMLElementTagNameMap { + "ion-radio-group": HTMLIonRadioGroupElement; + } + interface ElementTagNameMap { + "ion-radio-group": HTMLIonRadioGroupElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-radio-group": JSXElements.IonRadioGroupAttributes; + } + } + namespace JSXElements { + export interface IonRadioGroupAttributes extends HTMLAttributes { + allowEmptySelection?: boolean; + disabled?: boolean; + name?: string; + value?: string; + } + } +} + + +import { + Radio as IonRadio +} from './components/radio/radio'; + +declare global { + interface HTMLIonRadioElement extends IonRadio, HTMLElement { + } + var HTMLIonRadioElement: { + prototype: HTMLIonRadioElement; + new (): HTMLIonRadioElement; + }; + interface HTMLElementTagNameMap { + "ion-radio": HTMLIonRadioElement; + } + interface ElementTagNameMap { + "ion-radio": HTMLIonRadioElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-radio": JSXElements.IonRadioAttributes; + } + } + namespace JSXElements { + export interface IonRadioAttributes extends HTMLAttributes { + checked?: boolean; + color?: string; + disabled?: boolean; + mode?: 'ios' | 'md'; + name?: string; + value?: string; + } + } +} + + +import { + RangeKnob as IonRangeKnob +} from './components/range-knob/range-knob'; + +declare global { + interface HTMLIonRangeKnobElement extends IonRangeKnob, HTMLElement { + } + var HTMLIonRangeKnobElement: { + prototype: HTMLIonRangeKnobElement; + new (): HTMLIonRangeKnobElement; + }; + interface HTMLElementTagNameMap { + "ion-range-knob": HTMLIonRangeKnobElement; + } + interface ElementTagNameMap { + "ion-range-knob": HTMLIonRangeKnobElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-range-knob": JSXElements.IonRangeKnobAttributes; + } + } + namespace JSXElements { + export interface IonRangeKnobAttributes extends HTMLAttributes { + disabled?: boolean; + knob?: string; + labelId?: string; + max?: number; + min?: number; + pin?: boolean; + pressed?: boolean; + ratio?: number; + val?: number; + } + } +} + + +import { + Range as IonRange +} from './components/range/range'; + +declare global { + interface HTMLIonRangeElement extends IonRange, HTMLElement { + } + var HTMLIonRangeElement: { + prototype: HTMLIonRangeElement; + new (): HTMLIonRangeElement; + }; + interface HTMLElementTagNameMap { + "ion-range": HTMLIonRangeElement; + } + interface ElementTagNameMap { + "ion-range": HTMLIonRangeElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-range": JSXElements.IonRangeAttributes; + } + } + namespace JSXElements { + export interface IonRangeAttributes extends HTMLAttributes { + color?: string; + debounce?: number; + disabled?: boolean; + dualKnobs?: boolean; + max?: number; + min?: number; + mode?: 'ios' | 'md'; + pin?: boolean; + snaps?: boolean; + step?: number; + value?: any; + } + } +} + + +import { + RefresherContent as IonRefresherContent +} from './components/refresher-content/refresher-content'; + +declare global { + interface HTMLIonRefresherContentElement extends IonRefresherContent, HTMLElement { + } + var HTMLIonRefresherContentElement: { + prototype: HTMLIonRefresherContentElement; + new (): HTMLIonRefresherContentElement; + }; + interface HTMLElementTagNameMap { + "ion-refresher-content": HTMLIonRefresherContentElement; + } + interface ElementTagNameMap { + "ion-refresher-content": HTMLIonRefresherContentElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-refresher-content": JSXElements.IonRefresherContentAttributes; + } + } + namespace JSXElements { + export interface IonRefresherContentAttributes extends HTMLAttributes { + pullingIcon?: string; + pullingText?: string; + refreshingSpinner?: string; + refreshingText?: string; + } + } +} + + +import { + Refresher as IonRefresher +} from './components/refresher/refresher'; + +declare global { + interface HTMLIonRefresherElement extends IonRefresher, HTMLElement { + } + var HTMLIonRefresherElement: { + prototype: HTMLIonRefresherElement; + new (): HTMLIonRefresherElement; + }; + interface HTMLElementTagNameMap { + "ion-refresher": HTMLIonRefresherElement; + } + interface ElementTagNameMap { + "ion-refresher": HTMLIonRefresherElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-refresher": JSXElements.IonRefresherAttributes; + } + } + namespace JSXElements { + export interface IonRefresherAttributes extends HTMLAttributes { + closeDuration?: string; + disabled?: boolean; + pullMax?: any; + pullMin?: number; + snapbackDuration?: string; + } + } +} + + +import { + ReorderGroup as IonReorderGroup +} from './components/reorder-group/reorder-group'; + +declare global { + interface HTMLIonReorderGroupElement extends IonReorderGroup, HTMLElement { + } + var HTMLIonReorderGroupElement: { + prototype: HTMLIonReorderGroupElement; + new (): HTMLIonReorderGroupElement; + }; + interface HTMLElementTagNameMap { + "ion-reorder-group": HTMLIonReorderGroupElement; + } + interface ElementTagNameMap { + "ion-reorder-group": HTMLIonReorderGroupElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-reorder-group": JSXElements.IonReorderGroupAttributes; + } + } + namespace JSXElements { + export interface IonReorderGroupAttributes extends HTMLAttributes { + disabled?: boolean; + } + } +} + + +import { + Reorder as IonReorder +} from './components/reorder/reorder'; + +declare global { + interface HTMLIonReorderElement extends IonReorder, HTMLElement { + } + var HTMLIonReorderElement: { + prototype: HTMLIonReorderElement; + new (): HTMLIonReorderElement; + }; + interface HTMLElementTagNameMap { + "ion-reorder": HTMLIonReorderElement; + } + interface ElementTagNameMap { + "ion-reorder": HTMLIonReorderElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-reorder": JSXElements.IonReorderAttributes; + } + } + namespace JSXElements { + export interface IonReorderAttributes extends HTMLAttributes { + + } + } +} + + +import { + RippleEffect as IonRippleEffect +} from './components/ripple-effect/ripple-effect'; + +declare global { + interface HTMLIonRippleEffectElement extends IonRippleEffect, HTMLElement { + } + var HTMLIonRippleEffectElement: { + prototype: HTMLIonRippleEffectElement; + new (): HTMLIonRippleEffectElement; + }; + interface HTMLElementTagNameMap { + "ion-ripple-effect": HTMLIonRippleEffectElement; + } + interface ElementTagNameMap { + "ion-ripple-effect": HTMLIonRippleEffectElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-ripple-effect": JSXElements.IonRippleEffectAttributes; + } + } + namespace JSXElements { + export interface IonRippleEffectAttributes extends HTMLAttributes { + useTapClick?: boolean; + } + } +} + + +import { + RouteLink as IonRouteLink +} from './components/route-link/route-link'; + +declare global { + interface HTMLIonRouteLinkElement extends IonRouteLink, HTMLElement { + } + var HTMLIonRouteLinkElement: { + prototype: HTMLIonRouteLinkElement; + new (): HTMLIonRouteLinkElement; + }; + interface HTMLElementTagNameMap { + "ion-route-link": HTMLIonRouteLinkElement; + } + interface ElementTagNameMap { + "ion-route-link": HTMLIonRouteLinkElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-route-link": JSXElements.IonRouteLinkAttributes; + } + } + namespace JSXElements { + export interface IonRouteLinkAttributes extends HTMLAttributes { + router?: any; + url?: string; + } + } +} + + +import { + Route as IonRoute +} from './components/route/route'; + +declare global { + interface HTMLIonRouteElement extends IonRoute, HTMLElement { + } + var HTMLIonRouteElement: { + prototype: HTMLIonRouteElement; + new (): HTMLIonRouteElement; + }; + interface HTMLElementTagNameMap { + "ion-route": HTMLIonRouteElement; + } + interface ElementTagNameMap { + "ion-route": HTMLIonRouteElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-route": JSXElements.IonRouteAttributes; + } + } + namespace JSXElements { + export interface IonRouteAttributes extends HTMLAttributes { + component?: string; + path?: string; + props?: any; + } + } +} + + +import { + RouterController as IonRouterController +} from './components/router-controller/router-controller'; + +declare global { + interface HTMLIonRouterControllerElement extends IonRouterController, HTMLElement { + } + var HTMLIonRouterControllerElement: { + prototype: HTMLIonRouterControllerElement; + new (): HTMLIonRouterControllerElement; + }; + interface HTMLElementTagNameMap { + "ion-router-controller": HTMLIonRouterControllerElement; + } + interface ElementTagNameMap { + "ion-router-controller": HTMLIonRouterControllerElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-router-controller": JSXElements.IonRouterControllerAttributes; + } + } + namespace JSXElements { + export interface IonRouterControllerAttributes extends HTMLAttributes { + + } + } +} + + +import { + Row as IonRow +} from './components/row/row'; + +declare global { + interface HTMLIonRowElement extends IonRow, HTMLElement { + } + var HTMLIonRowElement: { + prototype: HTMLIonRowElement; + new (): HTMLIonRowElement; + }; + interface HTMLElementTagNameMap { + "ion-row": HTMLIonRowElement; + } + interface ElementTagNameMap { + "ion-row": HTMLIonRowElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-row": JSXElements.IonRowAttributes; + } + } + namespace JSXElements { + export interface IonRowAttributes extends HTMLAttributes { + + } + } +} + + +import { + Scroll as IonScroll +} from './components/scroll/scroll'; + +declare global { + interface HTMLIonScrollElement extends IonScroll, HTMLElement { + } + var HTMLIonScrollElement: { + prototype: HTMLIonScrollElement; + new (): HTMLIonScrollElement; + }; + interface HTMLElementTagNameMap { + "ion-scroll": HTMLIonScrollElement; + } + interface ElementTagNameMap { + "ion-scroll": HTMLIonScrollElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-scroll": JSXElements.IonScrollAttributes; + } + } + namespace JSXElements { + export interface IonScrollAttributes extends HTMLAttributes { + disabled?: boolean; + onionScroll?: ScrollCallback; + onionScrollEnd?: ScrollCallback; + onionScrollStart?: ScrollCallback; + } + } +} + + +import { + Searchbar as IonSearchbar +} from './components/searchbar/searchbar'; + +declare global { + interface HTMLIonSearchbarElement extends IonSearchbar, HTMLElement { + } + var HTMLIonSearchbarElement: { + prototype: HTMLIonSearchbarElement; + new (): HTMLIonSearchbarElement; + }; + interface HTMLElementTagNameMap { + "ion-searchbar": HTMLIonSearchbarElement; + } + interface ElementTagNameMap { + "ion-searchbar": HTMLIonSearchbarElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-searchbar": JSXElements.IonSearchbarAttributes; + } + } + namespace JSXElements { + export interface IonSearchbarAttributes extends HTMLAttributes { + animated?: boolean; + autocomplete?: string; + autocorrect?: string; + cancelButtonText?: string; + color?: string; + debounce?: number; + mode?: 'ios' | 'md'; + placeholder?: string; + showCancelButton?: boolean; + spellcheck?: boolean; + type?: string; + value?: string; + } + } +} + + +import { + SegmentButton as IonSegmentButton +} from './components/segment-button/segment-button'; + +declare global { + interface HTMLIonSegmentButtonElement extends IonSegmentButton, HTMLElement { + } + var HTMLIonSegmentButtonElement: { + prototype: HTMLIonSegmentButtonElement; + new (): HTMLIonSegmentButtonElement; + }; + interface HTMLElementTagNameMap { + "ion-segment-button": HTMLIonSegmentButtonElement; + } + interface ElementTagNameMap { + "ion-segment-button": HTMLIonSegmentButtonElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-segment-button": JSXElements.IonSegmentButtonAttributes; + } + } + namespace JSXElements { + export interface IonSegmentButtonAttributes extends HTMLAttributes { + activated?: boolean; + checked?: boolean; + color?: string; + disabled?: boolean; + href?: string; + mode?: 'ios' | 'md'; + value?: string; + } + } +} + + +import { + Segment as IonSegment +} from './components/segment/segment'; + +declare global { + interface HTMLIonSegmentElement extends IonSegment, HTMLElement { + } + var HTMLIonSegmentElement: { + prototype: HTMLIonSegmentElement; + new (): HTMLIonSegmentElement; + }; + interface HTMLElementTagNameMap { + "ion-segment": HTMLIonSegmentElement; + } + interface ElementTagNameMap { + "ion-segment": HTMLIonSegmentElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-segment": JSXElements.IonSegmentAttributes; + } + } + namespace JSXElements { + export interface IonSegmentAttributes extends HTMLAttributes { + color?: string; + disabled?: boolean; + mode?: 'ios' | 'md'; + value?: string; + } + } +} + + +import { + SelectOption as IonSelectOption +} from './components/select-option/select-option'; + +declare global { + interface HTMLIonSelectOptionElement extends IonSelectOption, HTMLElement { + } + var HTMLIonSelectOptionElement: { + prototype: HTMLIonSelectOptionElement; + new (): HTMLIonSelectOptionElement; + }; + interface HTMLElementTagNameMap { + "ion-select-option": HTMLIonSelectOptionElement; + } + interface ElementTagNameMap { + "ion-select-option": HTMLIonSelectOptionElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-select-option": JSXElements.IonSelectOptionAttributes; + } + } + namespace JSXElements { + export interface IonSelectOptionAttributes extends HTMLAttributes { + disabled?: boolean; + selected?: boolean; + value?: string; + } + } +} + + +import { + SelectPopover as IonSelectPopover +} from './components/select-popover/select-popover'; + +declare global { + interface HTMLIonSelectPopoverElement extends IonSelectPopover, HTMLElement { + } + var HTMLIonSelectPopoverElement: { + prototype: HTMLIonSelectPopoverElement; + new (): HTMLIonSelectPopoverElement; + }; + interface HTMLElementTagNameMap { + "ion-select-popover": HTMLIonSelectPopoverElement; + } + interface ElementTagNameMap { + "ion-select-popover": HTMLIonSelectPopoverElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-select-popover": JSXElements.IonSelectPopoverAttributes; + } + } + namespace JSXElements { + export interface IonSelectPopoverAttributes extends HTMLAttributes { + message?: string; + options?: SelectPopoverOption[]; + subTitle?: string; + title?: string; + } + } +} + + +import { + Select as IonSelect +} from './components/select/select'; + +declare global { + interface HTMLIonSelectElement extends IonSelect, HTMLElement { + } + var HTMLIonSelectElement: { + prototype: HTMLIonSelectElement; + new (): HTMLIonSelectElement; + }; + interface HTMLElementTagNameMap { + "ion-select": HTMLIonSelectElement; + } + interface ElementTagNameMap { + "ion-select": HTMLIonSelectElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-select": JSXElements.IonSelectAttributes; + } + } + namespace JSXElements { + export interface IonSelectAttributes extends HTMLAttributes { + cancelText?: string; + disabled?: boolean; + interface?: string; + interfaceOptions?: any; + multiple?: boolean; + name?: string; + okText?: string; + placeholder?: string; + selectedText?: string; + value?: string | string[]; + } + } +} + + +import { + SkeletonText as IonSkeletonText +} from './components/skeleton-text/skeleton-text'; + +declare global { + interface HTMLIonSkeletonTextElement extends IonSkeletonText, HTMLElement { + } + var HTMLIonSkeletonTextElement: { + prototype: HTMLIonSkeletonTextElement; + new (): HTMLIonSkeletonTextElement; + }; + interface HTMLElementTagNameMap { + "ion-skeleton-text": HTMLIonSkeletonTextElement; + } + interface ElementTagNameMap { + "ion-skeleton-text": HTMLIonSkeletonTextElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-skeleton-text": JSXElements.IonSkeletonTextAttributes; + } + } + namespace JSXElements { + export interface IonSkeletonTextAttributes extends HTMLAttributes { + width?: string; + } + } +} + + +import { + Slide as IonSlide +} from './components/slide/slide'; + +declare global { + interface HTMLIonSlideElement extends IonSlide, HTMLElement { + } + var HTMLIonSlideElement: { + prototype: HTMLIonSlideElement; + new (): HTMLIonSlideElement; + }; + interface HTMLElementTagNameMap { + "ion-slide": HTMLIonSlideElement; + } + interface ElementTagNameMap { + "ion-slide": HTMLIonSlideElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-slide": JSXElements.IonSlideAttributes; + } + } + namespace JSXElements { + export interface IonSlideAttributes extends HTMLAttributes { + + } + } +} + + +import { + Slides as IonSlides +} from './components/slides/slides'; + +declare global { + interface HTMLIonSlidesElement extends IonSlides, HTMLElement { + } + var HTMLIonSlidesElement: { + prototype: HTMLIonSlidesElement; + new (): HTMLIonSlidesElement; + }; + interface HTMLElementTagNameMap { + "ion-slides": HTMLIonSlidesElement; + } + interface ElementTagNameMap { + "ion-slides": HTMLIonSlidesElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-slides": JSXElements.IonSlidesAttributes; + } + } + namespace JSXElements { + export interface IonSlidesAttributes extends HTMLAttributes { + options?: any; + pager?: boolean; + } + } +} + + +import { + Spinner as IonSpinner +} from './components/spinner/spinner'; + +declare global { + interface HTMLIonSpinnerElement extends IonSpinner, HTMLElement { + } + var HTMLIonSpinnerElement: { + prototype: HTMLIonSpinnerElement; + new (): HTMLIonSpinnerElement; + }; + interface HTMLElementTagNameMap { + "ion-spinner": HTMLIonSpinnerElement; + } + interface ElementTagNameMap { + "ion-spinner": HTMLIonSpinnerElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-spinner": JSXElements.IonSpinnerAttributes; + } + } + namespace JSXElements { + export interface IonSpinnerAttributes extends HTMLAttributes { + color?: string; + duration?: number; + mode?: 'ios' | 'md'; + name?: string; + paused?: boolean; + } + } +} + + +import { + SplitPane as IonSplitPane +} from './components/split-pane/split-pane'; + +declare global { + interface HTMLIonSplitPaneElement extends IonSplitPane, HTMLElement { + } + var HTMLIonSplitPaneElement: { + prototype: HTMLIonSplitPaneElement; + new (): HTMLIonSplitPaneElement; + }; + interface HTMLElementTagNameMap { + "ion-split-pane": HTMLIonSplitPaneElement; + } + interface ElementTagNameMap { + "ion-split-pane": HTMLIonSplitPaneElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-split-pane": JSXElements.IonSplitPaneAttributes; + } + } + namespace JSXElements { + export interface IonSplitPaneAttributes extends HTMLAttributes { + disabled?: boolean; + when?: string | boolean; + } + } +} + + +import { + StatusTap as IonStatusTap +} from './components/status-tap/status-tap'; + +declare global { + interface HTMLIonStatusTapElement extends IonStatusTap, HTMLElement { + } + var HTMLIonStatusTapElement: { + prototype: HTMLIonStatusTapElement; + new (): HTMLIonStatusTapElement; + }; + interface HTMLElementTagNameMap { + "ion-status-tap": HTMLIonStatusTapElement; + } + interface ElementTagNameMap { + "ion-status-tap": HTMLIonStatusTapElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-status-tap": JSXElements.IonStatusTapAttributes; + } + } + namespace JSXElements { + export interface IonStatusTapAttributes extends HTMLAttributes { + duration?: number; + } + } +} + + +import { + TabButton as IonTabButton +} from './components/tab-button/tab-button'; + +declare global { + interface HTMLIonTabButtonElement extends IonTabButton, HTMLElement { + } + var HTMLIonTabButtonElement: { + prototype: HTMLIonTabButtonElement; + new (): HTMLIonTabButtonElement; + }; + interface HTMLElementTagNameMap { + "ion-tab-button": HTMLIonTabButtonElement; + } + interface ElementTagNameMap { + "ion-tab-button": HTMLIonTabButtonElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-tab-button": JSXElements.IonTabButtonAttributes; + } + } + namespace JSXElements { + export interface IonTabButtonAttributes extends HTMLAttributes { + mode?: 'ios' | 'md'; + selected?: boolean; + tab?: HTMLIonTabElement; + } + } +} + + +import { + Tab as IonTab +} from './components/tab/tab'; + +declare global { + interface HTMLIonTabElement extends IonTab, HTMLElement { + } + var HTMLIonTabElement: { + prototype: HTMLIonTabElement; + new (): HTMLIonTabElement; + }; + interface HTMLElementTagNameMap { + "ion-tab": HTMLIonTabElement; + } + interface ElementTagNameMap { + "ion-tab": HTMLIonTabElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-tab": JSXElements.IonTabAttributes; + } + } + namespace JSXElements { + export interface IonTabAttributes extends HTMLAttributes { + badge?: string; + badgeStyle?: string; + btnId?: string; + disabled?: boolean; + icon?: string; + path?: string; + selected?: boolean; + show?: boolean; + tabsHideOnSubPages?: boolean; + title?: string; + } + } +} + + +import { + Tabbar as IonTabbar +} from './components/tabbar/tabbar'; + +declare global { + interface HTMLIonTabbarElement extends IonTabbar, HTMLElement { + } + var HTMLIonTabbarElement: { + prototype: HTMLIonTabbarElement; + new (): HTMLIonTabbarElement; + }; + interface HTMLElementTagNameMap { + "ion-tabbar": HTMLIonTabbarElement; + } + interface ElementTagNameMap { + "ion-tabbar": HTMLIonTabbarElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-tabbar": JSXElements.IonTabbarAttributes; + } + } + namespace JSXElements { + export interface IonTabbarAttributes extends HTMLAttributes { + highlight?: boolean; + layout?: string; + placement?: string; + scrollable?: Boolean; + selectedTab?: HTMLIonTabElement; + tabs?: HTMLIonTabElement[]; + translucent?: boolean; + } + } +} + + +import { + Tabs as IonTabs +} from './components/tabs/tabs'; + +declare global { + interface HTMLIonTabsElement extends IonTabs, HTMLElement { + } + var HTMLIonTabsElement: { + prototype: HTMLIonTabsElement; + new (): HTMLIonTabsElement; + }; + interface HTMLElementTagNameMap { + "ion-tabs": HTMLIonTabsElement; + } + interface ElementTagNameMap { + "ion-tabs": HTMLIonTabsElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-tabs": JSXElements.IonTabsAttributes; + } + } + namespace JSXElements { + export interface IonTabsAttributes extends HTMLAttributes { + color?: string; + name?: string; + scrollable?: boolean; + tabbarHidden?: boolean; + tabbarHighlight?: boolean; + tabbarLayout?: string; + tabbarPlacement?: string; + translucent?: boolean; + } + } +} + + +import { + TapClick as IonTapClick +} from './components/tap-click/tap-click'; + +declare global { + interface HTMLIonTapClickElement extends IonTapClick, HTMLElement { + } + var HTMLIonTapClickElement: { + prototype: HTMLIonTapClickElement; + new (): HTMLIonTapClickElement; + }; + interface HTMLElementTagNameMap { + "ion-tap-click": HTMLIonTapClickElement; + } + interface ElementTagNameMap { + "ion-tap-click": HTMLIonTapClickElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-tap-click": JSXElements.IonTapClickAttributes; + } + } + namespace JSXElements { + export interface IonTapClickAttributes extends HTMLAttributes { + + } + } +} + + +import { + Text as IonText +} from './components/text/text'; + +declare global { + interface HTMLIonTextElement extends IonText, HTMLElement { + } + var HTMLIonTextElement: { + prototype: HTMLIonTextElement; + new (): HTMLIonTextElement; + }; + interface HTMLElementTagNameMap { + "ion-text": HTMLIonTextElement; + } + interface ElementTagNameMap { + "ion-text": HTMLIonTextElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-text": JSXElements.IonTextAttributes; + } + } + namespace JSXElements { + export interface IonTextAttributes extends HTMLAttributes { + color?: string; + mode?: 'ios' | 'md'; + } + } +} + + +import { + Textarea as IonTextarea +} from './components/textarea/textarea'; + +declare global { + interface HTMLIonTextareaElement extends IonTextarea, HTMLElement { + } + var HTMLIonTextareaElement: { + prototype: HTMLIonTextareaElement; + new (): HTMLIonTextareaElement; + }; + interface HTMLElementTagNameMap { + "ion-textarea": HTMLIonTextareaElement; + } + interface ElementTagNameMap { + "ion-textarea": HTMLIonTextareaElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-textarea": JSXElements.IonTextareaAttributes; + } + } + namespace JSXElements { + export interface IonTextareaAttributes extends HTMLAttributes { + autocapitalize?: string; + autocomplete?: string; + autofocus?: boolean; + clearOnEdit?: boolean; + cols?: number; + debounce?: number; + disabled?: boolean; + maxlength?: number; + minlength?: number; + name?: string; + placeholder?: string; + readonly?: boolean; + required?: boolean; + rows?: number; + spellcheck?: boolean; + value?: string; + wrap?: string; + } + } +} + + +import { + Thumbnail as IonThumbnail +} from './components/thumbnail/thumbnail'; + +declare global { + interface HTMLIonThumbnailElement extends IonThumbnail, HTMLElement { + } + var HTMLIonThumbnailElement: { + prototype: HTMLIonThumbnailElement; + new (): HTMLIonThumbnailElement; + }; + interface HTMLElementTagNameMap { + "ion-thumbnail": HTMLIonThumbnailElement; + } + interface ElementTagNameMap { + "ion-thumbnail": HTMLIonThumbnailElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-thumbnail": JSXElements.IonThumbnailAttributes; + } + } + namespace JSXElements { + export interface IonThumbnailAttributes extends HTMLAttributes { + + } + } +} + + +import { + ToolbarTitle as IonTitle +} from './components/title/title'; + +declare global { + interface HTMLIonTitleElement extends IonTitle, HTMLElement { + } + var HTMLIonTitleElement: { + prototype: HTMLIonTitleElement; + new (): HTMLIonTitleElement; + }; + interface HTMLElementTagNameMap { + "ion-title": HTMLIonTitleElement; + } + interface ElementTagNameMap { + "ion-title": HTMLIonTitleElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-title": JSXElements.IonTitleAttributes; + } + } + namespace JSXElements { + export interface IonTitleAttributes extends HTMLAttributes { + + } + } +} + + +import { + ToastController as IonToastController +} from './components/toast-controller/toast-controller'; + +declare global { + interface HTMLIonToastControllerElement extends IonToastController, HTMLElement { + } + var HTMLIonToastControllerElement: { + prototype: HTMLIonToastControllerElement; + new (): HTMLIonToastControllerElement; + }; + interface HTMLElementTagNameMap { + "ion-toast-controller": HTMLIonToastControllerElement; + } + interface ElementTagNameMap { + "ion-toast-controller": HTMLIonToastControllerElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-toast-controller": JSXElements.IonToastControllerAttributes; + } + } + namespace JSXElements { + export interface IonToastControllerAttributes extends HTMLAttributes { + + } + } +} + + +import { + Toast as IonToast +} from './components/toast/toast'; + +declare global { + interface HTMLIonToastElement extends IonToast, HTMLElement { + } + var HTMLIonToastElement: { + prototype: HTMLIonToastElement; + new (): HTMLIonToastElement; + }; + interface HTMLElementTagNameMap { + "ion-toast": HTMLIonToastElement; + } + interface ElementTagNameMap { + "ion-toast": HTMLIonToastElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-toast": JSXElements.IonToastAttributes; + } + } + namespace JSXElements { + export interface IonToastAttributes extends HTMLAttributes { + closeButtonText?: string; + cssClass?: string; + dismissOnPageChange?: boolean; + duration?: number; + enterAnimation?: AnimationBuilder; + leaveAnimation?: AnimationBuilder; + message?: string; + position?: string; + showCloseButton?: boolean; + toastId?: number; + translucent?: boolean; + willAnimate?: boolean; + } + } +} + + +import { + Toggle as IonToggle +} from './components/toggle/toggle'; + +declare global { + interface HTMLIonToggleElement extends IonToggle, HTMLElement { + } + var HTMLIonToggleElement: { + prototype: HTMLIonToggleElement; + new (): HTMLIonToggleElement; + }; + interface HTMLElementTagNameMap { + "ion-toggle": HTMLIonToggleElement; + } + interface ElementTagNameMap { + "ion-toggle": HTMLIonToggleElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-toggle": JSXElements.IonToggleAttributes; + } + } + namespace JSXElements { + export interface IonToggleAttributes extends HTMLAttributes { + checked?: boolean; + color?: string; + disabled?: boolean; + mode?: 'ios' | 'md'; + name?: string; + value?: string; + } + } +} + + +import { + Toolbar as IonToolbar +} from './components/toolbar/toolbar'; + +declare global { + interface HTMLIonToolbarElement extends IonToolbar, HTMLElement { + } + var HTMLIonToolbarElement: { + prototype: HTMLIonToolbarElement; + new (): HTMLIonToolbarElement; + }; + interface HTMLElementTagNameMap { + "ion-toolbar": HTMLIonToolbarElement; + } + interface ElementTagNameMap { + "ion-toolbar": HTMLIonToolbarElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-toolbar": JSXElements.IonToolbarAttributes; + } + } + namespace JSXElements { + export interface IonToolbarAttributes extends HTMLAttributes { + color?: string; + mode?: 'ios' | 'md'; + translucent?: boolean; + } + } +} + + +import { + VirtualScroll as IonVirtualScroll +} from './components/virtual-scroll/virtual-scroll'; + +declare global { + interface HTMLIonVirtualScrollElement extends IonVirtualScroll, HTMLElement { + } + var HTMLIonVirtualScrollElement: { + prototype: HTMLIonVirtualScrollElement; + new (): HTMLIonVirtualScrollElement; + }; + interface HTMLElementTagNameMap { + "ion-virtual-scroll": HTMLIonVirtualScrollElement; + } + interface ElementTagNameMap { + "ion-virtual-scroll": HTMLIonVirtualScrollElement; + } + namespace JSX { + interface IntrinsicElements { + "ion-virtual-scroll": JSXElements.IonVirtualScrollAttributes; + } + } + namespace JSXElements { + export interface IonVirtualScrollAttributes extends HTMLAttributes { + approxFooterHeight?: number; + approxHeaderHeight?: number; + approxItemHeight?: number; + domRender?: DomRenderFn; + footerFn?: HeaderFn; + headerFn?: HeaderFn; + itemHeight?: ItemHeightFn; + itemRender?: ItemRenderFn; + items?: any[]; + nodeHeight?: NodeHeightFn; + } + } +} + +declare global { namespace JSX { interface StencilJSX {} } } diff --git a/packages/core/src/components/action-sheet-controller/action-sheet-controller.tsx b/packages/core/src/components/action-sheet-controller/action-sheet-controller.tsx index 4ec612cd0f..ded5113541 100644 --- a/packages/core/src/components/action-sheet-controller/action-sheet-controller.tsx +++ b/packages/core/src/components/action-sheet-controller/action-sheet-controller.tsx @@ -32,6 +32,9 @@ export class ActionSheetController { dismiss(data?: any, role?: any, actionSheetId = -1) { actionSheetId = actionSheetId >= 0 ? actionSheetId : getHighestId(); const actionSheet = actionSheets.get(actionSheetId); + if (!actionSheet) { + return Promise.reject('action-sheet does not exist'); + } return actionSheet.dismiss(data, role); } diff --git a/packages/core/src/components/action-sheet/action-sheet.tsx b/packages/core/src/components/action-sheet/action-sheet.tsx index 98789e1d2d..cd0471416f 100644 --- a/packages/core/src/components/action-sheet/action-sheet.tsx +++ b/packages/core/src/components/action-sheet/action-sheet.tsx @@ -33,7 +33,7 @@ export class ActionSheet { color: string; actionSheetId: number; - private animation: Animation; + private animation: Animation | null = null; @Element() private el: HTMLElement; @@ -232,22 +232,17 @@ export class ActionSheet { } render() { - let cancelButton: ActionSheetButton; - const buttons = this.buttons - .map(b => { - if (typeof b === 'string') { - b = { text: b }; - } - if (!b.cssClass) { - b.cssClass = ''; - } - if (b.role === 'cancel') { - cancelButton = b; - return null; - } - return b; - }) - .filter(b => b !== null); + const allButtons = this.buttons.map(b => { + if (typeof b === 'string') { + b = { text: b }; + } + if (!b.cssClass) { + b.cssClass = ''; + } + return b; + }); + const cancelButton = allButtons.find(b => b.role === 'cancel'); + const buttons = allButtons.filter(b => b.role !== 'cancel'); return [ = 0 ? alertId : getHighestId(); const alert = alerts.get(alertId); + if (!alert) { + return Promise.reject('alert does not exist'); + } return alert.dismiss(data, role); } diff --git a/packages/core/src/components/alert/alert.tsx b/packages/core/src/components/alert/alert.tsx index 95441dfed0..7cdbbda727 100644 --- a/packages/core/src/components/alert/alert.tsx +++ b/packages/core/src/components/alert/alert.tsx @@ -26,9 +26,9 @@ export class Alert { color: string; alertId: number; - private animation: Animation; + private animation: Animation | null = null; private activeId: string; - private inputType: string; + private inputType: string | null = null; private hdrId: string; @Element() private el: HTMLElement; @@ -376,39 +376,34 @@ export class Alert { 'alert-button-group-vertical': this.buttons.length > 2 }; - const buttons = this.buttons - .map(b => { - if (typeof b === 'string') { - b = { text: b }; - } - return b; - }) - .filter(b => b !== null); + const buttons = this.buttons.map(b => { + if (typeof b === 'string') { + return { text: b } as AlertButton; + } + return b; + }) + .filter(b => b !== null); + + this.inputs = this.inputs.map((i, index) => { + return { + type: i.type || 'text', + name: i.name ? i.name : index + '', + placeholder: i.placeholder ? i.placeholder : '', + value: i.value ? i.value : '', + label: i.label, + checked: !!i.checked, + disabled: !!i.disabled, + id: i.id ? i.id : `alert-input-${this.alertId}-${index}`, + handler: i.handler ? i.handler : null, + min: i.min ? i.min : null, + max: i.max ? i.max : null + } as AlertInput; + }).filter(i => i !== null); // An alert can be created with several different inputs. Radios, // checkboxes and inputs are all accepted, but they cannot be mixed. const inputTypes: string[] = []; - - this.inputs = this.inputs - .map((i, index) => { - const r: AlertInput = { - type: i.type || 'text', - name: i.name ? i.name : index + '', - placeholder: i.placeholder ? i.placeholder : '', - value: i.value ? i.value : '', - label: i.label, - checked: !!i.checked, - disabled: !!i.disabled, - id: i.id ? i.id : `alert-input-${this.alertId}-${index}`, - handler: i.handler ? i.handler : null, - min: i.min ? i.min : null, - max: i.max ? i.max : null - }; - return r; - }) - .filter(i => i !== null); - - this.inputs.forEach(i => { + this.inputs.forEach(i => { if (inputTypes.indexOf(i.type) < 0) { inputTypes.push(i.type); } @@ -418,7 +413,7 @@ export class Alert { console.warn(`Alert cannot mix input types: ${(inputTypes.join('/'))}. Please see alert docs for more info.`); } - this.inputType = inputTypes.length ? inputTypes[0] : null; + this.inputType = inputTypes.length > 0 ? inputTypes[0] : null; return [
{this.title - ?

{this.title}

- : null} + ?

{this.title}

+ : null} {this.subTitle - ?

{this.subTitle}

- : null} + ?

{this.subTitle}

+ : null}
-
+
{(() => { switch (this.inputType) { - case 'checkbox': - return this.renderCheckbox(this.inputs); - - case 'radio': - return this.renderRadio(this.inputs); - - default: - return this.renderInput(this.inputs); + case 'checkbox': return this.renderCheckbox(this.inputs); + case 'radio': return this.renderRadio(this.inputs); + default: return this.renderInput(this.inputs); } })()} @@ -457,7 +447,7 @@ export class Alert { )} - + ]; } @@ -483,8 +473,8 @@ export interface AlertOptions { } export interface AlertInput { - type?: string; - name?: string | number; + type: string; + name: string | number; placeholder?: string; value?: string; label?: string; @@ -497,7 +487,7 @@ export interface AlertInput { } export interface AlertButton { - text?: string; + text: string; role?: string; cssClass?: string; handler?: (value: any) => boolean|void; diff --git a/packages/core/src/components/animation-controller/animation-interface.tsx b/packages/core/src/components/animation-controller/animation-interface.tsx index 933c80d83c..5e586a5d1f 100644 --- a/packages/core/src/components/animation-controller/animation-interface.tsx +++ b/packages/core/src/components/animation-controller/animation-interface.tsx @@ -74,6 +74,6 @@ export interface EffectProperty { export interface EffectState { val: any; - num: number; + num: number|null; effectUnit: string; } diff --git a/packages/core/src/components/animation-controller/animator.tsx b/packages/core/src/components/animation-controller/animator.tsx index 3ec42daad0..b880882486 100644 --- a/packages/core/src/components/animation-controller/animator.tsx +++ b/packages/core/src/components/animation-controller/animator.tsx @@ -14,25 +14,25 @@ export class Animator { private _beforeStyles: { [property: string]: any; }; private _childAnimations: Animator[]; private _childAnimationTotal: number; - private _duration: number = null; - private _easingName: string = null; - private _elements: HTMLElement[] = null; + private _duration: number|null = null; + private _easingName: string|null = null; + private _elements: HTMLElement[]|null = null; private _elementTotal: number; private _fxProperties: EffectProperty[]; private _hasDur: boolean; private _hasTweenEffect: boolean; private _isAsync: boolean; private _isReverse: boolean; - private _onFinishCallbacks: Function[]; - private _onFinishOneTimeCallbacks: Function[]; + private _onFinishCallbacks: Function[] | undefined; + private _onFinishOneTimeCallbacks: Function[] | undefined; private _readCallbacks: Function[]; - private _reversedEasingName: string = null; + private _reversedEasingName: string|undefined; private _timerId: any; - private _unregisterTrnsEnd: Function; + private _unregisterTrnsEnd: Function | undefined; private _writeCallbacks: Function[]; private _destroyed = false; - parent: Animator; + parent: Animator|undefined; opts: AnimationOptions; hasChildren = false; isPlaying = false; @@ -106,7 +106,7 @@ export class Animator { * Get the easing of this animation. If this animation does * not have an easing, then it'll get the easing from its parent. */ - getEasing(): string { + getEasing(): string|null { if (this._isReverse && this._reversedEasingName) { return this._reversedEasingName; } @@ -163,14 +163,14 @@ export class Animator { * NO DOM */ - private _getProp(name: string): EffectProperty { + private _getProp(name: string): EffectProperty | undefined { if (this._fxProperties) { - return this._fxProperties.find(function(prop) { return prop.effectName === name; }); + return this._fxProperties.find(prop => prop.effectName === name); } else { this._fxProperties = []; } - return null; + return undefined; } private _addProp(state: string, prop: string, val: any): EffectProperty { @@ -361,7 +361,7 @@ export class Animator { * DOM WRITE * RECURSION */ - _playInit(opts: PlayOptions) { + _playInit(opts: PlayOptions|undefined) { // always default that an animation does not tween // a tween requires that an Animation class has an element // and that it has at least one FROM/TO effect @@ -393,7 +393,7 @@ export class Animator { * NO RECURSION * ROOT ANIMATION */ - _playDomInspect(opts: PlayOptions) { + _playDomInspect(opts: PlayOptions|undefined) { const self = this; // fire off all the "before" function that have DOM READS in them // elements will be in the DOM, however visibily hidden @@ -426,7 +426,7 @@ export class Animator { * DOM WRITE * RECURSION */ - _playProgress(opts: PlayOptions) { + _playProgress(opts: PlayOptions|undefined) { const children = this._childAnimations; for (let i = 0; i < this._childAnimationTotal; i++) { // ******** DOM WRITE **************** @@ -558,7 +558,7 @@ export class Animator { * NO DOM * RECURSION */ - _hasDuration(opts: PlayOptions) { + _hasDuration(opts: PlayOptions|undefined) { if (this.getDuration(opts) > DURATION_MIN) { return true; } @@ -620,10 +620,11 @@ export class Animator { _progress(stepValue: number) { // bread 'n butter let val: any; + const elements = this._elements; const effects = this._fxProperties; const nuElements = this._elementTotal; - if (!effects || !nuElements || this._destroyed) { + if (!elements || !effects || !nuElements || this._destroyed) { return; } @@ -634,7 +635,6 @@ export class Animator { let i = 0; let j = 0; let finalTransform = ''; - const elements = this._elements; let fx: EffectProperty; for (i = 0; i < effects.length; i++) { @@ -701,12 +701,13 @@ export class Animator { */ _setTrans(dur: number, forcedLinearEasing: boolean) { // Transition is not enabled if there are not effects - if (!this._fxProperties) { + const elements = this._elements; + const nuElements = this._elementTotal; + if (!elements || !this._fxProperties || nuElements === 0) { return; } // set the TRANSITION properties inline on the element - const elements = this._elements; const easing = (forcedLinearEasing ? 'linear' : this.getEasing()); const durString = dur + 'ms'; const cssTransform = CSS_PROP.transitionProp; @@ -714,7 +715,7 @@ export class Animator { const cssTransitionTimingFn = CSS_PROP.transitionTimingFnProp; let eleStyle: any; - for (let i = 0; i < this._elementTotal; i++) { + for (let i = 0; i < nuElements; i++) { eleStyle = elements[i].style; if (dur > 0) { // ******** DOM WRITE **************** @@ -760,26 +761,27 @@ export class Animator { * RECURSION */ _setBeforeStyles() { - let i: number, j: number; + let j: number; const children = this._childAnimations; - for (i = 0; i < this._childAnimationTotal; i++) { + + for (let i = 0; i < this._childAnimationTotal; i++) { children[i]._setBeforeStyles(); } + const elements = this._elements; + const nuElements = this._elementTotal; // before the animations have started // only set before styles if animation is not reversed - if (this._isReverse) { + if (!elements || nuElements === 0 || this._isReverse) { return; } const addClasses = this._beforeAddClasses; const removeClasses = this._beforeRemoveClasses; - let el: HTMLElement; - let elementClassList: DOMTokenList; let prop: string; - for (i = 0; i < this._elementTotal; i++) { - el = this._elements[i]; - elementClassList = el.classList; + for (let i = 0; i < nuElements; i++) { + const el = elements[i]; + const elementClassList = el.classList; // css classes to add before the animation if (addClasses) { @@ -859,6 +861,9 @@ export class Animator { let el: HTMLElement; let elementClassList: DOMTokenList; const elements = this._elements; + if (!elements) { + return; + } let prop: string; for (i = 0; i < this._elementTotal; i++) { @@ -1012,13 +1017,8 @@ export class Animator { /** * End the progress animation. */ - progressEnd(shouldComplete: boolean, currentStepValue: number, dur: number) { - const self = this; - if (dur === undefined) { - dur = -1; - } - - if (self._isReverse) { + progressEnd(shouldComplete: boolean, currentStepValue: number, dur?: number) { + if (this._isReverse) { // if the animation is going in reverse then // flip the step value: 0 becomes 1, 1 becomes 0 currentStepValue = ((currentStepValue * -1) + 1); @@ -1026,28 +1026,31 @@ export class Animator { const stepValue = shouldComplete ? 1 : 0; const diff = Math.abs(currentStepValue - stepValue); + if (dur === undefined) { + dur = -1; + } if (diff < 0.05) { dur = 0; } else if (dur < 0) { - dur = self._duration; + dur = this._duration; } - self._isAsync = (dur > 30); + this._isAsync = (dur > 30); - self._progressEnd(shouldComplete, stepValue, dur, self._isAsync); + this._progressEnd(shouldComplete, stepValue, dur, this._isAsync); - if (self._isAsync) { + if (this._isAsync) { // for the root animation only // set the async TRANSITION END event // and run onFinishes when the transition ends // ******** DOM WRITE **************** - self._asyncEnd(dur, shouldComplete); + this._asyncEnd(dur, shouldComplete); // this animation has a duration so we need another RAF // for the CSS TRANSITION properties to kick in - if (!self._destroyed) { - window.requestAnimationFrame(function() { - self._playToStep(stepValue); + if (!this._destroyed) { + window.requestAnimationFrame(() => { + this._playToStep(stepValue); }); } } @@ -1182,7 +1185,7 @@ export class Animator { this._writeCallbacks.length = 0; } - this.parent = null; + this.parent = undefined; if (this._childAnimations) { this._childAnimations.length = this._childAnimationTotal = 0; @@ -1198,18 +1201,16 @@ export class Animator { /** * NO DOM */ - _transEl(): HTMLElement { + _transEl(): HTMLElement|null { // get the lowest level element that has an Animation - let targetEl: HTMLElement; - for (let i = 0; i < this._childAnimationTotal; i++) { - targetEl = this._childAnimations[i]._transEl(); + const targetEl = this._childAnimations[i]._transEl(); if (targetEl) { return targetEl; } } - return (this._hasTweenEffect && this._hasDur && this._elementTotal ? this._elements[0] : null); + return (this._hasTweenEffect && this._hasDur && this._elements && this._elementTotal > 0 ? this._elements[0] : null); } create() { diff --git a/packages/core/src/components/animation-controller/constants.ts b/packages/core/src/components/animation-controller/constants.ts index f9e4dfee55..6780fecf21 100644 --- a/packages/core/src/components/animation-controller/constants.ts +++ b/packages/core/src/components/animation-controller/constants.ts @@ -1,42 +1,27 @@ export let CSS_PROP = function(docEle: HTMLElement) { - const css: { - transformProp?: string; - transitionProp?: string; - transitionDurationProp?: string; - transitionTimingFnProp?: string; - } = {}; - // transform - let i: number; - let keys = ['webkitTransform', '-webkit-transform', 'webkit-transform', 'transform']; + const transformProp = [ + 'webkitTransform', + '-webkit-transform', + 'webkit-transform', + 'transform' + ].find(key => (docEle.style as any)[key] !== undefined) || 'transform'; - for (i = 0; i < keys.length; i++) { - if ((docEle.style as any)[keys[i]] !== undefined) { - css.transformProp = keys[i]; - break; - } - } - - // transition - keys = ['webkitTransition', 'transition']; - for (i = 0; i < keys.length; i++) { - if ((docEle.style as any)[keys[i]] !== undefined) { - css.transitionProp = keys[i]; - break; - } - } + const transitionProp = [ + 'webkitTransition', + 'transition' + ].find(key => (docEle.style as any)[key] !== undefined) || 'transition'; // The only prefix we care about is webkit for transitions. - const prefix = css.transitionProp.indexOf('webkit') > -1 ? '-webkit-' : ''; + const prefix = transitionProp.indexOf('webkit') > -1 ? '-webkit-' : ''; - // transition duration - css.transitionDurationProp = prefix + 'transition-duration'; - - // transition timing function - css.transitionTimingFnProp = prefix + 'transition-timing-function'; - - return css; + return { + transitionDurationProp: prefix + 'transition-duration', + transitionTimingFnProp: prefix + 'transition-timing-function', + transformProp, + transitionProp + }; }(document.documentElement); diff --git a/packages/core/src/components/button/button.tsx b/packages/core/src/components/button/button.tsx index 4faf7e04c4..2bbcb93e2f 100644 --- a/packages/core/src/components/button/button.tsx +++ b/packages/core/src/components/button/button.tsx @@ -148,7 +148,7 @@ export class Button { * Get the classes based on the type * e.g. block, full, round, large */ -function getButtonTypeClassMap(buttonType: string, type: string, mode: string): CssClassMap { +function getButtonTypeClassMap(buttonType: string, type: string|null, mode: string): CssClassMap { if (!type) { return {}; } diff --git a/packages/core/src/components/content/content.tsx b/packages/core/src/components/content/content.tsx index 18aed6b92e..29a48415f2 100644 --- a/packages/core/src/components/content/content.tsx +++ b/packages/core/src/components/content/content.tsx @@ -15,7 +15,7 @@ export class Content { private cTop = 0; private cBottom = 0; private dirty = false; - private scrollEl: HTMLIonScrollElement; + private scrollEl: HTMLIonScrollElement|null; mode: string; color: string; diff --git a/packages/core/src/components/gesture-controller/gesture-controller.ts b/packages/core/src/components/gesture-controller/gesture-controller.ts index ea120e1904..5e74258819 100644 --- a/packages/core/src/components/gesture-controller/gesture-controller.ts +++ b/packages/core/src/components/gesture-controller/gesture-controller.ts @@ -1,11 +1,10 @@ - export class GestureController { private gestureId = 0; private requestedStart = new Map(); private disabledGestures = new Map>(); private disabledScroll = new Set(); - private capturedId: number = null; + private capturedId: number|null = null; createGesture(gestureName: string, gesturePriority: number, disableScroll: boolean): GestureDelegate { return new GestureDelegate(this, this.newID(), gestureName, gesturePriority, disableScroll); diff --git a/packages/core/src/components/infinite-scroll/infinite-scroll.tsx b/packages/core/src/components/infinite-scroll/infinite-scroll.tsx index 6afbf50b3f..80a1761bce 100644 --- a/packages/core/src/components/infinite-scroll/infinite-scroll.tsx +++ b/packages/core/src/components/infinite-scroll/infinite-scroll.tsx @@ -21,7 +21,7 @@ export class InfiniteScroll { private thrPx = 0; private thrPc = 0; - private scrollEl: HTMLIonScrollElement; + private scrollEl: HTMLIonScrollElement|null = null; private didFire = false; private isBusy = false; private init = false; @@ -219,7 +219,7 @@ export class InfiniteScroll { return ( !this.disabled && !this.isBusy && - this.scrollEl && + !!this.scrollEl && !this.isLoading); } diff --git a/packages/core/src/components/modal-controller/modal-controller.tsx b/packages/core/src/components/modal-controller/modal-controller.tsx index a6544189e8..12a2adceba 100644 --- a/packages/core/src/components/modal-controller/modal-controller.tsx +++ b/packages/core/src/components/modal-controller/modal-controller.tsx @@ -32,6 +32,9 @@ export class ModalController { dismiss(data?: any, role?: any, modalId = -1) { modalId = modalId >= 0 ? modalId : getHighestId(); const modal = modals.get(modalId); + if (!modal) { + return Promise.reject('modal does not exist'); + } return modal.dismiss(data, role); } diff --git a/packages/core/src/components/picker-controller/picker-controller.tsx b/packages/core/src/components/picker-controller/picker-controller.tsx index e9b04b30ad..ec18347422 100644 --- a/packages/core/src/components/picker-controller/picker-controller.tsx +++ b/packages/core/src/components/picker-controller/picker-controller.tsx @@ -32,6 +32,9 @@ export class PickerController { dismiss(data?: any, role?: any, pickerId = -1) { pickerId = pickerId >= 0 ? pickerId : getHighestId(); const picker = pickers.get(pickerId); + if (!picker) { + return Promise.reject('picker does not exist'); + } return picker.dismiss(data, role); } diff --git a/packages/core/src/components/popover-controller/popover-controller.tsx b/packages/core/src/components/popover-controller/popover-controller.tsx index 6c607aeafa..422c9d5c92 100644 --- a/packages/core/src/components/popover-controller/popover-controller.tsx +++ b/packages/core/src/components/popover-controller/popover-controller.tsx @@ -32,6 +32,9 @@ export class PopoverController { dismiss(data?: any, role?: any, popoverId = -1) { popoverId = popoverId >= 0 ? popoverId : getHighestId(); const popover = popovers.get(popoverId); + if (!popover) { + return Promise.reject('popover does not exist'); + } return popover.dismiss(data, role); } diff --git a/packages/core/src/components/range-knob/range-knob.tsx b/packages/core/src/components/range-knob/range-knob.tsx index 0cccfa0a7e..41e9c59f2c 100644 --- a/packages/core/src/components/range-knob/range-knob.tsx +++ b/packages/core/src/components/range-knob/range-knob.tsx @@ -4,6 +4,7 @@ import { Component, Event, EventEmitter, Listen, Prop } from '@stencil/core'; tag: `ion-range-knob` }) export class RangeKnob { + @Prop() pressed: boolean; @Prop() pin: boolean; @Prop() min: number; diff --git a/packages/core/src/components/refresher/refresher.tsx b/packages/core/src/components/refresher/refresher.tsx index f88d79f858..eedb3f7553 100644 --- a/packages/core/src/components/refresher/refresher.tsx +++ b/packages/core/src/components/refresher/refresher.tsx @@ -28,8 +28,7 @@ export class Refresher { private didStart = false; private gestureConfig: any; private progress = 0; - - scrollEl: HTMLElement; + private scrollEl: HTMLElement | null = null; @Prop({ context: 'dom' }) dom: DomController; @@ -116,7 +115,12 @@ export class Refresher { console.error('Make sure you use: '); return; } - this.scrollEl = this.el.parentElement.querySelector('ion-scroll') as HTMLElement; + const parentElement = this.el.parentElement; + if (!parentElement) { + console.error('ion-refresher is not attached'); + return; + } + this.scrollEl = parentElement.querySelector('ion-scroll') as HTMLElement; if (!this.scrollEl) { console.error('ion-refresher didn\'t attached, make sure if parent is a ion-content'); } @@ -183,6 +187,9 @@ export class Refresher { } private onMove(detail: GestureDetail) { + if (!this.scrollEl) { + return 0; + } // this method can get called like a bazillion times per second, // so it's built to be as efficient as possible, and does its // best to do any DOM read/writes only when absolutely necessary @@ -309,26 +316,14 @@ export class Refresher { } private close(state: RefresherState, delay: string) { - let timer: number; - - function close(ev: TransitionEvent) { - // closing is done, return to inactive state - if (ev) { - clearTimeout(timer); - } + // create fallback timer incase something goes wrong with transitionEnd event + setTimeout(() => { this.state = RefresherState.Inactive; this.progress = 0; this.didStart = false; this.setCss(0, '0ms', false, ''); - } - - // create fallback timer incase something goes wrong with transitionEnd event - timer = setTimeout(close.bind(this), 600); - - // create transition end event on the content's scroll element - // TODO: what is this? - // this.scrollEl.onScrollElementTransitionEnd(close.bind(this)); + }, 600); // reset set the styles on the scroll element // set that the refresh is actively cancelling/completing @@ -336,9 +331,6 @@ export class Refresher { this.setCss(0, '', true, delay); // TODO: stop gesture - // if (this._pointerEvents) { - // this._pointerEvents.stop(); - // } } private setCss(y: number, duration: string, overflowVisible: boolean, delay: string) { diff --git a/packages/core/src/components/reorder-group/reorder-group.tsx b/packages/core/src/components/reorder-group/reorder-group.tsx index 7716c062be..e9f3056648 100644 --- a/packages/core/src/components/reorder-group/reorder-group.tsx +++ b/packages/core/src/components/reorder-group/reorder-group.tsx @@ -25,7 +25,7 @@ export class ReorderIndexes { } }) export class ReorderGroup { - private selectedItemEl: HTMLElement = null; + private selectedItemEl: HTMLElement|null = null; private selectedItemHeight: number; private lastToIndex: number; private cachedHeights: number[] = []; @@ -179,7 +179,7 @@ export class ReorderGroup { ? children[toIndex + 1] : children[toIndex]; - this.containerEl.insertBefore(this.selectedItemEl, ref); + this.containerEl.insertBefore(selectedItem, ref); const len = children.length; const transform = CSS_PROP.transformProp; @@ -188,9 +188,11 @@ export class ReorderGroup { } const reorderInactive = () => { - this.selectedItemEl.style.transition = ''; - this.selectedItemEl.classList.remove(ITEM_REORDER_SELECTED); - this.selectedItemEl = null; + if (this.selectedItemEl) { + this.selectedItemEl.style.transition = ''; + this.selectedItemEl.classList.remove(ITEM_REORDER_SELECTED); + this.selectedItemEl = null; + } }; if (toIndex === fromIndex) { selectedItem.style.transition = 'transform 200ms ease-in-out'; @@ -287,7 +289,7 @@ function indexForItem(element: any): number { return element['$ionIndex']; } -function findReorderItem(node: HTMLElement, container: HTMLElement): HTMLElement { +function findReorderItem(node: HTMLElement, container: HTMLElement): HTMLElement|null { let nested = 0; let parent; while (node && nested < 6) { diff --git a/packages/core/src/components/router-controller/router-controller.tsx b/packages/core/src/components/router-controller/router-controller.tsx index cfa51e590a..26e27539fe 100644 --- a/packages/core/src/components/router-controller/router-controller.tsx +++ b/packages/core/src/components/router-controller/router-controller.tsx @@ -21,7 +21,7 @@ export class RouterController { const base = document.querySelector('head > base'); if (base) { const baseURL = base.getAttribute('href'); - if (baseURL.length > 0) { + if (baseURL && baseURL.length > 0) { this.basePrefix = baseURL; } } diff --git a/packages/core/src/components/router-controller/router-utils.ts b/packages/core/src/components/router-controller/router-utils.ts index 540b473cd3..16e482adf4 100644 --- a/packages/core/src/components/router-controller/router-utils.ts +++ b/packages/core/src/components/router-controller/router-utils.ts @@ -11,7 +11,7 @@ export interface NavElement extends HTMLElement { export interface RouterEntry { path: string; id: any; - segments?: string[]; + segments: string[]; props?: any; } @@ -29,7 +29,7 @@ export class RouterSegments { next(): string { if (this.segments.length > 0) { - return this.segments.shift(); + return this.segments.shift() as string; } return ''; } @@ -55,7 +55,7 @@ export function writeNavState(root: HTMLElement, segments: RouterSegments): Prom export function readNavState(node: HTMLElement) { const stack = []; - let pivot: NavElement; + let pivot: NavElement | null = null; let state: NavState; while (true) { pivot = breadthFirstSearch(node); @@ -85,13 +85,13 @@ function mustMatchRoute(segments: RouterSegments, routes: RouterEntries) { return r; } -export function matchRoute(segments: RouterSegments, routes: RouterEntries): RouterEntry { +export function matchRoute(segments: RouterSegments, routes: RouterEntries): RouterEntry | null { if (!routes) { return null; } let index = 0; routes = routes.map(initRoute); - let selectedRoute: RouterEntry = null; + let selectedRoute: RouterEntry|null = null; let ambiguous = false; let segment: string; let l: number; @@ -154,7 +154,7 @@ export function parseURL(url: string): string[] { } const navs = ['ION-NAV', 'ION-TABS']; -export function breadthFirstSearch(root: HTMLElement): NavElement { +export function breadthFirstSearch(root: HTMLElement): NavElement | null { if (!root) { console.error('search root is null'); return null; @@ -166,8 +166,8 @@ export function breadthFirstSearch(root: HTMLElement): NavElement { // first, before moving to the next level neighbours. const queue = [root]; - while (queue.length > 0) { - const node = queue.shift(); + let node: HTMLElement | undefined; + while (node = queue.shift()) { // visit node if (navs.indexOf(node.tagName) >= 0) { return node as NavElement; diff --git a/packages/core/src/components/select/select.tsx b/packages/core/src/components/select/select.tsx index 45b8457bc3..5016e2f966 100644 --- a/packages/core/src/components/select/select.tsx +++ b/packages/core/src/components/select/select.tsx @@ -345,14 +345,14 @@ export class Select { openActionSheet() { const interfaceOptions = {...this.interfaceOptions}; - const actionSheetButtons: ActionSheetButton[] = this.childOpts.map(option => { + const actionSheetButtons = this.childOpts.map(option => { return { role: (option.selected ? 'selected' : ''), text: option.textContent, handler: () => { this.value = option.value; } - }; + } as ActionSheetButton; }); actionSheetButtons.push({ @@ -382,10 +382,7 @@ export class Select { const interfaceOptions = {...this.interfaceOptions}; const label = this.getLabel(); - let labelText: string = null; - if (label) { - labelText = label.textContent; - } + const labelText = (label) ? label.textContent : null; const alertOpts: AlertOptions = Object.assign(interfaceOptions, { title: interfaceOptions.title ? interfaceOptions.title : labelText, diff --git a/packages/core/src/components/tabbar/tabbar.tsx b/packages/core/src/components/tabbar/tabbar.tsx index 1d638fd9df..7c02be6b6b 100644 --- a/packages/core/src/components/tabbar/tabbar.tsx +++ b/packages/core/src/components/tabbar/tabbar.tsx @@ -62,11 +62,11 @@ export class Tabbar { } protected analyzeTabs() { - const tabs: HTMLIonTabButtonElement[] = Array.from(document.querySelectorAll('ion-tab-button')), - scrollLeft: number = this.scrollEl.scrollLeft, - tabsWidth: number = this.scrollEl.clientWidth; - let previous: {tab: HTMLIonTabButtonElement, amount: number}, - next: {tab: HTMLIonTabButtonElement, amount: number}; + const tabs: HTMLIonTabButtonElement[] = Array.from(document.querySelectorAll('ion-tab-button')); + const scrollLeft = this.scrollEl.scrollLeft; + const tabsWidth = this.scrollEl.clientWidth; + let previous: {tab: HTMLIonTabButtonElement, amount: number}; + let next: {tab: HTMLIonTabButtonElement, amount: number}; tabs.forEach((tab: HTMLIonTabButtonElement) => { const left: number = tab.offsetLeft, @@ -85,11 +85,70 @@ export class Tabbar { return {previous, next}; } - private getSelectedButton(): HTMLIonTabButtonElement { + private getSelectedButton(): HTMLIonTabButtonElement | undefined { return Array.from(this.el.querySelectorAll('ion-tab-button')) .find(btn => btn.selected); } + protected scrollToSelectedButton() { + this.dom.read(() => { + const activeTabButton = this.getSelectedButton(); + + if (activeTabButton) { + const scrollLeft: number = this.scrollEl.scrollLeft, + tabsWidth: number = this.scrollEl.clientWidth, + left: number = activeTabButton.offsetLeft, + right: number = left + activeTabButton.offsetWidth; + + let amount; + + if (right > (tabsWidth + scrollLeft)) { + amount = right - tabsWidth; + } else if (left < scrollLeft) { + amount = left; + } + + if (amount !== undefined) { + this.scrollEl.scrollToPoint(amount, 0, 250).then(() => { + this.updateBoundaries(); + }); + } + } + }); + } + + private scrollByTab(direction: 'left' | 'right') { + this.dom.read(() => { + const {previous, next} = this.analyzeTabs(), + info = direction === 'right' ? next : previous, + amount = info && info.amount; + + if (info) { + this.scrollEl.scrollToPoint(amount, 0, 250).then(() => { + this.updateBoundaries(); + }); + } + }); + } + + private updateBoundaries() { + this.canScrollLeft = this.scrollEl.scrollLeft !== 0; + this.canScrollRight = this.scrollEl.scrollLeft < (this.scrollEl.scrollWidth - this.scrollEl.offsetWidth); + } + + private updateHighlight() { + if (!this.highlight) { + return; + } + this.dom.read(() => { + const btn = this.getSelectedButton(); + const highlight = this.el.querySelector('div.tabbar-highlight') as HTMLElement; + if (btn && highlight) { + highlight.style.transform = `translate3d(${btn.offsetLeft}px,0,0) scaleX(${btn.offsetWidth})`; + } + }); + } + hostData() { const themedClasses = this.translucent ? createThemedClasses(this.mode, this.color, 'tabbar-translucent') : {}; @@ -139,61 +198,4 @@ export class Tabbar { ]; } } - - protected scrollToSelectedButton() { - this.dom.read(() => { - const activeTabButton: HTMLIonTabButtonElement = this.getSelectedButton(); - - if (activeTabButton) { - const scrollLeft: number = this.scrollEl.scrollLeft, - tabsWidth: number = this.scrollEl.clientWidth, - left: number = activeTabButton.offsetLeft, - right: number = left + activeTabButton.offsetWidth; - - let amount; - - if (right > (tabsWidth + scrollLeft)) { - amount = right - tabsWidth; - } else if (left < scrollLeft) { - amount = left; - } - - if (amount !== undefined) { - this.scrollEl.scrollToPoint(amount, 0, 250).then(() => { - this.updateBoundaries(); - }); - } - } - }); - } - - scrollByTab(direction: 'left' | 'right') { - this.dom.read(() => { - const {previous, next} = this.analyzeTabs(), - info = direction === 'right' ? next : previous, - amount = info && info.amount; - - if (info) { - this.scrollEl.scrollToPoint(amount, 0, 250).then(() => { - this.updateBoundaries(); - }); - } - }); - } - - updateBoundaries() { - this.canScrollLeft = this.scrollEl.scrollLeft !== 0; - this.canScrollRight = this.scrollEl.scrollLeft < (this.scrollEl.scrollWidth - this.scrollEl.offsetWidth); - } - - updateHighlight() { - this.dom.read(() => { - const btn = this.getSelectedButton(), - ionTabbarHighlight: HTMLElement = this.highlight && this.el.querySelector('div.tabbar-highlight'); - - if (btn && ionTabbarHighlight) { - ionTabbarHighlight.style.transform = `translate3d(${btn.offsetLeft}px,0,0) scaleX(${btn.offsetWidth})`; - } - }); - } } diff --git a/packages/core/src/components/tabs/tabs.tsx b/packages/core/src/components/tabs/tabs.tsx index 9e5fc3b3ca..22a815b14b 100644 --- a/packages/core/src/components/tabs/tabs.tsx +++ b/packages/core/src/components/tabs/tabs.tsx @@ -16,7 +16,7 @@ export class Tabs { @Element() el: HTMLElement; @State() tabs: HTMLIonTabElement[] = []; - @State() selectedTab: HTMLIonTabElement; + @State() selectedTab: HTMLIonTabElement | undefined; @Prop({ context: 'config' }) config: Config; @@ -77,7 +77,8 @@ export class Tabs { } componentDidUnload() { - this.tabs = this.selectedTab = null; + this.tabs.length = 0; + this.selectedTab = undefined; } @Listen('ionTabbarClick') @@ -132,7 +133,7 @@ export class Tabs { * @return {HTMLIonTabElement} Returns the currently selected tab */ @Method() - getSelected(): HTMLIonTabElement { + getSelected(): HTMLIonTabElement | undefined { return this.tabs.find((tab) => tab.selected); } @@ -190,7 +191,8 @@ export class Tabs { private initSelect() { // find pre-selected tabs - const selectedTab = this.tabs.find(t => t.selected) || this.tabs.find(t => t.show && !t.disabled); + const selectedTab = this.tabs.find(t => t.selected) || + this.tabs.find(t => t.show && !t.disabled); // reset all tabs none is selected for (const tab of this.tabs) { @@ -198,8 +200,9 @@ export class Tabs { tab.selected = false; } } - - selectedTab.setActive(true); + if (selectedTab) { + selectedTab.setActive(true); + } this.selectedTab = selectedTab; } diff --git a/packages/core/src/components/tap-click/tap-click.tsx b/packages/core/src/components/tap-click/tap-click.tsx index 118755c386..3883018d6c 100644 --- a/packages/core/src/components/tap-click/tap-click.tsx +++ b/packages/core/src/components/tap-click/tap-click.tsx @@ -17,7 +17,7 @@ export class TapClick { private gestureCtrl: GestureController; - private activatableEle: HTMLElement; + private activatableEle: HTMLElement | null; private activeDefer: any; private clearDefers = new WeakMap(); @@ -104,7 +104,7 @@ export class TapClick { this.setActivatedElement(null, ev); } - private setActivatedElement(el: HTMLElement, ev: UIEvent) { + private setActivatedElement(el: HTMLElement | null, ev: UIEvent) { // do nothing const activatableEle = this.activatableEle; if (el && el === activatableEle) { @@ -157,7 +157,9 @@ export class TapClick { private removeActivated(smooth: boolean) { const activatableEle = this.activatableEle; - + if (!activatableEle) { + return; + } const time = CLEAR_STATE_DEFERS - Date.now() + this.lastActivated; if (smooth && time > 0) { const deferId = setTimeout(() => { diff --git a/packages/core/src/components/toast-controller/toast-controller.tsx b/packages/core/src/components/toast-controller/toast-controller.tsx index ac0183a7b9..ca4cf81d3d 100644 --- a/packages/core/src/components/toast-controller/toast-controller.tsx +++ b/packages/core/src/components/toast-controller/toast-controller.tsx @@ -32,6 +32,9 @@ export class ToastController { dismiss(data?: any, role?: any, toastId = -1) { toastId = toastId >= 0 ? toastId : getHighestId(); const toast = toasts.get(toastId); + if (!toast) { + return Promise.reject('toast does not exist'); + } return toast.dismiss(data, role); } diff --git a/packages/core/src/components/toast/toast.tsx b/packages/core/src/components/toast/toast.tsx index 4905e16893..d93e781ddf 100644 --- a/packages/core/src/components/toast/toast.tsx +++ b/packages/core/src/components/toast/toast.tsx @@ -24,7 +24,7 @@ export class Toast { mode: string; color: string; - private animation: Animation; + private animation: Animation | null; @Element() private el: HTMLElement; diff --git a/packages/core/src/components/virtual-scroll/test/basic.html b/packages/core/src/components/virtual-scroll/test/basic.html index 37061a47f9..8072acfa52 100644 --- a/packages/core/src/components/virtual-scroll/test/basic.html +++ b/packages/core/src/components/virtual-scroll/test/basic.html @@ -15,10 +15,17 @@ Ionic CDN demo + + Add Items + +

+ Add Items + +

@@ -27,6 +34,10 @@