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