import { HideLoadingOptions } from "./HideLoadingOptions"; import { HideToastOptions } from "./HideToastOptions"; import { ShowActionSheetOptions } from "./ShowActionSheetOptions"; import { ShowActionSheetResult } from "./ShowActionSheetResult"; import { ShowLoadingOptions } from "./ShowLoadingOptions"; import { ShowModalOptions } from "./ShowModalOptions"; import { ShowModalResult } from "./ShowModalResult"; import { ShowToastOptions } from "./ShowToastOptions"; export declare class InteractionAPI { /** * 显示操作菜单。 * @param options * @returns * * @example * ```javascript * const itemList = ['A', 'B', 'C']; * * ks.showActionSheet({ * itemList: itemList, * success(res) { * console.log('用户选择:', itemList[res.tapIndex]); * }, * fail(res) { * console.log(res.errMsg); * }, * }); * * ``` * */ showActionSheet(options: ShowActionSheetOptions): Promise; /** * 显示 loading 提示框。需主动调用 [ks.hideLoading](https://open.kuaishou.com/docs/develop/api-next/ui/interaction/ks.hideLoading) 才能关闭提示框。 * @param options * @returns * @example * ```javascript * ks.showLoading({ * title: '加载中', * }); * * setTimeout(function () { * ks.hideLoading(); * }, 2000); * * ``` * */ showLoading(options?: ShowLoadingOptions): Promise; /** * 隐藏 loading 提示框。 * @param options * @returns * @example * ```javascript * ks.showLoading({ * title: '加载中', * }); * * setTimeout(function () { * ks.hideLoading(); * }, 2000); * * ``` * */ hideLoading(options?: HideLoadingOptions): Promise; /** * 显示模态对话框。 * @param options * @returns * * @example * ```javascript * const { confirm, cancel } = await ks.showModal({ * title: '提示', * content: '这是一个模态弹窗', * }); * * if (confirm) { * console.log('用户点击确定'); * } else if (cancel) { * console.log('用户点击取消'); * } * * ``` * */ showModal(options: ShowModalOptions): Promise; /** * 显示消息提示框。 * @param options * @returns * @example * ```javascript * ks.showToast({ * title: '成功', * icon: 'success', * duration: 2000, * }); * * ``` * */ showToast(options: ShowToastOptions): Promise; /** * 隐藏消息提示框。 * @param options * @returns * @example * ```javascript * ks.hideToast(); * * ``` * */ hideToast(options?: HideToastOptions): Promise; }