• 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 {CommonMethod, Resource} from "./common"
17
18export declare enum DialogAlignment {
19  Top,
20  Center,
21  Bottom,
22  Default
23}
24
25interface AlertDialog {
26  show(value: {
27    title?: string | Resource;
28    message: string | Resource;
29    autoCancel?: boolean;
30    confirm?: {
31      value: string | Resource;
32      action: () => void;
33    };
34    cancel?: () => void;
35    alignment?: DialogAlignment;
36    offset?: { dx: number | string | Resource, dy: number | string | Resource };
37  } | {
38    title?: string | Resource;
39    message: string | Resource;
40    autoCancel?: boolean;
41    primaryButton: {
42      value: string | Resource;
43      action: () => void;
44    };
45    secondaryButton: {
46      value: string | Resource;
47      action: () => void;
48    };
49    cancel?: () => void;
50    alignment?: DialogAlignment;
51    offset?: { dx: number | string | Resource, dy: number | string | Resource };
52  });
53}
54
55export declare const AlertDialogInterface: AlertDialog;
56