@embedpdf-editor/vue3-chapter-viewer 1.0.6 → 1.0.7-beta.2

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
@@ -213,6 +213,11 @@ export declare class ChapterManagerPlugin extends BasePlugin<ChapterManagerPlugi
213
213
  private readonly pendingChapterUrlsPromises;
214
214
  private unloadTimer;
215
215
  private documentManagerUnsubs;
216
+ private segmentScheduler;
217
+ /** 视口内下一段预取,优先级 = 视口距离 + 该值 */
218
+ private readonly SEG_PRIO_PREFETCH_NEXT;
219
+ /** 相邻章仅预取第 0 段 */
220
+ private readonly SEG_PRIO_CHAPTER_PREFETCH_BASE;
216
221
  constructor(id: string, registry: PluginRegistry);
217
222
  initialize(config: ChapterManagerPluginConfig): Promise<void>;
218
223
  protected buildCapability(): ChapterManagerCapability;
@@ -221,15 +226,19 @@ export declare class ChapterManagerPlugin extends BasePlugin<ChapterManagerPlugi
221
226
  private eagerPrefetchFromManifest;
222
227
  private findChapter;
223
228
  private getSegmentPlanForChapter;
229
+ private anySegmentOpen;
224
230
  private isSegmentDocumentOpen;
225
231
  private resolveSegmentDocumentId;
226
232
  private isSegmentLoadPending;
227
233
  private syncChapterStatusFromDocuments;
234
+ private lastVisibleIndicesKey;
228
235
  private handleVisibleChange;
229
236
  private collectIdleChapters;
230
237
  ensureChapterLoaded(chapterId: string): Promise<ChapterLoadStatus>;
231
238
  ensureAllSegmentsLoaded(chapterId: string): Promise<ChapterLoadStatus>;
239
+ /** 显式加载(跳转/导出等),不走可见区调度队列 */
232
240
  ensureSegmentLoaded(chapterId: string, segmentIndex: number): Promise<ChapterLoadStatus>;
241
+ private loadSegmentNow;
233
242
  private ensureSingleDocumentChapter;
234
243
  private resolveChapterUrls;
235
244
  private openPayloadFromUrl;
@@ -249,6 +258,8 @@ declare interface ChapterManagerPluginConfig extends BasePluginConfig {
249
258
  chapterPdfLoader?: IChapterPdfLoader;
250
259
  /** 视口前后预取多少章节,默认 1 */
251
260
  prefetchChapters?: number;
261
+ /** 同时 open 的分段 PDF 上限,默认 2(避免多段并行 WASM 卡主线程) */
262
+ maxConcurrentSegmentLoads?: number;
252
263
  /** 章节空闲多久后卸载(毫秒),默认 60s。设为 0 关闭卸载 */
253
264
  unloadTimeoutMs?: number;
254
265
  /** 第一个加载的章节是否自动设为 active,默认 true */
@@ -548,6 +559,8 @@ export declare interface CreatePdfChapterEditorOptions {
548
559
  toolbar?: PdfChapterEditorToolbarConfig;
549
560
  /** 传给 chapter-manager;manifest 就绪后预取前 N 章 */
550
561
  prefetchChapters?: number;
562
+ /** 同时 open 的分段 PDF 数,默认 2 */
563
+ maxConcurrentSegmentLoads?: number;
551
564
  /** 为 false 时不拉取 CDN 默认图章库(@embedpdf/default-stamps) */
552
565
  loadDefaultStampLibrary?: boolean;
553
566
  unloadTimeoutMs?: number;