mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
fix(): correct all type errors in ionic core.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { Component, h } from '@stencil/core';
|
||||
import { Component } from '@stencil/core';
|
||||
|
||||
/**
|
||||
* @name Col
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, h } from '@stencil/core';
|
||||
import { Component } from '@stencil/core';
|
||||
|
||||
/**
|
||||
* @name Grid
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, h } from '@stencil/core';
|
||||
import { Component } from '@stencil/core';
|
||||
|
||||
/**
|
||||
* @name Row
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Menu, MenuController as IMenuController } from '../../util/interfaces';
|
||||
import { Menu, MenuController as IMenuController } from '../../utils/interfaces';
|
||||
import { MenuType, MenuRevealType, MenuPushType, MenuOverlayType } from './menu-types';
|
||||
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ export class MenuType implements IMenuType {
|
||||
.duration(280);
|
||||
}
|
||||
|
||||
setOpen(shouldOpen: boolean, animated: boolean, done: Function) {
|
||||
setOpen(shouldOpen: boolean, animated: boolean, done: (animation: Animation) => void) {
|
||||
const ani = this.ani
|
||||
.onFinish(done, {oneTimeCallback: true, clearExistingCallacks: true })
|
||||
.reverse(!shouldOpen);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, h, Prop, Ionic } from '@stencil/core';
|
||||
import { Component, h, Prop, Ionic, PropDidChange } from '@stencil/core';
|
||||
import { VNodeData, GlobalNamespace, Menu as IMenu } from '../../utils/interfaces';
|
||||
import { MenuController } from './menu-controller';
|
||||
import { MenuType } from './menu-types';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, Prop, h } from '@stencil/core';
|
||||
import { Component, Prop } from '@stencil/core';
|
||||
|
||||
/**
|
||||
* @name Route
|
||||
@ -14,12 +14,15 @@ export class RouteLink {
|
||||
// The instance of the router
|
||||
@Prop() router: any;
|
||||
|
||||
handleClick(e) {
|
||||
handleClick(e: any) {
|
||||
console.log('Route link click', e);
|
||||
/*
|
||||
router.navigateTo(this.url)
|
||||
*/
|
||||
}
|
||||
|
||||
render() {
|
||||
/*
|
||||
const router = document.querySelector(this.router);
|
||||
const match = router.match
|
||||
console.log(` <ion-route-link> Rendering route ${this.url}`, router, match);
|
||||
@ -27,5 +30,6 @@ export class RouteLink {
|
||||
return (
|
||||
<a onClick={this.handleClick.bind(this)}><slot></slot></a>
|
||||
);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, Prop, h } from '@stencil/core';
|
||||
import { Component, Prop, State } from '@stencil/core';
|
||||
|
||||
/**
|
||||
* @name Route
|
||||
@ -24,15 +24,18 @@ export class Route {
|
||||
@State() match: any = {};
|
||||
|
||||
ionViewWillLoad() {
|
||||
/*
|
||||
this.routerInstance = document.querySelector(this.router)
|
||||
|
||||
// HACK
|
||||
this.routerInstance.addEventListener('ionRouterNavigation', (e) => {
|
||||
this.match = e.detail;
|
||||
})
|
||||
*/
|
||||
}
|
||||
|
||||
render() {
|
||||
/*
|
||||
this.match.url = this.routerInstance.$instance.routeMatch.url;
|
||||
const match = this.match
|
||||
const ChildComponent = this.component
|
||||
@ -47,5 +50,6 @@ export class Route {
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, h } from '@stencil/core';
|
||||
import { Component, Prop, State } from '@stencil/core';
|
||||
|
||||
/**
|
||||
* @name Router
|
||||
@ -20,6 +20,7 @@ export class Router {
|
||||
return this.routeMatch
|
||||
}
|
||||
|
||||
/*
|
||||
@Prop()
|
||||
navigateTo(url, data={}) {
|
||||
window.history.pushState(null, null, url);
|
||||
@ -60,4 +61,5 @@ export class Router {
|
||||
<slot></slot>
|
||||
);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ScrollCallback } from '../../util/interfaces';
|
||||
import { ScrollCallback } from '../../utils/interfaces';
|
||||
|
||||
|
||||
export interface Scroll {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, h, Ionic, Prop, PropDidChange, State } from '@stencil/core';
|
||||
import { Component, h, Ionic, Prop, State } from '@stencil/core';
|
||||
import { VNodeData } from '../../utils/interfaces';
|
||||
|
||||
/**
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, h, Prop } from '@stencil/core';
|
||||
import { Component, h } from '@stencil/core';
|
||||
|
||||
|
||||
@Component({
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, h, Prop } from '@stencil/core';
|
||||
import { Component, h } from '@stencil/core';
|
||||
|
||||
|
||||
@Component({
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, h, Prop } from '@stencil/core';
|
||||
import { Component, h } from '@stencil/core';
|
||||
|
||||
|
||||
@Component({
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, h, Prop } from '@stencil/core';
|
||||
import { Component, h, } from '@stencil/core';
|
||||
|
||||
@Component({
|
||||
tag: 'site-header',
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, h, Prop } from '@stencil/core';
|
||||
import { Component, h } from '@stencil/core';
|
||||
|
||||
@Component({
|
||||
tag: 'stencil-site'
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { Component, h } from '@stencil/core';
|
||||
import { VNodeData } from '../../utils/interfaces';
|
||||
import { Component, Prop } from '@stencil/core';
|
||||
|
||||
|
||||
|
||||
@ -10,7 +9,7 @@ import { VNodeData } from '../../utils/interfaces';
|
||||
}
|
||||
})
|
||||
export class TabBar {
|
||||
@Prop() tabs: [Tab] = [];
|
||||
@Prop() tabs: any;
|
||||
|
||||
@Prop() onTabSelected: Function;
|
||||
|
||||
@ -20,6 +19,7 @@ export class TabBar {
|
||||
* @prop {string} Set the tabbar layout: `icon-top`, `icon-start`, `icon-end`, `icon-bottom`, `icon-hide`, `title-hide`.
|
||||
*/
|
||||
@Prop() tabsLayout: string = 'icon-top'
|
||||
/*
|
||||
|
||||
hostData(): VNodeData {
|
||||
return {
|
||||
@ -52,4 +52,5 @@ export class TabBar {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, h } from '@stencil/core';
|
||||
import { Component, Prop, h } from '@stencil/core';
|
||||
import { VNodeData } from '../../utils/interfaces';
|
||||
|
||||
@Component({
|
||||
@ -8,7 +8,7 @@ import { VNodeData } from '../../utils/interfaces';
|
||||
}
|
||||
})
|
||||
export class TabButton {
|
||||
@Prop() tab: Tab;
|
||||
@Prop() tab: any;
|
||||
|
||||
@Prop() layout: string;
|
||||
|
||||
@ -54,8 +54,10 @@ export class TabButton {
|
||||
const tab = this.tab
|
||||
|
||||
// TODO: Apply these on host?
|
||||
/*
|
||||
let { id, ariaControls, ariaSelected, hasTitle, hasIcon, hasTitleOnly,
|
||||
iconOnly, hasBadge, disableHover, tabDisabled, tabHidden } = {};
|
||||
*/
|
||||
|
||||
const items = []
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, h, Ionic } from '@stencil/core';
|
||||
import { Component, h, Prop, State, Ionic } from '@stencil/core';
|
||||
import { VNodeData } from '../../utils/interfaces';
|
||||
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, h, Listen } from '@stencil/core';
|
||||
import { Component, h, State, Prop, Listen, PropDidChange } from '@stencil/core';
|
||||
|
||||
@Component({
|
||||
tag: 'ion-tabs',
|
||||
@ -13,12 +13,12 @@ import { Component, h, Listen } from '@stencil/core';
|
||||
})
|
||||
export class Tabs {
|
||||
// Current list of tabs
|
||||
@State() tabs: [Tab] = []
|
||||
@State() tabs: any
|
||||
|
||||
/**
|
||||
* @state {number} The selected tab
|
||||
*/
|
||||
@State() selectedTab: Tab;
|
||||
@State() selectedTab: any;
|
||||
|
||||
/**
|
||||
* @state {number} The selected tab index
|
||||
@ -55,7 +55,7 @@ export class Tabs {
|
||||
}
|
||||
|
||||
@Listen('ionTabDidLoad')
|
||||
tabDidLoad(ev) {
|
||||
tabDidLoad(ev: any) {
|
||||
const tab = ev.detail.tab;
|
||||
|
||||
// First tab? Select it
|
||||
@ -67,13 +67,13 @@ export class Tabs {
|
||||
}
|
||||
|
||||
@Listen('ionTabDidUnload')
|
||||
tabDidUnload(ev) {
|
||||
this.tabs = this.tabs.filter(t => t !== ev.detail.tab)
|
||||
tabDidUnload(ev: any) {
|
||||
this.tabs = this.tabs.filter((t: any) => t !== ev.detail.tab)
|
||||
}
|
||||
|
||||
handleOnTabSelected(tab, index) {
|
||||
handleOnTabSelected(tab: any, index: number) {
|
||||
// Select just this tab
|
||||
this.tabs.forEach(t => t.isSelected = false);
|
||||
this.tabs.forEach((t: any) => t.isSelected = false);
|
||||
tab.isSelected = true;
|
||||
|
||||
// Store the selected tab and index
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, Prop, h } from '@stencil/core';
|
||||
import { Component, h } from '@stencil/core';
|
||||
import { createThemedClasses } from '../../utils/theme';
|
||||
|
||||
/**
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, h, Listen, Prop, VNodeData, Ionic } from '@stencil/core';
|
||||
import { Component, h, Listen, Prop, VNodeData, Ionic, PropDidChange } from '@stencil/core';
|
||||
import { BooleanInputComponent, GestureDetail } from '../../utils/interfaces';
|
||||
|
||||
@Component({
|
||||
|
||||
@ -555,7 +555,6 @@ export interface ModeMeta {
|
||||
[1]?: string;
|
||||
}
|
||||
|
||||
|
||||
export interface HostMeta {
|
||||
[key: string]: any;
|
||||
}
|
||||
@ -897,54 +896,3 @@ export interface IdleOptions {
|
||||
export interface BundleCallbacks {
|
||||
[bundleId: string]: Function[];
|
||||
}
|
||||
|
||||
|
||||
export interface StencilSystem {
|
||||
fs?: {
|
||||
readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void;
|
||||
readFileSync(filename: string, encoding: string): string;
|
||||
readdirSync(path: string | Buffer, options?: string | {}): string[];
|
||||
statSync(path: string | Buffer): {
|
||||
isFile(): boolean;
|
||||
isDirectory(): boolean;
|
||||
};
|
||||
};
|
||||
path?: {
|
||||
join(...paths: string[]): string;
|
||||
};
|
||||
vm?: {
|
||||
createContext(sandbox?: any): any;
|
||||
runInContext(code: string, contextifiedSandbox: any, options?: any): any;
|
||||
};
|
||||
createDom?(): {
|
||||
parse(hydrateOptions: HydrateOptions): Window;
|
||||
serialize(): string;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
export interface RendererOptions {
|
||||
registry?: ComponentRegistry;
|
||||
staticDir?: string;
|
||||
debug?: boolean;
|
||||
sys?: StencilSystem;
|
||||
}
|
||||
|
||||
|
||||
export interface HydrateOptions {
|
||||
req?: {
|
||||
protocol: string;
|
||||
get: (key: string) => string;
|
||||
originalUrl: string;
|
||||
url: string;
|
||||
};
|
||||
html?: string;
|
||||
url?: string;
|
||||
referrer?: string;
|
||||
userAgent?: string;
|
||||
cookie?: string;
|
||||
dir?: string;
|
||||
lang?: string;
|
||||
config?: Object;
|
||||
removeUnusedCss?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user