@aiquants/daily-report 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +59 -0
  2. package/dist/client.d.mts +90 -5
  3. package/dist/client.d.ts +90 -5
  4. package/dist/client.js +4 -4
  5. package/dist/client.js.map +1 -1
  6. package/dist/client.mjs +4 -4
  7. package/dist/client.mjs.map +1 -1
  8. package/dist/index.d.mts +2 -2
  9. package/dist/index.d.ts +2 -2
  10. package/dist/index.js +1 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.mjs +1 -1
  13. package/dist/index.mjs.map +1 -1
  14. package/dist/server.d.mts +13 -1
  15. package/dist/server.d.ts +13 -1
  16. package/dist/server.js +6 -6
  17. package/dist/server.js.map +1 -1
  18. package/dist/server.mjs +6 -6
  19. package/dist/server.mjs.map +1 -1
  20. package/dist/{sse-schema-BnQQh_Cc.d.ts → sse-schema-ChCypDPj.d.ts} +34 -1
  21. package/dist/{sse-schema-DRNjDRDy.d.mts → sse-schema-Cs1oC2DP.d.mts} +34 -1
  22. package/dist/styles/daily-report.standalone.css +1 -1
  23. package/dist/{types-DAyE_3R1.d.mts → types-BNhYC2j9.d.mts} +1 -1
  24. package/dist/{types-DAyE_3R1.d.ts → types-BNhYC2j9.d.ts} +1 -1
  25. package/package.json +1 -1
  26. package/src/client/components/daily-report-detail-list.tsx +62 -50
  27. package/src/client/components/daily-report-list.tsx +15 -3
  28. package/src/client/components/daily-report-resolved-content.tsx +33 -7
  29. package/src/client/config-context.tsx +21 -8
  30. package/src/client/contexts/daily-report-action-context.tsx +53 -1
  31. package/src/client/hooks/use-daily-report.ts +23 -1
  32. package/src/server/cache.spec.ts +47 -0
  33. package/src/server/cache.ts +27 -0
  34. package/src/server/handlers.ts +4 -0
  35. package/src/server/service.ts +18 -1
  36. package/src/shared/sse-schema.ts +1 -0
  37. package/src/shared/types.ts +1 -1
