feat(scanner): validate elevated live automation
This commit is contained in:
@@ -15,6 +15,8 @@ import type {
|
||||
SaveScannerLearningRulesResult,
|
||||
SaveSnapshotResult,
|
||||
GoodDatabase,
|
||||
GoodImportFileResult,
|
||||
ScannerCommand,
|
||||
ScannerStatusPayload,
|
||||
ScannerLearningRulePayload,
|
||||
} from "../types/global";
|
||||
@@ -39,6 +41,7 @@ export interface AssistantBridge {
|
||||
options?: CaptureOptions,
|
||||
) => Promise<CaptureResult>;
|
||||
exportGood: (payload: GoodDatabase) => Promise<SaveResultWithPath>;
|
||||
importGoodFile: () => Promise<GoodImportFileResult>;
|
||||
showOverlay: () => Promise<BooleanResult>;
|
||||
loadArtifacts: () => Promise<ArtifactStoreLoadResult>;
|
||||
saveArtifacts: (records: StoredArtifactRecord[]) => Promise<ArtifactStoreSaveResult>;
|
||||
@@ -54,7 +57,7 @@ export interface AssistantBridge {
|
||||
focusGenshinForScanStart: () => Promise<FocusGenshinResult>;
|
||||
clickScreen: (x: number, y: number) => Promise<ClickResult>;
|
||||
scrollScreen: (notches: number, anchorX?: number, anchorY?: number) => Promise<ScrollResult>;
|
||||
onScannerCommand: (callback: (command: "start-auto" | "stop") => void) => () => void;
|
||||
onScannerCommand: (callback: (command: ScannerCommand) => void) => () => void;
|
||||
}
|
||||
|
||||
function hasFunction(api: Record<string, unknown>, key: string): boolean {
|
||||
@@ -81,6 +84,7 @@ export function getAssistantBridge(): AssistantBridge | null {
|
||||
listCaptureSources: () => api.listCaptureSources(),
|
||||
captureSource: (sourceId, delayMs, focusGenshin, options) => api.captureSource(sourceId, delayMs, focusGenshin, options),
|
||||
exportGood: (payload) => api.exportGood(payload),
|
||||
importGoodFile: () => api.importGoodFile(),
|
||||
loadArtifacts: () => api.loadArtifacts(),
|
||||
saveArtifacts: (records) => api.saveArtifacts(records),
|
||||
loadReviewSamples: (limit = 50) => api.loadReviewSamples(limit),
|
||||
|
||||
Reference in New Issue
Block a user