• 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 */
15import { ElementName } from '../bundle/elementName';
16import rpc from './../@ohos.rpc';
17
18export interface ConnectOptions {
19  /**
20   * The callback interface was connect successfully.
21   *
22   * @default -
23   * @devices phone, tablet
24   * @since 7
25   * @SysCap aafwk
26   * @param elementName The element name of the service ability
27   * @param remoteObject The remote object instance
28   */
29  onConnect: (elementName: ElementName, remoteObject: RemoteObject) => void;
30
31  /**
32   * The callback interface was disconnect successfully.
33   *
34   * @default -
35   * @devices phone, tablet
36   * @since 7
37   * @SysCap aafwk
38   * @param elementName The element name of the service ability
39   */
40  onDisconnect: (elementName: ElementName) => void;
41
42  /**
43   * The callback interface was connect failed.
44   *
45   * @default -
46   * @devices phone, tablet
47   * @since 7
48   * @SysCap aafwk
49   * @param code The error code of the failed.
50   */
51  onFailed: (code: number) => void;
52}
53