book-index-ui 0.65.2 → 0.65.3

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
@@ -3255,6 +3255,12 @@ export declare function ImagePanel({ pages, loading, page: pageProp, onPageChang
3255
3255
  preserveMargins?: boolean;
3256
3256
  }): JSX.Element;
3257
3257
 
3258
+ /**
3259
+ * 宿主自带的取图办法:返回 Promise 就由宿主给图(可以是它现摆正出来的图),返回 null/undefined 走默认的 `<img>` 加载。
3260
+ * 例:海外读者的 Commons 缩略图要先套透视矩阵才和逐字框同一坐标系。Promise 给 null 当作加载失败。
3261
+ */
3262
+ export declare type ImageSourceResolver = (url: string) => Promise<HTMLImageElement | null> | null | undefined;
3263
+
3258
3264
  /**
3259
3265
  * 完整的索引浏览应用:左侧导航 + 右侧详情。
3260
3266
  * 从 demo app (main.tsx) 提取,可直接嵌入任何 React 应用。
@@ -6494,6 +6500,8 @@ declare interface SectionProps {
6494
6500
  */
6495
6501
  export declare function segmentEntities(text: string, spans: readonly EntitySpan[], relocateWindow?: number): EntitySegment[];
6496
6502
 
6503
+ export declare function setImageSourceResolver(fn: ImageSourceResolver | null): void;
6504
+
6497
6505
  /** 七阁的分组 key:这一组画成一排方格,其余分组画成列表 */
6498
6506
  export declare const SEVEN_PAVILIONS_KEY = "siku_qige";
6499
6507