From 7f19ba5396c2140e26fddea35dac78c589fe9b0c Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Wed, 13 Jan 2016 23:22:45 -0600 Subject: [PATCH] chore(): add types to ActionSheet --- ionic/components/action-sheet/action-sheet.ts | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/ionic/components/action-sheet/action-sheet.ts b/ionic/components/action-sheet/action-sheet.ts index 3241822b8a..62110ff08f 100644 --- a/ionic/components/action-sheet/action-sheet.ts +++ b/ionic/components/action-sheet/action-sheet.ts @@ -76,7 +76,12 @@ import {Animation} from '../../animations/animation'; */ export class ActionSheet extends ViewController { - constructor(opts: any = {}) { + constructor(opts: { + title?: string, + subTitle?: string, + cssClass?: string, + buttons?: Array + } = {}) { opts.buttons = opts.buttons || []; super(ActionSheetCmp, opts); @@ -94,28 +99,33 @@ import {Animation} from '../../animations/animation'; /** * @param {string} title Action sheet title */ - setTitle(title) { + setTitle(title: string) { this.data.title = title; } /** * @param {string} subTitle Action sheet subtitle */ - setSubTitle(subTitle) { + setSubTitle(subTitle: string) { this.data.subTitle = subTitle; } /** - * @param {Object} button Action sheet button + * @param {object} button Action sheet button */ addButton(button) { this.data.buttons.push(button); } /** - * @param {Object} opts Action sheet options + * @param {object} opts Action sheet options */ - static create(opts={}) { + static create(opts: { + title?: string, + subTitle?: string, + cssClass?: string, + buttons?: Array + } = {}) { return new ActionSheet(opts); } @@ -158,7 +168,7 @@ class ActionSheetCmp { constructor( private _viewCtrl: ViewController, private _config: Config, - private elementRef: ElementRef, + elementRef: ElementRef, params: NavParams, renderer: Renderer ) { @@ -188,7 +198,7 @@ class ActionSheetCmp { } dismiss() { - this._viewCtrl.dismiss(); + this._viewCtrl.dismiss(null); } onPageLoaded() {