Files
ionic-framework/core/src/components/action-sheet/action-sheet-interface.ts
2024-02-07 11:48:46 -05:00

38 lines
1.0 KiB
TypeScript

import type { AnimationBuilder, LiteralUnion, Mode } from '../../interface';
export interface ActionSheetOptions {
header?: string;
subHeader?: string;
cssClass?: string | string[];
buttons: (ActionSheetButton | string)[];
backdropDismiss?: boolean;
translucent?: boolean;
animated?: boolean;
mode?: Mode;
keyboardClose?: boolean;
id?: string;
htmlAttributes?: { [key: string]: any };
enterAnimation?: AnimationBuilder;
leaveAnimation?: AnimationBuilder;
}
export interface ActionSheetButton<T = any> {
text?: string;
role?: LiteralUnion<'cancel' | 'destructive' | 'selected', string>;
icon?: string;
cssClass?: string | string[];
id?: string;
htmlAttributes?: { [key: string]: any };
handler?: () => boolean | void | Promise<boolean | void>;
data?: T;
/**
* When `disabled` is `true` the action
* sheet button will not be interactive. Note
* that buttons with a 'cancel' role cannot
* be disabled as that would make it difficult for
* users to dismiss the action sheet.
*/
disabled?: boolean;
}