• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2023 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 */
19
20/**
21 * A utility class used for handling objects that use the DataAbilityHelper scheme.
22 *
23 * @namespace dataUriUtils
24 * @syscap SystemCapability.Ability.AbilityRuntime.Core
25 * @since 7
26 * @deprecated since 9
27 * @useinstead ohos.app.ability.dataUriUtils/dataUriUtils
28 */
29declare namespace dataUriUtils {
30  /**
31   * Obtains the ID attached to the end of the path component of the given uri.
32   *
33   * @param { string } uri - Indicates the uri object from which the ID is to be obtained.
34   * @returns { number } Returns the ID attached to the end of the path component;
35   * @syscap SystemCapability.Ability.AbilityRuntime.Core
36   * @since 7
37   * @deprecated since 9
38   * @useinstead ohos.app.ability.dataUriUtils/dataUriUtils#getId
39   */
40  function getId(uri: string): number;
41
42  /**
43   * Attaches the given ID to the end of the path component of the given uri.
44   *
45   * @param { string } uri - Indicates the uri string from which the ID is to be obtained.
46   * @param { number } id - Indicates the ID to attach.
47   * @returns { string } Returns the uri object with the given ID attached.
48   * @syscap SystemCapability.Ability.AbilityRuntime.Core
49   * @since 7
50   * @deprecated since 9
51   * @useinstead ohos.app.ability.dataUriUtils/dataUriUtils#attachId
52   */
53  function attachId(uri: string, id: number): string;
54
55  /**
56   * Deletes the ID from the end of the path component of the given uri.
57   *
58   * @param { string } uri - Indicates the uri object from which the ID is to be deleted.
59   * @returns { string } Returns the uri object with the ID deleted.
60   * @syscap SystemCapability.Ability.AbilityRuntime.Core
61   * @since 7
62   * @deprecated since 9
63   * @useinstead ohos.app.ability.dataUriUtils/dataUriUtils#deleteId
64   */
65  function deleteId(uri: string): string;
66
67  /**
68   * Updates the ID in the specified uri
69   *
70   * @param { string } uri - Indicates the uri object to be updated.
71   * @param { number } id - Indicates the new ID.
72   * @returns { string } Returns the updated uri object.
73   * @syscap SystemCapability.Ability.AbilityRuntime.Core
74   * @since 7
75   * @deprecated since 9
76   * @useinstead ohos.app.ability.dataUriUtils/dataUriUtils#updateId
77   */
78  function updateId(uri: string, id: number): string;
79}
80export default dataUriUtils;
81