@coxwave/tap-kit-types 2.1.0 → 2.5.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 +32 -7
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -223,6 +223,8 @@ interface MaterialViewOpenMessage {
|
|
|
223
223
|
pageStart: number;
|
|
224
224
|
pageEnd: number;
|
|
225
225
|
title?: string;
|
|
226
|
+
/** Text phrases to highlight in PDF (from reference_string parsing) */
|
|
227
|
+
highlightPhrases?: string[];
|
|
226
228
|
nonce?: string | number;
|
|
227
229
|
}
|
|
228
230
|
/**
|
|
@@ -367,6 +369,8 @@ interface ConfigUpdateMessage {
|
|
|
367
369
|
minViewportWidth?: number;
|
|
368
370
|
};
|
|
369
371
|
};
|
|
372
|
+
/** SDK source for deprecation tracking (temporary - remove after monitoring period) */
|
|
373
|
+
sdkSource?: "tap-kit" | "tap-sdk";
|
|
370
374
|
}
|
|
371
375
|
/**
|
|
372
376
|
* Config Request Message (iframe → parent, call/handle pattern)
|
|
@@ -2226,6 +2230,7 @@ declare const ConfigUpdateSchema: ObjectSchema<{
|
|
|
2226
2230
|
readonly minViewportWidth: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
2227
2231
|
}, undefined>, undefined>;
|
|
2228
2232
|
}, undefined>, undefined>;
|
|
2233
|
+
readonly sdkSource: OptionalSchema<UnionSchema<[LiteralSchema<"tap-kit", undefined>, LiteralSchema<"tap-sdk", undefined>], undefined>, undefined>;
|
|
2229
2234
|
}, undefined>;
|
|
2230
2235
|
declare const ConfigRequestSchema: ObjectSchema<{
|
|
2231
2236
|
readonly type: LiteralSchema<"config:request", undefined>;
|
|
@@ -2336,6 +2341,7 @@ declare const TapMessageSchema: UnionSchema<[ObjectSchema<{
|
|
|
2336
2341
|
readonly minViewportWidth: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
2337
2342
|
}, undefined>, undefined>;
|
|
2338
2343
|
}, undefined>, undefined>;
|
|
2344
|
+
readonly sdkSource: OptionalSchema<UnionSchema<[LiteralSchema<"tap-kit", undefined>, LiteralSchema<"tap-sdk", undefined>], undefined>, undefined>;
|
|
2339
2345
|
}, undefined>, ObjectSchema<{
|
|
2340
2346
|
readonly type: LiteralSchema<"config:request", undefined>;
|
|
2341
2347
|
readonly nonce: OptionalSchema<UnionSchema<[StringSchema<undefined>, NumberSchema<undefined>], undefined>, undefined>;
|
|
@@ -2647,9 +2653,25 @@ type ContainerVisibility = "open" | "closed";
|
|
|
2647
2653
|
*
|
|
2648
2654
|
* @example
|
|
2649
2655
|
* ```typescript
|
|
2650
|
-
*
|
|
2656
|
+
* // Simple adapter (backward compatible)
|
|
2657
|
+
* const simpleAdapter: VideoPlayerAdapter = {
|
|
2651
2658
|
* getCurrentTime: () => player.currentTime,
|
|
2652
|
-
* setCurrentTime: (time) => {
|
|
2659
|
+
* setCurrentTime: (time) => {
|
|
2660
|
+
* player.currentTime = time;
|
|
2661
|
+
* }
|
|
2662
|
+
* };
|
|
2663
|
+
*
|
|
2664
|
+
* // Cross-clip seeking adapter (recommended)
|
|
2665
|
+
* const crossClipAdapter: VideoPlayerAdapter = {
|
|
2666
|
+
* getCurrentTime: () => player.currentTime,
|
|
2667
|
+
* setCurrentTime: (time, clipId) => {
|
|
2668
|
+
* // clipId enables cross-clip seeking (e.g., jump to different lecture)
|
|
2669
|
+
* if (clipId && clipId !== currentClipId) {
|
|
2670
|
+
* loadClip(clipId).then(() => player.currentTime = time);
|
|
2671
|
+
* } else {
|
|
2672
|
+
* player.currentTime = time;
|
|
2673
|
+
* }
|
|
2674
|
+
* }
|
|
2653
2675
|
* };
|
|
2654
2676
|
* ```
|
|
2655
2677
|
*/
|
|
@@ -2659,9 +2681,9 @@ interface VideoPlayerAdapter {
|
|
|
2659
2681
|
/**
|
|
2660
2682
|
* Set playback time in seconds
|
|
2661
2683
|
* @param time - Playback time in seconds
|
|
2662
|
-
* @param clipId - ClipId from the seek request (for cross-clip seeking)
|
|
2684
|
+
* @param clipId - ClipId from the seek request (for cross-clip seeking). Optional for backward compatibility.
|
|
2663
2685
|
*/
|
|
2664
|
-
setCurrentTime: (time: number, clipId
|
|
2686
|
+
setCurrentTime: (time: number, clipId?: string) => void;
|
|
2665
2687
|
}
|
|
2666
2688
|
/**
|
|
2667
2689
|
* Video Player Configuration
|
|
@@ -2673,10 +2695,13 @@ interface VideoPlayerAdapter {
|
|
|
2673
2695
|
* const videoElement = document.querySelector('video');
|
|
2674
2696
|
* sdk.video.bind(videoElement); // clipId from SDK config, auto-updates with setCourse()
|
|
2675
2697
|
*
|
|
2676
|
-
* // Custom Adapter
|
|
2677
|
-
* const adapter = {
|
|
2698
|
+
* // Custom Adapter (YouTube, Vimeo, etc.)
|
|
2699
|
+
* const adapter: VideoPlayerAdapter = {
|
|
2678
2700
|
* getCurrentTime: () => player.currentTime,
|
|
2679
|
-
* setCurrentTime: (time) => {
|
|
2701
|
+
* setCurrentTime: (time, clipId) => {
|
|
2702
|
+
* // clipId enables cross-clip seeking (e.g., jump to different lecture)
|
|
2703
|
+
* player.currentTime = time;
|
|
2704
|
+
* }
|
|
2680
2705
|
* };
|
|
2681
2706
|
* sdk.video.bind(adapter);
|
|
2682
2707
|
*
|
package/dist/index.js
CHANGED