/** * OCR サービス - 画像テキスト認識関連の処理を担当 */ export const ocrService = { // 画像内のテキストを認識 async recognizeText(authToken: string, image: Blob): Promise { const formData = new FormData(); formData.append('image', image); const response = await fetch('/api/ocr/recognize', { method: 'POST', headers: { 'Authorization': `Bearer ${authToken}` }, body: formData, }); if (!response.ok) { throw new Error('Failed to recognize text'); } const data = await response.json(); return data.text; } };