• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022-2024 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
16/**
17 * @file
18 * @kit AbilityKit
19 */
20
21/**
22 * The result of requestPermissionsFromUser with asynchronous callback.
23 *
24 * @syscap SystemCapability.Security.AccessToken
25 * @stagemodelonly
26 * @since 9
27 */
28/**
29 * The result of requestPermissionsFromUser with asynchronous callback.
30 *
31 * @syscap SystemCapability.Security.AccessToken
32 * @stagemodelonly
33 * @crossplatform
34 * @since 10
35 */
36/**
37 * The result of requestPermissionsFromUser with asynchronous callback.
38 *
39 * @syscap SystemCapability.Security.AccessToken
40 * @stagemodelonly
41 * @crossplatform
42 * @atomicservice
43 * @since arkts {'1.1':'11', '1.2':'20'}
44 * @arkts 1.1&1.2
45 */
46declare class PermissionRequestResult {
47  /**
48   * The permissions passed in by the user.
49   *
50   * @type { Array<string> }
51   * @syscap SystemCapability.Security.AccessToken
52   * @stagemodelonly
53   * @since 9
54   */
55  /**
56   * The permissions passed in by the user.
57   *
58   * @type { Array<string> }
59   * @syscap SystemCapability.Security.AccessToken
60   * @stagemodelonly
61   * @crossplatform
62   * @since 10
63   */
64  /**
65   * The permissions passed in by the user.
66   *
67   * @type { Array<string> }
68   * @syscap SystemCapability.Security.AccessToken
69   * @stagemodelonly
70   * @crossplatform
71   * @atomicservice
72   * @since arkts {'1.1':'11', '1.2':'20'}
73   * @arkts 1.1&1.2
74   */
75  permissions: Array<string>;
76
77  /**
78   * The results for the corresponding request permissions. The value 0 indicates that a
79   * permission is granted, the value -1 indicates not, and the value 2 indicates the request is invalid.
80   *
81   * @type { Array<int> }
82   * @syscap SystemCapability.Security.AccessToken
83   * @stagemodelonly
84   * @since 9
85   */
86  /**
87   * The results for the corresponding request permissions. The value 0 indicates that a
88   * permission is granted, the value -1 indicates not, and the value 2 indicates the request is invalid.
89   *
90   * @type { Array<int> }
91   * @syscap SystemCapability.Security.AccessToken
92   * @stagemodelonly
93   * @crossplatform
94   * @since 10
95   */
96  /**
97   * The results for the corresponding request permissions. The value 0 indicates that a
98   * permission is granted, the value -1 indicates not, and the value 2 indicates the request is invalid.
99   *
100   * @type { Array<int> }
101   * @syscap SystemCapability.Security.AccessToken
102   * @stagemodelonly
103   * @crossplatform
104   * @atomicservice
105   * @since arkts {'1.1':'11', '1.2':'20'}
106   * @arkts 1.1&1.2
107   */
108  authResults: Array<int>;
109
110  /**
111   * Specifies whether a dialog box is shown for each requested permission.
112   * The value true means that a dialog box is shown, and false means the opposite.
113   *
114   * @type { ?Array<boolean> }
115   * @syscap SystemCapability.Security.AccessToken
116   * @stagemodelonly
117   * @atomicservice
118   * @since arkts {'1.1':'12', '1.2':'20'}
119   * @arkts 1.1&1.2
120   */
121  dialogShownResults?: Array<boolean>;
122
123  /**
124   * Enumerates the return values of the permission request operation.
125   *   0  The operation is successful.
126   *   1  The permission name is invalid.
127   *   2  The requested permission has not been declared.
128   *   3  The conditions for requesting the permission are not met.
129   *   4  The user does not agree to the Privacy Statement.
130   *   5  The permission cannot be requested in a pop-up window.
131   *   12 The service is abnormal.
132   *
133   * @type { ?Array<int> }
134   * @syscap SystemCapability.Security.AccessToken
135   * @stagemodelonly
136   * @crossplatform
137   * @atomicservice
138   * @since arkts {'1.1':'18', '1.2':'20'}
139   * @arkts 1.1&1.2
140   */
141  errorReasons?: Array<int>;
142}
143
144export default PermissionRequestResult;
145