Fix: add missing ArkTS type exports (BatteryInfo, OcrAdapterImage, TextWord, PowerMonitor, filterFileDocs)

This commit is contained in:
root 2026-05-13 17:37:22 +08:00 committed by Eiloud
parent 20d4e15b42
commit 52d3e82881
2 changed files with 34 additions and 4 deletions

View File

@ -33,6 +33,10 @@ import type GestureEvent from '@ohos.multimodalInput.gestureEvent';
import type ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; import type ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant';
import type common from '@ohos.app.ability.common'; import type common from '@ohos.app.ability.common';
import type window from '@ohos.window'; import type window from '@ohos.window';
import type batteryInfo from '@ohos.batteryInfo';
// Re-export battery info type
export type BatteryInfo = batteryInfo.BatteryBasicInfo;
export interface ILoginInfo { export interface ILoginInfo {
status: boolean; status: boolean;
@ -117,6 +121,7 @@ export interface NativeContext {
ClearWindowEventFilter: (origin_window_id: number) => void; ClearWindowEventFilter: (origin_window_id: number) => void;
OnCaptionButtonRectChange: (id: string, event: CaptionButtonRect) => void; OnCaptionButtonRectChange: (id: string, event: CaptionButtonRect) => void;
UpdateWindowPcmodeSwitchStatusCB: (value: boolean) => void; UpdateWindowPcmodeSwitchStatusCB: (value: boolean) => void;
PowerMonitor: PowerMonitor;
} }
export interface IParams { export interface IParams {
@ -324,8 +329,24 @@ export enum BrowserCloseResponse {
// Electron // Electron
export interface WindowPreferences { export interface WindowPreferences {
hideTitleBar: boolean, hideTitleBar: boolean;
minimizable: boolean, minimizable: boolean;
maximizable: boolean, maximizable: boolean;
closable: boolean, closable: boolean;
}
export interface OcrAdapterImage {
width: number;
height: number;
}
export interface TextWord {
word: string;
confidence?: number;
}
export interface PowerMonitor {
OnSuspend: () => void;
OnResume: () => void;
OnPowerStateChanged: () => void;
} }

View File

@ -43,4 +43,13 @@ export default class StringUtil {
}); });
return copy; return copy;
} }
static filterFileDocs(uri: string): string {
// Remove "docs://" prefix if present and return the actual path
if (uri.startsWith('docs://')) {
// docs://file_URI/path -> return as-is, FileUri will handle it
return uri;
}
return uri;
}
} }