@designcombo/video 0.0.1 → 0.0.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/{SharedSystems-BhqLJf5z.js → SharedSystems-BWe03l6N.js} +20 -20
- package/dist/{WebGLRenderer-BzdmWLtP.js → WebGLRenderer-CKduQ9yw.js} +22 -22
- package/dist/{WebGPURenderer-Cypu9NWE.js → WebGPURenderer-BSX8DZj-.js} +19 -19
- package/dist/{browserAll-7OZQazmn.js → browserAll-CwPYLzJJ.js} +2 -2
- package/dist/clips/caption-clip.d.ts +33 -7
- package/dist/clips/image-clip.d.ts +26 -0
- package/dist/clips/text-clip.d.ts +34 -8
- package/dist/clips/video-clip.d.ts +30 -4
- package/dist/colorToUniform-C2jGzNe1.js +97 -0
- package/dist/effect/effect.d.ts +6 -0
- package/dist/effect/glsl/custom-glsl.d.ts +523 -0
- package/dist/effect/glsl/gl-effect.d.ts +14 -0
- package/dist/effect/types.d.ts +24 -0
- package/dist/effect/vertex.d.ts +1 -0
- package/dist/event-emitter.d.ts +47 -0
- package/dist/{index-BuRTeJh6.js → index-C333riU-.js} +8996 -6701
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +18 -16
- package/dist/index.umd.js +1492 -105
- package/dist/json-serialization.d.ts +14 -0
- package/dist/sprite/base-sprite.d.ts +7 -0
- package/dist/sprite/pixi-sprite-renderer.d.ts +1 -1
- package/dist/studio.d.ts +41 -2
- package/dist/{webworkerAll-DChKIQQa.js → webworkerAll-aNnyDpl9.js} +49 -49
- package/package.json +1 -1
- package/dist/colorToUniform-B0NRe8Du.js +0 -274
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
export declare const ROTATION_MOVEMENT_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime;\nuniform float rotationCount; \n\nvoid main(void)\n{\n vec2 center = vec2(0.35, 0.35);\n vec2 uvs = vTextureCoord.xy - center;\n \n // Rotaci\u00F3n en funci\u00F3n de la cantidad de vueltas\n float angle = uTime * rotationCount * 6.28318530718;\n \n float cosAngle = cos(angle);\n float sinAngle = sin(angle);\n mat2 rotation = mat2(cosAngle, -sinAngle, sinAngle, cosAngle);\n \n uvs = rotation * uvs;\n uvs += center;\n \n if (uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0) {\n discard;\n }\n \n vec4 fg = texture2D(uTexture, uvs);\n gl_FragColor = fg;\n}\n";
|
|
2
|
+
export declare const ROTATION_MOVEMENT_UNIFORMS: Record<string, {
|
|
3
|
+
value: any;
|
|
4
|
+
type: string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const RED_GRADIENT_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime;\n\nvoid main(void)\n{\n vec2 uvs = vTextureCoord.xy;\n\n vec4 fg = texture2D(uTexture, vTextureCoord);\n\n fg.r = uvs.y + sin(uTime);\n\n gl_FragColor = fg;\n\n}\n";
|
|
7
|
+
export declare const RED_GRADIENT_UNIFORMS: Record<string, {
|
|
8
|
+
value: any;
|
|
9
|
+
type: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const BUBBLE_SPARKLES_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime;\nuniform vec3 bubbleColor;\nuniform float bubbleCount;\n\nfloat rand(vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nfloat softCircle(vec2 uv, vec2 c, float r, float g) {\n float d = distance(uv, c);\n float base = 1.0 - smoothstep(r * 0.9, r, d);\n float halo = (1.0 - smoothstep(r, r * (1.0 + g), d));\n return base + halo * 0.5;\n}\n\nvec2 bubblePos(float id) {\n float fx = rand(vec2(id, 1.234));\n float fy = rand(vec2(id, 9.345));\n return vec2(fx, fy);\n}\n\nfloat bubbleRadius(float id) {\n return mix(0.015, 0.025, rand(vec2(id, 44.123)));\n}\n\nvoid main(void)\n{\n vec2 uvs = vTextureCoord.xy;\n vec4 fg = texture2D(uTexture, uvs);\n\n float bubbles = 0.0;\n\n for(float i = 0.0; i < 200.0; i++) {\n\n if(i >= bubbleCount) break;\n float spawnSpeed = 8.0; \n float spawnTime = (i / bubbleCount) / spawnSpeed;\n float t = uTime - spawnTime;\n\n if(t < 0.0) continue;\n\n float grow = pow(clamp(t, 0.0, 1.0), 0.35);\n\n vec2 pos = bubblePos(i);\n vec2 bubbleCenter = pos;\n\n float baseR = bubbleRadius(i);\n\n float r = baseR * grow;\n\n float phase = rand(vec2(i, 999.0)) * 6.28318;\n float pulse = sin(t * 1.6 + phase) * 0.5 + 0.5;\n float opacity = mix(0.2, 1.0, pulse);\n\n bubbles += softCircle(uvs, bubbleCenter, r, 0.8) * opacity;\n }\n\n fg.rgb += bubbleColor * bubbles;\n gl_FragColor = fg;\n}\n";
|
|
12
|
+
export declare const BUBBLE_SPARKLES_UNIFORMS: Record<string, {
|
|
13
|
+
value: any;
|
|
14
|
+
type: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const SEPIA_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime; \nuniform float maxIntensity; \n\nvoid main(void)\n{\n vec2 uvs = vTextureCoord.xy;\n vec4 color = texture2D(uTexture, uvs);\n\n float intensity = (sin(uTime) * 0.5 + 0.5) * maxIntensity;\n\n vec3 sepiaColor;\n sepiaColor.r = dot(color.rgb, vec3(0.393, 0.769, 0.189));\n sepiaColor.g = dot(color.rgb, vec3(0.349, 0.686, 0.168));\n sepiaColor.b = dot(color.rgb, vec3(0.272, 0.534, 0.131));\n\n color.rgb = mix(color.rgb, sepiaColor, intensity);\n\n gl_FragColor = color;\n}\n";
|
|
17
|
+
export declare const SEPIA_UNIFORMS: Record<string, {
|
|
18
|
+
value: any;
|
|
19
|
+
type: string;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const UV_GRADIENT_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform vec3 colorStart; \nuniform vec3 colorEnd; \nuniform int direction; \n\nvoid main(void)\n{\n vec2 uvs = vTextureCoord.xy;\n vec4 fg = texture2D(uTexture, uvs);\n\n float t = 0.0;\n if(direction == 0) {\n t = uvs.x; \n } else if(direction == 1) {\n t = uvs.y;\n } else {\n t = (uvs.x + uvs.y) * 0.5;\n }\n\n vec3 gradientColor = mix(colorStart, colorEnd, t);\n\n fg.rgb = fg.rgb * gradientColor; \n\n gl_FragColor = fg;\n}\n";
|
|
22
|
+
export declare const UV_GRADIENT_UNIFORMS: Record<string, {
|
|
23
|
+
value: any;
|
|
24
|
+
type: string;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const RAINBOW_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float intensity;\nuniform int direction; \n\nvec3 rainbow(float t) {\n float r = 0.5 + 0.5 * sin(6.28318 * (t + 0.0));\n float g = 0.5 + 0.5 * sin(6.28318 * (t + 0.33));\n float b = 0.5 + 0.5 * sin(6.28318 * (t + 0.66));\n return vec3(r, g, b);\n}\n\nvoid main(void)\n{\n vec2 uvs = vTextureCoord.xy;\n vec4 fg = texture2D(uTexture, uvs);\n\n float t = 0.0;\n if(direction == 0) {\n t = uvs.x; \n } else if(direction == 1) {\n t = uvs.y; \n } else {\n t = (uvs.x + uvs.y) * 0.5; \n }\n\n vec3 rainbowColor = rainbow(t);\n\n fg.rgb = fg.rgb * rainbowColor*intensity;\n\n gl_FragColor = fg;\n}\n";
|
|
27
|
+
export declare const RAINBOW_UNIFORMS: Record<string, {
|
|
28
|
+
value: any;
|
|
29
|
+
type: string;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const GLITCH_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime; \nuniform float intensity; \nuniform float sliceCount; \nuniform float rgbShift; \n\nfloat rand(float n) { return fract(sin(n) * 43758.5453123); }\nfloat rand2(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); }\n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n\n float sliceId = floor(uv.y * sliceCount);\n float sliceShift = (rand(sliceId + uTime * 10.0) - 0.5) * 0.2 * intensity;\n\n uv.x += sliceShift;\n\n float rShift = rgbShift * intensity;\n float gShift = -rgbShift * 0.5 * intensity;\n float bShift = rgbShift * 0.75 * intensity;\n\n vec3 col;\n col.r = texture2D(uTexture, uv + vec2(rShift, 0.0)).r;\n col.g = texture2D(uTexture, uv + vec2(gShift, 0.0)).g;\n col.b = texture2D(uTexture, uv + vec2(bShift, 0.0)).b;\n\n float noise = rand2(vec2(uTime * 50.0, uv.y * 100.0));\n float noiseIntensity = noise * 0.15 * intensity;\n\n col += noiseIntensity;\n\n gl_FragColor = vec4(col, 1.0);\n}\n";
|
|
32
|
+
export declare const GLITCH_UNIFORMS: Record<string, {
|
|
33
|
+
value: any;
|
|
34
|
+
type: string;
|
|
35
|
+
}>;
|
|
36
|
+
export declare const PIXELATE_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float pixelSize;\nuniform float uTime;\nuniform float jitterStrength;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n\n vec2 pixelUV = floor(uv / pixelSize) * pixelSize;\n\n float n1 = hash(pixelUV + uTime * 1.5);\n float n2 = hash(pixelUV * 2.3 + uTime * 1.7);\n\n vec2 jitter = (vec2(n1, n2) - 0.5) * jitterStrength * pixelSize;\n\n vec2 finalUV = pixelUV + jitter;\n\n finalUV = clamp(finalUV, 0.0, 1.0);\n vec4 color = texture2D(uTexture, finalUV);\n\n gl_FragColor = color;\n}\n";
|
|
37
|
+
export declare const PIXELATE_UNIFORMS: {
|
|
38
|
+
pixelSize: {
|
|
39
|
+
value: number;
|
|
40
|
+
type: string;
|
|
41
|
+
};
|
|
42
|
+
uTime: {
|
|
43
|
+
value: number;
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
jitterStrength: {
|
|
47
|
+
value: number;
|
|
48
|
+
type: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export declare const RGB_GLITCH_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime;\nuniform float glitchStrength; \nuniform float glitchSpeed; \n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\nfloat rand2(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); }\n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n\n float lineNoise = hash(vec2(floor(uv.y * 300.0), uTime * glitchSpeed));\n\n float rOffset = (hash(vec2(uTime, 1.0)) - 0.5) * glitchStrength;\n float gOffset = (hash(vec2(uTime, 2.0)) - 0.5) * glitchStrength * 0.5;\n float bOffset = (hash(vec2(uTime, 3.0)) - 0.5) * glitchStrength;\n\n float rShift = rOffset * lineNoise;\n float gShift = gOffset * lineNoise;\n float bShift = bOffset * lineNoise;\n vec3 col;\n\n col.r = texture2D(uTexture, uv + vec2(rShift, 0.0)).r;\n col.g = texture2D(uTexture, uv + vec2(gShift, 0.0)).g;\n col.b = texture2D(uTexture, uv + vec2(bShift, 0.0)).b;\n float noise = rand2(vec2(uTime * 50.0, uv.y * 100.0));\n float noiseIntensity = noise * 0.15 ;\n\n col += noiseIntensity;\n gl_FragColor = vec4(col, 1.0);\n}\n";
|
|
52
|
+
export declare const RGB_GLITCH_UNIFORMS: {
|
|
53
|
+
uTime: {
|
|
54
|
+
value: number;
|
|
55
|
+
type: string;
|
|
56
|
+
};
|
|
57
|
+
glitchStrength: {
|
|
58
|
+
value: number;
|
|
59
|
+
type: string;
|
|
60
|
+
};
|
|
61
|
+
glitchSpeed: {
|
|
62
|
+
value: number;
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
export declare const RGB_SHIFT_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float shiftAmount; \nuniform float angle; \nuniform float uTime; \nuniform float wobbleAmount; \nuniform float wobbleSpeed; \n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n vec2 dir = vec2(cos(angle), sin(angle));\n float wobble = sin(uTime * wobbleSpeed) * wobbleAmount;\n vec2 rUV = uv + dir * shiftAmount + vec2(wobble, 0.0);\n vec2 gUV = uv;\n vec2 bUV = uv - dir * shiftAmount - vec2(wobble, 0.0);\n float r = texture2D(uTexture, rUV).r;\n float g = texture2D(uTexture, gUV).g;\n float b = texture2D(uTexture, bUV).b;\n\n gl_FragColor = vec4(r, g, b, 1.0);\n}\n";
|
|
67
|
+
export declare const RGB_SHIFT_UNIFORMS: {
|
|
68
|
+
shiftAmount: {
|
|
69
|
+
value: number;
|
|
70
|
+
type: string;
|
|
71
|
+
};
|
|
72
|
+
angle: {
|
|
73
|
+
value: number;
|
|
74
|
+
type: string;
|
|
75
|
+
};
|
|
76
|
+
uTime: {
|
|
77
|
+
value: number;
|
|
78
|
+
type: string;
|
|
79
|
+
};
|
|
80
|
+
wobbleAmount: {
|
|
81
|
+
value: number;
|
|
82
|
+
type: string;
|
|
83
|
+
};
|
|
84
|
+
wobbleSpeed: {
|
|
85
|
+
value: number;
|
|
86
|
+
type: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
export declare const HALFTONE_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float dotSize; \nuniform float intensity; \nuniform float angle; \nuniform float uTime; \nuniform float vibrateStrength;\n\nfloat luminance(vec3 c) {\n return dot(c, vec3(0.299, 0.587, 0.114));\n}\n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n\n float ca = cos(angle);\n float sa = sin(angle);\n mat2 rot = mat2(ca, -sa, sa, ca);\n vec2 rotatedUV = rot * (uv - 0.5) + 0.5;\n vec2 grid = rotatedUV / dotSize;\n vec2 cell = floor(grid) + 0.5;\n\n vec2 cellCenter = cell * dotSize;\n\n float jitter = sin(uTime * 10.0 + cell.x * 12.989 + cell.y * 78.233) * 0.5;\n float dist = distance(rotatedUV, cellCenter + jitter * vibrateStrength * dotSize);\n vec4 texColor = texture2D(uTexture, uv);\n float lum = luminance(texColor.rgb);\n float radius = (1.0 - lum) * dotSize * 0.5;\n float mask = smoothstep(radius, radius * 0.8, dist);\n\n vec3 halftone = texColor.rgb * mask;\n texColor.rgb = mix(texColor.rgb, halftone, intensity);\n\n gl_FragColor = texColor;\n}\n";
|
|
90
|
+
export declare const HALFTONE_UNIFORMS: {
|
|
91
|
+
dotSize: {
|
|
92
|
+
value: number;
|
|
93
|
+
type: string;
|
|
94
|
+
};
|
|
95
|
+
intensity: {
|
|
96
|
+
value: number;
|
|
97
|
+
type: string;
|
|
98
|
+
};
|
|
99
|
+
angle: {
|
|
100
|
+
value: number;
|
|
101
|
+
type: string;
|
|
102
|
+
};
|
|
103
|
+
uTime: {
|
|
104
|
+
value: number;
|
|
105
|
+
type: string;
|
|
106
|
+
};
|
|
107
|
+
vibrateStrength: {
|
|
108
|
+
value: number;
|
|
109
|
+
type: string;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
export declare const SINEWAVE_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime; \nuniform float amplitude; \nuniform float frequency; \nuniform float speed; \nuniform int direction; \n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n\n vec2 offset = vec2(0.0);\n\n if(direction == 0) {\n offset.y = sin((uv.x + uTime * speed) * frequency * 6.2831853) * amplitude;\n } else {\n offset.x = sin((uv.y + uTime * speed) * frequency * 6.2831853) * amplitude;\n }\n\n vec4 color = texture2D(uTexture, uv + offset);\n gl_FragColor = color;\n}\n";
|
|
113
|
+
export declare const SINEWAVE_UNIFORMS: {
|
|
114
|
+
uTime: {
|
|
115
|
+
value: number;
|
|
116
|
+
type: string;
|
|
117
|
+
};
|
|
118
|
+
amplitude: {
|
|
119
|
+
value: number;
|
|
120
|
+
type: string;
|
|
121
|
+
};
|
|
122
|
+
frequency: {
|
|
123
|
+
value: number;
|
|
124
|
+
type: string;
|
|
125
|
+
};
|
|
126
|
+
speed: {
|
|
127
|
+
value: number;
|
|
128
|
+
type: string;
|
|
129
|
+
};
|
|
130
|
+
direction: {
|
|
131
|
+
value: number;
|
|
132
|
+
type: string;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
export declare const SHINE_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime; // tiempo para animaci\u00F3n\nuniform vec3 shineColor; // color de los rayos\nuniform float rayWidth; // grosor del rayo\nuniform float rayCount; // cantidad de rayos\nuniform float rotationSpeed; // velocidad de rotaci\u00F3n\n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n vec2 center = vec2(0.3, 0.35);\n\n vec2 dir = uv - center;\n\n float angle = atan(dir.y, dir.x);\n\n angle += uTime * rotationSpeed;\n\n float normAngle = fract(angle / 6.28318530718); // 2\u03C0\n\n float rays = sin(normAngle * rayCount * 6.28318530718);\n\n float intensity = smoothstep(0.0, rayWidth, rays) - smoothstep(rayWidth, rayWidth*1.5, rays);\n\n vec4 color = texture2D(uTexture, uv);\n\n color.rgb += shineColor * intensity;\n\n gl_FragColor = color;\n}\n";
|
|
136
|
+
export declare const SHINE_UNIFORMS: {
|
|
137
|
+
uTime: {
|
|
138
|
+
value: number;
|
|
139
|
+
type: string;
|
|
140
|
+
};
|
|
141
|
+
shineColor: {
|
|
142
|
+
value: number[];
|
|
143
|
+
type: string;
|
|
144
|
+
};
|
|
145
|
+
rayWidth: {
|
|
146
|
+
value: number;
|
|
147
|
+
type: string;
|
|
148
|
+
};
|
|
149
|
+
rayCount: {
|
|
150
|
+
value: number;
|
|
151
|
+
type: string;
|
|
152
|
+
};
|
|
153
|
+
rotationSpeed: {
|
|
154
|
+
value: number;
|
|
155
|
+
type: string;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
export declare const BLINK_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime; \nuniform float blinkSpeed; \nuniform float minIntensity; \nuniform float maxIntensity; \n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n vec4 color = texture2D(uTexture, uv);\n float t = sin(uTime * blinkSpeed * 6.2831853) * 0.5 + 0.5;\n float intensity = mix(minIntensity, maxIntensity, t);\n\n color.rgb *= intensity;\n\n gl_FragColor = color;\n}\n";
|
|
159
|
+
export declare const BLINK_UNIFORMS: {
|
|
160
|
+
uTime: {
|
|
161
|
+
value: number;
|
|
162
|
+
type: string;
|
|
163
|
+
};
|
|
164
|
+
blinkSpeed: {
|
|
165
|
+
value: number;
|
|
166
|
+
type: string;
|
|
167
|
+
};
|
|
168
|
+
minIntensity: {
|
|
169
|
+
value: number;
|
|
170
|
+
type: string;
|
|
171
|
+
};
|
|
172
|
+
maxIntensity: {
|
|
173
|
+
value: number;
|
|
174
|
+
type: string;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
export declare const SPRING_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime; \nuniform float frequency; \nuniform float damping; \nuniform float strength; \n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n\n float spring = exp(-damping * uTime) *\n sin(uTime * frequency * 6.2831853);\n\n uv.x += spring * strength;\n uv.y += spring * strength * 0.5; \n\n vec4 color = texture2D(uTexture, uv);\n\n gl_FragColor = color;\n}\n";
|
|
178
|
+
export declare const SPRING_UNIFORMS: {
|
|
179
|
+
uTime: {
|
|
180
|
+
value: number;
|
|
181
|
+
type: string;
|
|
182
|
+
};
|
|
183
|
+
frequency: {
|
|
184
|
+
value: number;
|
|
185
|
+
type: string;
|
|
186
|
+
};
|
|
187
|
+
damping: {
|
|
188
|
+
value: number;
|
|
189
|
+
type: string;
|
|
190
|
+
};
|
|
191
|
+
strength: {
|
|
192
|
+
value: number;
|
|
193
|
+
type: string;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
export declare const DUOTONE_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform vec3 colorA; \nuniform vec3 colorB; \nuniform float intensity; \n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n\n vec4 tex = texture2D(uTexture, uv);\n float gray = dot(tex.rgb, vec3(0.299, 0.587, 0.114));\n vec3 duo = mix(colorA, colorB, gray);\n tex.rgb = mix(tex.rgb, duo, intensity);\n gl_FragColor = tex;\n}\n";
|
|
197
|
+
export declare const DUOTONE_UNIFORMS: {
|
|
198
|
+
colorA: {
|
|
199
|
+
value: number[];
|
|
200
|
+
type: string;
|
|
201
|
+
};
|
|
202
|
+
colorB: {
|
|
203
|
+
value: number[];
|
|
204
|
+
type: string;
|
|
205
|
+
};
|
|
206
|
+
intensity: {
|
|
207
|
+
value: number;
|
|
208
|
+
type: string;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
export declare const TRITONE_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform vec3 colorShadow; \nuniform vec3 colorMid; \nuniform vec3 colorHighlight;\n\nuniform float intensity; \n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n vec4 tex = texture2D(uTexture, uv);\n float gray = dot(tex.rgb, vec3(0.299, 0.587, 0.114));\n\n\n vec3 duoA = mix(colorShadow, colorMid, smoothstep(0.0, 0.5, gray));\n vec3 duoB = mix(colorMid, colorHighlight, smoothstep(0.5, 1.0, gray));\n vec3 tritone = mix(duoA, duoB, smoothstep(0.33, 0.66, gray));\n tex.rgb = mix(tex.rgb, tritone, intensity);\n\n gl_FragColor = tex;\n}\n";
|
|
212
|
+
export declare const TRITONE_UNIFORMS: {
|
|
213
|
+
colorShadow: {
|
|
214
|
+
value: number[];
|
|
215
|
+
type: string;
|
|
216
|
+
};
|
|
217
|
+
colorMid: {
|
|
218
|
+
value: number[];
|
|
219
|
+
type: string;
|
|
220
|
+
};
|
|
221
|
+
colorHighlight: {
|
|
222
|
+
value: number[];
|
|
223
|
+
type: string;
|
|
224
|
+
};
|
|
225
|
+
intensity: {
|
|
226
|
+
value: number;
|
|
227
|
+
type: string;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
export declare const HUE_SHIFT_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime; \nuniform float amount; \n\nvec3 hueShift(vec3 color, float angle) {\n float cosA = cos(angle);\n float sinA = sin(angle);\n mat3 rot = mat3(\n 0.299 + 0.701 * cosA + 0.168 * sinA,\n 0.587 - 0.587 * cosA + 0.330 * sinA,\n 0.114 - 0.114 * cosA - 0.497 * sinA,\n\n 0.299 - 0.299 * cosA - 0.328 * sinA,\n 0.587 + 0.413 * cosA + 0.035 * sinA,\n 0.114 - 0.114 * cosA + 0.292 * sinA,\n\n 0.299 - 0.300 * cosA + 1.250 * sinA,\n 0.587 - 0.588 * cosA - 1.050 * sinA,\n 0.114 + 0.886 * cosA - 0.203 * sinA\n );\n\n return color * rot;\n}\n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n vec4 tex = texture2D(uTexture, uv);\n\n vec3 shifted = hueShift(tex.rgb, uTime*2.5);\n\n tex.rgb = mix(tex.rgb, shifted, amount);\n\n gl_FragColor = tex;\n}\n";
|
|
231
|
+
export declare const HUE_SHIFT_UNIFORMS: {
|
|
232
|
+
uTime: {
|
|
233
|
+
value: number;
|
|
234
|
+
type: string;
|
|
235
|
+
};
|
|
236
|
+
amount: {
|
|
237
|
+
value: number;
|
|
238
|
+
type: string;
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
export declare const WARP_TRANSITION_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime; \nuniform float uStrength; \nuniform float swirl; \n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n vec2 center = vec2(0.5, 0.5);\n vec2 dir = uv - center;\n float dist = length(dir);\n float warpAmount = pow(dist, 2.0) * uStrength * uTime;\n float angle = swirl * uTime * 6.283185; \n\n float s = sin(angle * dist);\n float c = cos(angle * dist);\n\n mat2 rot = mat2(c, -s, s, c);\n vec2 warpedUV = center + rot * dir * (1.0 - warpAmount);\n vec4 color = texture2D(uTexture, warpedUV);\n\n gl_FragColor = color;\n}\n";
|
|
242
|
+
export declare const WARP_TRANSITION_UNIFORMS: {
|
|
243
|
+
uTime: {
|
|
244
|
+
value: number;
|
|
245
|
+
type: string;
|
|
246
|
+
};
|
|
247
|
+
uStrength: {
|
|
248
|
+
value: number;
|
|
249
|
+
type: string;
|
|
250
|
+
};
|
|
251
|
+
swirl: {
|
|
252
|
+
value: number;
|
|
253
|
+
type: string;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
export declare const SLIT_SCAN_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime; \nuniform float uStrength; \nuniform int direction; \n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n float offset;\n if(direction == 0) {\n offset = (uv.y - 0.5) * uStrength * uTime;\n uv.x += offset;\n } else {\n offset = (uv.x - 0.5) * uStrength * uTime;\n uv.y += offset;\n }\n\n vec4 color = texture2D(uTexture, uv);\n\n gl_FragColor = color;\n}\n";
|
|
257
|
+
export declare const SLIT_SCAN_UNIFORMS: {
|
|
258
|
+
uTime: {
|
|
259
|
+
value: number;
|
|
260
|
+
type: string;
|
|
261
|
+
};
|
|
262
|
+
uStrength: {
|
|
263
|
+
value: number;
|
|
264
|
+
type: string;
|
|
265
|
+
};
|
|
266
|
+
direction: {
|
|
267
|
+
value: number;
|
|
268
|
+
type: string;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
export declare const SLIT_SCAN_GLITCH_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime;\nuniform float uStrength;\nuniform float uNoise;\nuniform int direction;\n\nfloat hash(float n) {\n return fract(sin(n) * 43758.5453);\n}\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n\n float offset;\n if(direction == 0) {\n offset = (uv.y - 0.5) * uStrength * uTime;\n uv.x += offset;\n } else {\n offset = (uv.x - 0.5) * uStrength * uTime;\n uv.y += offset;\n }\n\n float jitter = (hash(floor(uv * 100.0) + uTime) - 0.5) * uNoise;\n if(direction == 0) {\n uv.x += jitter;\n } else {\n uv.y += jitter;\n }\n\n float rOffset = (hash(uv + 1.0) - 0.5) * uNoise * 0.5;\n float gOffset = (hash(uv + 2.0) - 0.5) * uNoise * 0.5;\n float bOffset = (hash(uv + 3.0) - 0.5) * uNoise * 0.5;\n\n vec4 texR = texture2D(uTexture, uv + vec2(rOffset, 0.0));\n vec4 texG = texture2D(uTexture, uv + vec2(gOffset, 0.0));\n vec4 texB = texture2D(uTexture, uv + vec2(bOffset, 0.0));\n\n gl_FragColor = vec4(texR.r, texG.g, texB.b, 1.0);\n}\n";
|
|
272
|
+
export declare const SLIT_SCAN_GLITCH_UNIFORMS: {
|
|
273
|
+
uTime: {
|
|
274
|
+
value: number;
|
|
275
|
+
type: string;
|
|
276
|
+
};
|
|
277
|
+
uStrength: {
|
|
278
|
+
value: number;
|
|
279
|
+
type: string;
|
|
280
|
+
};
|
|
281
|
+
uNoise: {
|
|
282
|
+
value: number;
|
|
283
|
+
type: string;
|
|
284
|
+
};
|
|
285
|
+
direction: {
|
|
286
|
+
value: number;
|
|
287
|
+
type: string;
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
export declare const PIXELATE_TRANSITION_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime; \nuniform float maxPixelSize; \n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n float pixelSize = maxPixelSize * uTime;\n pixelSize = max(pixelSize, 0.001);\n vec2 pixelUV = floor(uv / pixelSize) * pixelSize;\n\n vec4 color = texture2D(uTexture, pixelUV);\n\n gl_FragColor = color;\n}\n";
|
|
291
|
+
export declare const PIXELATE_TRANSITION_UNIFORMS: {
|
|
292
|
+
uTime: {
|
|
293
|
+
value: number;
|
|
294
|
+
type: string;
|
|
295
|
+
};
|
|
296
|
+
maxPixelSize: {
|
|
297
|
+
value: number;
|
|
298
|
+
type: string;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
export declare const FOCUS_TRANSITION_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime; \nuniform float maxBlur; \n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n vec4 color = vec4(0.0);\n float blur = maxBlur * (1.0 - uTime);\n\n if(blur < 0.001) {\n color = texture2D(uTexture, uv);\n } else {\n vec2 offsets[9];\n offsets[0] = vec2(-blur, -blur);\n offsets[1] = vec2(0.0, -blur);\n offsets[2] = vec2(blur, -blur);\n offsets[3] = vec2(-blur, 0.0);\n offsets[4] = vec2(0.0, 0.0);\n offsets[5] = vec2(blur, 0.0);\n offsets[6] = vec2(-blur, blur);\n offsets[7] = vec2(0.0, blur);\n offsets[8] = vec2(blur, blur);\n\n for(int i = 0; i < 9; i++) {\n color += texture2D(uTexture, uv + offsets[i]);\n }\n\n color /= 9.0;\n }\n\n gl_FragColor = color;\n}\n";
|
|
302
|
+
export declare const FOCUS_TRANSITION_UNIFORMS: {
|
|
303
|
+
uTime: {
|
|
304
|
+
value: number;
|
|
305
|
+
type: string;
|
|
306
|
+
};
|
|
307
|
+
maxBlur: {
|
|
308
|
+
value: number;
|
|
309
|
+
type: string;
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
export declare const INVERT_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float amount;\n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n vec4 tex = texture2D(uTexture, uv);\n\n vec3 inverted = vec3(1.0) - tex.rgb;\n\n tex.rgb = mix(tex.rgb, inverted, amount);\n\n gl_FragColor = tex;\n}\n";
|
|
313
|
+
export declare const INVERT_UNIFORMS: {
|
|
314
|
+
amount: {
|
|
315
|
+
value: number;
|
|
316
|
+
type: string;
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
export declare const GRAYSCALE_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float amount; \n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n vec4 tex = texture2D(uTexture, uv);\n float gray = dot(tex.rgb, vec3(0.299, 0.587, 0.114));\n vec3 grayscale = vec3(gray);\n\n tex.rgb = mix(tex.rgb, grayscale, amount);\n\n gl_FragColor = tex;\n}\n";
|
|
320
|
+
export declare const GRAYSCALE_UNIFORMS: {
|
|
321
|
+
amount: {
|
|
322
|
+
value: number;
|
|
323
|
+
type: string;
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
export declare const VIGNETTE_FRAGMENT = "\nin vec2 vTextureCoord;\n\nuniform sampler2D uTexture;\nuniform float uIntensity; \nuniform float uSoftness; \n\nvoid main(void)\n{\n vec2 uv = vTextureCoord.xy;\n\n vec2 centered = uv - vec2(0.5);\n float dist = length(centered);\n float vignette = smoothstep(0.5, 0.5 - uSoftness, dist);\n vec4 color = texture(uTexture, uv);\n color.rgb *= 1.0 - (vignette * uIntensity);\n\n gl_FragColor = color;\n}\n";
|
|
327
|
+
export declare const VIGNETTE_UNIFORMS: {
|
|
328
|
+
uIntensity: {
|
|
329
|
+
value: number;
|
|
330
|
+
type: string;
|
|
331
|
+
};
|
|
332
|
+
uSoftness: {
|
|
333
|
+
value: number;
|
|
334
|
+
type: string;
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
export declare const CHROMATIC_FRAGMENT = "\nin vec2 vTextureCoord;\n\nuniform sampler2D uTexture;\nuniform float uIntensity; \nuniform vec2 uDirection; \n\nvoid main(void)\n{\n vec2 uv = vTextureCoord;\n vec2 offset = uDirection * uIntensity;\n float r = texture(uTexture, uv + offset).r;\n float g = texture(uTexture, uv).g;\n float b = texture(uTexture, uv - offset).b;\n vec4 color = vec4(r, g, b, 1.0);\n\n gl_FragColor = color;\n}\n";
|
|
338
|
+
export declare const CHROMATIC_UNIFORMS: {
|
|
339
|
+
uIntensity: {
|
|
340
|
+
value: number;
|
|
341
|
+
type: string;
|
|
342
|
+
};
|
|
343
|
+
uDirection: {
|
|
344
|
+
value: number[];
|
|
345
|
+
type: string;
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
export declare const SWIRL_MOVEMENT_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime;\nuniform float rotationCount;\n\nuniform float swirlStrength; \nuniform float swirlRadius; \nuniform float rainbowIntensity;\n\nvec3 hsv2rgb(vec3 c)\n{\n vec3 rgb = clamp( abs(mod(c.x*6.0 + vec3(0.0,4.0,2.0), 6.0) - 3.0) - 1.0,\n 0.0,\n 1.0 );\n return c.z * mix(vec3(1.0), rgb, c.y);\n}\n\nfloat flamePattern(float dist, float angle, float time) {\n return pow(sin(dist * 10.0 - time * 5.0 + angle * 5.0) * 0.5 + 0.5, 2.0);\n}\n\nvoid main(void)\n{\n vec2 center = vec2(0.3, 0.45);\n vec2 uvs = vTextureCoord - center;\n\n // fade del rainbow (0 cuando uTime >= 0.75)\n float fadeRainbow = clamp(1.0 - smoothstep(0.7, 0.75, uTime), 0.0, 1.0);\n\n // fade de swirl, wave y blur (disminuye entre 0.8 y 1.0)\n float fadeMotion = clamp(1.0 - smoothstep(0.8, 1.0, uTime), 0.0, 1.0);\n\n // \u00E1ngulo total acumulado para mantener la direcci\u00F3n del giro\n float angleTotal = uTime * rotationCount * 6.2831853; \n\n float cosA = cos(angleTotal);\n float sinA = sin(angleTotal);\n mat2 rotation = mat2(cosA, -sinA, sinA, cosA);\n vec2 rotatedUV = rotation * uvs + center;\n\n float dist = distance(rotatedUV, center);\n float d = clamp(dist / swirlRadius, 0.0, 1.0);\n\n // swirl disminuye suavemente sin invertir la direcci\u00F3n\n float swirlAngle = swirlStrength * d * d * 6.2831853 * fadeMotion;\n float cosS = cos(swirlAngle);\n float sinS = sin(swirlAngle);\n\n vec2 dir = rotatedUV - center;\n rotatedUV = vec2(\n dir.x * cosS - dir.y * sinS,\n dir.x * sinS + dir.y * cosS\n ) + center;\n\n float wave = sin(dist * 12.0 - uTime * 4.0) * 0.015 * fadeMotion; \n rotatedUV += wave * normalize(dir);\n\n // blur de la textura\n vec4 color = vec4(0.0);\n float blurAmount = (0.004 + rotationCount * 0.001) * fadeMotion; \n\n for (int i = -3; i <= 3; i++) {\n float offset = float(i) * blurAmount;\n vec2 blurUV = rotatedUV + vec2(offset * cosA, offset * sinA);\n color += texture2D(uTexture, blurUV);\n }\n color /= 7.0;\n\n // rainbow\n float rainbowScale = 0.05;\n float ang = atan(dir.y, dir.x);\n float hue = (ang / 6.2831853) + 0.5 + dist * rainbowScale;\n hue += uTime * 0.2 + rotationCount * 0.05;\n\n vec3 rainbow = hsv2rgb(vec3(hue, 0.35, 1.0));\n color.rgb = mix(color.rgb, rainbow, rainbowIntensity * fadeRainbow);\n\n // Flame disminuye con fadeMotion\n float flame = flamePattern(dist, ang, uTime) * fadeMotion;\n vec3 flameColor = vec3(1.0, 0.5, 0.0) * flame;\n flameColor = mix(flameColor, vec3(1.0,1.0,0.2), flame * 0.5);\n color.rgb += flameColor * 0.3;\n\n if (rotatedUV.x < 0.0 || rotatedUV.x > 1.0 || rotatedUV.y < 0.0 || rotatedUV.y > 1.0) {\n discard;\n }\n\n gl_FragColor = color;\n}\n\n";
|
|
349
|
+
export declare const SWIRL_MOVEMENT_UNIFORMS: {
|
|
350
|
+
uTime: {
|
|
351
|
+
value: number;
|
|
352
|
+
type: string;
|
|
353
|
+
};
|
|
354
|
+
rotationCount: {
|
|
355
|
+
value: number;
|
|
356
|
+
type: string;
|
|
357
|
+
};
|
|
358
|
+
swirlStrength: {
|
|
359
|
+
value: number;
|
|
360
|
+
type: string;
|
|
361
|
+
};
|
|
362
|
+
swirlRadius: {
|
|
363
|
+
value: number;
|
|
364
|
+
type: string;
|
|
365
|
+
};
|
|
366
|
+
rainbowIntensity: {
|
|
367
|
+
value: number;
|
|
368
|
+
type: string;
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
export declare const HEART_SPARKLES_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime;\nuniform vec3 heartColor;\nuniform float heartCount;\n\nfloat rand(vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nfloat heartShape(vec2 p) {\n p = (p - 0.5) * 2.0; \n p.y = -p.y; \n p.y += 0.25; \n float x = p.x;\n float y = p.y;\n float val = pow(x*x + y*y - 1.0, 3.0) - x*x * y*y*y;\n return smoothstep(0.0, 0.02, -val);\n}\n\nvec2 heartPos(float id) {\n float fx = rand(vec2(id, 1.234)) * 0.85 - 0.025; \n float fy = rand(vec2(id, 1.345)) * 0.85 + 0.025;\n return vec2(fx, fy);\n}\n\nfloat heartSize(float id) {\n return mix(0.02, 0.05, rand(vec2(id, 44.123))); \n}\n\nvoid main() {\n vec2 uv = vTextureCoord.xy;\n vec4 base = texture2D(uTexture, uv);\n\n float hearts = 0.0;\n\n for(float i = 0.0; i < 200.0; i++) {\n if(i >= heartCount) break;\n\n vec2 pos = heartPos(i);\n float size = heartSize(i);\n\n float vibX = (rand(vec2(i, uTime)) - 0.5) * 0.02;\n float vibY = (rand(vec2(i+1.0, uTime)) - 0.5) * 0.02;\n\n vec2 heartUV = (uv - (pos + vec2(vibX, vibY))) / size + 0.5;\n\n float h = heartShape(heartUV);\n\n float pulse = sin(uTime * 4.0 + i) * 0.2 + 1.0;\n h *= pulse;\n\n hearts += h;\n }\n\n base.rgb += heartColor * hearts;\n gl_FragColor = base;\n}\n";
|
|
372
|
+
export declare const HEART_SPARKLES_UNIFORMS: Record<string, {
|
|
373
|
+
value: any;
|
|
374
|
+
type: string;
|
|
375
|
+
}>;
|
|
376
|
+
export declare const BUTTERFLY_SPARKLES_FRAGMENT = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nuniform sampler2D uTexture;\nuniform float uTime;\nuniform vec3 butterflyColor;\nuniform float butterflyCount;\n\nfloat rand(vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nfloat wing(vec2 p) {\n float d = pow(p.x, 2.0) + pow(p.y * 1.2, 2.0);\n return smoothstep(0.3, 0.0, d);\n}\n\nfloat butterflyShape(vec2 uv) {\n vec2 p = (uv - 0.5) * 2.0;\n\n float body = smoothstep(0.12, 0.05, abs(p.x)) \n * smoothstep(0.4, 0.0, abs(p.y));\n\n float wL = wing(vec2(p.x * 1.2 + 0.6, p.y));\n float wR = wing(vec2(p.x * 1.2 - 0.6, p.y));\n\n return clamp(wL + wR + body, 0.0, 1.0);\n}\nvec2 butterflyPos(float id) {\n float fx = rand(vec2(id, 1.234)) * 0.85 - 0.025;\n float fy = rand(vec2(id, 1.345)) * 0.85 + 0.025;\n return vec2(fx, fy);\n}\n\nfloat butterflySize(float id) {\n return mix(0.03, 0.08, rand(vec2(id, 44.123)));\n}\n\nvoid main() {\n vec2 uv = vTextureCoord.xy;\n vec4 base = texture2D(uTexture, uv);\n\n float butterflies = 0.0;\n\n for(float i = 0.0; i < 200.0; i++) {\n if(i >= butterflyCount) break;\n\n vec2 pos = butterflyPos(i);\n float size = butterflySize(i);\n\n float vibX = (rand(vec2(i, uTime)) - 0.5) * 0.02;\n float vibY = (rand(vec2(i+1.0, uTime)) - 0.5) * 0.02;\n\n vec2 bUV = (uv - (pos + vec2(vibX, vibY))) / size + 0.5;\n\n float b = butterflyShape(bUV);\n\n float pulse = sin(uTime * 3.0 + i) * 0.25 + 1.0;\n b *= pulse;\n\n butterflies += b;\n }\n\n base.rgb += butterflyColor * butterflies;\n gl_FragColor = base;\n}\n";
|
|
377
|
+
export declare const BUTTERFLY_SPARKLES_UNIFORMS: Record<string, {
|
|
378
|
+
value: any;
|
|
379
|
+
type: string;
|
|
380
|
+
}>;
|
|
381
|
+
export declare const DISTORT_EFFECT_FRAGMENT = "\nin vec2 vTextureCoord;\n\nuniform sampler2D uTexture;\nuniform float amplitude; \nuniform float speed; \nuniform float uTime; \n\nvoid main() {\n vec2 p = vTextureCoord;\n vec2 center = vec2(0.28, 0.45);\n\n vec2 dir = p - center;\n float dist = length(dir);\n\n vec2 offset = vec2(0.0);\n\n if (dist <= uTime) {\n offset = dir * sin(dist * amplitude - uTime * speed);\n }\n\n gl_FragColor = texture2D(uTexture, p + offset);\n}\n";
|
|
382
|
+
export declare const DISTORT_UNIFORMS: {
|
|
383
|
+
uTime: {
|
|
384
|
+
value: number;
|
|
385
|
+
type: string;
|
|
386
|
+
};
|
|
387
|
+
amplitude: {
|
|
388
|
+
value: number;
|
|
389
|
+
type: string;
|
|
390
|
+
};
|
|
391
|
+
speed: {
|
|
392
|
+
value: number;
|
|
393
|
+
type: string;
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
export declare const PERSPECTIVE_SINGLE_FRAGMENT = "\nprecision mediump float;\n\nuniform sampler2D uTexture;\nuniform float persp; \nuniform float unzoom; \nuniform float reflection; \nuniform float floating; \nuniform float uTime;\n\nvarying vec2 vTextureCoord;\n\nbool inBounds(vec2 p) {\n return all(greaterThanEqual(p, vec2(0.0))) &&\n all(lessThanEqual(p, vec2(1.0)));\n}\n\nvec2 project(vec2 p) {\n return p * vec2(1.0, -1.2) + vec2(0.0, -floating / 100.0);\n}\n\nvec2 xskew(vec2 p, float persp, float center) {\n float x = mix(p.x, 1.0 - p.x, center);\n\n return (\n (\n vec2(\n x,\n (p.y - 0.5*(1.0-persp) * x) /\n (1.0+(persp-1.0)*x)\n )\n - vec2(0.5 - abs(center - 0.5), 0.0)\n )\n * vec2(\n 0.5 / abs(center - 0.5) * (center < 0.5 ? 1.0 : -1.0),\n 1.0\n )\n + vec2(center < 0.5 ? 0.0 : 1.0, 0.0)\n );\n}\n\nvoid main() {\n vec2 p = vTextureCoord;\n\n float uz = unzoom * sin(uTime * 0.5);\n p = -uz * 0.5 + (1.0 + uz) * p;\n\n vec2 warped = xskew(p, persp, 0.0);\n\n vec4 baseColor = vec4(0.0);\n\n if (inBounds(warped)) {\n baseColor = texture2D(uTexture, warped);\n }\n\n vec2 proj = project(warped);\n if (inBounds(proj)) {\n vec4 refl = texture2D(uTexture, proj);\n refl.rgb *= reflection * (1.0 - proj.y);\n baseColor += refl;\n }\n\n gl_FragColor = baseColor;\n}\n\n";
|
|
397
|
+
export declare const PERSPECTIVE_SINGLE_UNIFORMS: {
|
|
398
|
+
uTime: {
|
|
399
|
+
value: number;
|
|
400
|
+
type: string;
|
|
401
|
+
};
|
|
402
|
+
persp: {
|
|
403
|
+
value: number;
|
|
404
|
+
type: string;
|
|
405
|
+
};
|
|
406
|
+
unzoom: {
|
|
407
|
+
value: number;
|
|
408
|
+
type: string;
|
|
409
|
+
};
|
|
410
|
+
reflection: {
|
|
411
|
+
value: number;
|
|
412
|
+
type: string;
|
|
413
|
+
};
|
|
414
|
+
floating: {
|
|
415
|
+
value: number;
|
|
416
|
+
type: string;
|
|
417
|
+
};
|
|
418
|
+
};
|
|
419
|
+
export declare const DISTORT_SPIN_FRAGMENT = "\nin vec2 vTextureCoord;\n\nuniform sampler2D uTexture;\nuniform float uTime; \nuniform float radius; \nuniform float spinPower; \nuniform float speed; \n\nvoid main() {\n vec2 uv = vTextureCoord;\n vec2 center = vec2(0.28, 0.45);\n\n vec2 pos = uv - center;\n\n float dist = length(pos);\n\n if (dist < radius) {\n float percent = (radius - dist) / radius;\n\n float theta = percent * percent * spinPower * sin(uTime * speed);\n\n float s = sin(theta);\n float c = cos(theta);\n\n pos = vec2(\n pos.x * c - pos.y * s,\n pos.x * s + pos.y * c\n );\n }\n\n uv = pos + center;\n\n gl_FragColor = texture2D(uTexture, uv);\n}\n";
|
|
420
|
+
export declare const DISTORT_SPIN_UNIFORMS: {
|
|
421
|
+
uTime: {
|
|
422
|
+
value: number;
|
|
423
|
+
type: string;
|
|
424
|
+
};
|
|
425
|
+
radius: {
|
|
426
|
+
value: number;
|
|
427
|
+
type: string;
|
|
428
|
+
};
|
|
429
|
+
spinPower: {
|
|
430
|
+
value: number;
|
|
431
|
+
type: string;
|
|
432
|
+
};
|
|
433
|
+
speed: {
|
|
434
|
+
value: number;
|
|
435
|
+
type: string;
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
export declare const DISTORT_GRID_FRAGMENT = "\nin vec2 vTextureCoord;\n\nuniform sampler2D uTexture;\nuniform float uTime;\n\nuniform float speed; \nuniform float intensity; \nuniform int endx;\nuniform int endy;\n\n#define PI 3.14159265358979323\n\nfloat rand(vec2 v) {\n return fract(sin(dot(v.xy , vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec2 rotate2d(vec2 v, float a) {\n mat2 rm = mat2(cos(a), -sin(a),\n sin(a), cos(a));\n return rm * v;\n}\n\nvoid main() {\n vec2 uv = vTextureCoord;\n\n vec2 p = uv - 0.5;\n\n float t = sin(uTime * speed) * 0.5 + 0.5;\n\n float warp = 1.0 + intensity * abs(t - 0.5);\n\n vec2 rp = p * warp;\n float tx = float(endx) + 0.5;\n float ty = float(endy) + 0.5;\n\n vec2 shifted = mix(vec2(0.5, 0.5), vec2(tx, ty), t*t);\n\n vec2 tiled = fract(rp + shifted);\n\n vec2 cell = floor(rp + shifted);\n\n bool isEnd = int(cell.x) == endx && int(cell.y) == endy;\n\n if (!isEnd) {\n float rnd = rand(cell);\n float angle = float(int(rnd * 4.0)) * 0.5 * PI;\n tiled = vec2(0.5) + rotate2d(tiled - vec2(0.5), angle);\n }\n gl_FragColor = texture2D(uTexture, tiled);\n}\n";
|
|
439
|
+
export declare const DISTORT_GRID_UNIFORMS: {
|
|
440
|
+
uTime: {
|
|
441
|
+
value: number;
|
|
442
|
+
type: string;
|
|
443
|
+
};
|
|
444
|
+
speed: {
|
|
445
|
+
value: number;
|
|
446
|
+
type: string;
|
|
447
|
+
};
|
|
448
|
+
intensity: {
|
|
449
|
+
value: number;
|
|
450
|
+
type: string;
|
|
451
|
+
};
|
|
452
|
+
endx: {
|
|
453
|
+
value: number;
|
|
454
|
+
type: string;
|
|
455
|
+
};
|
|
456
|
+
endy: {
|
|
457
|
+
value: number;
|
|
458
|
+
type: string;
|
|
459
|
+
};
|
|
460
|
+
};
|
|
461
|
+
export declare const DISTORT_RIP_FRAGMENT = "\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uTexture;\nuniform float uTime;\n\nuniform float intensity; \nuniform float speed; \nuniform int slices; \nuniform float randomness; \n\n#define PI 3.141592653589793\nfloat rand(float x) {\n return fract(sin(x * 12.9898) * 43758.5453);\n}\n\nvoid main() {\n vec2 uv = vTextureCoord;\n\n float sliceHeight = 1.0 / float(slices);\n float sliceIndex = floor(uv.y / sliceHeight);\n\n float offsetX = (rand(sliceIndex + uTime * speed) - 0.5) * intensity;\n\n float offsetY = sin(uTime * speed + sliceIndex * 1.5) * 0.01 * randomness;\n\n uv.x += offsetX;\n uv.y += offsetY;\n vec4 color = texture(uTexture, uv);\n\n gl_FragColor = color;\n}\n\n";
|
|
462
|
+
export declare const DISTORT_RIP_UNIFORMS: {
|
|
463
|
+
uTime: {
|
|
464
|
+
value: number;
|
|
465
|
+
type: string;
|
|
466
|
+
};
|
|
467
|
+
intensity: {
|
|
468
|
+
value: number;
|
|
469
|
+
type: string;
|
|
470
|
+
};
|
|
471
|
+
speed: {
|
|
472
|
+
value: number;
|
|
473
|
+
type: string;
|
|
474
|
+
};
|
|
475
|
+
slices: {
|
|
476
|
+
value: number;
|
|
477
|
+
type: string;
|
|
478
|
+
};
|
|
479
|
+
randomness: {
|
|
480
|
+
value: number;
|
|
481
|
+
type: string;
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
export declare const TWO_CURTAIN_FRAGMENT = "\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uTexture;\nuniform float uTime; \nuniform float softness; \n\nvoid main() {\n vec2 uv = vTextureCoord;\n\n float t_raw = clamp(uTime, 0.0, 1.0);\n float t = pow(t_raw, 0.55);\n\n float mid = 0.5;\n\n float leftEdge = mid - t * mid;\n float rightEdge = mid + t * mid;\n\n float mask = smoothstep(leftEdge, leftEdge + softness, uv.x) *\n (1.0 - smoothstep(rightEdge - softness, rightEdge, uv.x));\n\n vec4 color = texture(uTexture, uv);\n\n gl_FragColor = vec4(color.rgb * mask, color.a * mask);\n}\n";
|
|
485
|
+
export declare const TWO_CURTAIN_UNIFORMS: {
|
|
486
|
+
uTime: {
|
|
487
|
+
value: number;
|
|
488
|
+
type: string;
|
|
489
|
+
};
|
|
490
|
+
softness: {
|
|
491
|
+
value: number;
|
|
492
|
+
type: string;
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
export declare const TRIANGLE_PATTERN_EFFECT_FRAGMENT = "\nprecision highp float;\n\nin vec2 vTextureCoord;\n\nuniform sampler2D uTexture;\nuniform float uTime;\nuniform float softness;\nuniform float zoom;\n\n#define PI 3.141592653589793\n\nvec2 rotate2D(vec2 st, float angle) {\n st -= 0.5;\n st = mat2(cos(angle), -sin(angle),\n sin(angle), cos(angle)) * st;\n st += 0.5;\n return st;\n}\n\nvec2 tile(vec2 st, float zoom) {\n st *= zoom;\n return fract(st);\n}\n\nvec2 rotateTile(vec2 st) {\n st *= 2.0;\n\n float index = 0.0;\n if (fract(st.x * 0.5) > 0.5) index += 1.0;\n if (fract(st.y * 0.5) > 0.5) index += 2.0;\n\n st = fract(st);\n\n if (index == 1.0) st = rotate2D(st, PI * 0.5);\n else if (index == 2.0) st = rotate2D(st, PI * -0.5);\n else if (index == 3.0) st = rotate2D(st, PI);\n\n return st;\n}\n\nfloat triangleShape(vec2 st, float smoothness) {\n vec2 p0 = vec2(0.3, -0.5);\n vec2 p1 = vec2(0.7, -0.5);\n vec2 p2 = vec2(0.5, 1.0);\n\n vec3 e0, e1, e2;\n\n e0.xy = normalize(p1 - p0).yx * vec2(+1.0, -1.0);\n e1.xy = normalize(p2 - p1).yx * vec2(+1.0, -1.0);\n e2.xy = normalize(p0 - p2).yx * vec2(+1.0, -1.0);\n\n e0.z = dot(e0.xy, p0) - smoothness;\n e1.z = dot(e1.xy, p1) - smoothness;\n e2.z = dot(e2.xy, p2) - smoothness;\n\n float a = max(0.0, dot(e0.xy, st) - e0.z);\n float b = max(0.0, dot(e1.xy, st) - e1.z);\n float c = max(0.0, dot(e2.xy, st) - e2.z);\n\n return smoothstep(smoothness * 2.0, 1e-7, length(vec3(a, b, c)));\n}\n\nvoid main() {\n vec2 uv = vTextureCoord;\n vec2 st = uv;\n st = tile(st, zoom);\n st = rotateTile(st);\n st = rotate2D(st, -PI * 0.25 * uTime);\n\n float mask = triangleShape(st, softness);\n\n vec4 tex = texture(uTexture, uv);\n gl_FragColor = vec4(tex.rgb * mask, tex.a * mask);\n}\n";
|
|
496
|
+
export declare const TRIANGLE_PATTERN_EFFECT_UNIFORMS: {
|
|
497
|
+
uTime: {
|
|
498
|
+
value: number;
|
|
499
|
+
type: string;
|
|
500
|
+
};
|
|
501
|
+
softness: {
|
|
502
|
+
value: number;
|
|
503
|
+
type: string;
|
|
504
|
+
};
|
|
505
|
+
zoom: {
|
|
506
|
+
value: number;
|
|
507
|
+
type: string;
|
|
508
|
+
};
|
|
509
|
+
};
|
|
510
|
+
export declare const MIRROR_TILE_FRAGMENT = "\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uTexture;\nuniform float uTime;\n\nvec2 mirrorTile(vec2 st, float zoom) {\n st *= zoom;\n\n if (fract(st.y * 0.5) > 0.5) {\n st.x = st.x + 0.5;\n st.y = 1.0 - st.y;\n }\n\n return fract(st);\n}\n\nfloat zigzag(vec2 st) {\n float x = st.x * 2.0;\n float a = floor(1.0 + sin(x * 3.14159));\n float b = floor(1.0 + sin((x + 1.0) * 3.14159));\n float f = fract(x);\n return mix(a, b, f);\n}\n\nvoid main() {\n vec2 st = vTextureCoord;\n\n st = mirrorTile(st * vec2(1.0, 2.0), 5.0);\n\n float zz = zigzag(st);\n\n st.y += zz * 0.03;\n\n vec4 tex = texture(uTexture, st);\n\n gl_FragColor = tex;\n}\n";
|
|
511
|
+
export declare const MIRROR_TILE_UNIFORMS: {
|
|
512
|
+
uTime: {
|
|
513
|
+
value: number;
|
|
514
|
+
type: string;
|
|
515
|
+
};
|
|
516
|
+
};
|
|
517
|
+
export declare const TRIANGLE_MASK_FRAGMENT = "\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uTexture;\nuniform float uTime;\n\nfloat triangleDF(vec2 st, vec2 p0, vec2 p1, vec2 p2) {\n vec3 e0, e1, e2;\n\n e0.xy = normalize(p1 - p0).yx * vec2(+1.0, -1.0);\n e1.xy = normalize(p2 - p1).yx * vec2(+1.0, -1.0);\n e2.xy = normalize(p0 - p2).yx * vec2(+1.0, -1.0);\n\n e0.z = dot(e0.xy, p0);\n e1.z = dot(e1.xy, p1);\n e2.z = dot(e2.xy, p2);\n\n float a = max(0.0, dot(e0.xy, st) - e0.z);\n float b = max(0.0, dot(e1.xy, st) - e1.z);\n float c = max(0.0, dot(e2.xy, st) - e2.z);\n\n return length(vec3(a, b, c) * 2.0);\n}\n\nvoid main() {\n vec2 uvs = vTextureCoord.xy;\n vec4 fg = texture(uTexture, uvs);\n \n float df = triangleDF(\n uvs,\n vec2(0.20, 0.45),\n vec2(0.40, 0.45),\n vec2(0.30, 0.60)\n );\n\n float size = fract(uTime * 0.2);\n float border = 0.15;\n\n float mask =\n smoothstep(size + border, size + 1e-7, df) -\n smoothstep(size + 0.001, size + 1e-7, df);\n\n vec4 tex = texture(uTexture, uvs);\n\n gl_FragColor = vec4(tex.rgb * mask, tex.a * mask);\n}\n";
|
|
518
|
+
export declare const TRIANGLE_MASK_UNIFORMS: {
|
|
519
|
+
uTime: {
|
|
520
|
+
value: number;
|
|
521
|
+
type: string;
|
|
522
|
+
};
|
|
523
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface GlTransition {
|
|
2
|
+
label: string;
|
|
3
|
+
fragment: string;
|
|
4
|
+
uniforms?: Record<string, {
|
|
5
|
+
value: any;
|
|
6
|
+
type: string;
|
|
7
|
+
}>;
|
|
8
|
+
}
|
|
9
|
+
export declare const GL_EFFECTS: Record<string, GlTransition>;
|
|
10
|
+
export type EffectKey = keyof typeof GL_EFFECTS;
|
|
11
|
+
export declare const GL_EFFECT_OPTIONS: Array<{
|
|
12
|
+
key: EffectKey;
|
|
13
|
+
label: string;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Renderer, RenderTexture } from 'pixi.js';
|
|
2
|
+
import { EffectKey } from './glsl/gl-effect';
|
|
3
|
+
export interface EffectOptions {
|
|
4
|
+
name: EffectKey;
|
|
5
|
+
renderer: Renderer;
|
|
6
|
+
}
|
|
7
|
+
export interface EffectRendererOptions {
|
|
8
|
+
canvasTexture: HTMLCanvasElement | ImageBitmap | HTMLImageElement | HTMLVideoElement | RenderTexture;
|
|
9
|
+
progress: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}
|
|
13
|
+
export interface GLEffect {
|
|
14
|
+
author?: string;
|
|
15
|
+
createdAt?: string;
|
|
16
|
+
glsl: string;
|
|
17
|
+
license?: string;
|
|
18
|
+
name: EffectKey;
|
|
19
|
+
updatedAt?: string;
|
|
20
|
+
defaultParams?: any;
|
|
21
|
+
paramsTypes?: any;
|
|
22
|
+
fragment?: string;
|
|
23
|
+
label?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const vertex = "\nin vec2 aPosition;\nout vec2 vTextureCoord;\n\nuniform vec4 uInputSize;\nuniform vec4 uOutputFrame;\nuniform vec4 uOutputTexture;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n\n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export type EventType = string | symbol;
|
|
2
|
+
export type Handler<T = unknown> = (event: T) => void;
|
|
3
|
+
export type WildcardHandler<T = Record<string, unknown>> = (type: keyof T, event: T[keyof T]) => void;
|
|
4
|
+
export type EventHandlerList<T = unknown> = Array<Handler<T>>;
|
|
5
|
+
export type WildCardEventHandlerList<T = Record<string, unknown>> = Array<WildcardHandler<T>>;
|
|
6
|
+
export type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<keyof Events | '*', EventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>>;
|
|
7
|
+
export interface Emitter<Events extends Record<EventType, unknown>> {
|
|
8
|
+
all: EventHandlerMap<Events>;
|
|
9
|
+
on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;
|
|
10
|
+
on(type: '*', handler: WildcardHandler<Events>): void;
|
|
11
|
+
off<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>): void;
|
|
12
|
+
off(type: '*', handler: WildcardHandler<Events>): void;
|
|
13
|
+
emit<Key extends keyof Events>(type: Key, event: Events[Key]): void;
|
|
14
|
+
emit<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* EventEmitter: A class-based event emitter for inheritance
|
|
18
|
+
*/
|
|
19
|
+
export default class EventEmitter<Events extends Record<EventType, unknown>> implements Emitter<Events> {
|
|
20
|
+
all: EventHandlerMap<Events>;
|
|
21
|
+
/**
|
|
22
|
+
* Register an event handler for the given type.
|
|
23
|
+
* @param {string|symbol} type Type of event to listen for, or `'*'` for all events
|
|
24
|
+
* @param {Function} handler Function to call in response to given event
|
|
25
|
+
*/
|
|
26
|
+
on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;
|
|
27
|
+
on(type: '*', handler: WildcardHandler<Events>): void;
|
|
28
|
+
/**
|
|
29
|
+
* Remove an event handler for the given type.
|
|
30
|
+
* If `handler` is omitted, all handlers of the given type are removed.
|
|
31
|
+
* @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler)
|
|
32
|
+
* @param {Function} [handler] Handler function to remove
|
|
33
|
+
*/
|
|
34
|
+
off<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>): void;
|
|
35
|
+
off(type: '*', handler: WildcardHandler<Events>): void;
|
|
36
|
+
/**
|
|
37
|
+
* Invoke all handlers for the given type.
|
|
38
|
+
* If present, `'*'` handlers are invoked after type-matched handlers.
|
|
39
|
+
*
|
|
40
|
+
* Note: Manually firing '*' handlers is not supported.
|
|
41
|
+
*
|
|
42
|
+
* @param {string|symbol} type The event type to invoke
|
|
43
|
+
* @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler
|
|
44
|
+
*/
|
|
45
|
+
emit<Key extends keyof Events>(type: Key, event: Events[Key]): void;
|
|
46
|
+
emit<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): void;
|
|
47
|
+
}
|