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