diff --git a/api/app/context.d.ts b/api/app/context.d.ts index cb0b24f6e98b58c52faa5a92f9513e7f3a8ee235..e4babaa2bdb37bc0a7ae72f8e2296f8f262af93a 100644 --- a/api/app/context.d.ts +++ b/api/app/context.d.ts @@ -17,6 +17,7 @@ import { AsyncCallback } from '../basic'; import { ApplicationInfo } from '../bundle/applicationInfo'; import { ProcessInfo } from './processInfo'; import { ElementName } from '../bundle/elementName'; +import BaseContext from '../application/BaseContext'; /** * The context of an ability or an application. It allows access to @@ -29,7 +30,7 @@ import { ElementName } from '../bundle/elementName'; * @import import abilityManager from 'app/context' * @permission N/A */ -export interface Context { +export interface Context extends BaseContext { /** * Get the local root dir of an app. If it is the first call, the dir diff --git a/api/application/BaseContext.d.ts b/api/application/BaseContext.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9461fdde36a81e7047392f64bbf22de38a374619 --- /dev/null +++ b/api/application/BaseContext.d.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The base context of 'app.Context' for FA Mode or + * 'application.Context' for Stage Mode. + * + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export default interface BaseContext { + /** + * Indicates the context is FA Mode or Stage Mode. + * + * @since 8 + * @sysCap AAFwk + */ + stageMode: boolean; +} \ No newline at end of file diff --git a/api/application/Context.d.ts b/api/application/Context.d.ts index db1912de8142d57364f82ba16183d882ec91ec3e..ce5fb3d3454d086695929db0f16d2179af6bcfd8 100644 --- a/api/application/Context.d.ts +++ b/api/application/Context.d.ts @@ -15,6 +15,7 @@ import { ApplicationInfo } from "../bundle/applicationInfo"; import resmgr from "../@ohos.resourceManager"; +import BaseContext from "./BaseContext"; /** * The base context of an ability or an application. It allows access to @@ -25,7 +26,7 @@ import resmgr from "../@ohos.resourceManager"; * @devices phone, tablet, tv, wearable, car * @permission N/A */ -export default class Context { +export default class Context extends BaseContext { /** * Indicates the capability of accessing application resources. *