1/* 2 * Copyright (c) 2022-2024 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 21/*** if arkts 1.1 */ 22import * as _UIAbilityContext from './application/UIAbilityContext'; 23import type * as _UIExtensionContext from './application/UIExtensionContext'; 24import type * as _AutoFillExtensionContext from './application/AutoFillExtensionContext'; 25import * as _AbilityStageContext from './application/AbilityStageContext'; 26import * as _ApplicationContext from './application/ApplicationContext'; 27import * as _BaseContext from './application/BaseContext'; 28import * as _Context from './application/Context'; 29import * as _ExtensionContext from './application/ExtensionContext'; 30import * as _FormExtensionContext from './application/FormExtensionContext'; 31import * as _ServiceExtensionContext from './application/ServiceExtensionContext'; 32import * as _EventHub from './application/EventHub'; 33import { PacMap as _PacMap } from './ability/dataAbilityHelper'; 34import type _AbilityStartCallback from './application/AbilityStartCallback'; 35import { ConnectOptions as _ConnectOptions } from './ability/connectOptions'; 36import type * as _VpnExtensionContext from './application/VpnExtensionContext'; 37import type { AutoStartupCallback as _AutoStartupCallback } from './application/AutoStartupCallback'; 38import type { AutoStartupInfo as _AutoStartupInfo } from './application/AutoStartupInfo'; 39import type * as _EmbeddableUIAbilityContext from './application/EmbeddableUIAbilityContext'; 40import type * as _PhotoEditorExtensionContext from './application/PhotoEditorExtensionContext'; 41import * as _UIServiceExtensionContext from './application/UIServiceExtensionContext'; 42import * as _UIServiceProxy from './application/UIServiceProxy'; 43import * as _UIServiceHostProxy from './application/UIServiceHostProxy'; 44import * as _UIServiceExtensionConnectCallback from './application/UIServiceExtensionConnectCallback'; 45import * as _AppServiceExtensionContext from './application/AppServiceExtensionContext'; 46/*** endif */ 47import { AbilityResult as _AbilityResult } from './ability/abilityResult'; 48/*** if arkts 1.2 */ 49import _UIAbilityContext from './application/UIAbilityContext'; 50import type _UIExtensionContext from './application/UIExtensionContext'; 51import _AbilityStageContext from './application/AbilityStageContext'; 52import _ApplicationContext from './application/ApplicationContext'; 53import _Context from './application/Context'; 54import _ExtensionContext from './application/ExtensionContext'; 55import _ServiceExtensionContext from './application/ServiceExtensionContext'; 56/*** endif */ 57 58/** 59 * This module provides application context classes and common data structures. 60 * 61 * @namespace common 62 * @syscap SystemCapability.Ability.AbilityRuntime.Core 63 * @stagemodelonly 64 * @since 9 65 */ 66/** 67 * This module provides application context classes and common data structures. 68 * 69 * @namespace common 70 * @syscap SystemCapability.Ability.AbilityRuntime.Core 71 * @stagemodelonly 72 * @crossplatform 73 * @since 10 74 */ 75/** 76 * This module provides application context classes and common data structures. 77 * 78 * @namespace common 79 * @syscap SystemCapability.Ability.AbilityRuntime.Core 80 * @crossplatform 81 * @atomicservice 82 * @since arkts {'1.1':'11', '1.2':'20'} 83 * @arkts 1.1&1.2 84 */ 85declare namespace common { 86 /** 87 * The context of an ability. It allows access to ability-specific resources. 88 * 89 * @syscap SystemCapability.Ability.AbilityRuntime.Core 90 * @stagemodelonly 91 * @since 9 92 */ 93 /** 94 * The context of an ability. It allows access to ability-specific resources. 95 * 96 * @syscap SystemCapability.Ability.AbilityRuntime.Core 97 * @stagemodelonly 98 * @crossplatform 99 * @since 10 100 */ 101 /** 102 * The context of an ability. It allows access to ability-specific resources. 103 * 104 * @typedef { _UIAbilityContext.default } 105 * @syscap SystemCapability.Ability.AbilityRuntime.Core 106 * @stagemodelonly 107 * @crossplatform 108 * @atomicservice 109 * @since 11 110 */ 111 export type UIAbilityContext = _UIAbilityContext.default; 112 113 /** 114 * The context of an ability. It allows access to ability-specific resources. 115 * 116 * @typedef { _UIAbilityContext } 117 * @syscap SystemCapability.Ability.AbilityRuntime.Core 118 * @stagemodelonly 119 * @crossplatform 120 * @atomicservice 121 * @since 20 122 * @arkts 1.2 123 */ 124 export type UIAbilityContext = _UIAbilityContext; 125 126 /** 127 * The context of an abilityStage. It allows access to abilityStage-specific resources. 128 * 129 * @syscap SystemCapability.Ability.AbilityRuntime.Core 130 * @stagemodelonly 131 * @since 9 132 */ 133 /** 134 * The context of an abilityStage. It allows access to abilityStage-specific resources. 135 * 136 * @syscap SystemCapability.Ability.AbilityRuntime.Core 137 * @stagemodelonly 138 * @crossplatform 139 * @since 10 140 */ 141 /** 142 * The context of an abilityStage. It allows access to abilityStage-specific resources. 143 * 144 * @typedef { _AbilityStageContext.default } 145 * @syscap SystemCapability.Ability.AbilityRuntime.Core 146 * @stagemodelonly 147 * @crossplatform 148 * @atomicservice 149 * @since 11 150 */ 151 export type AbilityStageContext = _AbilityStageContext.default; 152 153 /** 154 * The context of an abilityStage. It allows access to abilityStage-specific resources. 155 * 156 * @typedef { _AbilityStageContext } 157 * @syscap SystemCapability.Ability.AbilityRuntime.Core 158 * @stagemodelonly 159 * @crossplatform 160 * @atomicservice 161 * @since 20 162 * @arkts 1.2 163 */ 164 export type AbilityStageContext = _AbilityStageContext; 165 166 /** 167 * The context of an application. It allows access to application-specific resources. 168 * 169 * @syscap SystemCapability.Ability.AbilityRuntime.Core 170 * @stagemodelonly 171 * @since 9 172 */ 173 /** 174 * The context of an application. It allows access to application-specific resources. 175 * 176 * @syscap SystemCapability.Ability.AbilityRuntime.Core 177 * @stagemodelonly 178 * @crossplatform 179 * @since 10 180 */ 181 /** 182 * The context of an application. It allows access to application-specific resources. 183 * 184 * @typedef { _ApplicationContext.default } 185 * @syscap SystemCapability.Ability.AbilityRuntime.Core 186 * @stagemodelonly 187 * @crossplatform 188 * @atomicservice 189 * @since 11 190 */ 191 export type ApplicationContext = _ApplicationContext.default; 192 193 /** 194 * The context of an application. It allows access to application-specific resources. 195 * 196 * @typedef { _ApplicationContext } 197 * @syscap SystemCapability.Ability.AbilityRuntime.Core 198 * @stagemodelonly 199 * @crossplatform 200 * @atomicservice 201 * @since 20 202 * @arkts 1.2 203 */ 204 export type ApplicationContext = _ApplicationContext; 205 206 /** 207 * The base context of 'app.Context' for FA Mode or 'application.Context' for Stage Mode. 208 * 209 * @syscap SystemCapability.Ability.AbilityRuntime.Core 210 * @stagemodelonly 211 * @since 9 212 */ 213 /** 214 * The base context of 'app.Context' for FA Mode or 'application.Context' for Stage Mode. 215 * 216 * @syscap SystemCapability.Ability.AbilityRuntime.Core 217 * @stagemodelonly 218 * @crossplatform 219 * @since 10 220 */ 221 /** 222 * The base context of 'app.Context' for FA Mode or 'application.Context' for Stage Mode. 223 * 224 * @typedef { _BaseContext.default } 225 * @syscap SystemCapability.Ability.AbilityRuntime.Core 226 * @stagemodelonly 227 * @crossplatform 228 * @atomicservice 229 * @since 11 230 */ 231 export type BaseContext = _BaseContext.default; 232 233 /** 234 * The base context of an ability or an application. It allows access to 235 * application-specific resources. 236 * 237 * @syscap SystemCapability.Ability.AbilityRuntime.Core 238 * @stagemodelonly 239 * @since 9 240 */ 241 /** 242 * The base context of an ability or an application. It allows access to 243 * application-specific resources. 244 * 245 * @syscap SystemCapability.Ability.AbilityRuntime.Core 246 * @stagemodelonly 247 * @crossplatform 248 * @since 10 249 */ 250 /** 251 * The base context of an ability or an application. It allows access to 252 * application-specific resources. 253 * 254 * @typedef { _Context.default } 255 * @syscap SystemCapability.Ability.AbilityRuntime.Core 256 * @stagemodelonly 257 * @crossplatform 258 * @atomicservice 259 * @since 11 260 */ 261 export type Context = _Context.default; 262 263 /** 264 * The base context of an ability or an application. It allows access to 265 * application-specific resources. 266 * 267 * @typedef { _Context } 268 * @syscap SystemCapability.Ability.AbilityRuntime.Core 269 * @stagemodelonly 270 * @crossplatform 271 * @atomicservice 272 * @since 20 273 * @arkts 1.2 274 */ 275 export type Context = _Context; 276 277 /** 278 * The context of an extension. It allows access to extension-specific resources. 279 * 280 * @syscap SystemCapability.Ability.AbilityRuntime.Core 281 * @stagemodelonly 282 * @since 9 283 */ 284 /** 285 * The context of an extension. It allows access to extension-specific resources. 286 * 287 * @typedef { _ExtensionContext.default } 288 * @syscap SystemCapability.Ability.AbilityRuntime.Core 289 * @stagemodelonly 290 * @atomicservice 291 * @since 11 292 */ 293 export type ExtensionContext = _ExtensionContext.default; 294 295 /** 296 * The context of an extension. It allows access to extension-specific resources. 297 * 298 * @typedef { _ExtensionContext } 299 * @syscap SystemCapability.Ability.AbilityRuntime.Core 300 * @stagemodelonly 301 * @atomicservice 302 * @since 20 303 * @arkts 1.2 304 */ 305 export type ExtensionContext = _ExtensionContext; 306 307 /** 308 * The context of form extension. It allows access to 309 * formExtension-specific resources. 310 * 311 * @syscap SystemCapability.Ability.AbilityRuntime.Core 312 * @stagemodelonly 313 * @since 9 314 */ 315 /** 316 * The context of form extension. It allows access to 317 * formExtension-specific resources. 318 * 319 * @typedef { _FormExtensionContext.default } 320 * @syscap SystemCapability.Ability.AbilityRuntime.Core 321 * @stagemodelonly 322 * @atomicservice 323 * @since 11 324 */ 325 export type FormExtensionContext = _FormExtensionContext.default; 326 327 /** 328 * The context of service extension. It allows access to 329 * serviceExtension-specific resources. 330 * 331 * @typedef { _ServiceExtensionContext.default } 332 * @syscap SystemCapability.Ability.AbilityRuntime.Core 333 * @systemapi 334 * @stagemodelonly 335 * @since 9 336 */ 337 export type ServiceExtensionContext = _ServiceExtensionContext.default; 338 339 /** 340 * The context of service extension. It allows access to 341 * serviceExtension-specific resources. 342 * 343 * @typedef { _ServiceExtensionContext } 344 * @syscap SystemCapability.Ability.AbilityRuntime.Core 345 * @systemapi 346 * @stagemodelonly 347 * @since 20 348 * @arkts 1.2 349 */ 350 export type ServiceExtensionContext = _ServiceExtensionContext; 351 352 /** 353 * The event center of a context, support the subscription and publication of events. 354 * 355 * @syscap SystemCapability.Ability.AbilityRuntime.Core 356 * @stagemodelonly 357 * @since 9 358 */ 359 /** 360 * The event center of a context, support the subscription and publication of events. 361 * 362 * @syscap SystemCapability.Ability.AbilityRuntime.Core 363 * @stagemodelonly 364 * @atomicservice 365 * @since 11 366 */ 367 /** 368 * The event center of a context, support the subscription and publication of events. 369 * 370 * @typedef { _EventHub.default } 371 * @syscap SystemCapability.Ability.AbilityRuntime.Core 372 * @stagemodelonly 373 * @crossplatform 374 * @atomicservice 375 * @since 12 376 */ 377 export type EventHub = _EventHub.default; 378 379 /** 380 * Defines a PacMap object for storing a series of values. 381 * 382 * @syscap SystemCapability.Ability.AbilityRuntime.Core 383 * @stagemodelonly 384 * @since 9 385 */ 386 /** 387 * Defines a PacMap object for storing a series of values. 388 * 389 * @typedef { _PacMap } 390 * @syscap SystemCapability.Ability.AbilityRuntime.Core 391 * @atomicservice 392 * @since 11 393 */ 394 export type PacMap = _PacMap; 395 396 /** 397 * Indicates the result of startAbility. 398 * 399 * @syscap SystemCapability.Ability.AbilityRuntime.Core 400 * @stagemodelonly 401 * @since 9 402 */ 403 /** 404 * Indicates the result of startAbility. 405 * 406 * @typedef { _AbilityResult } 407 * @syscap SystemCapability.Ability.AbilityRuntime.Core 408 * @stagemodelonly 409 * @atomicservice 410 * @since arkts {'1.1':'11', '1.2':'20'} 411 * @arkts 1.1&1.2 412 */ 413 export type AbilityResult = _AbilityResult; 414 415 /** 416 * Indicates the callback of connection 417 * 418 * @typedef { _ConnectOptions } 419 * @syscap SystemCapability.Ability.AbilityRuntime.Core 420 * @stagemodelonly 421 * @since 9 422 */ 423 export type ConnectOptions = _ConnectOptions; 424 425 /** 426 * The context of UI extension. It allows access to 427 * UIExtension-specific resources. 428 * 429 * @typedef { _UIExtensionContext.default } 430 * @syscap SystemCapability.Ability.AbilityRuntime.Core 431 * @stagemodelonly 432 * @since 10 433 */ 434 export type UIExtensionContext = _UIExtensionContext.default; 435 436 /** 437 * The context of UI extension. It allows access to 438 * UIExtension-specific resources. 439 * 440 * @typedef { _UIExtensionContext } 441 * @syscap SystemCapability.Ability.AbilityRuntime.Core 442 * @stagemodelonly 443 * @since 20 444 * @arkts 1.2 445 */ 446 export type UIExtensionContext = _UIExtensionContext; 447 448 /** 449 * The context of auto fill extension. It allows access to 450 * AutoFillExtension-specific resources. 451 * 452 * @typedef { _AutoFillExtensionContext.default } 453 * @syscap SystemCapability.Ability.AbilityRuntime.Core 454 * @systemapi 455 * @stagemodelonly 456 * @since 11 457 */ 458 export type AutoFillExtensionContext = _AutoFillExtensionContext.default; 459 460 /** 461 * The function Called when some error occurred except disconnected from UIAbility or UIExtensionAbility 462 * 463 * @typedef { _AbilityStartCallback } 464 * @syscap SystemCapability.Ability.AbilityRuntime.Core 465 * @stagemodelonly 466 * @atomicservice 467 * @since 11 468 */ 469 export type AbilityStartCallback = _AbilityStartCallback; 470 471 /** 472 * The class of auto startup info. 473 * 474 * @typedef { _AutoStartupInfo } 475 * @syscap SystemCapability.Ability.AbilityRuntime.Core 476 * @systemapi 477 * @stagemodelonly 478 * @since 11 479 */ 480 export type AutoStartupInfo = _AutoStartupInfo; 481 482 /** 483 * The class of auto startup callback. 484 * 485 * @typedef { _AutoStartupCallback } 486 * @syscap SystemCapability.Ability.AbilityRuntime.Core 487 * @systemapi 488 * @stagemodelonly 489 * @since 11 490 */ 491 export type AutoStartupCallback = _AutoStartupCallback; 492 493 /** 494 * The context of vpn extension. It allows access to 495 * vpnExtension-specific resources. 496 * The class of auto startup info. 497 * 498 * @typedef { _VpnExtensionContext.default } 499 * @syscap SystemCapability.Ability.AbilityRuntime.Core 500 * @stagemodelonly 501 * @since 11 502 */ 503 export type VpnExtensionContext = _VpnExtensionContext.default; 504 505 /** 506 * The context of an embeddable UIAbility. 507 * 508 * @typedef { _EmbeddableUIAbilityContext.default } 509 * @syscap SystemCapability.Ability.AbilityRuntime.Core 510 * @stagemodelonly 511 * @atomicservice 512 * @since 12 513 */ 514 export type EmbeddableUIAbilityContext = _EmbeddableUIAbilityContext.default; 515 516 /** 517 * The context of an photo editor extension ability. 518 * 519 * @typedef { _PhotoEditorExtensionContext.default } 520 * @syscap SystemCapability.Ability.AppExtension.PhotoEditorExtension 521 * @stagemodelonly 522 * @since 12 523 */ 524 export type PhotoEditorExtensionContext = _PhotoEditorExtensionContext.default; 525 526 /** 527 * The context of a UI service ability. 528 * 529 * @typedef { _UIServiceExtensionContext.default } 530 * @syscap SystemCapability.Ability.AbilityRuntime.Core 531 * @systemapi 532 * @stagemodelonly 533 * @since 14 534 */ 535 export type UIServiceExtensionContext = _UIServiceExtensionContext.default; 536 537 /** 538 * The UI service proxy. 539 * 540 * @typedef { _UIServiceProxy.default } 541 * @syscap SystemCapability.Ability.AbilityRuntime.Core 542 * @stagemodelonly 543 * @atomicservice 544 * @since 14 545 */ 546 export type UIServiceProxy = _UIServiceProxy.default; 547 548 /** 549 * The UI service host proxy. 550 * 551 * @typedef { _UIServiceHostProxy.default } 552 * @syscap SystemCapability.Ability.AbilityRuntime.Core 553 * @systemapi 554 * @stagemodelonly 555 * @since 14 556 */ 557 export type UIServiceHostProxy = _UIServiceHostProxy.default; 558 559 /** 560 * The UI service extension connect callback. 561 * 562 * @typedef { _UIServiceExtensionConnectCallback.default } 563 * @syscap SystemCapability.Ability.AbilityRuntime.Core 564 * @stagemodelonly 565 * @atomicservice 566 * @since 14 567 */ 568 export type UIServiceExtensionConnectCallback = _UIServiceExtensionConnectCallback.default; 569 570 /** 571 * The context of app service extension. It allows access to 572 * appServiceExtension-specific resources. 573 * 574 * @typedef { _AppServiceExtensionContext.default } 575 * @syscap SystemCapability.Ability.AbilityRuntime.Core 576 * @stagemodelonly 577 * @since 20 578 */ 579 export type AppServiceExtensionContext = _AppServiceExtensionContext.default; 580} 581 582export default common; 583