taro-hooks
Version:
为 Taro 而设计的 Hooks Library
13 lines (12 loc) • 564 B
TypeScript
import type { PromiseOptionalAction, ExcludeOption } from '../type';
export type ActionSheetOption = Partial<ExcludeOption<Taro.showActionSheet.Option>>;
export type ActionSheetResult = Taro.showActionSheet.SuccessCallbackResult;
export type ActionSheetTapItem = Omit<ActionSheetResult, 'errMsg'> & {
tapItem: string;
};
export type Show = PromiseOptionalAction<ActionSheetOption, ActionSheetTapItem>;
declare function useActionSheet(option?: ActionSheetOption): {
tapItem: ActionSheetTapItem | undefined;
show: Show;
};
export default useActionSheet;