package/README.md CHANGED
@@ -157,6 +157,65 @@ export default function Route() {
157
157
 
158
158
  詳細/一覧カードの見出し (`id` / `businessDate` / `author` / `visitTime` / `createdAt` / `updatedAt` / `updatedBy` / `category` / `categoryInfo` / `creationCategory` / `customer` / `subject` / `content` / `interviewers` / `comments` / `tabArticle` / `tabRelations` / `relationsEmpty`) はすべて DI。**パッケージは中立な英語 (`Business date` / `Customer` / `Content` 等) のみを既定で同梱**し、各見出しの言語・表記は消費アプリが `fieldLabels` で上書きする。これによりパッケージ本体は業務ドメイン固有の表記を持たない。部分指定した分だけ既定へ上書きされる (`DailyReportConfigProvider` が 1 段深くマージ)。
159
159
 
160
+ ### 外部ソースバッジ設定 (`sourceTypeConfigs`)
161
+
162
+ 外部ソースから取り込まれた日報の表示 (ラベル名やバッジの CSS クラス) を `sourceTypeConfigs` で上書き設定できます。これにより、パッケージ自身は特定の外部サービス ( NI 日報や Kintone など) の名前やデザインに依存せず、ホストアプリケーションから柔軟に表示をカスタマイズできます。
163
+
164
+ ```tsx
165
+ sourceTypeConfigs: {
166
+ Internal: {
167
+ label: "オリジナル",
168
+ badgeClassName: "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",
169
+ },
170
+ NI: {
171
+ label: "NI 日報",
172
+ badgeClassName: "bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400",
173
+ },
174
+ Kintone: {
175
+ label: "Kintone",
176
+ badgeClassName: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",
177
+ },
178
+ }
179
+ ```
180
+
181
+ ### Troubleshooting: Hook errors / Multiple React instances (Cannot read properties of null)
182
+
183
+ If you encounter `TypeError: Cannot read properties of null (reading 'useMemo')` or "Invalid hook call", it means multiple React instances are loaded in memory. This often happens because the bundler/framework (Vite/React Router v7) resolves separate React packages for your application and this dependency (especially when linked via monorepo or npm link).
184
+
185
+ To fix this, update your consumer application's `vite.config.ts` to deduplicate React:
186
+
187
+ ```typescript
188
+ import path from "node:path"
189
+ import { defineConfig } from "vite"
190
+
191
+ export default defineConfig({
192
+ resolve: {
193
+ // Force Vite to always use the root React instance
194
+ dedupe: ["react", "react-dom", "react-router", "react-router-dom"],
195
+ alias: {
196
+ react: path.resolve(__dirname, "./node_modules/react"),
197
+ "react-dom": path.resolve(__dirname, "./node_modules/react-dom"),
198
+ }
199
+ },
200
+ optimizeDeps: {
201
+ // Exclude the package so Vite doesn't optimize it separately under .vite/deps
202
+ exclude: [
203
+ "@aiquants/daily-report",
204
+ "@aiquants/virtualscroll",
205
+ "@aiquants/swipe-overlay",
206
+ ],
207
+ },
208
+ ssr: {
209
+ // For SSR environments like React Router v7 / Remix
210
+ noExternal: [
211
+ "@aiquants/daily-report",
212
+ "@aiquants/virtualscroll",
213
+ "@aiquants/swipe-overlay",
214
+ ],
215
+ }
216
+ })
217
+ ```
218
+
160
219
  ## Realtime architecture
161
220
 
162
221
  1. 変更系サービスは `invalidate → epoch increment → SSE publish` の順で Redis Stream (`daily-report:sse-stream`) へ発行。
package/dist/client.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, Context, RefObject } from 'react';
3
3
  import { ScrollBarThumbOverlayRenderProps, ScrollPaneInertiaOptions, ScrollBarTapCircleOptions } from '@aiquants/virtualscroll';
4
- import { U as UIComment, D as DailyReportSseMessage } from './sse-schema-DRNjDRDy.mjs';
5
- import { D as DailyReportItem, a as DailyReportDetail, b as DailyReportUser } from './types-DAyE_3R1.mjs';
4
+ import { U as UIComment, D as DailyReportSseMessage } from './sse-schema-Cs1oC2DP.mjs';
5
+ import { D as DailyReportItem, a as DailyReportDetail, b as DailyReportUser } from './types-BNhYC2j9.mjs';
6
6
  import { ShouldRevalidateFunction } from 'react-router';
7
7
  import 'zod';
8
8
 
@@ -139,12 +139,12 @@ type DailyReportClientConfig = {
139
139
  draftLabelName: string;
140
140
  /** 詳細/一覧カード of field 見出しラベル。既定は中立英語。アプリが自ドメインの表記を注入する。 */
141
141
  fieldLabels: DailyReportFieldLabels;
142
+ /** 外部ソース区分ごとのバッジ表示設定。 */
143
+ sourceTypeConfigs?: Record<string, SourceTypeConfig>;
142
144
  /** ヘッダー描画スロット。アプリのヘッダーコンポーネントを差し込む。 */
143
145
  renderHeader: (props: DailyReportHeaderProps) => ReactNode;
144
146
  /** 開発向けコントロール (SSE 購読トグル等) を表示するか。 */
145
147
  showDevControls: boolean;
146
- /** データソースごとのバッジ表示設定。 */
147
- sourceTypeConfigs?: Record<string, SourceTypeConfig>;
148
148
  };
