@hyperframes/shader-transitions 0.3.0

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.
@@ -0,0 +1,35 @@
1
+ interface ShaderDef {
2
+ frag: string;
3
+ }
4
+ declare const shaders: Record<string, ShaderDef>;
5
+ type ShaderName = keyof typeof shaders;
6
+ declare const SHADER_NAMES: ShaderName[];
7
+
8
+ interface GsapTimeline {
9
+ paused: () => boolean;
10
+ play: () => GsapTimeline;
11
+ pause: () => GsapTimeline;
12
+ call: (fn: () => void, args: null, position: number) => GsapTimeline;
13
+ to: (target: Record<string, unknown>, vars: Record<string, unknown>, position: number) => GsapTimeline;
14
+ set: (target: string, vars: Record<string, unknown>, position?: number) => GsapTimeline;
15
+ from: (target: string, vars: Record<string, unknown>, position?: number) => GsapTimeline;
16
+ fromTo: (target: string, from: Record<string, unknown>, to: Record<string, unknown>, position?: number) => GsapTimeline;
17
+ [key: string]: unknown;
18
+ }
19
+ interface TransitionConfig {
20
+ time: number;
21
+ shader: ShaderName;
22
+ duration?: number;
23
+ ease?: string;
24
+ }
25
+ interface HyperShaderConfig {
26
+ bgColor: string;
27
+ accentColor?: string;
28
+ scenes: string[];
29
+ transitions: TransitionConfig[];
30
+ timeline?: GsapTimeline;
31
+ compositionId?: string;
32
+ }
33
+ declare function init(config: HyperShaderConfig): GsapTimeline;
34
+
35
+ export { type HyperShaderConfig, SHADER_NAMES, type ShaderName, type TransitionConfig, init };
@@ -0,0 +1,35 @@
1
+ interface ShaderDef {
2
+ frag: string;
3
+ }
4
+ declare const shaders: Record<string, ShaderDef>;
5
+ type ShaderName = keyof typeof shaders;
6
+ declare const SHADER_NAMES: ShaderName[];
7
+
8
+ interface GsapTimeline {
9
+ paused: () => boolean;
10
+ play: () => GsapTimeline;
11
+ pause: () => GsapTimeline;
12
+ call: (fn: () => void, args: null, position: number) => GsapTimeline;
13
+ to: (target: Record<string, unknown>, vars: Record<string, unknown>, position: number) => GsapTimeline;
14
+ set: (target: string, vars: Record<string, unknown>, position?: number) => GsapTimeline;
15
+ from: (target: string, vars: Record<string, unknown>, position?: number) => GsapTimeline;
16
+ fromTo: (target: string, from: Record<string, unknown>, to: Record<string, unknown>, position?: number) => GsapTimeline;
17
+ [key: string]: unknown;
18
+ }
19
+ interface TransitionConfig {
20
+ time: number;
21
+ shader: ShaderName;
22
+ duration?: number;
23
+ ease?: string;
24
+ }
25
+ interface HyperShaderConfig {
26
+ bgColor: string;
27
+ accentColor?: string;
28
+ scenes: string[];
29
+ transitions: TransitionConfig[];
30
+ timeline?: GsapTimeline;
31
+ compositionId?: string;
32
+ }
33
+ declare function init(config: HyperShaderConfig): GsapTimeline;
34
+
35
+ export { type HyperShaderConfig, SHADER_NAMES, type ShaderName, type TransitionConfig, init };