• 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 AbilityKit
19 */
20
21import insightIntent from './@ohos.app.ability.insightIntent';
22
23/**
24 * Declare interface of IntentDecoratorInfo.
25 *
26 * @interface IntentDecoratorInfo
27 * @syscap SystemCapability.Ability.AbilityRuntime.Core
28 * @stagemodelonly
29 * @atomicservice
30 * @since 20
31 */
32declare interface IntentDecoratorInfo {
33  /**
34   * The intent name.
35   *
36   * @type { string }
37   * @syscap SystemCapability.Ability.AbilityRuntime.Core
38   * @stagemodelonly
39   * @atomicservice
40   * @since 20
41   */
42  intentName: string;
43
44  /**
45   * The intent domain.
46   *
47   * @type { string }
48   * @syscap SystemCapability.Ability.AbilityRuntime.Core
49   * @stagemodelonly
50   * @atomicservice
51   * @since 20
52   */
53  domain: string;
54
55  /**
56   * The intent version.
57   *
58   * @type { string }
59   * @syscap SystemCapability.Ability.AbilityRuntime.Core
60   * @stagemodelonly
61   * @atomicservice
62   * @since 20
63   */
64  intentVersion: string;
65
66  /**
67   * The display name of intent.
68   *
69   * @type { string }
70   * @syscap SystemCapability.Ability.AbilityRuntime.Core
71   * @stagemodelonly
72   * @atomicservice
73   * @since 20
74   */
75  displayName: string;
76
77  /**
78   * The display description of intent.
79   *
80   * @type { ?string }
81   * @syscap SystemCapability.Ability.AbilityRuntime.Core
82   * @stagemodelonly
83   * @atomicservice
84   * @since 20
85   */
86  displayDescription?: string;
87
88  /**
89   * The schema of intent, indicates a standard intent.
90   *
91   * @type { ?string }
92   * @syscap SystemCapability.Ability.AbilityRuntime.Core
93   * @stagemodelonly
94   * @atomicservice
95   * @since 20
96   */
97  schema?: string;
98
99  /**
100   * The icon of intent, the string type indicates an online resource, and the Resource type indicates a local resource.
101   * The value of Resource type must be a literal.
102   *
103   * @type { ?ResourceStr }
104   * @syscap SystemCapability.Ability.AbilityRuntime.Core
105   * @stagemodelonly
106   * @atomicservice
107   * @since 20
108   */
109  icon?: ResourceStr;
110
111  /**
112   * The large language model description of intent.
113   *
114   * @type { ?string }
115   * @syscap SystemCapability.Ability.AbilityRuntime.Core
116   * @stagemodelonly
117   * @atomicservice
118   * @since 20
119   */
120  llmDescription?: string;
121
122  /**
123   * The search keywords of intent.
124   *
125   * @type { ?string[] }
126   * @syscap SystemCapability.Ability.AbilityRuntime.Core
127   * @stagemodelonly
128   * @atomicservice
129   * @since 20
130   */
131  keywords?: string[];
132
133  /**
134   * The parameters of intent.
135   *
136   * @type { ?Record<string, Object> }
137   * @syscap SystemCapability.Ability.AbilityRuntime.Core
138   * @stagemodelonly
139   * @atomicservice
140   * @since 20
141   */
142  parameters?: Record<string, Object>;
143
144  /**
145   * The type definition of the result returned by intent call.
146   *
147   * @type { ?Record<string, Object> }
148   * @syscap SystemCapability.Ability.AbilityRuntime.Core
149   * @stagemodelonly
150   * @atomicservice
151   * @since 20
152   */
153  result?: Record<string, Object>;
154}
155
156/**
157 * Declare interface of LinkIntentDecoratorInfo.
158 *
159 * @extends IntentDecoratorInfo
160 * @interface LinkIntentDecoratorInfo
161 * @syscap SystemCapability.Ability.AbilityRuntime.Core
162 * @stagemodelonly
163 * @atomicservice
164 * @since 20
165 */
166declare interface LinkIntentDecoratorInfo extends IntentDecoratorInfo {
167  /**
168   * The uri of a link.
169   *
170   * @type { string }
171   * @syscap SystemCapability.Ability.AbilityRuntime.Core
172   * @stagemodelonly
173   * @atomicservice
174   * @since 20
175   */
176  uri: string;
177
178  /**
179   * The parameters mapping of a link.
180   *
181   * @type { ?LinkIntentParamMapping[] }
182   * @syscap SystemCapability.Ability.AbilityRuntime.Core
183   * @stagemodelonly
184   * @atomicservice
185   * @since 20
186   */
187  paramMappings?: LinkIntentParamMapping[];
188}
189
190/**
191 * Enum definition of the paramCategory {@link #LinkIntentParamMapping#paramCategory},
192 * paramCategory is an attribute of LinkIntentParamMapping and
193 * used in InsightIntentLink {@link #InsightIntentLink}.
194 *
195 * @enum { string }
196 * @syscap SystemCapability.Ability.AbilityRuntime.Core
197 * @stagemodelonly
198 * @atomicservice
199 * @since 20
200 */
201declare enum LinkParamCategory {
202  /**
203   * The parameter will added to the end of link uri.
204   *
205   * @syscap SystemCapability.Ability.AbilityRuntime.Core
206   * @stagemodelonly
207   * @atomicservice
208   * @since 20
209   */
210  LINK = 'link',
211
212  /**
213   * The parameter will transferred to the application as parameters of want.
214   *
215   * @syscap SystemCapability.Ability.AbilityRuntime.Core
216   * @stagemodelonly
217   * @atomicservice
218   * @since 20
219   */
220  WANT = 'want',
221}
222
223/**
224 * Declare interface of LinkIntentParamMapping.
225 *
226 * @interface LinkIntentParamMapping
227 * @syscap SystemCapability.Ability.AbilityRuntime.Core
228 * @stagemodelonly
229 * @atomicservice
230 * @since 20
231 */
232declare interface LinkIntentParamMapping {
233  /**
234   * The parameter name.
235   *
236   * @type { string }
237   * @syscap SystemCapability.Ability.AbilityRuntime.Core
238   * @stagemodelonly
239   * @atomicservice
240   * @since 20
241   */
242  paramName: string;
243
244  /**
245   * The parameter mapping name.
246   *
247   * @type { ?string }
248   * @syscap SystemCapability.Ability.AbilityRuntime.Core
249   * @stagemodelonly
250   * @atomicservice
251   * @since 20
252   */
253  paramMappingName?: string;
254
255  /**
256   * The parameter category.
257   *
258   * @type { ?LinkParamCategory }
259   * @syscap SystemCapability.Ability.AbilityRuntime.Core
260   * @stagemodelonly
261   * @atomicservice
262   * @since 20
263   */
264  paramCategory?: LinkParamCategory;
265}
266
267/**
268 * Define InsightIntentLink.
269 *
270 * @type { ((intentInfo: LinkIntentDecoratorInfo) => ClassDecorator) }
271 * @syscap SystemCapability.Ability.AbilityRuntime.Core
272 * @stagemodelonly
273 * @atomicservice
274 * @since 20
275 */
276export declare const InsightIntentLink: ((intentInfo: LinkIntentDecoratorInfo) => ClassDecorator);
277
278/**
279 * Declare interface of PageIntentDecoratorInfo.
280 *
281 * @extends IntentDecoratorInfo
282 * @interface PageIntentDecoratorInfo
283 * @syscap SystemCapability.Ability.AbilityRuntime.Core
284 * @stagemodelonly
285 * @atomicservice
286 * @since 20
287 */
288declare interface PageIntentDecoratorInfo extends IntentDecoratorInfo {
289  /**
290   * The uiability name bound to the intent.
291   *
292   * @type { ?string }
293   * @syscap SystemCapability.Ability.AbilityRuntime.Core
294   * @stagemodelonly
295   * @atomicservice
296   * @since 20
297   */
298  uiAbility?: string;
299
300  /**
301   * The page path bound to the intent.
302   *
303   * @type { string }
304   * @syscap SystemCapability.Ability.AbilityRuntime.Core
305   * @stagemodelonly
306   * @atomicservice
307   * @since 20
308   */
309  pagePath: string;
310
311  /**
312   * The navigation Id bound to the intent.
313   *
314   * @type { ?string }
315   * @syscap SystemCapability.Ability.AbilityRuntime.Core
316   * @stagemodelonly
317   * @atomicservice
318   * @since 20
319   */
320  navigationId?: string;
321
322  /**
323   * The navigation destination name bound to the intent.
324   *
325   * @type { ?string }
326   * @syscap SystemCapability.Ability.AbilityRuntime.Core
327   * @stagemodelonly
328   * @atomicservice
329   * @since 20
330   */
331  navDestinationName?: string;
332}
333
334/**
335 * Define InsightIntentPage.
336 *
337 * @type { ((intentInfo: PageIntentDecoratorInfo) => ClassDecorator) }
338 * @syscap SystemCapability.Ability.AbilityRuntime.Core
339 * @stagemodelonly
340 * @atomicservice
341 * @since 20
342 */
343export declare const InsightIntentPage: ((intentInfo: PageIntentDecoratorInfo) => ClassDecorator);
344
345/**
346 * Declare interface of FunctionIntentDecoratorInfo.
347 *
348 * @extends IntentDecoratorInfo
349 * @interface FunctionIntentDecoratorInfo
350 * @syscap SystemCapability.Ability.AbilityRuntime.Core
351 * @stagemodelonly
352 * @atomicservice
353 * @since 20
354 */
355declare interface FunctionIntentDecoratorInfo extends IntentDecoratorInfo {}
356
357/**
358 * Define InsightIntentFunctionMethod.
359 *
360 * @type { ((intentInfo: FunctionIntentDecoratorInfo) => MethodDecorator) }
361 * @syscap SystemCapability.Ability.AbilityRuntime.Core
362 * @stagemodelonly
363 * @atomicservice
364 * @since 20
365 */
366export declare const InsightIntentFunctionMethod: ((intentInfo: FunctionIntentDecoratorInfo) => MethodDecorator);
367
368/**
369 * Define InsightIntentFunction.
370 *
371 * @type { (() => ClassDecorator) }
372 * @syscap SystemCapability.Ability.AbilityRuntime.Core
373 * @stagemodelonly
374 * @atomicservice
375 * @since 20
376 */
377export declare const InsightIntentFunction: (() => ClassDecorator);
378
379/**
380 * Declare interface of EntryIntentDecoratorInfo.
381 *
382 * @extends IntentDecoratorInfo
383 * @interface EntryIntentDecoratorInfo
384 * @syscap SystemCapability.Ability.AbilityRuntime.Core
385 * @stagemodelonly
386 * @atomicservice
387 * @since 20
388 */
389declare interface EntryIntentDecoratorInfo extends IntentDecoratorInfo {
390  /**
391   * The ability name bound to the intent.
392   *
393   * @type { string }
394   * @syscap SystemCapability.Ability.AbilityRuntime.Core
395   * @stagemodelonly
396   * @atomicservice
397   * @since 20
398   */
399  abilityName: string;
400
401  /**
402   * The execute mode of the intent.
403   * For UIAbility, the parameter can be set to insightIntent.ExecuteMode.UI_ABILITY_FOREGROUND or
404   * insightIntent.ExecuteMode.UI_ABILITY_BACKGROUND or both of them.
405   *
406   * @type { insightIntent.ExecuteMode[] }
407   * @syscap SystemCapability.Ability.AbilityRuntime.Core
408   * @stagemodelonly
409   * @atomicservice
410   * @since 20
411   */
412  executeMode: insightIntent.ExecuteMode[];
413}
414
415/**
416 * Define InsightIntentEntry.
417 *
418 * @type { ((intentInfo: EntryIntentDecoratorInfo) => ClassDecorator) }
419 * @syscap SystemCapability.Ability.AbilityRuntime.Core
420 * @stagemodelonly
421 * @atomicservice
422 * @since 20
423 */
424export declare const InsightIntentEntry: ((intentInfo: EntryIntentDecoratorInfo) => ClassDecorator);
425
426/**
427 * Declare interface of FormIntentDecoratorInfo.
428 *
429 * @extends IntentDecoratorInfo
430 * @interface FormIntentDecoratorInfo
431 * @syscap SystemCapability.Ability.AbilityRuntime.Core
432 * @stagemodelonly
433 * @atomicservice
434 * @since 20
435 */
436declare interface FormIntentDecoratorInfo extends IntentDecoratorInfo {
437  /**
438   * The form name bound to the intent.
439   *
440   * @type { string }
441   * @syscap SystemCapability.Ability.AbilityRuntime.Core
442   * @stagemodelonly
443   * @atomicservice
444   * @since 20
445   */
446  formName: string;
447}
448
449/**
450 * Define InsightIntentForm.
451 *
452 * @type { ((intentInfo: FormIntentDecoratorInfo) => ClassDecorator) }
453 * @syscap SystemCapability.Ability.AbilityRuntime.Core
454 * @stagemodelonly
455 * @atomicservice
456 * @since 20
457 */
458export declare const InsightIntentForm: ((intentInfo: FormIntentDecoratorInfo) => ClassDecorator);
459
460/**
461 * Declare interface of IntentEntityDecoratorInfo.
462 *
463 * @interface IntentEntityDecoratorInfo
464 * @syscap SystemCapability.Ability.AbilityRuntime.Core
465 * @stagemodelonly
466 * @atomicservice
467 * @since 20
468 */
469declare interface IntentEntityDecoratorInfo {
470  /**
471   * The entity category.
472   *
473   * @type { string }
474   * @syscap SystemCapability.Ability.AbilityRuntime.Core
475   * @stagemodelonly
476   * @atomicservice
477   * @since 20
478   */
479  entityCategory: string;
480
481  /**
482   * The parameters of intent entity.
483   *
484   * @type { ?Record<string, Object> }
485   * @syscap SystemCapability.Ability.AbilityRuntime.Core
486   * @stagemodelonly
487   * @atomicservice
488   * @since 20
489   */
490  parameters?: Record<string, Object>;
491}
492
493/**
494 * Define InsightIntentEntity.
495 *
496 * @type { ((intentEntityInfo: IntentEntityDecoratorInfo) => ClassDecorator) }
497 * @syscap SystemCapability.Ability.AbilityRuntime.Core
498 * @stagemodelonly
499 * @atomicservice
500 * @since 20
501 */
502export declare const InsightIntentEntity: ((intentEntityInfo: IntentEntityDecoratorInfo) => ClassDecorator);
503