mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 04:53:58 +08:00
chore(): add types to ActionSheet
This commit is contained in:
@ -76,7 +76,12 @@ import {Animation} from '../../animations/animation';
|
|||||||
*/
|
*/
|
||||||
export class ActionSheet extends ViewController {
|
export class ActionSheet extends ViewController {
|
||||||
|
|
||||||
constructor(opts: any = {}) {
|
constructor(opts: {
|
||||||
|
title?: string,
|
||||||
|
subTitle?: string,
|
||||||
|
cssClass?: string,
|
||||||
|
buttons?: Array<any>
|
||||||
|
} = {}) {
|
||||||
opts.buttons = opts.buttons || [];
|
opts.buttons = opts.buttons || [];
|
||||||
|
|
||||||
super(ActionSheetCmp, opts);
|
super(ActionSheetCmp, opts);
|
||||||
@ -94,28 +99,33 @@ import {Animation} from '../../animations/animation';
|
|||||||
/**
|
/**
|
||||||
* @param {string} title Action sheet title
|
* @param {string} title Action sheet title
|
||||||
*/
|
*/
|
||||||
setTitle(title) {
|
setTitle(title: string) {
|
||||||
this.data.title = title;
|
this.data.title = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} subTitle Action sheet subtitle
|
* @param {string} subTitle Action sheet subtitle
|
||||||
*/
|
*/
|
||||||
setSubTitle(subTitle) {
|
setSubTitle(subTitle: string) {
|
||||||
this.data.subTitle = subTitle;
|
this.data.subTitle = subTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Object} button Action sheet button
|
* @param {object} button Action sheet button
|
||||||
*/
|
*/
|
||||||
addButton(button) {
|
addButton(button) {
|
||||||
this.data.buttons.push(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<any>
|
||||||
|
} = {}) {
|
||||||
return new ActionSheet(opts);
|
return new ActionSheet(opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,7 +168,7 @@ class ActionSheetCmp {
|
|||||||
constructor(
|
constructor(
|
||||||
private _viewCtrl: ViewController,
|
private _viewCtrl: ViewController,
|
||||||
private _config: Config,
|
private _config: Config,
|
||||||
private elementRef: ElementRef,
|
elementRef: ElementRef,
|
||||||
params: NavParams,
|
params: NavParams,
|
||||||
renderer: Renderer
|
renderer: Renderer
|
||||||
) {
|
) {
|
||||||
@ -188,7 +198,7 @@ class ActionSheetCmp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dismiss() {
|
dismiss() {
|
||||||
this._viewCtrl.dismiss();
|
this._viewCtrl.dismiss(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
onPageLoaded() {
|
onPageLoaded() {
|
||||||
|
Reference in New Issue
Block a user