• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2* Copyright (C) 2021 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
16import {AsyncCallback, Callback} from "./basic";
17/**
18 * Provides Environment APIs.
19 *
20 * @since 9
21 * @syscap SystemCapability.FileManagement.File.DistributeFile
22 */
23declare namespace SendFile {
24  /**
25   * send file.
26   *
27   * @since 9
28   */
29  function sendFile(deviceId: string, sourPath: Array<string>, destPath: Array<string>, fileCount: number, callback: AsyncCallback<number>);
30  function sendFile(deviceId: string, sourPath: Array<string>, destPath: Array<string>, fileCount: number): Promise<number>;
31
32  export interface TransResult {
33    /**
34     * send file error code.
35     */
36    errCode: number;
37    /**
38     * receive file full path.
39     */
40    fileName: Array<string>;
41    /**
42     * receive file count.
43     */
44    fileCount: number;
45  }
46  /**
47   * event listen on.
48   *
49   * @since 9
50   */
51  function on(type: 'sendFinished' | 'receiveFinished', callback: AsyncCallback<TransResult>): void;
52  /**
53   * event listen off.
54   *
55   * @since 9
56   */
57  function off(type: 'sendFinished' | 'receiveFinished'): void;
58}
59
60export default SendFile;
61