@embedpdf-editor/vue3-chapter-viewer 1.0.7-beta.3 → 1.0.7-beta.5

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.
package/dist/index.d.ts CHANGED
@@ -217,11 +217,9 @@ export declare class ChapterManagerPlugin extends BasePlugin<ChapterManagerPlugi
217
217
  private readonly pendingChapterUrlsPromises;
218
218
  private unloadTimer;
219
219
  private documentManagerUnsubs;
220
- private segmentScheduler;
221
- /** 视口内下一段预取,优先级 = 视口距离 + 该值 */
222
- private readonly SEG_PRIO_PREFETCH_NEXT;
223
- /** 相邻章仅预取第 0 段 */
224
- private readonly SEG_PRIO_CHAPTER_PREFETCH_BASE;
220
+ /** 可见区驱动的分段加载 backlog(限制并发 open,避免仅缓存 URL 却不请求 PDF) */
221
+ private visibleSegmentBacklog;
222
+ private activeVisibleSegmentLoads;
225
223
  constructor(id: string, registry: PluginRegistry);
226
224
  initialize(config: ChapterManagerPluginConfig): Promise<void>;
227
225
  protected buildCapability(): ChapterManagerCapability;
@@ -239,6 +237,12 @@ export declare class ChapterManagerPlugin extends BasePlugin<ChapterManagerPlugi
239
237
  private lastVisibleIndicesKey;
240
238
  visibleRangeNeedsSegmentLoad(visibleGlobalPageIndices: number[]): boolean;
241
239
  shouldShowChapterLoadError(chapterId: string, segmentIndex: number): boolean;
240
+ private clearVisibleSegmentBacklog;
241
+ /** 分段在整本中的阅读顺序(globalPageIndex 升序 → 按章按段依次 open PDF) */
242
+ private globalSegmentSortKey;
243
+ /** 按阅读顺序重建队列并立即 pump(替换旧 backlog,避免末尾多章同时 loading) */
244
+ private scheduleVisibleSegmentLoads;
245
+ private pumpVisibleSegmentBacklog;
242
246
  private prepareChapterForSegmentLoad;
243
247
  private handleVisibleChange;
244
248
  private collectIdleChapters;
@@ -487,6 +491,12 @@ export declare interface ChapterViewerOptions {
487
491
  * 亦可用 `overlapStrategyForSamePageOwner('first' | 'last')`(chapter-core 包)
488
492
  */
489
493
  overlapStrategy?: OverlapOwnerStrategy;
494
+ /** manifest 就绪后预取前 N 章第 0 段;滚动时另会预取视口相邻章。默认 1 */
495
+ prefetchChapters?: number;
496
+ /** 滚动按需同时 open 的分段 PDF 上限。默认 2 */
497
+ maxConcurrentSegmentLoads?: number;
498
+ /** 章节空闲卸载超时(ms)。默认 120000 */
499
+ unloadTimeoutMs?: number;
490
500
  /** 功能开关与样式;省略则全开 */
491
501
  features?: ChapterViewerConfig;
492
502
  }