• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 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 BasicServicesKit
19 */
20
21import type rpc from './@ohos.rpc';
22import type Want from './@ohos.app.ability.Want';
23import type SelectionExtensionContext from './@ohos.selectionInput.SelectionExtensionContext';
24
25/**
26 * Defines the class of the ExtensionAbility for word selection.
27 * @syscap SystemCapability.SelectionInput.Selection
28 * @systemapi
29 * @since 20
30 */
31
32export default class SelectionExtensionAbility {
33  /**
34   * Context of the ExtensionAbility.
35   * @type { SelectionExtensionContext }
36   * @syscap SystemCapability.SelectionInput.Selection
37   * @systemapi
38   * @since 20
39   */
40  context: SelectionExtensionContext;
41
42  /**
43   * Callback invoked when the ExtensionAbility is initialized.
44   * @param { Want } want Want object used to initialize the ExtensionAbility.
45   * @returns { rpc.RemoteObject } RPC remote connection object.
46   * @syscap SystemCapability.SelectionInput.Selection
47   * @systemapi
48   * @since 20
49   */
50  onConnect(want: Want): rpc.RemoteObject;
51
52  /**
53   * Callback invoked when the ExtensionAbility is disconnected.
54   * @syscap SystemCapability.SelectionInput.Selection
55   * @systemapi
56   * @since 20
57   */
58  onDisconnect(): void;
59}