@fjandin/react-shader 0.0.15 → 0.0.17

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.
Files changed (41) hide show
  1. package/dist/ReactGpuShader.d.ts +11 -0
  2. package/dist/ReactGpuShader.d.ts.map +1 -0
  3. package/dist/ReactShader.d.ts.map +1 -1
  4. package/dist/example/examples/webgl.d.ts +2 -0
  5. package/dist/example/examples/webgl.d.ts.map +1 -0
  6. package/dist/example/examples/webgpu.d.ts +2 -0
  7. package/dist/example/examples/webgpu.d.ts.map +1 -0
  8. package/dist/example/frontend.d.ts.map +1 -1
  9. package/dist/hooks/useAudio.d.ts +3 -0
  10. package/dist/hooks/useAudio.d.ts.map +1 -0
  11. package/dist/hooks/useWebGPU.d.ts +13 -0
  12. package/dist/hooks/useWebGPU.d.ts.map +1 -0
  13. package/dist/index.cjs +1032 -54
  14. package/dist/index.d.ts +8 -1
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +1032 -54
  17. package/dist/shaders/color-palette-gpu.d.ts +2 -0
  18. package/dist/shaders/color-palette-gpu.d.ts.map +1 -0
  19. package/dist/shaders/distortion-ripple-gpu.d.ts +16 -0
  20. package/dist/shaders/distortion-ripple-gpu.d.ts.map +1 -0
  21. package/dist/shaders/scene-circles-gpu.d.ts +21 -0
  22. package/dist/shaders/scene-circles-gpu.d.ts.map +1 -0
  23. package/dist/shaders/simplex-noise-gpu.d.ts +2 -0
  24. package/dist/shaders/simplex-noise-gpu.d.ts.map +1 -0
  25. package/dist/types.d.ts +29 -0
  26. package/dist/types.d.ts.map +1 -1
  27. package/package.json +2 -1
  28. package/dist/example/glsl/cartesian-to-polar.glsl.d.ts +0 -2
  29. package/dist/example/glsl/cartesian-to-polar.glsl.d.ts.map +0 -1
  30. package/dist/example/glsl/circles.glsl.d.ts +0 -3
  31. package/dist/example/glsl/circles.glsl.d.ts.map +0 -1
  32. package/dist/example/glsl/noise.glsl.d.ts +0 -3
  33. package/dist/example/glsl/noise.glsl.d.ts.map +0 -1
  34. package/dist/example/glsl/palette.glsl.d.ts +0 -2
  35. package/dist/example/glsl/palette.glsl.d.ts.map +0 -1
  36. package/dist/example/glsl/texture-demo.glsl.d.ts +0 -2
  37. package/dist/example/glsl/texture-demo.glsl.d.ts.map +0 -1
  38. package/dist/example/lib/logger.d.ts +0 -2
  39. package/dist/example/lib/logger.d.ts.map +0 -1
  40. package/dist/example/shader.d.ts +0 -2
  41. package/dist/example/shader.d.ts.map +0 -1
@@ -0,0 +1,11 @@
1
+ import type { Vec2, Vec3, Vec4, Vec4Array } from "./types";
2
+ type GpuUniformValue = number | Vec2 | Vec3 | Vec4 | Vec4Array;
3
+ export interface ReactGpuShaderProps {
4
+ className?: string;
5
+ fragment: string;
6
+ uniforms?: Record<string, GpuUniformValue>;
7
+ fullscreen?: boolean;
8
+ }
9
+ export declare function ReactGpuShader({ className, fragment, uniforms, fullscreen }: ReactGpuShaderProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=ReactGpuShader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactGpuShader.d.ts","sourceRoot":"","sources":["../src/ReactGpuShader.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAG1D,KAAK,eAAe,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;AAE9D,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAuBD,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAkB,EAAE,EAAE,mBAAmB,2CAkDxG"}
@@ -1 +1 @@
1
- {"version":3,"file":"ReactShader.d.ts","sourceRoot":"","sources":["../src/ReactShader.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAgC/C,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,QAAQ,EACR,MAAuB,EACvB,QAAQ,EACR,UAAkB,EAClB,SAAa,EACb,OAAO,EACP,OAAO,EACP,WAAW,EACX,WAAW,EACX,SAAS,EACT,YAAY,GACb,EAAE,gBAAgB,2CA0DlB"}
1
+ {"version":3,"file":"ReactShader.d.ts","sourceRoot":"","sources":["../src/ReactShader.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAiC/C,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,QAAQ,EACR,MAAuB,EACvB,QAAQ,EACR,UAAkB,EAClB,SAAa,EACb,OAAO,EACP,OAAO,EACP,WAAW,EACX,WAAW,EACX,SAAS,EACT,YAAY,GACb,EAAE,gBAAgB,2CA0DlB"}
@@ -0,0 +1,2 @@
1
+ export declare function WebGlDemo(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=webgl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgl.d.ts","sourceRoot":"","sources":["../../../src/example/examples/webgl.tsx"],"names":[],"mappings":"AAiDA,wBAAgB,SAAS,4CA6BxB"}
@@ -0,0 +1,2 @@
1
+ export declare function WebGpuDemo(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=webgpu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgpu.d.ts","sourceRoot":"","sources":["../../../src/example/examples/webgpu.tsx"],"names":[],"mappings":"AA4CA,wBAAgB,UAAU,4CA8BzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../../src/example/frontend.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,aAAa,CAAA;AAiHpB,wBAAgB,GAAG,4CAwGlB"}
1
+ {"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../../src/example/frontend.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,aAAa,CAAA;AAwBpB,wBAAgB,GAAG,4CAyBlB"}
@@ -0,0 +1,3 @@
1
+ import type { UseAudioOptions, UseAudioReturn } from "../types";
2
+ export declare function useAudio(options?: UseAudioOptions): UseAudioReturn;
3
+ //# sourceMappingURL=useAudio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAudio.d.ts","sourceRoot":"","sources":["../../src/hooks/useAudio.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqC,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AA6DlG,wBAAgB,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,cAAc,CAsMtE"}
@@ -0,0 +1,13 @@
1
+ import type { Vec2, Vec3, Vec4, Vec4Array } from "../types";
2
+ type GpuUniformValue = number | Vec2 | Vec3 | Vec4 | Vec4Array;
3
+ interface UseWebGPUOptions {
4
+ fragment: string;
5
+ uniforms?: Record<string, GpuUniformValue>;
6
+ onError?: (error: Error) => void;
7
+ }
8
+ export declare function useWebGPU(options: UseWebGPUOptions): {
9
+ canvasRef: import("react").RefObject<HTMLCanvasElement>;
10
+ mouseRef: import("react").MutableRefObject<[number, number]>;
11
+ };
12
+ export {};
13
+ //# sourceMappingURL=useWebGPU.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWebGPU.d.ts","sourceRoot":"","sources":["../../src/hooks/useWebGPU.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAG3D,KAAK,eAAe,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;AAE9D,UAAU,gBAAgB;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IAC1C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;CACjC;AA+WD,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB;;;EA0NlD"}