/** * Internal dependencies — production 에서는 puppeteer / DB 를 사용하지만, test 에서는 * mock 으로 교체해 hash dedup / debounce / queue 로직만 검증. */ export interface SchedulerDeps { generateThumbnail: (model: string, context: any) => Promise; saveThumbnail: (boardId: string, thumbnail: string, timestamp: Date) => Promise; } /** Test-only — DI 로 internal dependency 교체. */ export declare function _setSchedulerDeps(d: SchedulerDeps): void; /** Test-only — default dependency 복원. */ export declare function _resetSchedulerDeps(): void; /** Test-only — module-level state 초기화. */ export declare function _resetSchedulerState(): void; /** Test-only — 현재 진행 중인 모든 작업 완료까지 대기. */ export declare function _waitForIdle(): Promise; /** FNV-1a 32-bit hash — 빠르고 model 변경 감지에 충분. */ export declare function fnv1a(s: string): string; /** * 백엔드 thumbnail 생성을 fire-and-forget 으로 schedule. * * 호출자는 await 하지 않는다 — mutation 응답이 thumbnail 완료에 차단되지 않도록. * * 동작: * - 직전 성공 model 과 hash 동일 → 즉시 return (no-op). * - 같은 board 에 진행 중 작업 있으면 → pending 만 갱신, 끝나면 이어서 처리. * - 진행 중 작업 없음 → 즉시 시작. * * 풀 timeout / puppeteer 오류는 사용자 mutation 에 전혀 영향 없다. * 그 경우 lastHashByBoard 를 set 하지 않아 다음 저장에서 재시도된다. */ export declare function scheduleThumbnail(boardId: string, model: string, context: any): void; /** * 진단 / 운영용 — 현재 큐 / 진행 상태. * 추후 admin endpoint 에서 활용 가능. */ export declare function getSchedulerStats(): { pending: number; inFlight: number; cachedHashes: number; };