mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
chore(): fix bad types for docs
This commit is contained in:
@ -198,7 +198,7 @@ export class Alert extends ViewController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} button Alert button
|
||||
* @param {any} button Alert button
|
||||
*/
|
||||
addButton(button: any) {
|
||||
this.data.buttons.push(button);
|
||||
|
@ -50,8 +50,8 @@ export class IonicApp {
|
||||
* available to accept new user commands. For example, this is set to `false`
|
||||
* while views transition, a modal slides up, an action-sheet
|
||||
* slides up, etc. After the transition completes it is set back to `true`.
|
||||
* @param {bool} isEnabled
|
||||
* @param {bool} fallback When `isEnabled` is set to `false`, this argument
|
||||
* @param {boolean} isEnabled
|
||||
* @param {boolean} fallback When `isEnabled` is set to `false`, this argument
|
||||
* is used to set the maximum number of milliseconds that app will wait until
|
||||
* it will automatically enable the app again. It's basically a fallback incase
|
||||
* something goes wrong during a transition and the app wasn't re-enabled correctly.
|
||||
@ -68,7 +68,7 @@ export class IonicApp {
|
||||
/**
|
||||
* @private
|
||||
* Boolean if the app is actively enabled or not.
|
||||
* @return {bool}
|
||||
* @return {boolean}
|
||||
*/
|
||||
isEnabled(): boolean {
|
||||
return (this._disTime < Date.now());
|
||||
@ -84,7 +84,7 @@ export class IonicApp {
|
||||
/**
|
||||
* @private
|
||||
* Boolean if the app is actively scrolling or not.
|
||||
* @return {bool}
|
||||
* @return {boolean}
|
||||
*/
|
||||
isScrolling(): boolean {
|
||||
return (this._scrollTime + 64 > Date.now());
|
||||
@ -94,7 +94,7 @@ export class IonicApp {
|
||||
* @private
|
||||
* Register a known component with a key, for easy lookups later.
|
||||
* @param {string} id The id to use to register the component
|
||||
* @param {Object} component The component to register
|
||||
* @param {object} component The component to register
|
||||
*/
|
||||
register(id: string, component: any) {
|
||||
this.components[id] = component;
|
||||
@ -112,8 +112,8 @@ export class IonicApp {
|
||||
/**
|
||||
* @private
|
||||
* Get a registered component with the given type (returns the first)
|
||||
* @param {Object} cls the type to search for
|
||||
* @return {Object} the matching component, or undefined if none was found
|
||||
* @param {object} cls the type to search for
|
||||
* @return {object} the matching component, or undefined if none was found
|
||||
*/
|
||||
getRegisteredComponent(cls: any): any {
|
||||
for (let key in this.components) {
|
||||
@ -128,7 +128,7 @@ export class IonicApp {
|
||||
* @private
|
||||
* Get the component for the given key.
|
||||
* @param {string} id TODO
|
||||
* @return {Object} TODO
|
||||
* @return {object} TODO
|
||||
*/
|
||||
getComponent(id: string): any {
|
||||
// deprecated warning
|
||||
|
@ -167,7 +167,7 @@ export class Checkbox {
|
||||
* Angular2 Forms API method called by the view (NgControl) to register the
|
||||
* onChange event handler that updates the model (Control).
|
||||
* https://github.com/angular/angular/blob/master/modules/angular2/src/forms/directives/shared.ts#L27
|
||||
* @param {Function} fn the onChange event handler.
|
||||
* @param {function} fn the onChange event handler.
|
||||
*/
|
||||
registerOnChange(fn) { this.onChange = fn; }
|
||||
|
||||
@ -175,7 +175,7 @@ export class Checkbox {
|
||||
* @private
|
||||
* Angular2 Forms API method called by the the view (NgControl) to register
|
||||
* the onTouched event handler that marks model (Control) as touched.
|
||||
* @param {Function} fn onTouched event handler.
|
||||
* @param {function} fn onTouched event handler.
|
||||
*/
|
||||
registerOnTouched(fn) { this.onTouched = fn; }
|
||||
|
||||
|
@ -109,8 +109,8 @@ export class Content extends Ion {
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* @param {function} handler The method you want perform when scrolling
|
||||
* @returns {function} A function that removes the scroll handler.
|
||||
* @param {Function} handler The method you want perform when scrolling
|
||||
* @returns {Function} A function that removes the scroll handler.
|
||||
*/
|
||||
addScrollEventListener(handler) {
|
||||
if (!this.scrollElement) {
|
||||
@ -131,7 +131,7 @@ export class Content extends Ion {
|
||||
/**
|
||||
* Call a method when scrolling has stopped
|
||||
*
|
||||
* @param {function} callback The method you want perform when scrolling has ended
|
||||
* @param {Function} callback The method you want perform when scrolling has ended
|
||||
*/
|
||||
onScrollEnd(callback) {
|
||||
let lastScrollTop = null;
|
||||
@ -186,8 +186,8 @@ export class Content extends Ion {
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* @param {function} handler The method you want to perform when touchmove is firing
|
||||
* @returns {function} A function that removes the touchmove handler.
|
||||
* @param {Function} handler The method you want to perform when touchmove is firing
|
||||
* @returns {Function} A function that removes the touchmove handler.
|
||||
*/
|
||||
addTouchMoveListener(handler) {
|
||||
if (!this.scrollElement) { return; }
|
||||
@ -229,7 +229,7 @@ export class Content extends Ion {
|
||||
* @param {number} y The y-value to scroll to.
|
||||
* @param {number} duration Duration of the scroll animation in ms.
|
||||
* @param {TODO} tolerance TODO
|
||||
* @returns {promise} Returns a promise when done
|
||||
* @returns {Promise} Returns a promise when done
|
||||
*/
|
||||
scrollTo(x: number, y: number, duration: number, tolerance?: number): Promise<any> {
|
||||
if (this._scrollTo) {
|
||||
@ -264,7 +264,7 @@ export class Content extends Ion {
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* @returns {promise} Returns a promise when done
|
||||
* @returns {Promise} Returns a promise when done
|
||||
*/
|
||||
scrollToTop() {
|
||||
if (this._scrollTo) {
|
||||
|
@ -135,7 +135,7 @@ export class MenuController {
|
||||
|
||||
/**
|
||||
* Progamatically open the Menu.
|
||||
* @return {promise} returns a promise when the menu is fully opened
|
||||
* @return {Promise} returns a promise when the menu is fully opened
|
||||
*/
|
||||
open(menuId?: string) {
|
||||
let menu = this.get(menuId);
|
||||
@ -147,7 +147,7 @@ export class MenuController {
|
||||
/**
|
||||
* Progamatically close the Menu.
|
||||
* @param {string} [menuId] Optionally get the menu by its id, or side.
|
||||
* @return {promise} returns a promise when the menu is fully closed
|
||||
* @return {Promise} returns a promise when the menu is fully closed
|
||||
*/
|
||||
close(menuId?: string) {
|
||||
let menu = this.get(menuId);
|
||||
@ -160,7 +160,7 @@ export class MenuController {
|
||||
* Toggle the menu. If it's closed, it will open, and if opened, it will
|
||||
* close.
|
||||
* @param {string} [menuId] Optionally get the menu by its id, or side.
|
||||
* @return {promise} returns a promise when the menu has been toggled
|
||||
* @return {Promise} returns a promise when the menu has been toggled
|
||||
*/
|
||||
toggle(menuId?: string) {
|
||||
let menu = this.get(menuId);
|
||||
@ -174,7 +174,7 @@ export class MenuController {
|
||||
* left menus, but only one of them should be able to be dragged open.
|
||||
* @param {boolean} shouldEnable True if it should be enabled, false if not.
|
||||
* @param {string} [menuId] Optionally get the menu by its id, or side.
|
||||
* @return {menu} Returns the instance of the menu, which is useful for chaining.
|
||||
* @return {Menu} Returns the instance of the menu, which is useful for chaining.
|
||||
*/
|
||||
enable(shouldEnable: boolean, menuId?: string) {
|
||||
let menu = this.get(menuId);
|
||||
@ -187,7 +187,7 @@ export class MenuController {
|
||||
* Used to enable or disable the ability to swipe open the menu.
|
||||
* @param {boolean} shouldEnable True if it should be swipe-able, false if not.
|
||||
* @param {string} [menuId] Optionally get the menu by its id, or side.
|
||||
* @return {menu} Returns the instance of the menu, which is useful for chaining.
|
||||
* @return {Menu} Returns the instance of the menu, which is useful for chaining.
|
||||
*/
|
||||
swipeEnable(shouldEnable: boolean, menuId?: string) {
|
||||
let menu = this.get(menuId);
|
||||
@ -199,7 +199,7 @@ export class MenuController {
|
||||
/**
|
||||
* Used to get a menu instance.
|
||||
* @param {string} [menuId] Optionally get the menu by its id, or side.
|
||||
* @return {menu} Returns the instance of the menu if found, otherwise `null`.
|
||||
* @return {Menu} Returns the instance of the menu if found, otherwise `null`.
|
||||
*/
|
||||
get(menuId?: string): Menu {
|
||||
if (menuId) {
|
||||
|
@ -177,10 +177,10 @@ export class NavController extends Ion {
|
||||
|
||||
/**
|
||||
* Set the root for the current navigation stack
|
||||
* @param {type} page The name of the component you want to push on the navigation stack
|
||||
* @param {Type} page The name of the component you want to push on the navigation stack
|
||||
* @param {object} [params={}] Any nav-params you want to pass along to the next view
|
||||
* @param {object} [opts={}] Any options you want to use pass to transtion
|
||||
* @returns {promise} Returns a promise when done
|
||||
* @returns {Promise} Returns a promise when done
|
||||
*/
|
||||
setRoot(page: Type, params: any = {}, opts: NavOptions = {}): Promise<any> {
|
||||
return this.setPages([{page, params}], opts);
|
||||
@ -255,9 +255,9 @@ export class NavController extends Ion {
|
||||
* }
|
||||
*```
|
||||
*
|
||||
* @param {array<type>} pages An arry of page components and their params to load in the stack
|
||||
* @param {array<Type>} pages An arry of page components and their params to load in the stack
|
||||
* @param {object} [opts={}] Any options you want to use pass
|
||||
* @returns {promise} Returns a promise when the pages are set
|
||||
* @returns {Promise} Returns a promise when the pages are set
|
||||
*/
|
||||
setPages(pages: Array<{page: Type, params?: any}>, opts: NavOptions = {}): Promise<any> {
|
||||
if (!pages || !pages.length) {
|
||||
@ -372,10 +372,10 @@ export class NavController extends Ion {
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* @param {type} page The page component class you want to push on to the navigation stack
|
||||
* @param {Type} page The page component class you want to push on to the navigation stack
|
||||
* @param {object} [params={}] Any nav-params you want to pass along to the next view
|
||||
* @param {object} [opts={}] Any options you want to use pass to transtion
|
||||
* @returns {promise} Returns a promise, which resolves when the transition has completed
|
||||
* @returns {Promise} Returns a promise, which resolves when the transition has completed
|
||||
*/
|
||||
push(page: Type, params: any = {}, opts: NavOptions = {}) {
|
||||
return this.insertPages(-1, [{page: page, params: params}], opts);
|
||||
@ -402,9 +402,9 @@ export class NavController extends Ion {
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @param {viewController} enteringView The name of the component you want to push on the navigation stack
|
||||
* @param {ViewController} enteringView The name of the component you want to push on the navigation stack
|
||||
* @param {object} [opts={}] Any options you want to use pass to transtion
|
||||
* @returns {promise} Returns a promise, which resolves when the transition has completed
|
||||
* @returns {Promise} Returns a promise, which resolves when the transition has completed
|
||||
*/
|
||||
present(enteringView: ViewController, opts: NavOptions = {}): Promise<any> {
|
||||
let rootNav = this.rootNav;
|
||||
@ -456,7 +456,7 @@ export class NavController extends Ion {
|
||||
* @param {Type} page The name of the component you want to insert into the nav stack
|
||||
* @param {object} [params={}] Any nav-params you want to pass along to the next page
|
||||
* @param {object} [opts={}] Any options you want to use pass to transtion
|
||||
* @returns {promise} Returns a promise when the page has been inserted into the navigation stack
|
||||
* @returns {Promise} Returns a promise when the page has been inserted into the navigation stack
|
||||
*/
|
||||
insert(insertIndex: number, page: Type, params: any = {}, opts: NavOptions = {}): Promise<any> {
|
||||
return this.insertPages(insertIndex, [{page: page, params: params}], opts);
|
||||
@ -486,9 +486,9 @@ export class NavController extends Ion {
|
||||
* in and become the active page.
|
||||
*
|
||||
* @param {number} insertIndex The index where you want to insert the page
|
||||
* @param {Array<{page: Type, params=: any}>} insertPages An array of objects, each with a `page` and optionally `params` property
|
||||
* @param {array<{page: Type, params=: any}>} insertPages An array of objects, each with a `page` and optionally `params` property
|
||||
* @param {object} [opts={}] Any options you want to use pass to transtion
|
||||
* @returns {promise} Returns a promise when the pages have been inserted into the navigation stack
|
||||
* @returns {Promise} Returns a promise when the pages have been inserted into the navigation stack
|
||||
*/
|
||||
insertPages(insertIndex: number, insertPages: Array<{page: Type, params?: any}>, opts: NavOptions = {}): Promise<any> {
|
||||
let views = insertPages.map(p => new ViewController(p.page, p.params));
|
||||
@ -618,7 +618,7 @@ export class NavController extends Ion {
|
||||
* ```
|
||||
*
|
||||
* @param {object} [opts={}] Any options you want to use pass to transtion
|
||||
* @returns {promise} Returns a promise when the transition is completed
|
||||
* @returns {Promise} Returns a promise when the transition is completed
|
||||
*/
|
||||
pop(opts: NavOptions = {}): Promise<any> {
|
||||
// get the index of the active view
|
||||
@ -639,7 +639,7 @@ export class NavController extends Ion {
|
||||
|
||||
/**
|
||||
* Pop to a specific view in the history stack
|
||||
* @param {viewController} view to pop to
|
||||
* @param {ViewController} view to pop to
|
||||
* @param {object} [opts={}] Any options you want to use pass to transtion
|
||||
*/
|
||||
popTo(view: ViewController, opts: NavOptions = {}): Promise<any> {
|
||||
@ -669,7 +669,7 @@ export class NavController extends Ion {
|
||||
* @param {number} [startIndex] The starting index to remove pages from the stack. Default is the index of the last page.
|
||||
* @param {number} [removeCount] The number of pages to remove, defaults to remove `1`.
|
||||
* @param {object} [opts={}] Any options you want to use pass to transtion.
|
||||
* @returns {promise} Returns a promise when the page has been removed.
|
||||
* @returns {Promise} Returns a promise when the page has been removed.
|
||||
*/
|
||||
remove(startIndex: number = -1, removeCount: number = 1, opts: NavOptions = {}): Promise<any> {
|
||||
if (startIndex === -1) {
|
||||
@ -1462,7 +1462,7 @@ export class NavController extends Ion {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @returns {viewController}
|
||||
* @returns {ViewController}
|
||||
*/
|
||||
getByState(state: string): ViewController {
|
||||
for (var i = this._views.length - 1; i >= 0; i--) {
|
||||
@ -1475,21 +1475,21 @@ export class NavController extends Ion {
|
||||
|
||||
/**
|
||||
* @param {number} index The index of the page you want to get
|
||||
* @returns {viewController} Returns the component that matches the index given
|
||||
* @returns {ViewController} Returns the component that matches the index given
|
||||
*/
|
||||
getByIndex(index: number): ViewController {
|
||||
return (index < this._views.length && index > -1 ? this._views[index] : null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {viewController} Returns the active page's view controller.
|
||||
* @returns {ViewController} Returns the active page's view controller.
|
||||
*/
|
||||
getActive(): ViewController {
|
||||
return this.getByState(STATE_ACTIVE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {viewController} view
|
||||
* @param {ViewController} view
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isActive(view: ViewController): boolean {
|
||||
@ -1497,7 +1497,7 @@ export class NavController extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {viewController} view The ViewController to get the previous view to
|
||||
* @param {ViewController} view The ViewController to get the previous view to
|
||||
* @returns {viewController}
|
||||
*/
|
||||
getPrevious(view: ViewController): ViewController {
|
||||
@ -1506,7 +1506,7 @@ export class NavController extends Ion {
|
||||
|
||||
/**
|
||||
* First page in this nav controller's stack.
|
||||
* @returns {viewController} Returns the first component page in the current stack
|
||||
* @returns {ViewController} Returns the first component page in the current stack
|
||||
*/
|
||||
first(): ViewController {
|
||||
return (this._views.length ? this._views[0] : null);
|
||||
@ -1514,14 +1514,14 @@ export class NavController extends Ion {
|
||||
|
||||
/**
|
||||
* Last page in this nav controller's stack. This would not return a page which is about to be destroyed.
|
||||
* @returns {viewController} Returns the last component page in the current stack
|
||||
* @returns {ViewController} Returns the last component page in the current stack
|
||||
*/
|
||||
last(): ViewController {
|
||||
return (this._views.length ? this._views[this._views.length - 1] : null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {viewController} view
|
||||
* @param {ViewController} view
|
||||
* @returns {number} Returns the index number of the view
|
||||
*/
|
||||
indexOf(view: ViewController): number {
|
||||
@ -1538,7 +1538,7 @@ export class NavController extends Ion {
|
||||
|
||||
/**
|
||||
* Returns the root NavController.
|
||||
* @returns {navController}
|
||||
* @returns {NavController}
|
||||
*/
|
||||
get rootNav(): NavController {
|
||||
let nav = this;
|
||||
|
@ -17,7 +17,7 @@ export class Option {
|
||||
private _value;
|
||||
|
||||
/**
|
||||
* @input {Any} Event to evaluate when option has changed
|
||||
* @input {any} Event to evaluate when option has changed
|
||||
*/
|
||||
@Output() select: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
|
@ -50,15 +50,6 @@ import {raf, ready, CSS} from '../../util/dom';
|
||||
* ```
|
||||
* @demo /docs/v2/demos/refresher/
|
||||
*
|
||||
* @property {string} [pullingIcon] - the icon you want to display when you begin to pull down
|
||||
* @property {string} [pullingText] - the text you want to display when you begin to pull down
|
||||
* @property {string} [refreshingIcon] - the icon you want to display when performing a refresh
|
||||
* @property {string} [refreshingText] - the text you want to display when performing a refresh
|
||||
*
|
||||
* @property {any} (refresh) - the methond on your class you want to perform when you refreshing
|
||||
* @property {any} (starting) - the methond on your class you want to perform when you start pulling down
|
||||
* @property {any} (pulling) - the methond on your class you want to perform when you are pulling down
|
||||
*
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ion-refresher',
|
||||
@ -174,22 +165,22 @@ export class Refresher {
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @input {string} the icon you want to display when you begin to pull down
|
||||
*/
|
||||
@Input() pullingIcon: string;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @input {string} the text you want to display when you begin to pull down
|
||||
*/
|
||||
@Input() pullingText: string;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @input {string} the icon you want to display when performing a refresh
|
||||
*/
|
||||
@Input() refreshingIcon: string;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @input {string} the text you want to display when performing a refresh
|
||||
*/
|
||||
@Input() refreshingText: string;
|
||||
|
||||
@ -200,17 +191,17 @@ export class Refresher {
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @output {any} the methond on your class you want to perform when you are pulling down
|
||||
*/
|
||||
@Output() pulling: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @output {any} the methond on your class you want to perform when you refreshing
|
||||
*/
|
||||
@Output() refresh: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @output {any} the methond on your class you want to perform when you start pulling down
|
||||
*/
|
||||
@Output() starting: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
|
@ -269,7 +269,7 @@ export class Tabs extends Ion {
|
||||
|
||||
/**
|
||||
* @param {number} index Index of the tab you want to get
|
||||
* @returns {Any} Tab Returs the tab who's index matches the one passed
|
||||
* @returns {any} Tab Returs the tab who's index matches the one passed
|
||||
*/
|
||||
getByIndex(index: number): any {
|
||||
if (index < this._tabs.length && index > -1) {
|
||||
@ -279,7 +279,7 @@ export class Tabs extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Any} Tab Returns the currently selected tab
|
||||
* @return {any} Tab Returns the currently selected tab
|
||||
*/
|
||||
getSelected(): Tab {
|
||||
for (let i = 0; i < this._tabs.length; i++) {
|
||||
|
Reference in New Issue
Block a user