wing-ops/frontend/src/common/utils/imageAnalysisSignal.ts
leedano 38d931db65 refactor(mpa): 탭 디렉토리를 MPA 컴포넌트 구조로 재편
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 17:38:49 +09:00

28 lines
893 B
TypeScript

import type { ImageAnalyzeResult } from '@interfaces/prediction/PredictionInterface';
/**
* 항공탐색(유출유면적분석) → 유출유 확산예측 탭 간 데이터 전달용 모듈 레벨 시그널.
* registerMainTabSwitcher / navigateToTab 패턴과 동일한 방식으로 구현된다.
*/
interface PendingImageAnalysis extends ImageAnalyzeResult {
autoRun: boolean;
}
let _pending: PendingImageAnalysis | null = null;
/** 분석 결과를 시그널에 저장한다. navigateToTab 호출 직전에 사용한다. */
export function setPendingImageAnalysis(data: PendingImageAnalysis): void {
_pending = data;
}
/**
* 시그널에서 분석 결과를 꺼내고 초기화한다.
* OilSpillView 마운트 시 1회 호출한다.
*/
export function consumePendingImageAnalysis(): PendingImageAnalysis | null {
const value = _pending;
_pending = null;
return value;
}