diff --git a/BuildProfile.ets b/BuildProfile.ets index e11789b..dd6e96c 100644 --- a/BuildProfile.ets +++ b/BuildProfile.ets @@ -2,8 +2,8 @@ * Use these variables when you tailor your ArkTS code. They must be of the const type. */ export const HAR_VERSION = '1.0.1'; -export const BUILD_MODE_NAME = 'release'; -export const DEBUG = false; +export const BUILD_MODE_NAME = 'debug'; +export const DEBUG = true; export const TARGET_NAME = 'default'; /** diff --git a/Index.ets b/Index.ets index 629f66d..bfda226 100644 --- a/Index.ets +++ b/Index.ets @@ -43,3 +43,7 @@ export { WindowHelper } from './src/main/ets/utils/WindowHelper' * 自定义view */ export { LoadingView } from './src/main/ets/view/LoadingView' +/** + * 自定义view + */ +export { GlobalContext } from './src/main/ets/ContextConfig' diff --git a/src/main/ets/ContextConfig.ets b/src/main/ets/ContextConfig.ets new file mode 100644 index 0000000..922646a --- /dev/null +++ b/src/main/ets/ContextConfig.ets @@ -0,0 +1,20 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved. + */ + +import type common from '@ohos.app.ability.common'; + +declare namespace globalThis { + let _brushEngineContext: common.UIAbilityContext; +}; + +export class GlobalContext { + static getContext(): common.UIAbilityContext { + return globalThis._brushEngineContext; + } + + static setContext(context: common.UIAbilityContext): void { + globalThis._brushEngineContext = context; + } +} +