From 52a0dc9b29c090008972eee3dc71d512c259eb70 Mon Sep 17 00:00:00 2001 From: zhouzhichao Date: Tue, 29 Nov 2022 12:14:10 +0800 Subject: [PATCH] add grantUriPermission interface Signed-off-by: zhouzhichao --- api/@ohos.fileshare.d.ts | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 api/@ohos.fileshare.d.ts diff --git a/api/@ohos.fileshare.d.ts b/api/@ohos.fileshare.d.ts new file mode 100644 index 0000000000..973734d1d9 --- /dev/null +++ b/api/@ohos.fileshare.d.ts @@ -0,0 +1,43 @@ +/* +* Copyright (C) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import {AsyncCallback, Callback} from "./basic"; + +/** + * Provides fileshare APIS + * + * @since 9 + * @syscap SystemCapability.FileManagement.AppFileService + */ +declare namespace fileShare { + +/** + * Provides grant uri permission for app + * + * @since 9 + * @param {string} uri uri + * @param {string} bundleName bundleName + * @param {number} mode mode to uri + * @throws { BusinessError } 201 - Permission verification failed. + * @throws { BusinessError } 401 - The input parameter is invalid. + * @throws { BusinessError } 142000001 - IPC error. + * @syscap SystemCapability.FileManagement.AppFileService + * @systemapi + */ +function grantUriPermission(uri: string, bundleName: string, mode: number, callback: AsyncCallback): void; +function grantUriPermission(uri: string, bundleName: string, mode: number): Promise; +} + +export default fileShare; -- Gitee