1/* 2 * Copyright (c) 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 LocalizationKit 19 */ 20 21import { Resource as _Resource } from './global/resource'; 22import { SendableResource as _SendableResource } from './global/sendableResource'; 23 24/** 25 * Provides sendable resource related APIs. 26 * 27 * @namespace sendableResourceManager 28 * @syscap SystemCapability.Global.ResourceManager 29 * @crossplatform 30 * @atomicservice 31 * @since 12 32 */ 33declare namespace sendableResourceManager { 34 35 /** 36 * Convert the resource object to a sendable resource object. 37 * 38 * @param { Resource } resource - The resource object. 39 * @returns { SendableResource } The sendable resource object is returned. 40 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 41 * 2.Parameter verification failed. 42 * @syscap SystemCapability.Global.ResourceManager 43 * @crossplatform 44 * @atomicservice 45 * @since 12 46 */ 47 export function resourceToSendableResource(resource: Resource): SendableResource; 48 49 /** 50 * Convert the sendable resource object to a resource object. 51 * 52 * @param { SendableResource } resource - The sendable resource object. 53 * @returns { Resource } The resource object is returned. 54 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 55 * 2.Parameter verification failed. 56 * @syscap SystemCapability.Global.ResourceManager 57 * @crossplatform 58 * @atomicservice 59 * @since 12 60 */ 61 export function sendableResourceToResource(resource: SendableResource): Resource; 62 63 /** 64 * Contains resource descriptor information. 65 * 66 * @typedef {_Resource} 67 * @syscap SystemCapability.Global.ResourceManager 68 * @crossplatform 69 * @atomicservice 70 * @since 12 71 */ 72 export type Resource = _Resource; 73 74 /** 75 * Contains sendable resource descriptor information. 76 * 77 * @typedef {_SendableResource} 78 * @syscap SystemCapability.Global.ResourceManager 79 * @crossplatform 80 * @atomicservice 81 * @since 12 82 */ 83 export type SendableResource = _SendableResource; 84 85} export default sendableResourceManager;