@hyperframes/shader-transitions 0.6.6 → 0.6.8

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.cts CHANGED
@@ -40,4 +40,59 @@ declare function init(config: HyperShaderConfig): GsapTimeline;
40
40
 
41
41
  declare function isHtmlInCanvasCaptureSupported(): boolean;
42
42
 
43
- export { type HyperShaderConfig, SHADER_NAMES, type ShaderName, type TransitionConfig, init, isHtmlInCanvasCaptureSupported };
43
+ interface AccentColors {
44
+ accent: [number, number, number];
45
+ dark: [number, number, number];
46
+ bright: [number, number, number];
47
+ }
48
+
49
+ /**
50
+ * engineModePageComposite — page-side WebGL compositor for engine render mode.
51
+ *
52
+ * Opt-in via `window.__HF_PAGE_SIDE_COMPOSITING__ = true` (set by the producer
53
+ * when `EngineConfig.enablePageSideCompositing` is true). When the flag is
54
+ * off, hyper-shader's engine-mode path stays on the opacity-flip-only timeline
55
+ * and the producer's hf#677 Node-side layered pipeline runs the shader blend.
56
+ *
57
+ * Two-phase capture protocol:
58
+ *
59
+ * Phase 1 (seek wrapper, runs inside page.evaluate):
60
+ * - Runs original GSAP seek to position the timeline
61
+ * - If inside a transition window, clones FROM/TO scene elements into
62
+ * layoutsubtree staging canvases
63
+ * - Sets window.__hf_page_composite_pending with transition metadata
64
+ * - Returns immediately (seek resolves)
65
+ *
66
+ * Paint force (engine-side, frameCapture.ts):
67
+ * - Engine detects the pending flag and fires a micro Page.captureScreenshot
68
+ * to force the browser compositor to paint the staging canvas clones
69
+ *
70
+ * Phase 2 (engine calls window.__hf_page_composite_resolve):
71
+ * - drawElementImage reads the now-valid paint records from the clones
72
+ * - Uploads textures to WebGL, runs the shader, shows the GL overlay
73
+ * - Cleans up staging canvases
74
+ *
75
+ * This gives native-fidelity capture (identical to preview-path
76
+ * drawElementImage) without depending on requestAnimationFrame for paint.
77
+ */
78
+
79
+ interface PageCompositeTransitionConfig {
80
+ time: number;
81
+ shader: ShaderName;
82
+ duration?: number;
83
+ }
84
+ interface PageCompositorInstallOptions {
85
+ scenes: string[];
86
+ transitions: PageCompositeTransitionConfig[];
87
+ bgColor: string;
88
+ accentColors: AccentColors;
89
+ width: number;
90
+ height: number;
91
+ defaultDuration: number;
92
+ }
93
+ declare const PAGE_COMPOSITOR_CANVAS_ID = "__hf-page-side-compositor";
94
+ declare const PAGE_COMPOSITOR_BUILD_CANARY = "__hf_page_compositor_v1__";
95
+ declare function isPageSideCompositingSupported(): boolean;
96
+ declare function installPageSideCompositor(options: PageCompositorInstallOptions): boolean;
97
+
98
+ export { type HyperShaderConfig, PAGE_COMPOSITOR_BUILD_CANARY, PAGE_COMPOSITOR_CANVAS_ID, SHADER_NAMES, type ShaderName, type TransitionConfig, init, installPageSideCompositor, isHtmlInCanvasCaptureSupported, isPageSideCompositingSupported };
package/dist/index.d.ts CHANGED
@@ -40,4 +40,59 @@ declare function init(config: HyperShaderConfig): GsapTimeline;
40
40
 
41
41
  declare function isHtmlInCanvasCaptureSupported(): boolean;
42
42
 
43
- export { type HyperShaderConfig, SHADER_NAMES, type ShaderName, type TransitionConfig, init, isHtmlInCanvasCaptureSupported };
43
+ interface AccentColors {
44
+ accent: [number, number, number];
45
+ dark: [number, number, number];
46
+ bright: [number, number, number];
47
+ }
48
+
49
+ /**
50
+ * engineModePageComposite — page-side WebGL compositor for engine render mode.
51
+ *
52
+ * Opt-in via `window.__HF_PAGE_SIDE_COMPOSITING__ = true` (set by the producer
53
+ * when `EngineConfig.enablePageSideCompositing` is true). When the flag is
54
+ * off, hyper-shader's engine-mode path stays on the opacity-flip-only timeline
55
+ * and the producer's hf#677 Node-side layered pipeline runs the shader blend.
56
+ *
57
+ * Two-phase capture protocol:
58
+ *
59
+ * Phase 1 (seek wrapper, runs inside page.evaluate):
60
+ * - Runs original GSAP seek to position the timeline
61
+ * - If inside a transition window, clones FROM/TO scene elements into
62
+ * layoutsubtree staging canvases
63
+ * - Sets window.__hf_page_composite_pending with transition metadata
64
+ * - Returns immediately (seek resolves)
65
+ *
66
+ * Paint force (engine-side, frameCapture.ts):
67
+ * - Engine detects the pending flag and fires a micro Page.captureScreenshot
68
+ * to force the browser compositor to paint the staging canvas clones
69
+ *
70
+ * Phase 2 (engine calls window.__hf_page_composite_resolve):
71
+ * - drawElementImage reads the now-valid paint records from the clones
72
+ * - Uploads textures to WebGL, runs the shader, shows the GL overlay
73
+ * - Cleans up staging canvases
74
+ *
75
+ * This gives native-fidelity capture (identical to preview-path
76
+ * drawElementImage) without depending on requestAnimationFrame for paint.
77
+ */
78
+
79
+ interface PageCompositeTransitionConfig {
80
+ time: number;
81
+ shader: ShaderName;
82
+ duration?: number;
83
+ }
84
+ interface PageCompositorInstallOptions {
85
+ scenes: string[];
86
+ transitions: PageCompositeTransitionConfig[];
87
+ bgColor: string;
88
+ accentColors: AccentColors;
89
+ width: number;
90
+ height: number;
91
+ defaultDuration: number;
92
+ }
93
+ declare const PAGE_COMPOSITOR_CANVAS_ID = "__hf-page-side-compositor";
94
+ declare const PAGE_COMPOSITOR_BUILD_CANARY = "__hf_page_compositor_v1__";
95
+ declare function isPageSideCompositingSupported(): boolean;
96
+ declare function installPageSideCompositor(options: PageCompositorInstallOptions): boolean;
97
+
98
+ export { type HyperShaderConfig, PAGE_COMPOSITOR_BUILD_CANARY, PAGE_COMPOSITOR_CANVAS_ID, SHADER_NAMES, type ShaderName, type TransitionConfig, init, installPageSideCompositor, isHtmlInCanvasCaptureSupported, isPageSideCompositingSupported };