diff --git a/arkoala-arkts/arkui/src/generated/arkts/index.ts b/arkoala-arkts/arkui/src/generated/arkts/index.ts index 69e843017a623c1def8445f0326290ba4649c3ab..3fb82bf1adb44a9d0c7d297d4c718199f5a9714b 100644 --- a/arkoala-arkts/arkui/src/generated/arkts/index.ts +++ b/arkoala-arkts/arkui/src/generated/arkts/index.ts @@ -1,4 +1,5 @@ export * from "./type_check" export * from "./ArkUINativeModule" export * from "./ArkUIGeneratedNativeModule" -export * from "./TestNativeModule" \ No newline at end of file +export * from "./TestNativeModule" +export * from "./ohos.arkui.global" \ No newline at end of file diff --git a/arkoala-arkts/arkui/src/generated/arkts/ohos.arkui.global.ts b/arkoala-arkts/arkui/src/generated/arkts/ohos.arkui.global.ts new file mode 100644 index 0000000000000000000000000000000000000000..85327591b22e973beb7faecf335ac8dad6e981ce --- /dev/null +++ b/arkoala-arkts/arkui/src/generated/arkts/ohos.arkui.global.ts @@ -0,0 +1,6 @@ +import { loadNativeModuleLibrary } from "@koalaui/interop"; + +export class OhosGlobal { + static { loadNativeModuleLibrary("ace_ani.z") } + static native getInspectorByKey(key: string): string; +} \ No newline at end of file diff --git a/arkoala-arkts/arkui/src/generated/ts/index.ts b/arkoala-arkts/arkui/src/generated/ts/index.ts index 4aedac570509d75071616798bc5674fc540db6f3..3ba0ec3216f3c7e846b0da8764fbc72295edcfd7 100644 --- a/arkoala-arkts/arkui/src/generated/ts/index.ts +++ b/arkoala-arkts/arkui/src/generated/ts/index.ts @@ -2,3 +2,4 @@ export * from "./type_check" export * from "./ArkUINativeModule" export * from "./ArkUIGeneratedNativeModule" export * from "./TestNativeModule" +export * from "./ohos.arkui.global" diff --git a/arkoala-arkts/arkui/src/generated/ts/ohos.arkui.global.ts b/arkoala-arkts/arkui/src/generated/ts/ohos.arkui.global.ts new file mode 100644 index 0000000000000000000000000000000000000000..9bdfbbd42edd70a38e74b018eaf691fe36e30fee --- /dev/null +++ b/arkoala-arkts/arkui/src/generated/ts/ohos.arkui.global.ts @@ -0,0 +1 @@ +export const OhosGlobal: any = undefined \ No newline at end of file diff --git a/arkoala-arkts/arkui/src/index.ts b/arkoala-arkts/arkui/src/index.ts index b2ed0e9af0218c6ef301f2703fda18c68eb84357..5718d7c8a38c63d89bd9159b0b919fb7341318b6 100644 --- a/arkoala-arkts/arkui/src/index.ts +++ b/arkoala-arkts/arkui/src/index.ts @@ -30,4 +30,5 @@ export * from "./PeerNode" export * from "./generated/Events" export * from "./generated/peers/CallbacksChecker" export * from "./peers/ArkTestComponentPeer" -export * from "./ArkTestComponent" \ No newline at end of file +export * from "./ArkTestComponent" +export * from "./ohos.arkui.global" \ No newline at end of file diff --git a/arkoala-arkts/arkui/src/ohos.arkui.global.ts b/arkoala-arkts/arkui/src/ohos.arkui.global.ts new file mode 100644 index 0000000000000000000000000000000000000000..66e4085ed2ad45081e95febc52e565ee76496d74 --- /dev/null +++ b/arkoala-arkts/arkui/src/ohos.arkui.global.ts @@ -0,0 +1,5 @@ +import {OhosGlobal} from "#components" + +export function getInspectorByKey(id: string): string { + return OhosGlobal.getInspectorByKey(id); +} \ No newline at end of file diff --git a/arkoala-arkts/shopping/user/tsconfig-unmemoize.json b/arkoala-arkts/shopping/user/tsconfig-unmemoize.json index f95644c4cf6acc965652eecee2e2e1cdc5e2c076..93358d437425e5188cb6538a9783f56c957fd8d3 100644 --- a/arkoala-arkts/shopping/user/tsconfig-unmemoize.json +++ b/arkoala-arkts/shopping/user/tsconfig-unmemoize.json @@ -31,6 +31,9 @@ "@koalaui/arkts-arkui/ohos.arkui.UIContext": [ "../../arkui/src/ohos.arkui.UIContext.ts" ], + "@koalaui/arkts-arkui/ohos.arkui.global": [ + "../../arkui/src/ohos.arkui.global.ts" + ], "app/*": [ "./build/generated/*" ] diff --git a/arkoala/ets-plugin/src/Importer.ts b/arkoala/ets-plugin/src/Importer.ts index 5701eced94b27a0a53cbb73cbec20df2aabcc387..eef0fed45ccb031c299e1ef1c5de6ca1268b1d33 100644 --- a/arkoala/ets-plugin/src/Importer.ts +++ b/arkoala/ets-plugin/src/Importer.ts @@ -116,7 +116,8 @@ function implementedPackages(kind: ArkUIImplementation): string[] { ] if (kind == ArkUIImplementation.ARKTS) return [ 'ohos.router', - 'ohos.arkui.UIContext' + 'ohos.arkui.UIContext', + 'ohos.arkui.global', ] assertUnreachable(kind)