149
149
  /**
150
150
  * Partial client-config override. `fieldLabels` may itself be partially overridden.
@@ -152,6 +152,7 @@ type DailyReportClientConfig = {
152
152
  */
153
153
  type DailyReportClientConfigInput = Partial<Omit<DailyReportClientConfig, "fieldLabels">> & {
154
154
  fieldLabels?: Partial<DailyReportFieldLabels>;
155
+ sourceTypeConfigs?: Record<string, SourceTypeConfig>;
155
156
  };
156
157
  /** 中立英語のフィールドラベル既定 (ドメイン非依存)。 */
157
158
  declare const defaultDailyReportFieldLabels: DailyReportFieldLabels;
@@ -170,6 +171,11 @@ declare const DailyReportConfigProvider: ({ config, children }: {
170
171
  * 日報クライアント設定を読む (プロバイダー未設置時は既定値)。
171
172
  */
172
173
  declare const useDailyReportConfig: () => DailyReportClientConfig;
174
+ /**
175
+ * Resolves source type badge configuration with case-insensitive fallback.
176
+ * ケースインセンシティブなフォールバック付きでデータソースバッジ設定を解決する。
177
+ */
178
+ declare const resolveSourceTypeConfig: (sourceType?: string | null, sourceTypeConfigs?: Record<string, SourceTypeConfig>) => SourceTypeConfig | undefined;
173
179
 
174
180
  /**
175
181
  * Error display component for daily report data fetch failures.
@@ -274,6 +280,10 @@ type DailyReportActionContextType = {
274
280
  deleteReport: (reportHubId: number, businessDate: string) => Promise<void>;
275
281
  /** stale アイテムをリストから除去する安全弁 */
276
282
  removeStaleItem: (reportHubId: number) => void;
283
+ /** データのみリロード (ページリロードなし) */
284
+ refetchData: () => Promise<void>;
285
+ /** キャッシュを破棄してデータのみ再読み込み (ページリロードなし) */
286
+ clearCacheAndRefetch: () => Promise<void>;
277
287
  };
278
288
  declare global {
279
289
  var __DailyReportActionContext: Context<DailyReportActionContextType | null> | undefined;
@@ -292,6 +302,76 @@ declare const DailyReportActionProvider: ({ children, user, initialItems, userId
292
302
  userId?: string | null;
293
303
  }) => react.JSX.Element;
294
304
 
305
+ type CacheEntry<T> = {
306
+ data: T;
307
+ expiresAt: number;
308
+ };
309
+ declare const DailyReportCache: {
310
+ reports: Map<number, CacheEntry<DailyReportDetail>>;
311
+ lists: Map<string, CacheEntry<DailyReportDetail[]>>;
312
+ pendingLists: Map<string, Promise<DailyReportDetail[]>>;
313
+ pendingReports: Map<number, Promise<DailyReportDetail>>;
314
+ listeners: Set<(id: number) => void>;
315
+ locks: Set<number>;
316
+ lastMutations: Map<number, number>;
317
+ recentDeletes: Map<number, number>;
318
+ lastPrune: number;
319
+ /**
320
+ * Prune expired entries from the cache.
321
+ * キャッシュから期限切れのエントリを削除する。
322
+ */
323
+ prune(): void;
324
+ /**
325
+ * Clear all cached entries and pending requests.
326
+ * すべてのキャッシュエントリおよび待機中リクエストをクリアする。
327
+ */
328
+ clear(): void;
329
+ /**
330
+ * Check if the cache entry is still valid.
331
+ * キャッシュエントリがまだ有効かを確認する。
332
+ */
333
+ isValid: (ex: number) => boolean;
334
+ /**
335
+ * Notify all listeners of a report update.
336
+ * レポートの更新をすべてのリスナーに通知する。
337
+ */
338
+ notify: (id: number) => void;
339
+ /**
340
+ * Retrieve a cached report by ID.
341
+ * ID でキャッシュされたレポートを取得する。
342
+ */
343
+ getReport(id: number, ignoreExpiry?: boolean): DailyReportDetail | null;
344
+ /**
345
+ * Retrieve a cached list of reports by business date key.
346
+ * 営業日キーでレポートのキャッシュリストを取得する。
347
+ */
348
+ getList(dateKey: string | null, ignoreExpiry?: boolean): DailyReportDetail[] | null;
349
+ /**
350
+ * Set a report in the cache and optionally sync with the list cache.
351
+ * キャッシュにレポートを設定し、必要に応じてリストキャッシュと同期する。
352
+ */
353
+ set(report: DailyReportDetail, expiresAt: number, syncList?: boolean): void;
354
+ /**
355
+ * Update a cached report with partial data.
356
+ * 部分的なデータでキャッシュされたレポートを更新する。
357
+ */
358
+ update(id: number, updates: Partial<DailyReportDetail>, strict?: boolean): void;
359
+ /**
360
+ * Delete a report from the cache and update the corresponding list.
361
+ * キャッシュからレポートを削除し、対応するリストを更新する。
362
+ */
363
+ delete(id: number, date: string): void;
364
+ /**
365
+ * Merge server report with cached report to handle optimistic updates and zombies.
366
+ * サーバーレポートとキャッシュレポートをマージして、楽観的更新とゾンビコメントを処理する。
367
+ */
368
+ merge(serverReport: DailyReportDetail, cachedReport?: DailyReportDetail | null): DailyReportDetail;
369
+ /**
370
+ * Hydrate the cache with fetched reports, handling comment merges and locks.
371
+ * フェッチされたレポートでキャッシュをハイドレートし、コメントのマージとロックを処理する。
372
+ */
373
+ cacheMany(reports: DailyReportDetail[], dateKey: string | null, fetchStart?: number): DailyReportDetail[];
374
+ };
295
375
  /**
296
376
  * Update the cache for a single report.
297
377
  * 単一レポートのキャッシュを更新する。
@@ -314,6 +394,11 @@ declare const updateDailyReportCache: (id: number, u: Partial<DailyReportDetail>
314
394
  * キャッシュからレポートを削除する。
315
395
  */
316
396
  declare const deleteDailyReportCache: (id: number, d: string) => void;
397
+ /**
398
+ * Clear all daily report cache store entries.
399
+ * 日報の全キャッシュストアを消去する。
400
+ */
401
+ declare const clearDailyReportCache: () => void;
317
402
  declare const acquireMutationLock: (id: number) => void;
318
403
  declare const releaseMutationLock: (id: number) => void;
319
404
  declare const registerRecentDeletion: (cId: number) => Map<number, number>;
@@ -453,4 +538,4 @@ declare const SCROLL_BAR_WIDTH = 8;
453
538
  declare const MAX_PREVIEW_LINES = 3;
454
539
  declare const TAP_SCROLL_CIRCLE_OPTIONS: ScrollBarTapCircleOptions;
455
540
 
456
- export { BusinessDayThumbOverlay, DAILY_REPORT_FETCH_DEBOUNCE_MS, DEFAULT_ITEM_HEIGHT, DailyReportActionProvider, type DailyReportClientConfig, type DailyReportClientConfigInput, DailyReportCommentForm, DailyReportCommentItem, DailyReportCommentList, DailyReportConfigProvider, DailyReportDetailList, type DailyReportDetailResource, DailyReportEditForm, type DailyReportFieldLabels, type DailyReportHeaderProps, DailyReportList, DailyReportLoadError, DailyReportLoading, DailyReportPage, type DailyReportPageProps, DailyReportResolvedContent, EMPTY_DETAIL, EMPTY_ITEM, FAST_SCROLL_INERTIA_OPTIONS, FAST_SCROLL_WHEEL_MULTIPLIER, ITEM_CONTAINER_HEIGHT, ITEM_VERTICAL_PADDING, MAX_PREVIEW_LINES, PREFETCH_LOOKAHEAD, PREFETCH_MAX_DATES, SCROLL_BAR_WIDTH, type SourceTypeConfig, TAP_SCROLL_CIRCLE_OPTIONS, UnreadIndicator, VIRTUAL_SCROLL_OVERSCAN_COUNT, WHEEL_RESET_TIMEOUT_MS, acquireMutationLock, applyDailyReportServerUpdates, createDailyReportClientLoader, dailyReportShouldRevalidate, defaultDailyReportClientConfig, defaultDailyReportFieldLabels, deleteDailyReportCache, fetchDailyReportIds, getCachedReport, registerRecentDeletion, releaseMutationLock, subscribeCacheReady, updateDailyReportCache, useDailyReportActionContext, useDailyReportComments, useDailyReportConfig, useDailyReportDetail, useDailyReportPrefetch, useDailyReportSseConnection, useDynamicViewportHeight, writeCache };
541
+ export { BusinessDayThumbOverlay, DAILY_REPORT_FETCH_DEBOUNCE_MS, DEFAULT_ITEM_HEIGHT, DailyReportActionProvider, DailyReportCache, type DailyReportClientConfig, type DailyReportClientConfigInput, DailyReportCommentForm, DailyReportCommentItem, DailyReportCommentList, DailyReportConfigProvider, DailyReportDetailList, type DailyReportDetailResource, DailyReportEditForm, type DailyReportFieldLabels, type DailyReportHeaderProps, DailyReportList, DailyReportLoadError, DailyReportLoading, DailyReportPage, type DailyReportPageProps, DailyReportResolvedContent, EMPTY_DETAIL, EMPTY_ITEM, FAST_SCROLL_INERTIA_OPTIONS, FAST_SCROLL_WHEEL_MULTIPLIER, ITEM_CONTAINER_HEIGHT, ITEM_VERTICAL_PADDING, MAX_PREVIEW_LINES, PREFETCH_LOOKAHEAD, PREFETCH_MAX_DATES, SCROLL_BAR_WIDTH, type SourceTypeConfig, TAP_SCROLL_CIRCLE_OPTIONS, UnreadIndicator, VIRTUAL_SCROLL_OVERSCAN_COUNT, WHEEL_RESET_TIMEOUT_MS, acquireMutationLock, applyDailyReportServerUpdates, clearDailyReportCache, createDailyReportClientLoader, dailyReportShouldRevalidate, defaultDailyReportClientConfig, defaultDailyReportFieldLabels, deleteDailyReportCache, fetchDailyReportIds, getCachedReport, registerRecentDeletion, releaseMutationLock, resolveSourceTypeConfig, subscribeCacheReady, updateDailyReportCache, useDailyReportActionContext, useDailyReportComments, useDailyReportConfig, useDailyReportDetail, useDailyReportPrefetch, useDailyReportSseConnection, useDynamicViewportHeight, writeCache };
package/dist/client.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, Context, RefObject } from 'react';
3
3
  import { ScrollBarThumbOverlayRenderProps, ScrollPaneInertiaOptions, ScrollBarTapCircleOptions } from '@aiquants/virtualscroll';
4
- import { U as UIComment, D as DailyReportSseMessage } from './sse-schema-BnQQh_Cc.js';
5
- import { D as DailyReportItem, a as DailyReportDetail, b as DailyReportUser } from './types-DAyE_3R1.js';
4
+ import { U as UIComment, D as DailyReportSseMessage } from './sse-schema-ChCypDPj.js';
5
+ import { D as DailyReportItem, a as DailyReportDetail, b as DailyReportUser } from './types-BNhYC2j9.js';
6
6
  import { ShouldRevalidateFunction } from 'react-router';
7
7
  import 'zod';
8
8
 
@@ -139,12 +139,12 @@ type DailyReportClientConfig = {
139
139
  draftLabelName: string;
140
140
  /** 詳細/一覧カード of field 見出しラベル。既定は中立英語。アプリが自ドメインの表記を注入する。 */
141
141
  fieldLabels: DailyReportFieldLabels;
142
+ /** 外部ソース区分ごとのバッジ表示設定。 */
143
+ sourceTypeConfigs?: Record<string, SourceTypeConfig>;
142
144
  /** ヘッダー描画スロット。アプリのヘッダーコンポーネントを差し込む。 */
143
145
  renderHeader: (props: DailyReportHeaderProps) => ReactNode;
144
146
  /** 開発向けコントロール (SSE 購読トグル等) を表示するか。 */
145
147
  showDevControls: boolean;
146
- /** データソースごとのバッジ表示設定。 */
147
- sourceTypeConfigs?: Record<string, SourceTypeConfig>;
148
148
  };
149
149
  /**
150
150
  * Partial client-config override. `fieldLabels` may itself be partially overridden.
@@ -152,6 +152,7 @@ type DailyReportClientConfig = {
152
152
  */
153
153
  type DailyReportClientConfigInput = Partial<Omit<DailyReportClientConfig, "fieldLabels">> & {
154
154
  fieldLabels?: Partial<DailyReportFieldLabels>;
155
+ sourceTypeConfigs?: Record<string, SourceTypeConfig>;
155
156
  };
156
157
  /** 中立英語のフィールドラベル既定 (ドメイン非依存)。 */
157
158
  declare const defaultDailyReportFieldLabels: DailyReportFieldLabels;
@@ -170,6 +171,11 @@ declare const DailyReportConfigProvider: ({ config, children }: {
170
171
  * 日報クライアント設定を読む (プロバイダー未設置時は既定値)。
171
172
  */
172
173
  declare const useDailyReportConfig: () => DailyReportClientConfig;
174
+ /**
175
+ * Resolves source type badge configuration with case-insensitive fallback.
176
+ * ケースインセンシティブなフォールバック付きでデータソースバッジ設定を解決する。
177
+ */
178
+ declare const resolveSourceTypeConfig: (sourceType?: string | null, sourceTypeConfigs?: Record<string, SourceTypeConfig>) => SourceTypeConfig | undefined;
173
179
 
174
180
  /**
175
181
  * Error display component for daily report data fetch failures.
@@ -274,6 +280,10 @@ type DailyReportActionContextType = {
274
280
  deleteReport: (reportHubId: number, businessDate: string) => Promise<void>;
275
281
  /** stale アイテムをリストから除去する安全弁 */
276
282
  removeStaleItem: (reportHubId: number) => void;
283
+ /** データのみリロード (ページリロードなし) */
284
+ refetchData: () => Promise<void>;
285
+ /** キャッシュを破棄してデータのみ再読み込み (ページリロードなし) */
286
+ clearCacheAndRefetch: () => Promise<void>;
277
287
  };
278
288
  declare global {
279
289
  var __DailyReportActionContext: Context<DailyReportActionContextType | null> | undefined;
@@ -292,6 +302,76 @@ declare const DailyReportActionProvider: ({ children, user, initialItems, userId
292
302
  userId?: string | null;
293
303
  }) => react.JSX.Element;
294
304
 
305
+ type CacheEntry<T> = {
306
+ data: T;
307
+ expiresAt: number;
308
+ };
309
+ declare const DailyReportCache: {
310
+ reports: Map<number, CacheEntry<DailyReportDetail>>;
311
+ lists: Map<string, CacheEntry<DailyReportDetail[]>>;
312
+ pendingLists: Map<string, Promise<DailyReportDetail[]>>;
313
+ pendingReports: Map<number, Promise<DailyReportDetail>>;
314
+ listeners: Set<(id: number) => void>;
315
+ locks: Set<number>;
316
+ lastMutations: Map<number, number>;
317
+ recentDeletes: Map<number, number>;
318
+ lastPrune: number;
319
+ /**
320
+ * Prune expired entries from the cache.
321
+ * キャッシュから期限切れのエントリを削除する。
322
+ */
323
+ prune(): void;
324
+ /**
325
+ * Clear all cached entries and pending requests.
326
+ * すべてのキャッシュエントリおよび待機中リクエストをクリアする。
327
+ */
328
+ clear(): void;
329
+ /**
330
+ * Check if the cache entry is still valid.
331
+ * キャッシュエントリがまだ有効かを確認する。
332
+ */
333
+ isValid: (ex: number) => boolean;
334
+ /**
335
+ * Notify all listeners of a report update.
336
+ * レポートの更新をすべてのリスナーに通知する。
337
+ */
338
+ notify: (id: number) => void;
339
+ /**
340
+ * Retrieve a cached report by ID.
341
+ * ID でキャッシュされたレポートを取得する。
342
+ */
343
+ getReport(id: number, ignoreExpiry?: boolean): DailyReportDetail | null;
344
+ /**
345
+ * Retrieve a cached list of reports by business date key.
346
+ * 営業日キーでレポートのキャッシュリストを取得する。
347
+ */
348
+ getList(dateKey: string | null, ignoreExpiry?: boolean): DailyReportDetail[] | null;
349
+ /**
350
+ * Set a report in the cache and optionally sync with the list cache.
351
+ * キャッシュにレポートを設定し、必要に応じてリストキャッシュと同期する。
352
+ */
353
+ set(report: DailyReportDetail, expiresAt: number, syncList?: boolean): void;
354
+ /**
355
+ * Update a cached report with partial data.
356
+ * 部分的なデータでキャッシュされたレポートを更新する。
357
+ */
358
+ update(id: number, updates: Partial<DailyReportDetail>, strict?: boolean): void;
359
+ /**
360
+ * Delete a report from the cache and update the corresponding list.
361
+ * キャッシュからレポートを削除し、対応するリストを更新する。
362
+ */
363
+ delete(id: number, date: string): void;
364
+ /**
365
+ * Merge server report with cached report to handle optimistic updates and zombies.
366
+ * サーバーレポートとキャッシュレポートをマージして、楽観的更新とゾンビコメントを処理する。
367
+ */
368
+ merge(serverReport: DailyReportDetail, cachedReport?: DailyReportDetail | null): DailyReportDetail;
369
+ /**
370
+ * Hydrate the cache with fetched reports, handling comment merges and locks.
371
+ * フェッチされたレポートでキャッシュをハイドレートし、コメントのマージとロックを処理する。
372
+ */
373
+ cacheMany(reports: DailyReportDetail[], dateKey: string | null, fetchStart?: number): DailyReportDetail[];
374
+ };
295
375
  /**
296
376
  * Update the cache for a single report.
297
377
  * 単一レポートのキャッシュを更新する。
@@ -314,6 +394,11 @@ declare const updateDailyReportCache: (id: number, u: Partial<DailyReportDetail>
314
394
  * キャッシュからレポートを削除する。
315
395
  */
316
396
  declare const deleteDailyReportCache: (id: number, d: string) => void;
397
+ /**
398
+ * Clear all daily report cache store entries.
399
+ * 日報の全キャッシュストアを消去する。
400
+ */
401
+ declare const clearDailyReportCache: () => void;
317
402
  declare const acquireMutationLock: (id: number) => void;
318
403
  declare const releaseMutationLock: (id: number) => void;
319
404
  declare const registerRecentDeletion: (cId: number) => Map<number, number>;
@@ -453,4 +538,4 @@ declare const SCROLL_BAR_WIDTH = 8;
453
538
  declare const MAX_PREVIEW_LINES = 3;
454
539
  declare const TAP_SCROLL_CIRCLE_OPTIONS: ScrollBarTapCircleOptions;
455
540
 
456
- export { BusinessDayThumbOverlay, DAILY_REPORT_FETCH_DEBOUNCE_MS, DEFAULT_ITEM_HEIGHT, DailyReportActionProvider, type DailyReportClientConfig, type DailyReportClientConfigInput, DailyReportCommentForm, DailyReportCommentItem, DailyReportCommentList, DailyReportConfigProvider, DailyReportDetailList, type DailyReportDetailResource, DailyReportEditForm, type DailyReportFieldLabels, type DailyReportHeaderProps, DailyReportList, DailyReportLoadError, DailyReportLoading, DailyReportPage, type DailyReportPageProps, DailyReportResolvedContent, EMPTY_DETAIL, EMPTY_ITEM, FAST_SCROLL_INERTIA_OPTIONS, FAST_SCROLL_WHEEL_MULTIPLIER, ITEM_CONTAINER_HEIGHT, ITEM_VERTICAL_PADDING, MAX_PREVIEW_LINES, PREFETCH_LOOKAHEAD, PREFETCH_MAX_DATES, SCROLL_BAR_WIDTH, type SourceTypeConfig, TAP_SCROLL_CIRCLE_OPTIONS, UnreadIndicator, VIRTUAL_SCROLL_OVERSCAN_COUNT, WHEEL_RESET_TIMEOUT_MS, acquireMutationLock, applyDailyReportServerUpdates, createDailyReportClientLoader, dailyReportShouldRevalidate, defaultDailyReportClientConfig, defaultDailyReportFieldLabels, deleteDailyReportCache, fetchDailyReportIds, getCachedReport, registerRecentDeletion, releaseMutationLock, subscribeCacheReady, updateDailyReportCache, useDailyReportActionContext, useDailyReportComments, useDailyReportConfig, useDailyReportDetail, useDailyReportPrefetch, useDailyReportSseConnection, useDynamicViewportHeight, writeCache };
541
+ export { BusinessDayThumbOverlay, DAILY_REPORT_FETCH_DEBOUNCE_MS, DEFAULT_ITEM_HEIGHT, DailyReportActionProvider, DailyReportCache, type DailyReportClientConfig, type DailyReportClientConfigInput, DailyReportCommentForm, DailyReportCommentItem, DailyReportCommentList, DailyReportConfigProvider, DailyReportDetailList, type DailyReportDetailResource, DailyReportEditForm, type DailyReportFieldLabels, type DailyReportHeaderProps, DailyReportList, DailyReportLoadError, DailyReportLoading, DailyReportPage, type DailyReportPageProps, DailyReportResolvedContent, EMPTY_DETAIL, EMPTY_ITEM, FAST_SCROLL_INERTIA_OPTIONS, FAST_SCROLL_WHEEL_MULTIPLIER, ITEM_CONTAINER_HEIGHT, ITEM_VERTICAL_PADDING, MAX_PREVIEW_LINES, PREFETCH_LOOKAHEAD, PREFETCH_MAX_DATES, SCROLL_BAR_WIDTH, type SourceTypeConfig, TAP_SCROLL_CIRCLE_OPTIONS, UnreadIndicator, VIRTUAL_SCROLL_OVERSCAN_COUNT, WHEEL_RESET_TIMEOUT_MS, acquireMutationLock, applyDailyReportServerUpdates, clearDailyReportCache, createDailyReportClientLoader, dailyReportShouldRevalidate, defaultDailyReportClientConfig, defaultDailyReportFieldLabels, deleteDailyReportCache, fetchDailyReportIds, getCachedReport, registerRecentDeletion, releaseMutationLock, resolveSourceTypeConfig, subscribeCacheReady, updateDailyReportCache, useDailyReportActionContext, useDailyReportComments, useDailyReportConfig, useDailyReportDetail, useDailyReportPrefetch, useDailyReportSseConnection, useDynamicViewportHeight, writeCache };