• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2023 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 * Defines the text data detector type.
18 *
19 * @enum { number }
20 * @syscap SystemCapability.ArkUI.ArkUI.Full
21 * @since 11
22 */
23declare enum TextDataDetectorType {
24  /**
25   * Detector type phone number.
26   *
27   * @syscap SystemCapability.ArkUI.ArkUI.Full
28   * @since 11
29   */
30  PHONE_NUMBER = 0,
31
32  /**
33   * Detector type URL.
34   *
35   * @syscap SystemCapability.ArkUI.ArkUI.Full
36   * @since 11
37   */
38  URL = 1,
39
40  /**
41   * Detector type email.
42   *
43   * @syscap SystemCapability.ArkUI.ArkUI.Full
44   * @since 11
45   */
46  EMAIL = 2,
47
48  /**
49   * Detector type address.
50   *
51   * @syscap SystemCapability.ArkUI.ArkUI.Full
52   * @since 11
53   */
54  ADDRESS = 3,
55}
56
57/**
58 * Text data detector config.
59 *
60 * @interface TextDataDetectorConfig
61 * @syscap SystemCapability.ArkUI.ArkUI.Full
62 * @since 11
63 */
64declare interface TextDataDetectorConfig {
65  /**
66   * Text data detector types.
67   *
68   * @type { TextDataDetectorType[] }
69   * @syscap SystemCapability.ArkUI.ArkUI.Full
70   * @since 11
71   */
72  types: TextDataDetectorType[]
73
74  /**
75   * Text data detect result callback.
76   *
77   * @type { ?function }
78   * @syscap SystemCapability.ArkUI.ArkUI.Full
79   * @since 11
80   */
81  onDetectResultUpdate?: (result: string) => void
82}
83