- design_view_profile_sections: 노선마다 상세 갈아끼움을 듣고 종단도 · 표 · 3D 측점선 다시(보일 때만 · 숨으면 flushSwap 이 다시 보일 때) · 가게 stations 도 들어 횡단 보기를 안 열어도 갈아끼움(먼저 부른 쪽만 · 다음은 「같은 목록」) - design_view_profile: 받는 줄만(보임 · 떠날 때 끊음 · 다시 보일 때 flushSwap) - 갈아끼움 알림판 B06_Section_Swap_Bus(가져오기 없음 · 돌고 도는 가져오기 막음) — 조정창 값 · 암 경계 옮김을 어느 보기가 갈아끼웠든 한 번 · 횡단 보기는 알림으로 다시 그림 - 시험: 종단 보기 보임 7 → 8 · 숨음 = 안 그림 · 다시 보임 = 6 · 3D 측점선 같은 차례 · 옛 시험 둘(342-1 화면 선 = listedBase · 323-9 열쇠 모듈 진짜로) 맞춤 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QfHKQs7J3hQELKMWQMUJEy
28 lines
1.4 KiB
TypeScript
28 lines
1.4 KiB
TypeScript
/* =============================================================================
|
|
* B06_Section_Swap_Bus.ts
|
|
* 상세 갈아끼움 알림판(PLAN 346-2) — 측점 수가 바뀌어 `Section_Store` 가 상세 객체를 갈아끼우면 여기로 알림.
|
|
* 가져오는 것 없음 — 세션 조작값 맵(`_UI_Page_Link_Session`) · 암 경계 저장소(`_UI_Page_Persist`)가 모듈을 읽을 때
|
|
* 붙어도 `Section_Store` 와 돌고 도는 가져오기가 안 생김.
|
|
* ========================================================================== */
|
|
|
|
import type { SectionDetailResponse } from "./B06_Section_Api_Types";
|
|
|
|
/** 새 상세 · 이어 받은 측점의 누가거리 옮김(옛 0.01 m 글 → 새 글 · 조작값 맵을 옮길 때). */
|
|
export type DetailListener = (
|
|
detail: SectionDetailResponse,
|
|
moves: ReadonlyMap<string, string>,
|
|
) => void;
|
|
|
|
const anyListeners = new Set<DetailListener>();
|
|
|
|
/** 어느 노선이든 상세가 갈아끼워지면 부름(조정창 값 · 암 경계 옮김 · 다시 그림) — 돌려준 함수로 끊음. */
|
|
export function onAnySwap(fn: DetailListener): () => void {
|
|
anyListeners.add(fn);
|
|
return () => anyListeners.delete(fn);
|
|
}
|
|
|
|
/** 갈아끼운 쪽(`Section_Store`)이 부름. */
|
|
export function emitSwap(detail: SectionDetailResponse, moves: ReadonlyMap<string, string>): void {
|
|
anyListeners.forEach((fn) => fn(detail, moves));
|
|
}
|