• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16import { DialogAlignment } from "./alert_dialog";
17import {CommonMethod, Resource} from "./common"
18
19interface SheetInfo {
20  title: string | Resource;
21  icon?: string | Resource;
22  action: () => void;
23}
24
25export declare class ActionSheetExtend<T> extends ActionSheetAttribute<T> {
26}
27
28interface ActionSheet extends ActionSheetAttribute<ActionSheet> {
29}
30
31declare class ActionSheetAttribute<T> extends CommonMethod<T> {
32  show(value: {
33    title: string | Resource;
34    message: string | Resource;
35    confirm?: {
36      value: string | Resource;
37      action: () => void;
38    };
39    cancel?: () => void;
40    sheets: Array<SheetInfo>;
41    autoCancel?: boolean;
42    alignment?: DialogAlignment;
43    offset?: { dx: number | string | Resource, dy: number | string | Resource };
44  });
45}
46
47export declare const ActionSheetInterface: ActionSheet;
48